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