diff --git a/include/msg.h b/include/msg.h index 283eb9b..80058cd 100644 --- a/include/msg.h +++ b/include/msg.h @@ -60,7 +60,7 @@ struct MessageEntry /* Message table structure */ struct Message { - const char *cmd; + char *cmd; unsigned int count; /* number of times command used */ unsigned int rcount; /* number of times command used by server */ unsigned long bytes; /* bytes received for this message */ diff --git a/include/parse.h b/include/parse.h index c9597e0..e4d25e3 100644 --- a/include/parse.h +++ b/include/parse.h @@ -27,6 +27,7 @@ #ifndef INCLUDED_parse_h_h #define INCLUDED_parse_h_h +#include "irc_dictionary.h" #include "tools.h" struct Message; diff --git a/src/newconf.c b/src/newconf.c index 84144e6..cc55dff 100644 --- a/src/newconf.c +++ b/src/newconf.c @@ -1619,7 +1619,7 @@ conf_end_alias(struct TopConf *tc) } if (!alias_dict) - alias_dict = irc_dictionary_create(alias_dict); + alias_dict = irc_dictionary_create(strcasecmp); irc_dictionary_add(alias_dict, yy_alias->name, yy_alias); diff --git a/src/parse.c b/src/parse.c index 78353ac..38e0d30 100644 --- a/src/parse.c +++ b/src/parse.c @@ -63,8 +63,6 @@ static void do_alias(struct alias_entry *, struct Client *, char *); static int handle_command(struct Message *, struct Client *, struct Client *, int, const char**); -static int cmd_hash(const char *p); - static char buffer[1024]; /* turn a string into a parc/parv pair */ @@ -218,7 +216,7 @@ parse(struct Client *client_p, char *pbuffer, char *bufend) if((s = strchr(ch, ' '))) *s++ = '\0'; - mptr = irc_dictionary_retrieve(cmd_dict, mptr); + mptr = irc_dictionary_retrieve(cmd_dict, ch); /* no command or its encap only, error */ if(!mptr || !mptr->cmd) @@ -475,7 +473,7 @@ report_messages(struct Client *source_p) struct Message *msg; struct alias_entry *amsg; - IRC_DICTIONARY_FOREACH(msg, &iter, cmd_dict) + DICTIONARY_FOREACH(msg, &iter, cmd_dict) { s_assert(msg->cmd != NULL); sendto_one_numeric(source_p, RPL_STATSCOMMANDS, @@ -484,7 +482,7 @@ report_messages(struct Client *source_p) msg->bytes, msg->rcount); } - IRC_DICTIONARY_FOREACH(amsg, &iter, alias_dict) + DICTIONARY_FOREACH(amsg, &iter, alias_dict) { s_assert(amsg->name != NULL); sendto_one_numeric(source_p, RPL_STATSCOMMANDS, diff --git a/src/s_conf.c b/src/s_conf.c index 20b641b..15912c9 100644 --- a/src/s_conf.c +++ b/src/s_conf.c @@ -1225,7 +1225,6 @@ clear_out_old_conf(void) struct Class *cltmp; dlink_node *ptr; dlink_node *next_ptr; - int i; /* * don't delete the class table, rather mark all entries