diff --git a/Changes b/Changes index 642276034..c16b09013 100644 --- a/Changes +++ b/Changes @@ -1688,3 +1688,5 @@ MOTDs functions above) if DISABLE_STACKED_EXTBANS is #defined (this is controled by Config). Modules will not compile/load if they try to use them anyway. This change should not break extban modules, and should need some more extensive testing. +- Removed some more confusion in source (module IRC commands vs IRC commands) +- Changed IRCCommand::friend into IRCCommand::partner diff --git a/include/struct.h b/include/struct.h index c9e1fc45f..b1b305e2c 100644 --- a/include/struct.h +++ b/include/struct.h @@ -142,7 +142,7 @@ typedef struct ListOptions LOpts; typedef struct FloodOpt aFloodOpt; typedef struct MotdItem aMotd; typedef struct trecord aTrecord; -typedef struct Command aCommand; +typedef struct IRCCommand aCommand; typedef struct _cmdoverride Cmdoverride; typedef struct SMember Member; typedef struct SMembership Membership; @@ -1732,7 +1732,7 @@ extern MODVAR char *gnulicense[]; #endif #define EVENT_HASHES EVENT_DRUGS #include "events.h" -struct Command { +struct IRCCommand { aCommand *prev, *next; char *cmd; int (*func) (); @@ -1741,7 +1741,7 @@ struct Command { unsigned parameters : 5; unsigned long bytes; Module *owner; - aCommand *friend; /* cmd if token, token if cmd */ + aCommand *partner; /* cmd if token, token if cmd */ Cmdoverride *overriders; Cmdoverride *overridetail; #ifdef DEBUGMODE diff --git a/src/api-command.c b/src/api-command.c index 6bd8dcc3f..d89ed5b49 100644 --- a/src/api-command.c +++ b/src/api-command.c @@ -58,12 +58,12 @@ Command *CommandAdd(Module *module, char *cmd, char *tok, int (*func)(), unsigne command->cmd->owner = module; if (tok) { command->tok = add_Command_backend(tok,func,params,1,flags); - command->cmd->friend = command->tok; - command->tok->friend = command->cmd; + command->cmd->partner = command->tok; + command->tok->partner = command->cmd; command->tok->owner = module; } else - command->cmd->friend = NULL; + command->cmd->partner = NULL; if (module) { ModuleObject *cmdobj = (ModuleObject *)MyMallocEx(sizeof(ModuleObject)); cmdobj->object.command = command; diff --git a/src/modules.c b/src/modules.c index 9e4a5ff81..74730f24f 100644 --- a/src/modules.c +++ b/src/modules.c @@ -1480,11 +1480,11 @@ Cmdoverride *CmdoverrideAdd(Module *module, char *name, iFP function) if (!p->overriders) p->overridetail = ovr; AddListItem(ovr, p->overriders); - if (p->friend) + if (p->partner) { - if (!p->friend->overriders) - p->friend->overridetail = ovr; - AddListItem(ovr, p->friend->overriders); + if (!p->partner->overriders) + p->partner->overridetail = ovr; + AddListItem(ovr, p->partner->overriders); } return ovr; } @@ -1496,11 +1496,11 @@ void CmdoverrideDel(Cmdoverride *cmd) DelListItem(cmd, cmd->command->overriders); if (!cmd->command->overriders) cmd->command->overridetail = NULL; - if (cmd->command->friend) + if (cmd->command->partner) { if (!cmd->prev) - cmd->command->friend->overridetail = NULL; - DelListItem(cmd, cmd->command->friend->overriders); + cmd->command->partner->overridetail = NULL; + DelListItem(cmd, cmd->command->partner->overriders); } if (cmd->owner) { diff --git a/src/packet.c b/src/packet.c index fa64d9a06..7a1fe8588 100644 --- a/src/packet.c +++ b/src/packet.c @@ -283,11 +283,11 @@ void add_Command(char *name, char *token, int (*func)(), unsigned char parameter if (token) { tok = add_Command_backend(token, func, parameters, 1, 0); - tok->friend = cmd; - cmd->friend = tok; + tok->partner = cmd; + cmd->partner = tok; } else - cmd->friend = NULL; + cmd->partner = NULL; } void add_CommandX(char *name, char *token, int (*func)(), unsigned char parameters, int flags) @@ -297,11 +297,11 @@ void add_CommandX(char *name, char *token, int (*func)(), unsigned char param if (token != NULL) { tok = add_Command_backend(token, func, parameters, 1, flags); - tok->friend = cmd; - cmd->friend = tok; + tok->partner = cmd; + cmd->partner = tok; } else - cmd->friend = NULL; + cmd->partner = NULL; } inline aCommand *find_CommandEx(char *cmd, int (*func)(), int token)