1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-25 12:26:40 +02:00

Add new functions in plugin API (hashtable_get_string, hook_info_hashtable, info_get_hashtable), add IRC info_hashtable "irc_parse_message"

Note: tcl >= 8.5 is now required (for tcl plugin).
This commit is contained in:
Sebastien Helleu
2010-08-27 15:59:06 +02:00
parent bb42984f5d
commit 712623547f
55 changed files with 3753 additions and 856 deletions
+44
View File
@@ -1202,6 +1202,50 @@ script_api_hook_info (struct t_weechat_plugin *weechat_plugin,
return new_hook;
}
/*
* script_api_hook_info_hashtable: hook an info_hashtable
* return new hook, NULL if error
*/
struct t_hook *
script_api_hook_info_hashtable (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script,
const char *info_name,
const char *description,
const char *args_description,
const char *output_description,
struct t_hashtable *(*callback)(void *data,
const char *info_name,
struct t_hashtable *hashtable),
const char *function,
const char *data)
{
struct t_script_callback *new_script_callback;
struct t_hook *new_hook;
new_script_callback = script_callback_alloc ();
if (!new_script_callback)
return NULL;
new_hook = weechat_hook_info_hashtable (info_name, description,
args_description,
output_description,
callback, new_script_callback);
if (!new_hook)
{
script_callback_free_data (new_script_callback);
free (new_script_callback);
return NULL;
}
script_callback_init (new_script_callback, script, function, data);
new_script_callback->hook = new_hook;
script_callback_add (script, new_script_callback);
return new_hook;
}
/*
* script_api_hook_infolist: hook an infolist
* return new hook, NULL if error