diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2009-05-17 15:49:58 +0200 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2009-05-17 15:49:58 +0200 |
commit | 353538e3d80a1f90c2f3149b82d4be680ede0cdb (patch) | |
tree | f0d64a8cadd1ea1e8bdf5e044f759c8c31e358c2 /src/plugins/scripts/perl | |
parent | 1076183317b7e4f7e9bf3bd9bac139cd620136cb (diff) | |
download | weechat-353538e3d80a1f90c2f3149b82d4be680ede0cdb.zip |
Add function "config_is_set_plugin" in plugin/script API
Diffstat (limited to 'src/plugins/scripts/perl')
-rw-r--r-- | src/plugins/scripts/perl/weechat-perl-api.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/plugins/scripts/perl/weechat-perl-api.c b/src/plugins/scripts/perl/weechat-perl-api.c index 419f8b45b..f3fe2fe37 100644 --- a/src/plugins/scripts/perl/weechat-perl-api.c +++ b/src/plugins/scripts/perl/weechat-perl-api.c @@ -2258,6 +2258,40 @@ static XS (XS_weechat_api_config_get_plugin) } /* + * weechat::config_is_set_plugin: check if a plugin option is set + */ + +static XS (XS_weechat_api_config_is_set_plugin) +{ + char *option; + int rc; + dXSARGS; + + /* make C compiler happy */ + (void) cv; + + if (!perl_current_script) + { + WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "config_is_set_plugin"); + PERL_RETURN_INT(0); + } + + if (items < 1) + { + WEECHAT_SCRIPT_MSG_WRONG_ARGS(PERL_CURRENT_SCRIPT_NAME, "config_is_set_plugin"); + PERL_RETURN_INT(0); + } + + option = SvPV (ST (0), PL_na); + + rc = script_api_config_is_set_plugin (weechat_perl_plugin, + perl_current_script, + option); + + PERL_RETURN_INT(rc); +} + +/* * weechat::config_set_plugin: set value of a plugin option */ @@ -5646,6 +5680,7 @@ weechat_perl_api_init (pTHX) 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"); + newXS ("weechat::config_is_set_plugin", XS_weechat_api_config_is_set_plugin, "weechat"); newXS ("weechat::config_set_plugin", XS_weechat_api_config_set_plugin, "weechat"); newXS ("weechat::config_unset_plugin", XS_weechat_api_config_unset_plugin, "weechat"); newXS ("weechat::prefix", XS_weechat_api_prefix, "weechat"); |