]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/bind/bin/named/ns_parseutil.h
This commit was generated by cvs2svn to compensate for changes in r56639,
[FreeBSD/FreeBSD.git] / contrib / bind / bin / named / ns_parseutil.h
1 /*
2  * Copyright (c) 1996-1999 by Internet Software Consortium.
3  *
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.
7  *
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
15  * SOFTWARE.
16  */
17
18 #ifndef _NS_PARSEUTIL_H
19 #define _NS_PARSEUTIL_H
20
21 /*
22  * Symbol Table
23  */
24
25 #define SYMBOL_FREE_KEY         0x01
26 #define SYMBOL_FREE_VALUE       0x02
27
28 typedef union symbol_value {
29         void *pointer;
30         int integer;
31 } symbol_value;
32
33 typedef void (*free_function)(int, void *);
34
35 typedef struct symbol_entry {
36         char *key;
37         int type;
38         symbol_value value;
39         unsigned int flags;
40         struct symbol_entry *next;
41 } *symbol_entry;
42
43 typedef struct symbol_table {
44         int size;
45         symbol_entry *table;
46         free_function free_value;
47 } *symbol_table;
48
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,
54                                       symbol_value *);
55 void                    define_symbol(symbol_table, char *, int, symbol_value,
56                                       unsigned int);
57 void                    undefine_symbol(symbol_table, char *, int type);
58
59 /*
60  * Conversion Routines
61  */
62
63 int                     unit_to_ulong(char *, u_long *);
64
65 #endif /* !_NS_PARSEUTIL_H */