summaryrefslogtreecommitdiff
path: root/src/plugins/scripts/ruby/weechat-ruby-api.c
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2011-04-26 17:47:49 +0200
committerSebastien Helleu <flashcode@flashtux.org>2011-04-26 17:47:49 +0200
commit3fd2af81847440fa221621572d6cf36eca910483 (patch)
treee97824372bd150213f3cbf8c22513f5bd209722a /src/plugins/scripts/ruby/weechat-ruby-api.c
parent51f836feb81e8021dda0b67d4efcd56d635f8f5d (diff)
downloadweechat-3fd2af81847440fa221621572d6cf36eca910483.zip
api: add new function config_set_desc_plugin (task #10925)
Diffstat (limited to 'src/plugins/scripts/ruby/weechat-ruby-api.c')
-rw-r--r--src/plugins/scripts/ruby/weechat-ruby-api.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/plugins/scripts/ruby/weechat-ruby-api.c b/src/plugins/scripts/ruby/weechat-ruby-api.c
index cfa82cf88..a9df9537a 100644
--- a/src/plugins/scripts/ruby/weechat-ruby-api.c
+++ b/src/plugins/scripts/ruby/weechat-ruby-api.c
@@ -2993,6 +2993,45 @@ weechat_ruby_api_config_set_plugin (VALUE class, VALUE option, VALUE value)
}
/*
+ * weechat_ruby_api_config_set_desc_plugin: set description of a plugin option
+ */
+
+static VALUE
+weechat_ruby_api_config_set_desc_plugin (VALUE class, VALUE option,
+ VALUE description)
+{
+ char *c_option, *c_description;
+
+ /* make C compiler happy */
+ (void) class;
+
+ if (!ruby_current_script || !ruby_current_script->name)
+ {
+ WEECHAT_SCRIPT_MSG_NOT_INIT(RUBY_CURRENT_SCRIPT_NAME, "config_set_desc_plugin");
+ RUBY_RETURN_ERROR;
+ }
+
+ if (NIL_P (option) || NIL_P (description))
+ {
+ WEECHAT_SCRIPT_MSG_WRONG_ARGS(RUBY_CURRENT_SCRIPT_NAME, "config_set_desc_plugin");
+ RUBY_RETURN_ERROR;
+ }
+
+ Check_Type (option, T_STRING);
+ Check_Type (description, T_STRING);
+
+ c_option = StringValuePtr (option);
+ c_description = StringValuePtr (description);
+
+ script_api_config_set_desc_plugin (weechat_ruby_plugin,
+ ruby_current_script,
+ c_option,
+ c_description);
+
+ RUBY_RETURN_OK;
+}
+
+/*
* weechat_ruby_api_config_unset_plugin: unset plugin option
*/
@@ -7737,6 +7776,7 @@ weechat_ruby_api_init (VALUE ruby_mWeechat)
rb_define_module_function (ruby_mWeechat, "config_get_plugin", &weechat_ruby_api_config_get_plugin, 1);
rb_define_module_function (ruby_mWeechat, "config_is_set_plugin", &weechat_ruby_api_config_is_set_plugin, 1);
rb_define_module_function (ruby_mWeechat, "config_set_plugin", &weechat_ruby_api_config_set_plugin, 2);
+ rb_define_module_function (ruby_mWeechat, "config_set_desc_plugin", &weechat_ruby_api_config_set_desc_plugin, 2);
rb_define_module_function (ruby_mWeechat, "config_unset_plugin", &weechat_ruby_api_config_unset_plugin, 1);
rb_define_module_function (ruby_mWeechat, "prefix", &weechat_ruby_api_prefix, 1);
rb_define_module_function (ruby_mWeechat, "color", &weechat_ruby_api_color, 1);