diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/guile/weechat-guile-api.c | 37 | ||||
-rw-r--r-- | src/plugins/javascript/weechat-js-api.cpp | 35 | ||||
-rw-r--r-- | src/plugins/lua/weechat-lua-api.c | 37 | ||||
-rw-r--r-- | src/plugins/perl/weechat-perl-api.c | 39 | ||||
-rw-r--r-- | src/plugins/php/weechat-php-api.c | 43 | ||||
-rw-r--r-- | src/plugins/php/weechat-php-api.h | 2 | ||||
-rw-r--r-- | src/plugins/php/weechat-php.c | 2 | ||||
-rw-r--r-- | src/plugins/php/weechat-php.stub.php | 2 | ||||
-rw-r--r-- | src/plugins/php/weechat-php_arginfo.h | 7 | ||||
-rw-r--r-- | src/plugins/php/weechat-php_legacy_arginfo.h | 7 | ||||
-rw-r--r-- | src/plugins/python/weechat-python-api.c | 35 | ||||
-rw-r--r-- | src/plugins/ruby/weechat-ruby-api.c | 48 | ||||
-rw-r--r-- | src/plugins/tcl/weechat-tcl-api.c | 37 |
13 files changed, 328 insertions, 3 deletions
diff --git a/src/plugins/guile/weechat-guile-api.c b/src/plugins/guile/weechat-guile-api.c index d67559338..290e069b2 100644 --- a/src/plugins/guile/weechat-guile-api.c +++ b/src/plugins/guile/weechat-guile-api.c @@ -1516,6 +1516,41 @@ weechat_guile_api_config_option_rename (SCM option, SCM new_name) } SCM +weechat_guile_api_config_option_get_string (SCM option, SCM property) +{ + const char *result; + SCM return_value; + + API_INIT_FUNC(1, "config_option_get_string", API_RETURN_EMPTY); + if (!scm_is_string (option) || !scm_is_string (property)) + API_WRONG_ARGS(API_RETURN_EMPTY); + + result = weechat_config_option_get_string ( + API_STR2PTR(API_SCM_TO_STRING(option)), + API_SCM_TO_STRING(property)); + + API_RETURN_STRING(result); +} + +SCM +weechat_guile_api_config_option_get_pointer (SCM option, SCM property) +{ + const char *result; + SCM return_value; + + API_INIT_FUNC(1, "config_option_get_pointer", API_RETURN_EMPTY); + if (!scm_is_string (option) || !scm_is_string (property)) + API_WRONG_ARGS(API_RETURN_EMPTY); + + result = API_PTR2STR( + weechat_config_option_get_pointer ( + API_STR2PTR(API_SCM_TO_STRING(option)), + API_SCM_TO_STRING(property))); + + API_RETURN_STRING(result); +} + +SCM weechat_guile_api_config_option_is_null (SCM option) { int value; @@ -5366,6 +5401,8 @@ weechat_guile_api_module_init (void *data) API_DEF_FUNC(config_option_set_null, 2); API_DEF_FUNC(config_option_unset, 1); API_DEF_FUNC(config_option_rename, 2); + API_DEF_FUNC(config_option_get_string, 2); + API_DEF_FUNC(config_option_get_pointer, 2); API_DEF_FUNC(config_option_is_null, 1); API_DEF_FUNC(config_option_default_is_null, 1); API_DEF_FUNC(config_boolean, 1); diff --git a/src/plugins/javascript/weechat-js-api.cpp b/src/plugins/javascript/weechat-js-api.cpp index 9bf8b1c54..12d1c79ae 100644 --- a/src/plugins/javascript/weechat-js-api.cpp +++ b/src/plugins/javascript/weechat-js-api.cpp @@ -1425,6 +1425,39 @@ API_FUNC(config_option_rename) API_RETURN_OK; } +API_FUNC(config_option_get_string) +{ + const char *result; + + API_INIT_FUNC(1, "config_option_get_string", "ss", API_RETURN_EMPTY); + + v8::String::Utf8Value option(args[0]); + v8::String::Utf8Value property(args[1]); + + result = weechat_config_option_get_string ( + (struct t_config_option *)API_STR2PTR(*option), + *property); + + API_RETURN_STRING(result); +} + +API_FUNC(config_option_get_pointer) +{ + const char *result; + + API_INIT_FUNC(1, "config_option_get_pointer", "ss", API_RETURN_EMPTY); + + v8::String::Utf8Value option(args[0]); + v8::String::Utf8Value property(args[1]); + + result = API_PTR2STR( + weechat_config_option_get_pointer ( + (struct t_config_option *)API_STR2PTR(*option), + *property)); + + API_RETURN_STRING(result); +} + API_FUNC(config_option_is_null) { int value; @@ -5319,6 +5352,8 @@ WeechatJsV8::loadLibs() API_DEF_FUNC(config_option_set_null); API_DEF_FUNC(config_option_unset); API_DEF_FUNC(config_option_rename); + API_DEF_FUNC(config_option_get_string); + API_DEF_FUNC(config_option_get_pointer); API_DEF_FUNC(config_option_is_null); API_DEF_FUNC(config_option_default_is_null); API_DEF_FUNC(config_boolean); diff --git a/src/plugins/lua/weechat-lua-api.c b/src/plugins/lua/weechat-lua-api.c index 5b2de2079..222ed500a 100644 --- a/src/plugins/lua/weechat-lua-api.c +++ b/src/plugins/lua/weechat-lua-api.c @@ -1552,6 +1552,41 @@ API_FUNC(config_option_rename) API_RETURN_OK; } +API_FUNC(config_option_get_string) +{ + const char *option, *property, *result; + + API_INIT_FUNC(1, "config_option_get_string", API_RETURN_EMPTY); + if (lua_gettop (L) < 2) + API_WRONG_ARGS(API_RETURN_EMPTY); + + option = lua_tostring (L, -2); + property = lua_tostring (L, -1); + + result = weechat_config_option_get_string (API_STR2PTR(option), + property); + + API_RETURN_STRING(result); +} + +API_FUNC(config_option_get_pointer) +{ + const char *option, *property; + const char *result; + + API_INIT_FUNC(1, "config_option_get_pointer", API_RETURN_EMPTY); + if (lua_gettop (L) < 2) + API_WRONG_ARGS(API_RETURN_EMPTY); + + option = lua_tostring (L, -2); + property = lua_tostring (L, -1); + + result = API_PTR2STR(weechat_config_option_get_pointer (API_STR2PTR(option), + property)); + + API_RETURN_STRING(result); +} + API_FUNC(config_option_is_null) { const char *option; @@ -5686,6 +5721,8 @@ const struct luaL_Reg weechat_lua_api_funcs[] = { API_DEF_FUNC(config_option_set_null), API_DEF_FUNC(config_option_unset), API_DEF_FUNC(config_option_rename), + API_DEF_FUNC(config_option_get_string), + API_DEF_FUNC(config_option_get_pointer), API_DEF_FUNC(config_option_is_null), API_DEF_FUNC(config_option_default_is_null), API_DEF_FUNC(config_boolean), diff --git a/src/plugins/perl/weechat-perl-api.c b/src/plugins/perl/weechat-perl-api.c index 69a872d20..62caf2984 100644 --- a/src/plugins/perl/weechat-perl-api.c +++ b/src/plugins/perl/weechat-perl-api.c @@ -1491,6 +1491,43 @@ API_FUNC(config_option_rename) API_RETURN_OK; } +API_FUNC(config_option_get_string) +{ + char *option, *property; + const char *result; + dXSARGS; + + API_INIT_FUNC(1, "config_option_get_string", API_RETURN_EMPTY); + if (items < 2) + API_WRONG_ARGS(API_RETURN_EMPTY); + + option = SvPV_nolen (ST (0)); + property = SvPV_nolen (ST (1)); + + result = weechat_config_option_get_string (API_STR2PTR(option), property); + + API_RETURN_STRING(result); +} + +API_FUNC(config_option_get_pointer) +{ + char *option, *property; + const char *result; + dXSARGS; + + API_INIT_FUNC(1, "config_option_get_pointer", API_RETURN_EMPTY); + if (items < 2) + API_WRONG_ARGS(API_RETURN_EMPTY); + + option = SvPV_nolen (ST (0)); + property = SvPV_nolen (ST (1)); + + result = API_PTR2STR(weechat_config_option_get_pointer (API_STR2PTR(option), + property)); + + API_RETURN_STRING(result); +} + API_FUNC(config_option_is_null) { int value; @@ -5623,6 +5660,8 @@ weechat_perl_api_init (pTHX) API_DEF_FUNC(config_option_set_null); API_DEF_FUNC(config_option_unset); API_DEF_FUNC(config_option_rename); + API_DEF_FUNC(config_option_get_string); + API_DEF_FUNC(config_option_get_pointer); API_DEF_FUNC(config_option_is_null); API_DEF_FUNC(config_option_default_is_null); API_DEF_FUNC(config_boolean); diff --git a/src/plugins/php/weechat-php-api.c b/src/plugins/php/weechat-php-api.c index d4cc5a352..bc6328f42 100644 --- a/src/plugins/php/weechat-php-api.c +++ b/src/plugins/php/weechat-php-api.c @@ -1570,6 +1570,47 @@ API_FUNC(config_option_rename) API_RETURN_OK; } +API_FUNC(config_option_get_string) +{ + zend_string *z_option, *z_property; + struct t_config_option *option; + char *property; + const char *result; + + API_INIT_FUNC(1, "config_option_get_string", API_RETURN_EMPTY); + if (zend_parse_parameters (ZEND_NUM_ARGS(), "SS", &z_option, + &z_property) == FAILURE) + API_WRONG_ARGS(API_RETURN_EMPTY); + + option = (struct t_config_option *)API_STR2PTR(ZSTR_VAL(z_option)); + property = ZSTR_VAL(z_property); + + result = weechat_config_option_get_string (option, (const char *)property); + + API_RETURN_STRING(result); +} + +API_FUNC(config_option_get_pointer) +{ + zend_string *z_option, *z_property; + struct t_config_option *option; + char *property; + const char *result; + + API_INIT_FUNC(1, "config_option_get_pointer", API_RETURN_EMPTY); + if (zend_parse_parameters (ZEND_NUM_ARGS(), "SS", &z_option, + &z_property) == FAILURE) + API_WRONG_ARGS(API_RETURN_EMPTY); + + option = (struct t_config_option *)API_STR2PTR(ZSTR_VAL(z_option)); + property = ZSTR_VAL(z_property); + + result = API_PTR2STR( + weechat_config_option_get_pointer (option, (const char *)property)); + + API_RETURN_STRING(result); +} + API_FUNC(config_option_is_null) { zend_string *z_option; @@ -3764,9 +3805,9 @@ API_FUNC(buffer_get_integer) API_FUNC(buffer_get_string) { zend_string *z_buffer, *z_property; - const char *result; struct t_gui_buffer *buffer; char *property; + const char *result; API_INIT_FUNC(1, "buffer_get_string", API_RETURN_EMPTY); if (zend_parse_parameters (ZEND_NUM_ARGS(), "SS", &z_buffer, diff --git a/src/plugins/php/weechat-php-api.h b/src/plugins/php/weechat-php-api.h index dceb64f6f..40b8dd1aa 100644 --- a/src/plugins/php/weechat-php-api.h +++ b/src/plugins/php/weechat-php-api.h @@ -96,6 +96,8 @@ PHP_FUNCTION(weechat_config_option_set); PHP_FUNCTION(weechat_config_option_set_null); PHP_FUNCTION(weechat_config_option_unset); PHP_FUNCTION(weechat_config_option_rename); +PHP_FUNCTION(weechat_config_option_get_string); +PHP_FUNCTION(weechat_config_option_get_pointer); PHP_FUNCTION(weechat_config_option_is_null); PHP_FUNCTION(weechat_config_option_default_is_null); PHP_FUNCTION(weechat_config_boolean); diff --git a/src/plugins/php/weechat-php.c b/src/plugins/php/weechat-php.c index 9ea05d4cb..5324d8320 100644 --- a/src/plugins/php/weechat-php.c +++ b/src/plugins/php/weechat-php.c @@ -154,6 +154,8 @@ const zend_function_entry weechat_functions[] = { PHP_FE(weechat_config_option_set_null, arginfo_weechat_config_option_set_null) PHP_FE(weechat_config_option_unset, arginfo_weechat_config_option_unset) PHP_FE(weechat_config_option_rename, arginfo_weechat_config_option_rename) + PHP_FE(weechat_config_option_get_string, arginfo_weechat_config_option_get_string) + PHP_FE(weechat_config_option_get_pointer, arginfo_weechat_config_option_get_pointer) PHP_FE(weechat_config_option_is_null, arginfo_weechat_config_option_is_null) PHP_FE(weechat_config_option_default_is_null, arginfo_weechat_config_option_default_is_null) PHP_FE(weechat_config_boolean, arginfo_weechat_config_boolean) diff --git a/src/plugins/php/weechat-php.stub.php b/src/plugins/php/weechat-php.stub.php index 3fa47053b..32ef0dcca 100644 --- a/src/plugins/php/weechat-php.stub.php +++ b/src/plugins/php/weechat-php.stub.php @@ -62,6 +62,8 @@ function weechat_config_option_set(string $p0, string $p1, int $p2): int {} function weechat_config_option_set_null(string $p0, int $p1): int {} function weechat_config_option_unset(string $p0): int {} function weechat_config_option_rename(string $p0, string $p1): int {} +function weechat_config_option_get_string(string $p0, string $p1): string {} +function weechat_config_option_get_pointer(string $p0, string $p1): string {} function weechat_config_option_is_null(string $p0): int {} function weechat_config_option_default_is_null(string $p0): int {} function weechat_config_boolean(string $p0): int {} diff --git a/src/plugins/php/weechat-php_arginfo.h b/src/plugins/php/weechat-php_arginfo.h index 250d2ea5f..225a00abe 100644 --- a/src/plugins/php/weechat-php_arginfo.h +++ b/src/plugins/php/weechat-php_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: b6e9e3f12ed24566eb77aa0c08bf3e7c5d866b76 */ + * Stub hash: 2c52caa5a78009856a6e6ced63555d1b1e2be0fe */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_weechat_register, 0, 7, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, p0, IS_STRING, 0) @@ -161,6 +161,10 @@ ZEND_END_ARG_INFO() #define arginfo_weechat_config_option_rename arginfo_weechat_string_has_highlight +#define arginfo_weechat_config_option_get_string arginfo_weechat_iconv_to_internal + +#define arginfo_weechat_config_option_get_pointer arginfo_weechat_iconv_to_internal + #define arginfo_weechat_config_option_is_null arginfo_weechat_charset_set #define arginfo_weechat_config_option_default_is_null arginfo_weechat_charset_set @@ -639,3 +643,4 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_forget_class, 0, 1, _IS_BOOL, 0) ZEND_END_ARG_INFO() #define arginfo_forget_function arginfo_forget_class + diff --git a/src/plugins/php/weechat-php_legacy_arginfo.h b/src/plugins/php/weechat-php_legacy_arginfo.h index 2622d66b0..9b620112b 100644 --- a/src/plugins/php/weechat-php_legacy_arginfo.h +++ b/src/plugins/php/weechat-php_legacy_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: b6e9e3f12ed24566eb77aa0c08bf3e7c5d866b76 */ + * Stub hash: 2c52caa5a78009856a6e6ced63555d1b1e2be0fe */ ZEND_BEGIN_ARG_INFO_EX(arginfo_weechat_register, 0, 0, 7) ZEND_ARG_INFO(0, p0) @@ -126,6 +126,10 @@ ZEND_END_ARG_INFO() #define arginfo_weechat_config_option_rename arginfo_weechat_iconv_to_internal +#define arginfo_weechat_config_option_get_string arginfo_weechat_iconv_to_internal + +#define arginfo_weechat_config_option_get_pointer arginfo_weechat_iconv_to_internal + #define arginfo_weechat_config_option_is_null arginfo_weechat_plugin_get_name #define arginfo_weechat_config_option_default_is_null arginfo_weechat_plugin_get_name @@ -462,3 +466,4 @@ ZEND_END_ARG_INFO() #define arginfo_forget_class arginfo_weechat_plugin_get_name #define arginfo_forget_function arginfo_weechat_plugin_get_name + diff --git a/src/plugins/python/weechat-python-api.c b/src/plugins/python/weechat-python-api.c index 068981bdd..d4a1118c4 100644 --- a/src/plugins/python/weechat-python-api.c +++ b/src/plugins/python/weechat-python-api.c @@ -1480,6 +1480,39 @@ API_FUNC(config_option_rename) API_RETURN_OK; } +API_FUNC(config_option_get_string) +{ + char *option, *property; + const char *result; + + API_INIT_FUNC(1, "config_option_get_string", API_RETURN_EMPTY); + option = NULL; + property = NULL; + if (!PyArg_ParseTuple (args, "ss", &option, &property)) + API_WRONG_ARGS(API_RETURN_EMPTY); + + result = weechat_config_option_get_string (API_STR2PTR(option), property); + + API_RETURN_STRING(result); +} + +API_FUNC(config_option_get_pointer) +{ + char *option, *property; + const char *result; + + API_INIT_FUNC(1, "config_option_get_pointer", API_RETURN_EMPTY); + option = NULL; + property = NULL; + if (!PyArg_ParseTuple (args, "ss", &option, &property)) + API_WRONG_ARGS(API_RETURN_EMPTY); + + result = API_PTR2STR(weechat_config_option_get_pointer (API_STR2PTR(option), + property)); + + API_RETURN_STRING(result); +} + API_FUNC(config_option_is_null) { char *option; @@ -5552,6 +5585,8 @@ PyMethodDef weechat_python_funcs[] = API_DEF_FUNC(config_option_set_null), API_DEF_FUNC(config_option_unset), API_DEF_FUNC(config_option_rename), + API_DEF_FUNC(config_option_get_string), + API_DEF_FUNC(config_option_get_pointer), API_DEF_FUNC(config_option_is_null), API_DEF_FUNC(config_option_default_is_null), API_DEF_FUNC(config_boolean), diff --git a/src/plugins/ruby/weechat-ruby-api.c b/src/plugins/ruby/weechat-ruby-api.c index 21a6e3521..7d31d374c 100644 --- a/src/plugins/ruby/weechat-ruby-api.c +++ b/src/plugins/ruby/weechat-ruby-api.c @@ -1811,6 +1811,52 @@ weechat_ruby_api_config_option_rename (VALUE class, VALUE option, } static VALUE +weechat_ruby_api_config_option_get_string (VALUE class, VALUE option, + VALUE property) +{ + char *c_option, *c_property; + const char *result; + + API_INIT_FUNC(1, "config_option_get_string", API_RETURN_EMPTY); + if (NIL_P (option) || NIL_P (property)) + API_WRONG_ARGS(API_RETURN_EMPTY); + + Check_Type (option, T_STRING); + Check_Type (property, T_STRING); + + c_option = StringValuePtr (option); + c_property = StringValuePtr (property); + + result = weechat_config_option_get_string (API_STR2PTR(c_option), + c_property); + + API_RETURN_STRING(result); +} + +static VALUE +weechat_ruby_api_config_option_get_pointer (VALUE class, VALUE option, + VALUE property) +{ + char *c_option, *c_property; + const char *result; + + API_INIT_FUNC(1, "config_option_get_pointer", API_RETURN_EMPTY); + if (NIL_P (option) || NIL_P (property)) + API_WRONG_ARGS(API_RETURN_EMPTY); + + Check_Type (option, T_STRING); + Check_Type (property, T_STRING); + + c_option = StringValuePtr (option); + c_property = StringValuePtr (property); + + result = API_PTR2STR(weechat_config_option_get_pointer (API_STR2PTR(c_option), + c_property)); + + API_RETURN_STRING(result); +} + +static VALUE weechat_ruby_api_config_option_is_null (VALUE class, VALUE option) { char *c_option; @@ -6883,6 +6929,8 @@ weechat_ruby_api_init (VALUE ruby_mWeechat) API_DEF_FUNC(config_option_set_null, 2); API_DEF_FUNC(config_option_unset, 1); API_DEF_FUNC(config_option_rename, 2); + API_DEF_FUNC(config_option_get_string, 2); + API_DEF_FUNC(config_option_get_pointer, 2); API_DEF_FUNC(config_option_is_null, 1); API_DEF_FUNC(config_option_default_is_null, 1); API_DEF_FUNC(config_boolean, 1); diff --git a/src/plugins/tcl/weechat-tcl-api.c b/src/plugins/tcl/weechat-tcl-api.c index c0f8dc812..b05a0b7da 100644 --- a/src/plugins/tcl/weechat-tcl-api.c +++ b/src/plugins/tcl/weechat-tcl-api.c @@ -1557,6 +1557,41 @@ API_FUNC(config_option_rename) API_RETURN_OK; } +API_FUNC(config_option_get_string) +{ + char *option, *property; + const char *result; + + API_INIT_FUNC(1, "config_option_get_string", API_RETURN_EMPTY); + if (objc < 3) + API_WRONG_ARGS(API_RETURN_EMPTY); + + option = Tcl_GetString (objv[1]); + property = Tcl_GetString (objv[2]); + + result = weechat_config_option_get_string (API_STR2PTR(option), property); + + API_RETURN_STRING(result); +} + +API_FUNC(config_option_get_pointer) +{ + char *option, *property; + const char *result; + + API_INIT_FUNC(1, "config_option_get_pointer", API_RETURN_EMPTY); + if (objc < 3) + API_WRONG_ARGS(API_RETURN_EMPTY); + + option = Tcl_GetString (objv[1]); + property = Tcl_GetString (objv[2]); + + result = API_PTR2STR(weechat_config_option_get_pointer (API_STR2PTR(option), + property)); + + API_RETURN_STRING(result); +} + API_FUNC(config_option_is_null) { int result; @@ -5659,6 +5694,8 @@ void weechat_tcl_api_init (Tcl_Interp *interp) API_DEF_FUNC(config_option_set_null); API_DEF_FUNC(config_option_unset); API_DEF_FUNC(config_option_rename); + API_DEF_FUNC(config_option_get_string); + API_DEF_FUNC(config_option_get_pointer); API_DEF_FUNC(config_option_is_null); API_DEF_FUNC(config_option_default_is_null); API_DEF_FUNC(config_boolean); |