Move dll_commands and find_dll_command from commands.c to modules.c
Kind of where it belongs.
This commit is contained in:
@@ -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
|
||||
*/
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user