1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-01 07:16:37 +02:00

Add new argument "value" to function config_new_option

This commit is contained in:
Sebastien Helleu
2008-10-18 19:31:40 +02:00
parent 8511f9a77e
commit 3b81a4746a
27 changed files with 354 additions and 374 deletions
+10 -4
View File
@@ -1377,12 +1377,13 @@ weechat_ruby_api_config_new_option (VALUE class, VALUE config_file,
VALUE section, VALUE name, VALUE type,
VALUE description, VALUE string_values,
VALUE min, VALUE max, VALUE default_value,
VALUE value,
VALUE function_check_value,
VALUE function_change,
VALUE function_delete)
{
char *c_config_file, *c_section, *c_name, *c_type, *c_description;
char *c_string_values, *c_default_value, *result;
char *c_string_values, *c_default_value, *c_value, *result;
char *c_function_check_value, *c_function_change, *c_function_delete;
int c_min, c_max;
VALUE return_value;
@@ -1405,14 +1406,16 @@ weechat_ruby_api_config_new_option (VALUE class, VALUE config_file,
c_min = 0;
c_max = 0;
c_default_value = NULL;
c_value = NULL;
c_function_check_value = NULL;
c_function_change = NULL;
c_function_delete = NULL;
if (NIL_P (config_file) || NIL_P (section) || NIL_P (name) || NIL_P (type)
|| NIL_P (description) || NIL_P (string_values)
|| NIL_P (default_value) || NIL_P (function_check_value)
|| NIL_P (function_change) || NIL_P (function_delete))
|| NIL_P (default_value) || NIL_P (value)
|| NIL_P (function_check_value) || NIL_P (function_change)
|| NIL_P (function_delete))
{
WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("config_new_option");
RUBY_RETURN_EMPTY;
@@ -1427,6 +1430,7 @@ weechat_ruby_api_config_new_option (VALUE class, VALUE config_file,
Check_Type (min, T_FIXNUM);
Check_Type (max, T_FIXNUM);
Check_Type (default_value, T_STRING);
Check_Type (value, T_STRING);
Check_Type (function_check_value, T_STRING);
Check_Type (function_change, T_STRING);
Check_Type (function_delete, T_STRING);
@@ -1440,6 +1444,7 @@ weechat_ruby_api_config_new_option (VALUE class, VALUE config_file,
c_min = FIX2INT (min);
c_max = FIX2INT (max);
c_default_value = STR2CSTR (default_value);
c_value = STR2CSTR (value);
c_function_check_value = STR2CSTR (function_check_value);
c_function_change = STR2CSTR (function_change);
c_function_delete = STR2CSTR (function_delete);
@@ -1455,6 +1460,7 @@ weechat_ruby_api_config_new_option (VALUE class, VALUE config_file,
c_min,
c_max,
c_default_value,
c_value,
&weechat_ruby_api_config_option_check_value_cb,
c_function_check_value,
&weechat_ruby_api_config_option_change_cb,
@@ -5354,7 +5360,7 @@ weechat_ruby_api_init (VALUE ruby_mWeechat)
rb_define_module_function (ruby_mWeechat, "config_new", &weechat_ruby_api_config_new, 2);
rb_define_module_function (ruby_mWeechat, "config_new_section", &weechat_ruby_api_config_new_section, 8);
rb_define_module_function (ruby_mWeechat, "config_search_section", &weechat_ruby_api_config_search_section, 2);
rb_define_module_function (ruby_mWeechat, "config_new_option", &weechat_ruby_api_config_new_option, 12);
rb_define_module_function (ruby_mWeechat, "config_new_option", &weechat_ruby_api_config_new_option, 13);
rb_define_module_function (ruby_mWeechat, "config_search_option", &weechat_ruby_api_config_search_option, 3);
rb_define_module_function (ruby_mWeechat, "config_string_to_boolean", &weechat_ruby_api_config_string_to_boolean, 1);
rb_define_module_function (ruby_mWeechat, "config_option_reset", &weechat_ruby_api_config_option_reset, 2);