/LOAD module tries to load "module_core" instead. If it wasn't found,

it fallbacks to "module" again. If it is found, it tries to load several
other modules too, like irc_module, fe_module and fe_irc_module.

Split perl module to perl_core and fe_perl. Removed "_common" from some
fe_common modules.


git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1228 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2001-02-17 10:35:35 +00:00 committed by cras
commit abe4ddb52a
15 changed files with 250 additions and 104 deletions

View file

@ -24,6 +24,7 @@
#include "signals.h"
#include "commands.h"
#include "levels.h"
#include "chat-protocols.h"
#include "printtext.h"
@ -72,14 +73,54 @@ static void cmd_load_list(void)
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, TXT_MODULE_FOOTER);
}
static char **module_prefixes_get(void)
{
GSList *tmp;
char **list, *name;
int count;
list = g_new(char *, 2 + 2*g_slist_length(chat_protocols));
list[0] = "fe";
count = 1;
for (tmp = chat_protocols; tmp != NULL; tmp = tmp->next) {
CHAT_PROTOCOL_REC *rec = tmp->data;
name = g_strdup(rec->name);
g_strdown(name);
list[count++] = name;
list[count++] = g_strconcat("fe_", name, NULL);
}
list[count] = NULL;
return list;
}
static void module_prefixes_free(char **list)
{
char **pos = list+1;
while (*pos != NULL) {
g_free(*pos);
pos++;
}
g_free(list);
}
/* SYNTAX: LOAD <module> */
static void cmd_load(const char *data)
{
char **module_prefixes;
g_return_if_fail(data != NULL);
if (*data == '\0')
cmd_load_list();
else
module_load(data);
else {
module_prefixes = module_prefixes_get();
module_load(data, module_prefixes);
module_prefixes_free(module_prefixes);
}
}
/* SYNTAX: UNLOAD <module> */