diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2009-02-21 21:31:46 +0100 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2009-02-21 21:31:46 +0100 |
commit | a708f9f81397e5d9e8a066cc74b2103f4cfc2178 (patch) | |
tree | 42327f4ee7a2b7a445add14441f61f2cbdbf5b58 /src/plugins/scripts/perl | |
parent | afdee2d9194bced6af912daefb91895890a1fefd (diff) | |
download | weechat-a708f9f81397e5d9e8a066cc74b2103f4cfc2178.zip |
Add missing config functions in script plugin API to free sections and options
Diffstat (limited to 'src/plugins/scripts/perl')
-rw-r--r-- | src/plugins/scripts/perl/weechat-perl-api.c | 94 |
1 files changed, 94 insertions, 0 deletions
diff --git a/src/plugins/scripts/perl/weechat-perl-api.c b/src/plugins/scripts/perl/weechat-perl-api.c index 4856d679f..6e314afe1 100644 --- a/src/plugins/scripts/perl/weechat-perl-api.c +++ b/src/plugins/scripts/perl/weechat-perl-api.c @@ -1904,6 +1904,97 @@ static XS (XS_weechat_api_config_reload) } /* + * weechat::config_option_free: free an option in configuration file + */ + +static XS (XS_weechat_api_config_option_free) +{ + dXSARGS; + + /* make C compiler happy */ + (void) cv; + + if (!perl_current_script) + { + WEECHAT_SCRIPT_MSG_NOT_INITIALIZED("config_option_free"); + PERL_RETURN_ERROR; + } + + if (items < 1) + { + WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("config_option_free"); + PERL_RETURN_ERROR; + } + + script_api_config_option_free (weechat_perl_plugin, + perl_current_script, + script_str2ptr (SvPV (ST (0), PL_na))); /* option */ + + PERL_RETURN_OK; +} + +/* + * weechat::config_section_free_options: free options of a section in + * configuration file + */ + +static XS (XS_weechat_api_config_section_free_options) +{ + dXSARGS; + + /* make C compiler happy */ + (void) cv; + + if (!perl_current_script) + { + WEECHAT_SCRIPT_MSG_NOT_INITIALIZED("config_section_free_options"); + PERL_RETURN_ERROR; + } + + if (items < 1) + { + WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("config_section_free_options"); + PERL_RETURN_ERROR; + } + + script_api_config_section_free_options (weechat_perl_plugin, + perl_current_script, + script_str2ptr (SvPV (ST (0), PL_na))); /* section */ + + PERL_RETURN_OK; +} + +/* + * weechat::config_section_free: free section in configuration file + */ + +static XS (XS_weechat_api_config_section_free) +{ + dXSARGS; + + /* make C compiler happy */ + (void) cv; + + if (!perl_current_script) + { + WEECHAT_SCRIPT_MSG_NOT_INITIALIZED("config_section_free"); + PERL_RETURN_ERROR; + } + + if (items < 1) + { + WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("config_section_free"); + PERL_RETURN_ERROR; + } + + script_api_config_section_free (weechat_perl_plugin, + perl_current_script, + script_str2ptr (SvPV (ST (0), PL_na))); /* section */ + + PERL_RETURN_OK; +} + +/* * weechat::config_free: free configuration file */ @@ -4984,6 +5075,9 @@ weechat_perl_api_init (pTHX) newXS ("weechat::config_write", XS_weechat_api_config_write, "weechat"); newXS ("weechat::config_read", XS_weechat_api_config_read, "weechat"); newXS ("weechat::config_reload", XS_weechat_api_config_reload, "weechat"); + newXS ("weechat::config_option_free", XS_weechat_api_config_option_free, "weechat"); + newXS ("weechat::config_section_free_options", XS_weechat_api_config_section_free_options, "weechat"); + newXS ("weechat::config_section_free", XS_weechat_api_config_section_free, "weechat"); newXS ("weechat::config_free", XS_weechat_api_config_free, "weechat"); newXS ("weechat::config_get", XS_weechat_api_config_get, "weechat"); newXS ("weechat::config_get_plugin", XS_weechat_api_config_get_plugin, "weechat"); |