mirror of
https://github.com/irssi/irssi.git
synced 2026-08-10 12:23:37 +02:00
/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:
parent
f1205c10e0
commit
abe4ddb52a
15 changed files with 250 additions and 104 deletions
|
|
@ -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> */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue