fixes init script for non ipv6 enabled systems #472755
[packages/xinetd.git] / xinetd / parse.h
1 /*
2  * (c) Copyright 1992 by Panagiotis Tsirigotis
3  * (c) Sections Copyright 1998-2001 by Rob Braun
4  * All rights reserved.  The file named COPYRIGHT specifies the terms 
5  * and conditions for redistribution.
6  */
7
8 #ifndef PARSE_H
9 #define PARSE_H
10
11 #include "defs.h"
12 #include "conf.h"
13
14
15 /*
16  * $Id: parse.h,v 1.4 2003/07/12 19:17:53 steveg Exp $
17  */
18
19 typedef enum { NO_ENTRY, 
20                BAD_ENTRY, 
21                SERVICE_ENTRY, 
22                DEFAULTS_ENTRY, 
23                INCLUDE_ENTRY,
24                INCLUDEDIR_ENTRY
25 } entry_e ;
26
27 enum assign_op { SET_EQ, PLUS_EQ, MINUS_EQ } ;
28
29 struct attribute
30 {
31    const char  *a_name ;        /* name of attribute   */
32    unsigned     a_id ;          /* attribute id        */
33    int          a_nvalues ;     /* number of values    */
34    status_e    (*a_parser)() ;  /* function that parses the attribute   */
35 } ;
36
37
38 #define ENTRY_BEGIN              '{'
39 #define ENTRY_END                '}'
40 #define COMMENT_BEGIN            '#'
41 #define KW_SERVICE              "service"
42 #define KW_DEFAULTS             "defaults"
43 #define KW_INCLUDE              "include"
44 #define KW_INCLUDEDIR           "includedir"
45
46 extern int line_count;
47 extern const char *current_file;
48
49 const char *attr_name_lookup(unsigned int id);
50 void parse_end(void);
51 void parse_conf_file(int fd,struct configuration *confp, const char *filename);
52
53 #endif  /* PARSE_H */