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