1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-29 22:36:38 +02:00

guile: add missing function "hook_process_hashtable" in API

This commit is contained in:
Sebastien Helleu
2012-03-25 18:20:25 +02:00
parent b867c69477
commit 7e1859ad5d
2 changed files with 40 additions and 1 deletions
+2 -1
View File
@@ -1,7 +1,7 @@
WeeChat ChangeLog
=================
Sébastien Helleu <flashcode@flashtux.org>
v0.3.8-dev, 2012-03-24
v0.3.8-dev, 2012-03-25
Version 0.3.8 (under dev!)
@@ -19,6 +19,7 @@ Version 0.3.8 (under dev!)
* api: display warning in scripts when invalid pointers (malformed strings) are
given to plugin API functions (warning displayed if debug for plugin is >= 1)
* api: add list "gui_buffer_last_displayed" in hdata "buffer"
* guile: add missing function "hook_process_hashtable" in API
* irc: do not send command "MODE #channel" on manual /names (do it only when
names are received on join of channel) (bug #35930)
* irc: do not allow the creation of two servers with same name but different
@@ -2422,6 +2422,43 @@ weechat_guile_api_hook_process (SCM command, SCM timeout, SCM function,
API_RETURN_STRING_FREE(result);
}
/*
* weechat_guile_api_hook_process_hashtable: hook a process with options in a
* hashtable
*/
SCM
weechat_guile_api_hook_process_hashtable (SCM command, SCM options, SCM timeout,
SCM function, SCM data)
{
char *result;
SCM return_value;
struct t_hashtable *c_options;
API_FUNC(1, "hook_process_hashtable", API_RETURN_EMPTY);
if (!scm_is_string (command) || !scm_list_p (options)
|| !scm_is_integer (timeout) || !scm_is_string (function)
|| !scm_is_string (data))
API_WRONG_ARGS(API_RETURN_EMPTY);
c_options = weechat_guile_alist_to_hashtable (options,
WEECHAT_SCRIPT_HASHTABLE_DEFAULT_SIZE);
result = script_ptr2str (script_api_hook_process_hashtable (weechat_guile_plugin,
guile_current_script,
scm_i_string_chars (command),
c_options,
scm_to_int (timeout),
&weechat_guile_api_hook_process_cb,
scm_i_string_chars (function),
scm_i_string_chars (data)));
if (c_options)
weechat_hashtable_free (c_options);
API_RETURN_STRING_FREE(result);
}
/*
* weechat_guile_api_hook_connect_cb: callback for connect hooked
*/
@@ -5308,6 +5345,7 @@ weechat_guile_api_module_init (void *data)
API_DEF_FUNC(hook_timer, 5);
API_DEF_FUNC(hook_fd, 6);
API_DEF_FUNC(hook_process, 4);
API_DEF_FUNC(hook_process_hashtable, 5);
API_DEF_FUNC(hook_connect, 8);
API_DEF_FUNC(hook_print, 6);
API_DEF_FUNC(hook_signal, 3);