1 |
adx |
179 |
/* |
2 |
|
|
* ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). |
3 |
|
|
* manager.h: A header for the configuration manager. |
4 |
|
|
* |
5 |
|
|
* Copyright (C) 2003 by Piotr Nizynski, Advanced IRC Services Project |
6 |
|
|
* Copyright (C) 2005 by the Hybrid Development Team. |
7 |
|
|
* |
8 |
|
|
* This program is free software; you can redistribute it and/or modify |
9 |
|
|
* it under the terms of the GNU General Public License as published by |
10 |
|
|
* the Free Software Foundation; either version 2 of the License, or |
11 |
|
|
* (at your option) any later version. |
12 |
|
|
* |
13 |
|
|
* This program is distributed in the hope that it will be useful, |
14 |
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 |
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 |
|
|
* GNU General Public License for more details. |
17 |
|
|
* |
18 |
|
|
* You should have received a copy of the GNU General Public License |
19 |
|
|
* along with this program; if not, write to the Free Software |
20 |
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 |
21 |
|
|
* USA |
22 |
|
|
* |
23 |
adx |
180 |
* $Id$ |
24 |
adx |
179 |
*/ |
25 |
|
|
|
26 |
|
|
#define CONF_BUFSIZE 512 |
27 |
|
|
|
28 |
|
|
#define CT_NUMBER 0 |
29 |
|
|
#define CT_BOOL 1 |
30 |
|
|
#define CT_TIME 2 |
31 |
|
|
#define CT_SIZE 3 |
32 |
|
|
#define CT_STRING 4 |
33 |
|
|
#define CT_LIST 5 |
34 |
|
|
|
35 |
|
|
typedef void CONFS_HANDLER(void); |
36 |
|
|
typedef void CONFF_HANDLER(void *); |
37 |
|
|
|
38 |
|
|
struct ConfParserContext { |
39 |
|
|
FBFILE *f; |
40 |
|
|
char *filename; |
41 |
|
|
int lineno; |
42 |
|
|
}; |
43 |
|
|
|
44 |
|
|
struct ConfSection { |
45 |
|
|
const char *name; |
46 |
|
|
CONFS_HANDLER *before; |
47 |
|
|
CONFS_HANDLER *after; |
48 |
|
|
int pass; |
49 |
|
|
dlink_list fields; |
50 |
|
|
dlink_node node; |
51 |
|
|
}; |
52 |
|
|
|
53 |
|
|
struct ConfField { |
54 |
|
|
const char *name; |
55 |
|
|
int type; |
56 |
|
|
CONFF_HANDLER *handler; |
57 |
|
|
dlink_node node; |
58 |
|
|
}; |
59 |
|
|
|
60 |
|
|
extern int conf_pass; |
61 |
|
|
extern struct ConfParserContext conf_curctx; |
62 |
|
|
extern char conf_linebuf[]; |
63 |
|
|
extern int conf_include_sptr; |
64 |
|
|
|
65 |
|
|
extern struct Callback *reset_conf; |
66 |
|
|
extern struct Callback *verify_conf; |
67 |
|
|
|
68 |
|
|
extern void init_conf(void); |
69 |
|
|
extern void parse_error(const char *, ...); |
70 |
|
|
extern void yyerror(const char *); |
71 |
|
|
extern int conf_yy_input(char *, int); |
72 |
|
|
extern int yylex(void); |
73 |
|
|
extern void conf_clear_ident_list(void); |
74 |
|
|
extern struct ConfSection *find_conf_section(const char *); |
75 |
|
|
extern struct ConfSection *add_conf_section(const char *, int); |
76 |
|
|
extern void delete_conf_section(struct ConfSection *); |
77 |
|
|
extern struct ConfField *find_conf_field(struct ConfSection *, char *); |
78 |
|
|
extern void conf_assign(int, struct ConfField *, void *); |
79 |
|
|
extern void add_conf_field(struct ConfSection *, const char *, int, |
80 |
|
|
CONFF_HANDLER *); |