]> jfr.im git - irc/rqf/shadowircd.git/blame - include/newconf.h
Update FAQ.
[irc/rqf/shadowircd.git] / include / newconf.h
CommitLineData
212380e3 1/* This code is in the public domain.
2 * $Nightmare: nightmare/include/config.h,v 1.32.2.2.2.2 2002/07/02 03:41:28 ejb Exp $
3 * $Id: newconf.h 1735 2006-07-19 02:35:40Z nenolod $
4 */
5
6#ifndef _NEWCONF_H_INCLUDED
7#define _NEWCONF_H_INCLUDED
8
212380e3 9struct ConfEntry
10{
11 const char *cf_name;
12 int cf_type;
13 void (*cf_func) (void *);
14 int cf_len;
15 void *cf_arg;
16};
17
18struct TopConf
19{
d7f753cd 20 const char *tc_name;
212380e3 21 int (*tc_sfunc) (struct TopConf *);
22 int (*tc_efunc) (struct TopConf *);
08d11e34 23 rb_dlink_list tc_items;
212380e3 24 struct ConfEntry *tc_entries;
25};
26
27
28#define CF_QSTRING 0x01
29#define CF_INT 0x02
30#define CF_STRING 0x03
31#define CF_TIME 0x04
32#define CF_YESNO 0x05
33#define CF_LIST 0x06
34#define CF_ONE 0x07
35
36#define CF_MTYPE 0xFF
37
38#define CF_FLIST 0x1000
39#define CF_MFLAG 0xFF00
40
41typedef struct conf_parm_t_stru
42{
43 struct conf_parm_t_stru *next;
44 int type;
45 union
46 {
47 char *string;
48 int number;
49 struct conf_parm_t_stru *list;
50 }
51 v;
52}
53conf_parm_t;
54
55extern struct TopConf *conf_cur_block;
56
57extern char *current_file;
58
59int read_config(char *);
60int conf_start_block(char *, char *);
61int conf_end_block(struct TopConf *);
62int conf_call_set(struct TopConf *, char *, conf_parm_t *, int);
63void conf_report_error(const char *, ...);
64void newconf_init(void);
65int add_conf_item(const char *topconf, const char *name, int type, void (*func) (void *));
66int remove_conf_item(const char *topconf, const char *name);
67int add_top_conf(const char *name, int (*sfunc) (struct TopConf *), int (*efunc) (struct TopConf *), struct ConfEntry *items);
68int remove_top_conf(char *name);
69struct TopConf *find_top_conf(const char *name);
70struct ConfEntry *find_conf_item(const struct TopConf *top, const char *name);
71
72#endif