1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-27 21:36:37 +02:00

New format for [bar] section in weechat.conf file, bar options can be set with /set command

This commit is contained in:
Sebastien Helleu
2008-04-15 13:50:01 +02:00
parent 362ce3eca8
commit b87d709a70
34 changed files with 1657 additions and 474 deletions
+98 -12
View File
@@ -1128,7 +1128,7 @@ weechat_lua_api_config_new_section (lua_State *L)
const char *config_file, *name, *function_read, *function_write;
const char *function_write_default, *function_create_option;
char *result;
int n;
int n, user_can_add_options, user_can_delete_options;
/* make C compiler happy */
(void) L;
@@ -1141,6 +1141,8 @@ weechat_lua_api_config_new_section (lua_State *L)
config_file = NULL;
name = NULL;
user_can_add_options = 0;
user_can_delete_options = 0;
function_read = NULL;
function_write = NULL;
function_write_default = NULL;
@@ -1148,14 +1150,16 @@ weechat_lua_api_config_new_section (lua_State *L)
n = lua_gettop (lua_current_interpreter);
if (n < 6)
if (n < 8)
{
WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("config_new_section");
LUA_RETURN_EMPTY;
}
config_file = lua_tostring (lua_current_interpreter, -6);
name = lua_tostring (lua_current_interpreter, -5);
config_file = lua_tostring (lua_current_interpreter, -8);
name = lua_tostring (lua_current_interpreter, -7);
user_can_add_options = lua_tonumber (lua_current_interpreter, -6);
user_can_delete_options = lua_tonumber (lua_current_interpreter, -5);
function_read = lua_tostring (lua_current_interpreter, -4);
function_write = lua_tostring (lua_current_interpreter, -3);
function_write_default = lua_tostring (lua_current_interpreter, -2);
@@ -1165,6 +1169,8 @@ weechat_lua_api_config_new_section (lua_State *L)
lua_current_script,
script_str2ptr ((char *)config_file),
(char *)name,
user_can_add_options,
user_can_delete_options,
&weechat_lua_api_config_read_cb,
(char *)function_read,
&weechat_lua_api_config_section_write_cb,
@@ -1391,6 +1397,45 @@ weechat_lua_api_config_string_to_boolean (lua_State *L)
LUA_RETURN_INT(value);
}
/*
* weechat_lua_api_config_option_reset: reset option with default value
*/
static int
weechat_lua_api_config_option_reset (lua_State *L)
{
const char *option;
int n, run_callback, rc;
/* make C compiler happy */
(void) L;
if (!lua_current_script)
{
WEECHAT_SCRIPT_MSG_NOT_INITIALIZED("config_option_reset");
LUA_RETURN_INT(0);
}
option = NULL;
run_callback = 0;
n = lua_gettop (lua_current_interpreter);
if (n < 2)
{
WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("config_option_reset");
LUA_RETURN_INT(0);
}
option = lua_tostring (lua_current_interpreter, -2);
run_callback = lua_tonumber (lua_current_interpreter, -1);
rc = weechat_config_option_reset (script_str2ptr ((char *)option),
run_callback);
LUA_RETURN_INT(rc);
}
/*
* weechat_lua_api_config_option_set: set new value for option
*/
@@ -1433,6 +1478,45 @@ weechat_lua_api_config_option_set (lua_State *L)
LUA_RETURN_INT(rc);
}
/*
* weechat_lua_api_config_option_rename: rename an option
*/
static int
weechat_lua_api_config_option_rename (lua_State *L)
{
const char *option, *new_name;
int n;
/* make C compiler happy */
(void) L;
if (!lua_current_script)
{
WEECHAT_SCRIPT_MSG_NOT_INITIALIZED("config_option_rename");;
LUA_RETURN_ERROR;
}
option = NULL;
new_name = NULL;
n = lua_gettop (lua_current_interpreter);
if (n < 2)
{
WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("config_option_rename");
LUA_RETURN_ERROR;
}
option = lua_tostring (lua_current_interpreter, -2);
new_name = lua_tostring (lua_current_interpreter, -1);
weechat_config_option_rename (script_str2ptr ((char *)option),
(char *)new_name);
LUA_RETURN_OK;
}
/*
* weechat_lua_api_config_boolean: return boolean value of option
*/
@@ -3794,9 +3878,9 @@ weechat_lua_api_bar_search (lua_State *L)
static int
weechat_lua_api_bar_new (lua_State *L)
{
const char *name, *type, *position, *items;
const char *name, *type, *position, *items, *size, *separator;
char *result;
int n, size, separator;
int n;
/* make C compiler happy */
(void) L;
@@ -3810,8 +3894,8 @@ weechat_lua_api_bar_new (lua_State *L)
name = NULL;
type = NULL;
position = NULL;
size = 0;
separator = 0;
size = NULL;
separator = NULL;
items = NULL;
n = lua_gettop (lua_current_interpreter);
@@ -3825,15 +3909,15 @@ weechat_lua_api_bar_new (lua_State *L)
name = lua_tostring (lua_current_interpreter, -6);
type = lua_tostring (lua_current_interpreter, -5);
position = lua_tostring (lua_current_interpreter, -4);
size = lua_tonumber (lua_current_interpreter, -3);
separator = lua_tonumber (lua_current_interpreter, -2);
size = lua_tostring (lua_current_interpreter, -3);
separator = lua_tostring (lua_current_interpreter, -2);
items = lua_tostring (lua_current_interpreter, -1);
result = script_ptr2str (weechat_bar_new ((char *)name,
(char *)type,
(char *)position,
size,
separator,
(char *)size,
(char *)separator,
(char *)items));
LUA_RETURN_STRING_FREE(result);
@@ -4533,7 +4617,9 @@ const struct luaL_reg weechat_lua_api_funcs[] = {
{ "config_new_option", &weechat_lua_api_config_new_option },
{ "config_search_option", &weechat_lua_api_config_search_option },
{ "config_string_to_boolean", &weechat_lua_api_config_string_to_boolean },
{ "config_option_reset", &weechat_lua_api_config_option_reset },
{ "config_option_set", &weechat_lua_api_config_option_set },
{ "config_option_rename", &weechat_lua_api_config_option_rename },
{ "config_boolean", &weechat_lua_api_config_boolean },
{ "config_integer", &weechat_lua_api_config_integer },
{ "config_string", &weechat_lua_api_config_string },
+78 -8
View File
@@ -964,7 +964,7 @@ static XS (XS_weechat_config_new_section)
PERL_RETURN_EMPTY;
}
if (items < 6)
if (items < 8)
{
WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("config_new_section");
PERL_RETURN_EMPTY;
@@ -972,14 +972,16 @@ static XS (XS_weechat_config_new_section)
cfg_file = SvPV (ST (0), PL_na);
name = SvPV (ST (1), PL_na);
function_read = SvPV (ST (2), PL_na);
function_write = SvPV (ST (3), PL_na);
function_write_default = SvPV (ST (4), PL_na);
function_create_option = SvPV (ST (5), PL_na);
function_read = SvPV (ST (4), PL_na);
function_write = SvPV (ST (5), PL_na);
function_write_default = SvPV (ST (6), PL_na);
function_create_option = SvPV (ST (7), PL_na);
result = script_ptr2str (script_api_config_new_section (weechat_perl_plugin,
perl_current_script,
script_str2ptr (cfg_file),
name,
SvIV (ST (2)), /* user_can_add_options */
SvIV (ST (3)), /* user_can_delete_options */
&weechat_perl_api_config_section_read_cb,
function_read,
&weechat_perl_api_config_section_write_cb,
@@ -1164,6 +1166,38 @@ static XS (XS_weechat_config_string_to_boolean)
PERL_RETURN_INT(value);
}
/*
* weechat::config_option_reset: reset an option with default value
*/
static XS (XS_weechat_config_option_reset)
{
int rc;
char *option;
dXSARGS;
/* make C compiler happy */
(void) cv;
if (!perl_current_script)
{
WEECHAT_SCRIPT_MSG_NOT_INITIALIZED("config_option_reset");
PERL_RETURN_INT(0);
}
if (items < 2)
{
WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("config_option_reset");
PERL_RETURN_INT(0);
}
option = SvPV (ST (0), PL_na);
rc = weechat_config_option_reset (script_str2ptr (option),
SvIV (ST (1))); /* run_callback */
PERL_RETURN_INT(rc);
}
/*
* weechat::config_option_set: set new value for option
*/
@@ -1198,6 +1232,38 @@ static XS (XS_weechat_config_option_set)
PERL_RETURN_INT(rc);
}
/*
* weechat::config_option_rename: rename an option
*/
static XS (XS_weechat_config_option_rename)
{
char *option, *new_name;
dXSARGS;
/* make C compiler happy */
(void) cv;
if (!perl_current_script)
{
WEECHAT_SCRIPT_MSG_NOT_INITIALIZED("config_option_rename");
PERL_RETURN_ERROR;
}
if (items < 2)
{
WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("config_option_rename");
PERL_RETURN_ERROR;
}
option = SvPV (ST (0), PL_na);
new_name = SvPV (ST (1), PL_na);
weechat_config_option_rename (script_str2ptr (option),
new_name);
PERL_RETURN_OK;
}
/*
* weechat::config_boolean: return boolean value of option
*/
@@ -3153,7 +3219,7 @@ static XS (XS_weechat_bar_search)
static XS (XS_weechat_bar_new)
{
char *result, *name, *type, *position, *bar_items;
char *result, *name, *type, *position, *size, *separator, *bar_items;
dXSARGS;
/* make C compiler happy */
@@ -3174,12 +3240,14 @@ static XS (XS_weechat_bar_new)
name = SvPV (ST (0), PL_na);
type = SvPV (ST (1), PL_na);
position = SvPV (ST (2), PL_na);
size = SvPV (ST (3), PL_na);
separator = SvPV (ST (4), PL_na);
bar_items = SvPV (ST (5), PL_na);
result = script_ptr2str (weechat_bar_new (name,
type,
position,
SvIV (ST (3)), /* size */
SvIV (ST (4)), /* separator */
size,
separator,
bar_items));
PERL_RETURN_STRING_FREE(result);
@@ -3651,7 +3719,9 @@ weechat_perl_api_init (pTHX)
newXS ("weechat::config_new_option", XS_weechat_config_new_option, "weechat");
newXS ("weechat::config_search_option", XS_weechat_config_search_option, "weechat");
newXS ("weechat::config_string_to_boolean", XS_weechat_config_string_to_boolean, "weechat");
newXS ("weechat::config_option_reset", XS_weechat_config_option_reset, "weechat");
newXS ("weechat::config_option_set", XS_weechat_config_option_set, "weechat");
newXS ("weechat::config_option_rename", XS_weechat_config_option_rename, "weechat");
newXS ("weechat::config_boolean", XS_weechat_config_boolean, "weechat");
newXS ("weechat::config_integer", XS_weechat_config_integer, "weechat");
newXS ("weechat::config_string", XS_weechat_config_string, "weechat");
@@ -999,6 +999,7 @@ weechat_python_api_config_new_section (PyObject *self, PyObject *args)
char *config_file, *name, *function_read, *function_write;
char *function_write_default, *function_create_option;
char *result;
int user_can_add_options, user_can_delete_options;
PyObject *object;
/* make C compiler happy */
@@ -1012,12 +1013,15 @@ weechat_python_api_config_new_section (PyObject *self, PyObject *args)
config_file = NULL;
name = NULL;
user_can_add_options = 0;
user_can_delete_options = 0;
function_read = NULL;
function_write = NULL;
function_write_default = NULL;
function_create_option = NULL;
if (!PyArg_ParseTuple (args, "ssssss", &config_file, &name,
if (!PyArg_ParseTuple (args, "ssiissss", &config_file, &name,
&user_can_add_options, &user_can_delete_options,
&function_read, &function_write,
&function_write_default, &function_create_option))
{
@@ -1029,6 +1033,8 @@ weechat_python_api_config_new_section (PyObject *self, PyObject *args)
python_current_script,
script_str2ptr (config_file),
name,
user_can_add_options,
user_can_delete_options,
&weechat_python_api_config_read_cb,
function_read,
&weechat_python_api_config_section_write_cb,
@@ -1225,6 +1231,40 @@ weechat_python_api_config_string_to_boolean (PyObject *self, PyObject *args)
PYTHON_RETURN_INT(value);
}
/*
* weechat_python_api_config_option_reset: reset an option with default value
*/
static PyObject *
weechat_python_api_config_option_reset (PyObject *self, PyObject *args)
{
char *option;
int run_callback, rc;
/* make C compiler happy */
(void) self;
if (!python_current_script)
{
WEECHAT_SCRIPT_MSG_NOT_INITIALIZED("config_option_reset");
PYTHON_RETURN_INT(0);
}
option = NULL;
run_callback = 0;
if (!PyArg_ParseTuple (args, "si", &option, &run_callback))
{
WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("config_option_reset");
PYTHON_RETURN_INT(0);
}
rc = weechat_config_option_reset (script_str2ptr (option),
run_callback);
PYTHON_RETURN_INT(rc);
}
/*
* weechat_python_api_config_option_set: set new value for option
*/
@@ -1261,6 +1301,39 @@ weechat_python_api_config_option_set (PyObject *self, PyObject *args)
PYTHON_RETURN_INT(rc);
}
/*
* weechat_python_api_config_option_rename: rename an option
*/
static PyObject *
weechat_python_api_config_option_rename (PyObject *self, PyObject *args)
{
char *option, *new_name;
/* make C compiler happy */
(void) self;
if (!python_current_script)
{
WEECHAT_SCRIPT_MSG_NOT_INITIALIZED("config_option_rename");
PYTHON_RETURN_ERROR;
}
option = NULL;
new_name = NULL;
if (!PyArg_ParseTuple (args, "ss", &option, &new_name))
{
WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("config_option_rename");
PYTHON_RETURN_ERROR;
}
weechat_config_option_rename (script_str2ptr (option),
new_name);
PYTHON_RETURN_OK;
}
/*
* weechat_python_api_config_boolean: return boolean value of option
*/
@@ -3353,8 +3426,7 @@ weechat_python_api_bar_search (PyObject *self, PyObject *args)
static PyObject *
weechat_python_api_bar_new (PyObject *self, PyObject *args)
{
char *name, *type, *position, *items, *result;
int size, separator;
char *name, *type, *position, *size, *separator, *items, *result;
PyObject *object;
/* make C compiler happy */
@@ -3369,11 +3441,11 @@ weechat_python_api_bar_new (PyObject *self, PyObject *args)
name = NULL;
type = NULL;
position = NULL;
size = 0;
separator = 0;
size = NULL;
separator = NULL;
items = NULL;
if (!PyArg_ParseTuple (args, "sssiis", &name, &type, &position, &size,
if (!PyArg_ParseTuple (args, "ssssss", &name, &type, &position, &size,
&separator, &items))
{
WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("bar_new");
@@ -3704,7 +3776,7 @@ weechat_python_api_infolist_integer (PyObject *self, PyObject *args)
infolist = NULL;
variable = NULL;
if (!PyArg_ParseTuple (args, "s&", &infolist, &variable))
if (!PyArg_ParseTuple (args, "ss", &infolist, &variable))
{
WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("infolist_integer");
PYTHON_RETURN_INT(0);
@@ -3884,7 +3956,9 @@ PyMethodDef weechat_python_funcs[] =
{ "config_new_option", &weechat_python_api_config_new_option, METH_VARARGS, "" },
{ "config_search_option", &weechat_python_api_config_search_option, METH_VARARGS, "" },
{ "config_string_to_boolean", &weechat_python_api_config_string_to_boolean, METH_VARARGS, "" },
{ "config_option_reset", &weechat_python_api_config_option_reset, METH_VARARGS, "" },
{ "config_option_set", &weechat_python_api_config_option_set, METH_VARARGS, "" },
{ "config_option_rename", &weechat_python_api_config_option_rename, METH_VARARGS, "" },
{ "config_boolean", &weechat_python_api_config_boolean, METH_VARARGS, "" },
{ "config_integer", &weechat_python_api_config_integer, METH_VARARGS, "" },
{ "config_string", &weechat_python_api_config_string, METH_VARARGS, "" },
+106 -11
View File
@@ -1114,7 +1114,9 @@ weechat_ruby_api_config_section_create_option_cb (void *data,
static VALUE
weechat_ruby_api_config_new_section (VALUE class, VALUE config_file,
VALUE name, VALUE function_read,
VALUE name, VALUE user_can_add_options,
VALUE user_can_delete_options,
VALUE function_read,
VALUE function_write,
VALUE function_write_default,
VALUE function_create_option)
@@ -1122,6 +1124,7 @@ weechat_ruby_api_config_new_section (VALUE class, VALUE config_file,
char *c_config_file, *c_name, *c_function_read, *c_function_write;
char *c_function_write_default, *c_function_create_option;
char *result;
int c_user_can_add_options, c_user_can_delete_options;
VALUE return_value;
/* make C compiler happy */
@@ -1135,12 +1138,15 @@ weechat_ruby_api_config_new_section (VALUE class, VALUE config_file,
c_config_file = NULL;
c_name = NULL;
c_user_can_add_options = 0;
c_user_can_delete_options = 0;
c_function_read = NULL;
c_function_write = NULL;
c_function_write_default = NULL;
c_function_create_option = NULL;
if (NIL_P (config_file) || NIL_P (name) || NIL_P (function_read)
if (NIL_P (config_file) || NIL_P (name) || NIL_P (user_can_add_options)
|| NIL_P (user_can_delete_options) || NIL_P (function_read)
|| NIL_P (function_write) || NIL_P (function_write_default)
|| NIL_P (function_create_option))
{
@@ -1150,6 +1156,8 @@ weechat_ruby_api_config_new_section (VALUE class, VALUE config_file,
Check_Type (config_file, T_STRING);
Check_Type (name, T_STRING);
Check_Type (user_can_add_options, T_FIXNUM);
Check_Type (user_can_delete_options, T_FIXNUM);
Check_Type (function_read, T_STRING);
Check_Type (function_write, T_STRING);
Check_Type (function_write_default, T_STRING);
@@ -1157,6 +1165,8 @@ weechat_ruby_api_config_new_section (VALUE class, VALUE config_file,
c_config_file = STR2CSTR (config_file);
c_name = STR2CSTR (name);
c_user_can_add_options = FIX2INT (user_can_add_options);
c_user_can_delete_options = FIX2INT (user_can_delete_options);
c_function_read = STR2CSTR (function_read);
c_function_write = STR2CSTR (function_write);
c_function_write_default = STR2CSTR (function_write_default);
@@ -1166,6 +1176,8 @@ weechat_ruby_api_config_new_section (VALUE class, VALUE config_file,
ruby_current_script,
script_str2ptr (c_config_file),
c_name,
c_user_can_add_options,
c_user_can_delete_options,
&weechat_ruby_api_config_read_cb,
c_function_read,
&weechat_ruby_api_config_section_write_cb,
@@ -1410,6 +1422,47 @@ weechat_ruby_api_config_string_to_boolean (VALUE class, VALUE text)
RUBY_RETURN_INT(value);
}
/*
* weechat_ruby_api_config_option_reset: reset option with default value
*/
static VALUE
weechat_ruby_api_config_option_reset (VALUE class, VALUE option,
VALUE run_callback)
{
char *c_option;
int c_run_callback, rc;
/* make C compiler happy */
(void) class;
if (!ruby_current_script)
{
WEECHAT_SCRIPT_MSG_NOT_INITIALIZED("config_option_reset");
RUBY_RETURN_INT(0);
}
c_option = NULL;
c_run_callback = 0;
if (NIL_P (option) || NIL_P (run_callback))
{
WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("config_option_reset");
RUBY_RETURN_INT(0);
}
Check_Type (option, T_STRING);
Check_Type (run_callback, T_FIXNUM);
c_option = STR2CSTR (option);
c_run_callback = FIX2INT (run_callback);
rc = weechat_config_option_reset (script_str2ptr (c_option),
c_run_callback);
RUBY_RETURN_INT(rc);
}
/*
* weechat_ruby_api_config_option_set: set new value for option
*/
@@ -1455,6 +1508,46 @@ weechat_ruby_api_config_option_set (VALUE class, VALUE option, VALUE new_value,
RUBY_RETURN_INT(rc);
}
/*
* weechat_ruby_api_config_option_rename: rename an option
*/
static VALUE
weechat_ruby_api_config_option_rename (VALUE class, VALUE option,
VALUE new_name)
{
char *c_option, *c_new_name;
/* make C compiler happy */
(void) class;
if (!ruby_current_script)
{
WEECHAT_SCRIPT_MSG_NOT_INITIALIZED("config_option_rename");
RUBY_RETURN_ERROR;
}
c_option = NULL;
c_new_name = NULL;
if (NIL_P (option) || NIL_P (new_name))
{
WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("config_option_rename");
RUBY_RETURN_ERROR;
}
Check_Type (option, T_STRING);
Check_Type (new_name, T_STRING);
c_option = STR2CSTR (option);
c_new_name = STR2CSTR (new_name);
weechat_config_option_rename (script_str2ptr (c_option),
c_new_name);
RUBY_RETURN_OK;
}
/*
* weechat_ruby_api_config_boolean: return boolean value of option
*/
@@ -3852,8 +3945,8 @@ static VALUE
weechat_ruby_api_bar_new (VALUE class, VALUE name, VALUE type, VALUE position,
VALUE size, VALUE separator, VALUE items)
{
char *c_name, *c_type, *c_position, *c_items, *result;
int c_size, c_separator;
char *c_name, *c_type, *c_position, *c_size, *c_separator, *c_items;
char *result;
VALUE return_value;
/* make C compiler happy */
@@ -3868,8 +3961,8 @@ weechat_ruby_api_bar_new (VALUE class, VALUE name, VALUE type, VALUE position,
c_name = NULL;
c_type = NULL;
c_position = NULL;
c_size = 0;
c_separator = 0;
c_size = NULL;
c_separator = NULL;
c_items = NULL;
if (NIL_P (name) || NIL_P (type) || NIL_P (position) || NIL_P (size)
@@ -3882,15 +3975,15 @@ weechat_ruby_api_bar_new (VALUE class, VALUE name, VALUE type, VALUE position,
Check_Type (name, T_STRING);
Check_Type (type, T_STRING);
Check_Type (position, T_STRING);
Check_Type (size, T_FIXNUM);
Check_Type (separator, T_FIXNUM);
Check_Type (size, T_STRING);
Check_Type (separator, T_STRING);
Check_Type (items, T_STRING);
c_name = STR2CSTR (name);
c_type = STR2CSTR (type);
c_position = STR2CSTR (position);
c_size = FIX2INT (size);
c_separator = FIX2INT (separator);
c_size = STR2CSTR (size);
c_separator = STR2CSTR (separator);
c_items = STR2CSTR (items);
result = script_ptr2str (weechat_bar_new (c_name,
@@ -4436,12 +4529,14 @@ weechat_ruby_api_init (VALUE ruby_mWeechat)
rb_define_module_function (ruby_mWeechat, "list_remove_all", &weechat_ruby_api_list_remove_all, 1);
rb_define_module_function (ruby_mWeechat, "list_free", &weechat_ruby_api_list_free, 1);
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, 6);
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, 10);
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);
rb_define_module_function (ruby_mWeechat, "config_option_set", &weechat_ruby_api_config_option_set, 3);
rb_define_module_function (ruby_mWeechat, "config_option_rename", &weechat_ruby_api_config_option_rename, 2);
rb_define_module_function (ruby_mWeechat, "config_boolean", &weechat_ruby_api_config_boolean, 1);
rb_define_module_function (ruby_mWeechat, "config_integer", &weechat_ruby_api_config_integer, 1);
rb_define_module_function (ruby_mWeechat, "config_string", &weechat_ruby_api_config_string, 1);
+4
View File
@@ -98,6 +98,8 @@ script_api_config_new_section (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script,
struct t_config_file *config_file,
char *name,
int user_can_add_options,
int user_can_delete_options,
void (*callback_read)(void *data,
struct t_config_file *config_file,
char *option_name,
@@ -202,6 +204,8 @@ script_api_config_new_section (struct t_weechat_plugin *weechat_plugin,
new_section = weechat_config_new_section (config_file,
name,
user_can_add_options,
user_can_delete_options,
callback1,
new_script_callback1,
callback2,
+2
View File
@@ -31,6 +31,8 @@ extern struct t_config_section *script_api_config_new_section (struct t_weechat_
struct t_plugin_script *script,
struct t_config_file *config_file,
char *name,
int user_can_add_options,
int user_can_delete_options,
void (*callback_read)(void *data,
struct t_config_file *config_file,
char *option_name,