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