diff options
Diffstat (limited to 'doc/sr')
-rw-r--r-- | doc/sr/weechat_plugin_api.sr.adoc | 266 | ||||
-rw-r--r-- | doc/sr/weechat_scripting.sr.adoc | 7 |
2 files changed, 269 insertions, 4 deletions
diff --git a/doc/sr/weechat_plugin_api.sr.adoc b/doc/sr/weechat_plugin_api.sr.adoc index 59d78117c..4f6ee5b20 100644 --- a/doc/sr/weechat_plugin_api.sr.adoc +++ b/doc/sr/weechat_plugin_api.sr.adoc @@ -2170,7 +2170,7 @@ C пример: unsigned long long size = weechat_parse_size ("1.34m"); /* size == 1340000 */ ---- -Script (Python): +Скрипта (Python): [source,python] ---- @@ -6461,7 +6461,7 @@ weechat_config_set_version (config_file, 2, &my_config_update_cb, NULL, NULL); weechat_config_read (config_file); ---- -Script (Python): +Скрипта (Python): [source,python] ---- @@ -7794,6 +7794,92 @@ if weechat.config_boolean_default(option): # ... ---- +==== config_boolean_inherited + +_WeeChat ≥ 4.3.0._ + +Return inherited boolean value of option: value of option if not NULL, +or value of the parent option (if option inherits from another option). + +If the parent option is not found, return the default value of the option. + +If the parent value is NULL, return the default value of the parent option. + +Прототип: + +[source,c] +---- +int weechat_config_boolean_inherited (struct t_config_option *option); +---- + +Аргументи: + +* _option_: показивач на опцију + +Return value: see functions <<_config_boolean,config_boolean>> and +<<_config_boolean_default,config_boolean_default>>. + +C пример: + +[source,c] +---- +struct t_config_option *option = weechat_config_get ("irc.server.libera.autoconnect"); +int autoconnect = weechat_config_boolean_inherited (option); +---- + +Скрипта (Python): + +[source,python] +---- +# прототип +def config_boolean_inherited(option: str) -> int: ... + +# пример +option = weechat.config_get("irc.server.libera.autoconnect") +autoconect = weechat.config_boolean_inherited(option) +---- + +==== config_integer + +Return integer value of option. + +Прототип: + +[source,c] +---- +int weechat_config_integer (struct t_config_option *option); +---- + +Аргументи: + +* _option_: показивач на опцију + +Return value, depending on the option type: + +* _boolean_: boolean value of option (0 or 1) +* _integer_: integer value of option +* _string_: 0 +* _color_: color index +* _enum_: integer value of option (index of enum value) + +C пример: + +[source,c] +---- +struct t_config_option *option = weechat_config_get ("plugin.section.option"); +int value = weechat_config_integer (option); +---- + +Скрипта (Python): + +[source,python] +---- +# прототип +def config_integer(option: str) -> int: ... + +# пример +option = weechat.config_get("plugin.section.option") +value = weechat.config_integer(option) +---- + ==== config_integer Враћа целобројну вредност опције. @@ -7880,6 +7966,49 @@ option = weechat.config_get("plugin.section.option") value = weechat.config_integer_default(option) ---- +==== config_integer_inherited + +_WeeChat ≥ 4.3.0._ + +Return inherited integer value of option: value of option if not NULL, +or value of the parent option (if option inherits from another option). + +If the parent option is not found, return the default value of the option. + +If the parent value is NULL, return the default value of the parent option. + +Прототип: + +[source,c] +---- +int weechat_config_integer_inherited (struct t_config_option *option); +---- + +Аргументи: + +* _option_: показивач на опцију + +Return value: see functions <<_config_integer,config_integer>> and +<<_config_integer_default,config_integer_default>>. + +C пример: + +[source,c] +---- +struct t_config_option *option = weechat_config_get ("irc.server.libera.autojoin_delay"); +int delay = weechat_config_integer_inherited (option); +---- + +Скрипта (Python): + +[source,python] +---- +# прототип +def config_integer_inherited(option: str) -> int: ... + +# пример +option = weechat.config_get("irc.server.libera.autojoin_delay") +delay = weechat.config_integer_inherited(option) +---- + ==== config_string Враћа стринг вредност опције. @@ -7966,6 +8095,49 @@ option = weechat.config_get("plugin.section.option") value = weechat.config_string_default(option) ---- +==== config_string_inherited + +_WeeChat ≥ 4.3.0._ + +Return inherited string value of option: value of option if not NULL, +or value of the parent option (if option inherits from another option). + +If the parent option is not found, return the default value of the option. + +If the parent value is NULL, return the default value of the parent option. + +Прототип: + +[source,c] +---- +const char *weechat_config_string_inherited (struct t_config_option *option); +---- + +Аргументи: + +* _option_: показивач на опцију + +Return value: see functions <<_config_string,config_string>> and +<<_config_string_default,config_string_default>>. + +C пример: + +[source,c] +---- +struct t_config_option *option = weechat_config_get ("irc.server.libera.msg_quit"); +const char *msg_quit = weechat_config_string_inherited (option); +---- + +Скрипта (Python): + +[source,python] +---- +# прототип +def config_string_inherited(option: str) -> str: ... + +# пример +option = weechat.config_get("irc.server.libera.msg_quit") +msg_quit = weechat.config_string_inherited(option) +---- + ==== config_color Враћа вредност опције као боју. @@ -8006,7 +8178,7 @@ def config_color(option: str) -> str: ... # пример option = weechat.config_get("plugin.section.option") -value = weechat.config_color(option) +color = weechat.config_color(option) ---- ==== config_color_default @@ -8049,7 +8221,50 @@ def config_color_default(option: str) -> str: ... # пример option = weechat.config_get("plugin.section.option") -value = weechat.config_color_default(option) +color = weechat.config_color_default(option) +---- + +==== config_color_inherited + +_WeeChat ≥ 4.3.0._ + +Return inherited color value of option: value of option if not NULL, +or value of the parent option (if option inherits from another option). + +If the parent option is not found, return the default value of the option. + +If the parent value is NULL, return the default value of the parent option. + +Прототип: + +[source,c] +---- +const char *weechat_config_color_inherited (struct t_config_option *option); +---- + +Аргументи: + +* _option_: показивач на опцију + +Return value: see functions <<_config_color,config_color>> and +<<_config_color_default,config_color_default>>. + +C пример: + +[source,c] +---- +struct t_config_option *option = weechat_config_get ("plugin.section.option"); +const char *color = weechat_config_color_inherited (option); +---- + +Скрипта (Python): + +[source,python] +---- +# прототип +def config_color_inherited(option: str) -> str: ... + +# пример +option = weechat.config_get("plugin.section.option") +color = weechat.config_color_inherited(option) ---- ==== config_enum @@ -8142,6 +8357,49 @@ option = weechat.config_get("plugin.section.option") value = weechat.config_enum_default(option) ---- +==== config_enum_inherited + +_WeeChat ≥ 4.3.0._ + +Return inherited enum value of option: value of option if not NULL, +or value of the parent option (if option inherits from another option). + +If the parent option is not found, return the default value of the option. + +If the parent value is NULL, return the default value of the parent option. + +Прототип: + +[source,c] +---- +int weechat_config_enum_inherited (struct t_config_option *option); +---- + +Аргументи: + +* _option_: показивач на опцију + +Return value: see functions <<_config_enum,config_enum>> and +<<_config_enum_default,config_enum_default>>. + +C пример: + +[source,c] +---- +struct t_config_option *option = weechat_config_get ("irc.server.libera.sasl_fail"); +int sasl_fail = weechat_config_enum_inherited (option); +---- + +Скрипта (Python): + +[source,python] +---- +# прототип +def config_enum_inherited(option: str) -> int: ... + +# пример +option = weechat.config_get("irc.server.libera.sasl_fail") +sasl_fail = weechat.config_enum_inherited(option) +---- + ==== config_write_option Уписује линију у конфигурациони фајл са опцијом и њеном вредности (ова функција би требало да се позове само у „write” или „write_default” функцијама повратног позива за одељак). diff --git a/doc/sr/weechat_scripting.sr.adoc b/doc/sr/weechat_scripting.sr.adoc index 3fa685ce9..6eb3b9f88 100644 --- a/doc/sr/weechat_scripting.sr.adoc +++ b/doc/sr/weechat_scripting.sr.adoc @@ -581,12 +581,19 @@ weechat_hook_timer(1000, 0, 1, $timer_cb, 'test'); config_option_default_is_null + config_boolean + config_boolean_default + + config_boolean_inherited + config_integer + config_integer_default + + config_integer_inherited + config_string + config_string_default + + config_string_inherited + config_color + config_color_default + + config_color_inherited + + config_enum + + config_enum_default + + config_enum_inherited + config_write_option + config_write_line + config_write + |