diff --git a/src/debug.c b/src/debug.c index decc215..1687c1d 100644 --- a/src/debug.c +++ b/src/debug.c @@ -1404,6 +1404,7 @@ int wrap_debug(void) dodebug = TRUE; run_debug(); + parse_server_input(NULL); close(fd); debug_fd = backup_fd; diff --git a/src/parse.c b/src/parse.c index 0c182e1..e951fa4 100644 --- a/src/parse.c +++ b/src/parse.c @@ -1369,11 +1369,12 @@ void parse_005(char *from, char *rest) #define NEEDFROM 1 #define DROPONE 2 -LS const struct +struct ParseFunctions { - uint32_t hash; - short flags; - void (*func)(char *, char *); + const uint32_t hash; + const short flags; + const void (*func)(char *, char *); + int hits; } pFuncs[] = { @@ -1465,6 +1466,17 @@ void parse_server_input(char *rest) uint32_t cmdhash; int i; +#ifdef DEBUG + if (rest == NULL) + { + for(i=0;pFuncs[i].hash;i++) + { + debug("[PsI] (%i) hash %X: hits %i\n",i,pFuncs[i].hash,pFuncs[i].hits); + } + return; + } +#endif /* DEBUG */ + if (current->spy & (SPYF_RAWIRC|SPYF_RANDSRC)) send_spy(SPYSTR_RAWIRC,rest); @@ -1530,6 +1542,7 @@ void parse_server_input(char *rest) return; if (pFuncs[i].flags & DROPONE) chop(&rest); /* discard one argument (usually bot nick) */ + pFuncs[i].hits++; pFuncs[i].func(from,rest); return; }