1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-07-05 21:33:13 +02:00

+- Added the next part of the new config parser

This commit is contained in:
stskeeps
2000-12-24 13:31:33 +00:00
parent e24f9f0844
commit f3c5f6f6c8
3 changed files with 95 additions and 1 deletions
+1
View File
@@ -39,3 +39,4 @@
/topic #channel same for +b if not +o or on the channel. Suggested by Sysop_Mars
- Fixed a bug where you would receive a double notice when someone does a /who 0 o
- Added first part of the new config parser, s_conf2.c
- Added the next part of the new config parser
+60 -1
View File
@@ -64,8 +64,15 @@ typedef struct t_vhost aVhost;
typedef struct SqlineItem aSqlineItem;
typedef struct aloopStruct LoopStruct;
typedef struct ConfItem aConfItem;
/* New Config Stuff */
typedef struct _configentry ConfigEntry;
typedef struct _configfile ConfigFile;
typedef struct _configitem ConfigItem;
typedef struct _configitem_me ConfigItem_me;
typedef struct _configitem_admin ConfigItem_admin;
typedef struct _configitem_class ConfigItem_class;
typedef struct _configitem_oper ConfigItem_oper;
typedef struct Notify aNotify;
typedef struct Client aClient;
typedef struct Channel aChannel;
@@ -900,6 +907,58 @@ struct _configentry
};
struct _configitem {
long flags;
ConfigItem *prev;
ConfigItem *next;
};
struct _confitem_me {
long flags;
ConfigItem *prev;
ConfigItem *next;
char *name;
char *info;
short numeric;
};
struct _confitem_admin {
long flags;
ConfigItem *prev;
ConfigItem *next;
char *line;
};
struct _confitem_class {
long flags;
ConfigItem *prev;
ConfigItem *next;
char *name;
int pingfreq;
int maxclients;
int sendq;
};
struct _confitem_allow {
long flags;
ConfigItem *prev;
ConfigItem *next;
char *ip;
char *hostname;
ConfigItem_class *class;
};
struct _confitem_oper {
long flags;
ConfigItem *prev;
ConfigItem *next;
ConfigItem *from;
long oflags;
char *password;
};
/*
* statistics structures
*/
@@ -1190,8 +1249,8 @@ extern char *gnulicense[];
#define FLUSH_BUFFER -2
#define COMMA ","
#ifdef USE_SSL
#include "ssl.h"
#endif
#endif /* __struct_include__ */
+34
View File
@@ -67,6 +67,40 @@ static ConfigFile *config_parse(char *filename, char *confdata);
static void config_entry_free(ConfigEntry *ceptr);
int ConfigParse(ConfigFile *cfptr);
ConfigItem_me *conf_me = NULL;
void add_ConfigItem(ConfigItem *item, ConfigItem **list)
{
item->next = *list;
item->prev = NULL;
if (*list)
(*list)->prev = item;
*list = item;
}
ConfigItem *del_ConfigItem(ConfigItem *item, ConfigItem **list)
{
ConfigItem *p, *q;
for (p = *list; p; p = p->next)
{
if (p == item)
{
q = p->next;
if (p->prev)
p->prev->next = p->next;
else
*list = p->next;
if (p->next)
p->next->prev = p->prev;
return q;
}
}
return NULL;
}
static void config_error(char *format, ...)
{
va_list ap;