diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2009-02-20 14:53:32 +0100 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2009-02-20 14:53:32 +0100 |
commit | 1b4028218cc6d9e369e73e769228ae05b8611dd1 (patch) | |
tree | e9aab2fb14f545fe170856ad53e32bce1b7134a9 /src/plugins/scripts/python/weechat-python-api.c | |
parent | e3f12be462a37c09549fff4e3652914e81ae41b0 (diff) | |
download | weechat-1b4028218cc6d9e369e73e769228ae05b8611dd1.zip |
Add return code value for config_read callback in script plugins
Diffstat (limited to 'src/plugins/scripts/python/weechat-python-api.c')
-rw-r--r-- | src/plugins/scripts/python/weechat-python-api.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/plugins/scripts/python/weechat-python-api.c b/src/plugins/scripts/python/weechat-python-api.c index 0848cf284..fe709237f 100644 --- a/src/plugins/scripts/python/weechat-python-api.c +++ b/src/plugins/scripts/python/weechat-python-api.c @@ -949,7 +949,7 @@ weechat_python_api_config_new (PyObject *self, PyObject *args) * weechat_python_api_config_read_cb: callback for reading option in section */ -void +int weechat_python_api_config_read_cb (void *data, struct t_config_file *config_file, struct t_config_section *section, @@ -957,10 +957,10 @@ weechat_python_api_config_read_cb (void *data, { struct t_script_callback *script_callback; char *python_argv[5]; - int *rc; + int *rc, ret; script_callback = (struct t_script_callback *)data; - + if (script_callback->function && script_callback->function[0]) { python_argv[0] = script_ptr2str (config_file); @@ -974,13 +974,25 @@ weechat_python_api_config_read_cb (void *data, script_callback->function, python_argv); + if (!rc) + ret = WEECHAT_CONFIG_OPTION_SET_ERROR; + else + { + ret = *rc; + free (rc); + } + if (rc) free (rc); if (python_argv[0]) free (python_argv[0]); if (python_argv[1]) free (python_argv[1]); + + return ret; } + + return WEECHAT_CONFIG_OPTION_SET_ERROR; } /* |