1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-29 14:26:39 +02:00

Add hook infolist to plugins API, fix bugs with gettext in plugins

This commit is contained in:
Sebastien Helleu
2008-08-22 21:34:29 +02:00
parent 4185de5219
commit 74d595498d
12 changed files with 345 additions and 62 deletions
+20 -2
View File
@@ -34,6 +34,7 @@
#include "../core/weechat.h"
#include "../core/wee-config.h"
#include "../core/wee-hook.h"
#include "../core/wee-infolist.h"
#include "../core/wee-input.h"
#include "../core/wee-string.h"
@@ -293,6 +294,10 @@ plugin_api_info_get (struct t_weechat_plugin *plugin, const char *info)
{
return WEECHAT_SHAREDIR;
}
else if (string_strcasecmp (info, "weechat_localedir") == 0)
{
return LOCALEDIR;
}
else if (string_strcasecmp (info, "charset_terminal") == 0)
{
return weechat_local_charset;
@@ -469,7 +474,7 @@ plugin_api_infolist_get (const char *name, void *pointer, const char *arguments)
}
}
}
else if (string_strcasecmp (name, "options") == 0)
else if (string_strcasecmp (name, "option") == 0)
{
ptr_infolist = infolist_new ();
if (ptr_infolist)
@@ -482,8 +487,21 @@ plugin_api_infolist_get (const char *name, void *pointer, const char *arguments)
return ptr_infolist;
}
}
else if (string_strcasecmp (name, "hook") == 0)
{
ptr_infolist = infolist_new ();
if (ptr_infolist)
{
if (!hook_add_to_infolist (ptr_infolist, arguments))
{
infolist_free (ptr_infolist);
return NULL;
}
return ptr_infolist;
}
}
/* list not found */
/* infolist not found */
return NULL;
}