diff --git a/CHANGELOG.md b/CHANGELOG.md index 2170b1357..abcfc9c7d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ SPDX-License-Identifier: GPL-3.0-or-later - core: add condition on connected relay api clients in default value of option weechat.look.hotlist_add_conditions - core: add `/mute` in default command for key `Alt`+`=` (toggle filters) +- api: change type of parameter "pos_option_name" to "const char **" in function config_search_with_string - relay/api: add field "last_read_line_id" in GET /api/buffers ### Added diff --git a/doc/en/weechat_plugin_api.en.adoc b/doc/en/weechat_plugin_api.en.adoc index 211bc8527..c84e790e7 100644 --- a/doc/en/weechat_plugin_api.en.adoc +++ b/doc/en/weechat_plugin_api.en.adoc @@ -7709,7 +7709,7 @@ void weechat_config_search_with_string (const char *option_name, struct t_config_file **config_file, struct t_config_section **section, struct t_config_option **option, - char **pos_option_name); + const char **pos_option_name); ---- Arguments: @@ -7731,7 +7731,7 @@ C example: struct t_config_file *ptr_config_file; struct t_config_section *ptr_section; struct t_config_option *ptr_option; -char *option_name; +const char *option_name; weechat_config_search_with_string ("file.section.option", &ptr_config_file, diff --git a/doc/fr/weechat_plugin_api.fr.adoc b/doc/fr/weechat_plugin_api.fr.adoc index fdf41abcf..a6c2c36dd 100644 --- a/doc/fr/weechat_plugin_api.fr.adoc +++ b/doc/fr/weechat_plugin_api.fr.adoc @@ -7838,7 +7838,7 @@ void weechat_config_search_with_string (const char *option_name, struct t_config_file **config_file, struct t_config_section **section, struct t_config_option **option, - char **pos_option_name); + const char **pos_option_name); ---- Paramètres : @@ -7861,7 +7861,7 @@ Exemple en C : struct t_config_file *ptr_config_file; struct t_config_section *ptr_section; struct t_config_option *ptr_option; -char *option_name; +const char *option_name; weechat_config_search_with_string ("fichier.section.option", &ptr_config_file, diff --git a/doc/it/weechat_plugin_api.it.adoc b/doc/it/weechat_plugin_api.it.adoc index df153528f..6e9e222cb 100644 --- a/doc/it/weechat_plugin_api.it.adoc +++ b/doc/it/weechat_plugin_api.it.adoc @@ -8011,7 +8011,7 @@ void weechat_config_search_with_string (const char *option_name, struct t_config_file **config_file, struct t_config_section **section, struct t_config_option **option, - char **pos_option_name); + const char **pos_option_name); ---- Argomenti: @@ -8034,7 +8034,7 @@ Esempio in C: struct t_config_file *ptr_config_file; struct t_config_section *ptr_section; struct t_config_option *ptr_option; -char *option_name; +const char *option_name; weechat_config_search_with_string ("file.section.option", &ptr_config_file, diff --git a/doc/ja/weechat_plugin_api.ja.adoc b/doc/ja/weechat_plugin_api.ja.adoc index 514a77948..171f5cf02 100644 --- a/doc/ja/weechat_plugin_api.ja.adoc +++ b/doc/ja/weechat_plugin_api.ja.adoc @@ -7816,7 +7816,7 @@ void weechat_config_search_with_string (const char *option_name, struct t_config_file **config_file, struct t_config_section **section, struct t_config_option **option, - char **pos_option_name); + const char **pos_option_name); ---- 引数: @@ -7838,7 +7838,7 @@ C 言語での使用例: struct t_config_file *ptr_config_file; struct t_config_section *ptr_section; struct t_config_option *ptr_option; -char *option_name; +const char *option_name; weechat_config_search_with_string ("file.section.option", &ptr_config_file, diff --git a/doc/sr/weechat_plugin_api.sr.adoc b/doc/sr/weechat_plugin_api.sr.adoc index 7aa1efa61..a37cc32ac 100644 --- a/doc/sr/weechat_plugin_api.sr.adoc +++ b/doc/sr/weechat_plugin_api.sr.adoc @@ -7492,7 +7492,7 @@ void weechat_config_search_with_string (const char *option_name, struct t_config_file **config_file, struct t_config_section **section, struct t_config_option **option, - char **pos_option_name); + const char **pos_option_name); ---- Аргументи: @@ -7510,7 +7510,7 @@ C пример: struct t_config_file *ptr_config_file; struct t_config_section *ptr_section; struct t_config_option *ptr_option; -char *option_name; +const char *option_name; weechat_config_search_with_string ("file.section.option", &ptr_config_file, diff --git a/src/core/core-config-file.c b/src/core/core-config-file.c index b6b6a2a31..1d313074f 100644 --- a/src/core/core-config-file.c +++ b/src/core/core-config-file.c @@ -1095,12 +1095,13 @@ config_file_search_with_string (const char *option_name, struct t_config_file **config_file, struct t_config_section **section, struct t_config_option **option, - char **pos_option_name) + const char **pos_option_name) { struct t_config_file *ptr_config; struct t_config_section *ptr_section; struct t_config_option *ptr_option; - char *file_name, *pos_section, *section_name, *pos_option; + const char *pos_section, *pos_option; + char *file_name, *section_name; if (config_file) *config_file = NULL; @@ -2553,7 +2554,7 @@ config_file_option_set_with_string (const char *option_name, const char *value) struct t_config_file *ptr_config; struct t_config_section *ptr_section; struct t_config_option *ptr_option; - char *pos_option; + const char *pos_option; rc = WEECHAT_CONFIG_OPTION_SET_OPTION_NOT_FOUND; diff --git a/src/core/core-config-file.h b/src/core/core-config-file.h index 81980e9ba..1298f0c50 100644 --- a/src/core/core-config-file.h +++ b/src/core/core-config-file.h @@ -286,7 +286,7 @@ extern void config_file_search_with_string (const char *option_name, struct t_config_file **config_file, struct t_config_section **section, struct t_config_option **option, - char **pos_option_name); + const char **pos_option_name); extern int config_file_string_to_boolean (const char *text); extern int config_file_option_reset (struct t_config_option *option, int run_callback); diff --git a/src/gui/gui-bar-item.c b/src/gui/gui-bar-item.c index 40104b43e..11bf5b4cb 100644 --- a/src/gui/gui-bar-item.c +++ b/src/gui/gui-bar-item.c @@ -1880,9 +1880,9 @@ gui_bar_item_buffer_nicklist_cb (const void *pointer, void *data, { if (strchr (ptr_nick->prefix_color, '.')) { - config_file_search_with_string (ptr_nick->prefix_color, - NULL, NULL, &ptr_option, - NULL); + config_file_search_with_string ( + ptr_nick->prefix_color, + NULL, NULL, &ptr_option, NULL); if (ptr_option) { string_dyn_concat ( @@ -1907,9 +1907,9 @@ gui_bar_item_buffer_nicklist_cb (const void *pointer, void *data, { if (strchr (ptr_nick->color, '.')) { - config_file_search_with_string (ptr_nick->color, - NULL, NULL, &ptr_option, - NULL); + config_file_search_with_string ( + ptr_nick->color, + NULL, NULL, &ptr_option, NULL); if (ptr_option) { string_dyn_concat ( @@ -1940,9 +1940,9 @@ gui_bar_item_buffer_nicklist_cb (const void *pointer, void *data, { if (strchr (ptr_group->color, '.')) { - config_file_search_with_string (ptr_group->color, - NULL, NULL, &ptr_option, - NULL); + config_file_search_with_string ( + ptr_group->color, + NULL, NULL, &ptr_option, NULL); if (ptr_option) { string_dyn_concat ( diff --git a/src/gui/gui-color.c b/src/gui/gui-color.c index 909617860..59cfaaef0 100644 --- a/src/gui/gui-color.c +++ b/src/gui/gui-color.c @@ -170,8 +170,7 @@ gui_color_search_config (const char *color_name) /* search in any configuration file (example: "irc.color.message_quit") */ if (strchr (color_name, '.')) { - config_file_search_with_string (color_name, NULL, NULL, &ptr_option, - NULL); + config_file_search_with_string (color_name, NULL, NULL, &ptr_option, NULL); if (ptr_option) return gui_color_from_option (ptr_option); } diff --git a/src/plugins/weechat-plugin.h b/src/plugins/weechat-plugin.h index 7d644a657..360cfb6b4 100644 --- a/src/plugins/weechat-plugin.h +++ b/src/plugins/weechat-plugin.h @@ -76,7 +76,7 @@ struct t_weelist_item; * please change the date with current one; for a second change at same * date, increment the 01, otherwise please keep 01. */ -#define WEECHAT_PLUGIN_API_VERSION "20260530-01" +#define WEECHAT_PLUGIN_API_VERSION "20260614-01" /* macros for defining plugin infos */ #define WEECHAT_PLUGIN_NAME(__name) \ @@ -671,7 +671,7 @@ struct t_weechat_plugin struct t_config_file **config_file, struct t_config_section **section, struct t_config_option **option, - char **pos_option_name); + const char **pos_option_name); int (*config_string_to_boolean) (const char *text); int (*config_option_reset) (struct t_config_option *option, int run_callback); diff --git a/tests/unit/core/test-core-config-file.cpp b/tests/unit/core/test-core-config-file.cpp index 0b528edfe..2a24863f4 100644 --- a/tests/unit/core/test-core-config-file.cpp +++ b/tests/unit/core/test-core-config-file.cpp @@ -526,7 +526,7 @@ TEST(CoreConfigFile, SearchWithString) struct t_config_file *ptr_config; struct t_config_section *ptr_section; struct t_config_option *ptr_option; - char *pos_option_name; + const char *pos_option_name; ptr_config = (struct t_config_file *)0x1; ptr_section = (struct t_config_section *)0x1;