Monolithic source layout doesn't really work; go back to modular.
[seven-1.x.git] / include / newconf.h
blob62faf05e5a63522f6075e9423a8d3f91dfc10d89
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 64 2006-09-23 00:27:18Z spb $
4 */
6 #ifndef _NEWCONF_H_INCLUDED
7 #define _NEWCONF_H_INCLUDED
9 #include <sys/types.h>
11 #include <stdio.h>
13 #include "tools.h"
14 #include "client.h"
15 #include "s_newconf.h"
17 struct ConfEntry
19 const char *cf_name;
20 int cf_type;
21 void (*cf_func) (void *);
22 int cf_len;
23 void *cf_arg;
26 struct TopConf
28 char *tc_name;
29 int (*tc_sfunc) (struct TopConf *);
30 int (*tc_efunc) (struct TopConf *);
31 dlink_list tc_items;
32 struct ConfEntry *tc_entries;
36 #define CF_QSTRING 0x01
37 #define CF_INT 0x02
38 #define CF_STRING 0x03
39 #define CF_TIME 0x04
40 #define CF_YESNO 0x05
41 #define CF_LIST 0x06
42 #define CF_ONE 0x07
44 #define CF_MTYPE 0xFF
46 #define CF_FLIST 0x1000
47 #define CF_MFLAG 0xFF00
49 typedef struct conf_parm_t_stru
51 struct conf_parm_t_stru *next;
52 int type;
53 union
55 char *string;
56 int number;
57 struct conf_parm_t_stru *list;
61 conf_parm_t;
63 extern struct TopConf *conf_cur_block;
65 extern char *current_file;
67 int read_config(char *);
68 int conf_start_block(char *, char *);
69 int conf_end_block(struct TopConf *);
70 int conf_call_set(struct TopConf *, char *, conf_parm_t *, int);
71 void conf_report_error(const char *, ...);
72 void newconf_init(void);
73 int add_conf_item(const char *topconf, const char *name, int type, void (*func) (void *));
74 int remove_conf_item(const char *topconf, const char *name);
75 int add_top_conf(const char *name, int (*sfunc) (struct TopConf *), int (*efunc) (struct TopConf *), struct ConfEntry *items);
76 int remove_top_conf(char *name);
77 struct TopConf *find_top_conf(const char *name);
78 struct ConfEntry *find_conf_item(const struct TopConf *top, const char *name);
80 #endif