2 * Copyright (c) 1996-1999 by Internet Software Consortium.
4 * Permission to use, copy, modify, and distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
8 * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
9 * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
10 * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
11 * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
12 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
13 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
14 * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
18 #ifndef _NS_PARSEUTIL_H
19 #define _NS_PARSEUTIL_H
25 #define SYMBOL_FREE_KEY 0x01
26 #define SYMBOL_FREE_VALUE 0x02
28 typedef union symbol_value {
33 typedef void (*free_function)(int, void *);
35 typedef struct symbol_entry {
40 struct symbol_entry *next;
43 typedef struct symbol_table {
46 free_function free_value;
49 symbol_table new_symbol_table(int, free_function);
50 void free_symbol(symbol_table, symbol_entry);
51 void free_symbol_table(symbol_table);
52 void dprint_symbol_table(int, symbol_table);
53 int lookup_symbol(symbol_table, const char *, int,
55 void define_symbol(symbol_table, char *, int, symbol_value,
57 void undefine_symbol(symbol_table, char *, int type);
63 int unit_to_ulong(char *, u_long *);
65 #endif /* !_NS_PARSEUTIL_H */