diff --git a/include/module.h b/include/module.h index d64b147..67bc5c9 100644 --- a/include/module.h +++ b/include/module.h @@ -87,7 +87,7 @@ extern CtcpEntryDll *dll_ctcp; extern WindowDll *dll_window; extern IrcVariableDll *dll_variable; - +IrcCommandDll *find_dll_command(const char *, int *); char *BX_get_dllstring_var(char *); int BX_get_dllint_var(char *); void BX_set_dllstring_var(char *, char *); diff --git a/source/commands.c b/source/commands.c index 13e2546..f7fb085 100644 --- a/source/commands.c +++ b/source/commands.c @@ -85,6 +85,7 @@ CVS_REVISION(commands_c) #include "hash2.h" #include "cset.h" #include "notice.h" +#include "module.h" #ifdef TRANSLATE #include "translat.h" @@ -152,11 +153,6 @@ static WaitCmd *start_wait_list = NULL, char lame_wait_nick[] = "***LW***"; char wait_nick[] = "***W***"; -#ifdef WANT_DLL - IrcCommandDll *find_dll_command (const char *, int *); - IrcCommandDll *dll_commands = NULL; -#endif - AJoinList *ajoin_list = NULL; BUILT_IN_COMMAND(obits); @@ -930,36 +926,6 @@ const IrcCommand *BX_find_command(const char *com, int *cnt) return retval; } -#ifdef WANT_DLL -IrcCommandDll *find_dll_command(const char *com, int *cnt) -{ - const size_t len = com ? strlen(com) : 0; - IrcCommandDll *first_match = NULL; - - *cnt = 0; - - if (len) - { - IrcCommandDll *cmd; - - for (cmd = dll_commands; cmd; cmd = cmd->next) - { - if (!my_strnicmp(com, cmd->name, len)) - { - if (!first_match) - first_match = cmd; - (*cnt)++; - } - } - - if (first_match && strlen(first_match->name) == len) - *cnt *= -1; - } - - return first_match; -} -#endif - /* IRCUSER command. Changes your userhost on the fly. Takes effect * the next time you connect to a server */ diff --git a/source/modules.c b/source/modules.c index 5634691..c76ffb7 100644 --- a/source/modules.c +++ b/source/modules.c @@ -41,6 +41,7 @@ CVS_REVISION(modules_c) #define MAIN_SOURCE #include "modval.h" +IrcCommandDll *dll_commands = NULL; IrcVariableDll *dll_variable = NULL; extern void *default_output_function; extern void *default_status_output_function; @@ -706,6 +707,34 @@ int BX_check_module_version(unsigned long number) } #ifdef WANT_DLL +IrcCommandDll *find_dll_command(const char *com, int *cnt) +{ + const size_t len = com ? strlen(com) : 0; + IrcCommandDll *first_match = NULL; + + *cnt = 0; + + if (len) + { + IrcCommandDll *cmd; + + for (cmd = dll_commands; cmd; cmd = cmd->next) + { + if (!my_strnicmp(com, cmd->name, len)) + { + if (!first_match) + first_match = cmd; + (*cnt)++; + } + } + + if (first_match && strlen(first_match->name) == len) + *cnt *= -1; + } + + return first_match; +} + static IrcVariableDll *lookup_dllvar(char *name) { IrcVariableDll *dll = NULL;