mirror of
https://github.com/unrealircd/unrealircd.git
synced 2026-07-04 04:23:13 +02:00
+- Added the next part of the new config parser, and some even more
This commit is contained in:
@@ -39,4 +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
|
||||
- Added the next part of the new config parser, and some even more
|
||||
|
||||
+5
-5
@@ -913,7 +913,7 @@ struct _configitem {
|
||||
ConfigItem *next;
|
||||
};
|
||||
|
||||
struct _confitem_me {
|
||||
struct _configitem_me {
|
||||
long flags;
|
||||
ConfigItem *prev;
|
||||
ConfigItem *next;
|
||||
@@ -923,14 +923,14 @@ struct _confitem_me {
|
||||
short numeric;
|
||||
};
|
||||
|
||||
struct _confitem_admin {
|
||||
struct _configitem_admin {
|
||||
long flags;
|
||||
ConfigItem *prev;
|
||||
ConfigItem *next;
|
||||
char *line;
|
||||
};
|
||||
|
||||
struct _confitem_class {
|
||||
struct _configitem_class {
|
||||
long flags;
|
||||
ConfigItem *prev;
|
||||
ConfigItem *next;
|
||||
@@ -940,7 +940,7 @@ struct _confitem_class {
|
||||
int sendq;
|
||||
};
|
||||
|
||||
struct _confitem_allow {
|
||||
struct _configitem_allow {
|
||||
long flags;
|
||||
ConfigItem *prev;
|
||||
ConfigItem *next;
|
||||
@@ -949,7 +949,7 @@ struct _confitem_allow {
|
||||
ConfigItem_class *class;
|
||||
};
|
||||
|
||||
struct _confitem_oper {
|
||||
struct _configitem_oper {
|
||||
long flags;
|
||||
ConfigItem *prev;
|
||||
ConfigItem *next;
|
||||
|
||||
+33
-3
@@ -67,9 +67,16 @@ 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 *MyMallocEx(size_t size)
|
||||
{
|
||||
void *p = MyMalloc(size);
|
||||
|
||||
bzero(p, size);
|
||||
return (p);
|
||||
}
|
||||
|
||||
void add_ConfigItem(ConfigItem *item, ConfigItem **list)
|
||||
{
|
||||
item->next = *list;
|
||||
@@ -584,7 +591,11 @@ int _conf_admin(ConfigFile *conf, ConfigEntry *ce)
|
||||
int _conf_me(ConfigFile *conf, ConfigEntry *ce)
|
||||
{
|
||||
ConfigEntry *cep;
|
||||
|
||||
|
||||
if (!conf_me)
|
||||
{
|
||||
conf_me = (ConfigItem_me *) MyMallocEx(sizeof(ConfigItem_me));
|
||||
}
|
||||
for (cep = ce->ce_entries; cep; cep = cep->ce_next)
|
||||
{
|
||||
if (!cep->ce_varname)
|
||||
@@ -594,7 +605,26 @@ int _conf_me(ConfigFile *conf, ConfigEntry *ce)
|
||||
}
|
||||
config_status("[me] Set %s to %s",
|
||||
cep->ce_varname, cep->ce_vardata);
|
||||
}
|
||||
if (!strcmp(cep->ce_varname, "name"))
|
||||
{
|
||||
if (conf_me->name)
|
||||
MyFree(conf_me->name);
|
||||
conf_me->name = strdup(cep->ce_vardata);
|
||||
config_status("Set me->name to %s :)", conf_me->name);
|
||||
} else
|
||||
if (!strcmp(cep->ce_varname, "info"))
|
||||
{
|
||||
if (conf_me->info)
|
||||
MyFree(conf_me->info);
|
||||
conf_me->info = strdup(cep->ce_vardata);
|
||||
config_status("Set me->info to %s :)", conf_me->info);
|
||||
} else
|
||||
if (!strcmp(cep->ce_varname, "numeric"))
|
||||
{
|
||||
conf_me->numeric = atol(cep->ce_vardata);
|
||||
config_status("Set me->numeric to %i (i) :))", conf_me->numeric);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int _conf_oper(ConfigFile *conf, ConfigEntry *ce)
|
||||
|
||||
Reference in New Issue
Block a user