diff options
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | src/plugins/scripts/guile/weechat-guile-api.c | 38 |
2 files changed, 40 insertions, 1 deletions
@@ -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 diff --git a/src/plugins/scripts/guile/weechat-guile-api.c b/src/plugins/scripts/guile/weechat-guile-api.c index cc67a2171..8afb11b21 100644 --- a/src/plugins/scripts/guile/weechat-guile-api.c +++ b/src/plugins/scripts/guile/weechat-guile-api.c @@ -2423,6 +2423,43 @@ weechat_guile_api_hook_process (SCM command, SCM timeout, SCM function, } /* + * 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); |