mirror of
https://github.com/weechat/weechat.git
synced 2026-06-25 12:26:40 +02:00
Add function "config_is_set_plugin" in plugin/script API
This commit is contained in:
@@ -1535,6 +1535,33 @@ script_api_config_get_plugin (struct t_weechat_plugin *weechat_plugin,
|
||||
return return_value;
|
||||
}
|
||||
|
||||
/*
|
||||
* script_api_config_is_set_plugin: check if a script option is set
|
||||
*/
|
||||
|
||||
int
|
||||
script_api_config_is_set_plugin (struct t_weechat_plugin *weechat_plugin,
|
||||
struct t_plugin_script *script,
|
||||
const char *option)
|
||||
{
|
||||
char *option_fullname;
|
||||
int return_code;
|
||||
|
||||
option_fullname = malloc ((strlen (script->name) +
|
||||
strlen (option) + 2));
|
||||
if (!option_fullname)
|
||||
return 0;
|
||||
|
||||
strcpy (option_fullname, script->name);
|
||||
strcat (option_fullname, ".");
|
||||
strcat (option_fullname, option);
|
||||
|
||||
return_code = weechat_config_is_set_plugin (option_fullname);
|
||||
free (option_fullname);
|
||||
|
||||
return return_code;
|
||||
}
|
||||
|
||||
/*
|
||||
* script_api_config_set_plugin: set value of a script config option
|
||||
* format in file is "plugin.script.option"
|
||||
|
||||
Reference in New Issue
Block a user