removed conf_read() definition. No one outside of main/conffile.c
[freeradius.git] / src / include / conffile.h
1 #ifndef _CONFFILE_H
2 #define _CONFFILE_H
3
4 /*
5  * conffile.h   Defines for the conffile parsing routines.
6  *
7  * Version:     $Id$
8  *
9  */
10
11 #include "token.h"
12
13 /*
14  * Export the minimum amount of information about these structs
15  */
16 typedef struct conf_item CONF_ITEM;
17 typedef struct conf_pair CONF_PAIR;
18 typedef struct conf_part CONF_SECTION;
19
20 /*
21  *  Instead of putting the information into a configuration structure,
22  *  the configuration file routines MAY just parse it directly into
23  *  user-supplied variables.
24  */
25 #define PW_TYPE_STRING_PTR      100
26 #define PW_TYPE_BOOLEAN         101
27
28 typedef struct CONF_PARSER {
29   const char *name;
30   int type;                     /* PW_TYPE_STRING, etc. */
31   void *data;                   /* pointer to where to put it */
32   const char *dflt;             /* default as it would appear in radiusd.conf */
33 } CONF_PARSER;
34
35 /* This preprocessor trick will be useful in initializing CONF_PARSER struct */
36 #define XStringify(x) #x
37 #define Stringify(x) XStringify(x)
38
39 void            cf_pair_free(CONF_PAIR *cp);
40 void            cf_section_free(CONF_SECTION *cp);
41 int             cf_section_parse(CONF_SECTION *cs, const CONF_PARSER *variables);
42
43 /* JLN -- Newly added */
44                 
45 CONF_PAIR       *cf_pair_find(CONF_SECTION *section, const char *name);
46 CONF_PAIR       *cf_pair_find_next(CONF_SECTION *section, CONF_PAIR *pair, const char *name);
47 CONF_SECTION    *cf_section_find(const char *name);
48 CONF_SECTION    *cf_section_sub_find(CONF_SECTION *section, const char *name);
49 char            *cf_section_value_find(CONF_SECTION *section, const char *attr);
50
51 int             read_radius_conf_file(void);
52
53 char *cf_pair_attr(CONF_PAIR *pair);
54 char *cf_pair_value(CONF_PAIR *pair);
55 char *cf_section_name1(CONF_SECTION *section);
56 char *cf_section_name2(CONF_SECTION *section);
57 int dump_config(void);
58 CONF_SECTION *cf_subsection_find_next(CONF_SECTION *section,
59                                       CONF_SECTION *subsection,
60                                       const char *name1);
61 int cf_section_lineno(CONF_SECTION *section);
62 int cf_pair_lineno(CONF_PAIR *pair);
63 CONF_ITEM *cf_item_find_next(CONF_SECTION *section, CONF_ITEM *item);
64 int cf_item_is_section(CONF_ITEM *item);
65 CONF_PAIR *cf_itemtopair(CONF_ITEM *item);
66 CONF_SECTION *cf_itemtosection(CONF_ITEM *item);
67 #endif /* _CONFFILE_H */