diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2023-08-29 10:22:17 +0200 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2023-08-29 10:22:17 +0200 |
commit | 8b3311860b0825008e4d2c4bddc3978128d4cb13 (patch) | |
tree | d3664eb7aaa56ac31ad6c482498c84c718145b71 /doc | |
parent | 58d61cb153761979e162cd80162bac941797c40e (diff) | |
download | weechat-8b3311860b0825008e4d2c4bddc3978128d4cb13.zip |
api: add support of path to variable and hashtable comparison in function hdata_compare (closes #1066)
Diffstat (limited to 'doc')
-rw-r--r-- | doc/en/weechat_plugin_api.en.adoc | 16 | ||||
-rw-r--r-- | doc/fr/weechat_plugin_api.fr.adoc | 18 | ||||
-rw-r--r-- | doc/it/weechat_plugin_api.it.adoc | 16 | ||||
-rw-r--r-- | doc/ja/weechat_plugin_api.ja.adoc | 18 | ||||
-rw-r--r-- | doc/sr/weechat_plugin_api.sr.adoc | 16 |
5 files changed, 60 insertions, 24 deletions
diff --git a/doc/en/weechat_plugin_api.en.adoc b/doc/en/weechat_plugin_api.en.adoc index fc933adc7..5ea06d649 100644 --- a/doc/en/weechat_plugin_api.en.adoc +++ b/doc/en/weechat_plugin_api.en.adoc @@ -18589,7 +18589,7 @@ for key in hash: ==== hdata_compare -_WeeChat ≥ 1.9._ +_WeeChat ≥ 1.9, updated in 4.1.0._ Compare a hdata variable of two objects. @@ -18605,8 +18605,8 @@ Arguments: * _hdata_: hdata pointer * _pointer1_: pointer to first WeeChat/plugin object * _pointer2_: pointer to second WeeChat/plugin object -* _name_: variable name; for arrays, the name can be "N|name" where N is - the index in array (starting at 0), for example: "2|name" +* _name_: variable name or path to a variable name; for arrays, the name can be + "N|name" where N is the index in array (starting at 0), for example: "2|name" * _case_sensitive_: 1 for case sensitive comparison of strings, otherwise 0 Return value: @@ -18622,8 +18622,12 @@ C example: struct t_hdata *hdata = weechat_hdata_get ("buffer"); struct t_gui_buffer *buffer1 = weechat_buffer_search ("irc", "libera.#weechat"); struct t_gui_buffer *buffer2 = weechat_buffer_search ("irc", "libera.#weechat-fr"); -weechat_printf (NULL, "number comparison = %d", +weechat_printf (NULL, "comparison of buffer number = %d", weechat_hdata_compare (hdata, buffer1, buffer2, "number", 0)); +weechat_printf (NULL, "comparison of number of lines = %d", + weechat_hdata_compare (hdata, buffer1, buffer2, "own_lines.lines_count", 0)); +weechat_printf (NULL, "comparison of local variable = %d", + weechat_hdata_compare (hdata, buffer1, buffer2, "local_variables.myvar", 0)); ---- Script (Python): @@ -18637,7 +18641,9 @@ def hdata_compare(hdata: str, pointer1: str, pointer2: str, name: str, case_sens hdata = weechat.hdata_get("buffer") buffer1 = weechat.buffer_search("irc", "libera.#weechat") buffer2 = weechat.buffer_search("irc", "libera.#weechat-fr") -weechat.prnt("", "number comparison = %d" % weechat.hdata_compare(hdata, buffer1, buffer2, "number", 0)) +weechat.prnt("", "comparison of buffer number = %d" % weechat.hdata_compare(hdata, buffer1, buffer2, "number", 0)) +weechat.prnt("", "comparison of number of lines = %d" % weechat.hdata_compare(hdata, buffer1, buffer2, "own_lines.lines_count", 0)) +weechat.prnt("", "comparison of local variable = %d" % weechat.hdata_compare(hdata, buffer1, buffer2, "local_variables.myvar", 0)) ---- ==== hdata_set diff --git a/doc/fr/weechat_plugin_api.fr.adoc b/doc/fr/weechat_plugin_api.fr.adoc index 8a309b934..1e6e3a186 100644 --- a/doc/fr/weechat_plugin_api.fr.adoc +++ b/doc/fr/weechat_plugin_api.fr.adoc @@ -18982,7 +18982,7 @@ for key in hash: ==== hdata_compare -_WeeChat ≥ 1.9._ +_WeeChat ≥ 1.9, mis à jour dans la 4.1.0._ Comparer une variable hdata de deux objets. @@ -18998,8 +18998,9 @@ Paramètres : * _hdata_ : pointeur vers le hdata * _pointer1_ : pointeur vers le premier objet WeeChat ou d'une extension * _pointer2_ : pointeur vers le second objet WeeChat ou d'une extension -* _name_ : nom de la variable ; pour les tableaux, le nom peut être "N|name" où N - est un index dans le tableau (démarrant à 0), par exemple : "2|name" +* _name_ : nom de la variable ou chemin vers le nom de la variable ; pour les + tableaux, le nom peut être "N|name" où N est un index dans le tableau + (démarrant à 0), par exemple : "2|name" * _case_sensitive_ : 1 pour une comparaison tenant compte de la casse pour les chaînes, sinon 0 @@ -19016,7 +19017,12 @@ Exemple en C : struct t_hdata *hdata = weechat_hdata_get ("buffer"); struct t_gui_buffer *buffer1 = weechat_buffer_search ("irc", "libera.#weechat"); struct t_gui_buffer *buffer2 = weechat_buffer_search ("irc", "libera.#weechat-fr"); -weechat_printf (NULL, "comparaison de numéro = %d", weechat_hdata_compare (hdata, buffer1, buffer2, "number", 0)); +weechat_printf (NULL, "comparaison de numéro de tampon = %d", + weechat_hdata_compare (hdata, buffer1, buffer2, "number", 0)); +weechat_printf (NULL, "comparaison du nombre de lignes = %d", + weechat_hdata_compare (hdata, buffer1, buffer2, "own_lines.lines_count", 0)); +weechat_printf (NULL, "comparaison de variable locale = %d", + weechat_hdata_compare (hdata, buffer1, buffer2, "local_variables.myvar", 0)); ---- Script (Python) : @@ -19030,7 +19036,9 @@ def hdata_compare(hdata: str, pointer1: str, pointer2: str, name: str, case_sens hdata = weechat.hdata_get("buffer") buffer1 = weechat.buffer_search("irc", "libera.#weechat") buffer2 = weechat.buffer_search("irc", "libera.#weechat-fr") -weechat.prnt("", "comparaison de numéro = %d" % weechat.hdata_compare(hdata, buffer1, buffer2, "number", 0)) +weechat.prnt("", "comparaison de numéro de tampon = %d" % weechat.hdata_compare(hdata, buffer1, buffer2, "number", 0)) +weechat.prnt("", "comparaison du nombre de lignes = %d" % weechat.hdata_compare(hdata, buffer1, buffer2, "own_lines.lines_count", 0)) +weechat.prnt("", "comparaison de variable locale = %d" % weechat.hdata_compare(hdata, buffer1, buffer2, "local_variables.myvar", 0)) ---- ==== hdata_set diff --git a/doc/it/weechat_plugin_api.it.adoc b/doc/it/weechat_plugin_api.it.adoc index b0bf49ae2..f958e2c43 100644 --- a/doc/it/weechat_plugin_api.it.adoc +++ b/doc/it/weechat_plugin_api.it.adoc @@ -19408,7 +19408,7 @@ for key in hash: // TRANSLATION MISSING ==== hdata_compare -_WeeChat ≥ 1.9._ +_WeeChat ≥ 1.9, updated in 4.1.0._ Compare a hdata variable of two objects. @@ -19424,8 +19424,8 @@ Argomenti: * _hdata_: hdata pointer * _pointer1_: pointer to first WeeChat/plugin object * _pointer2_: pointer to second WeeChat/plugin object -* _name_: variable name; for arrays, the name can be "N|name" where N is - the index in array (starting at 0), for example: "2|name" +* _name_: variable name or path to a variable name; for arrays, the name can be + "N|name" where N is the index in array (starting at 0), for example: "2|name" * _case_sensitive_: 1 for case sensitive comparison of strings, otherwise 0 Valore restituito: @@ -19441,8 +19441,12 @@ Esempio in C: struct t_hdata *hdata = weechat_hdata_get ("buffer"); struct t_gui_buffer *buffer1 = weechat_buffer_search ("irc", "libera.#weechat"); struct t_gui_buffer *buffer2 = weechat_buffer_search ("irc", "libera.#weechat-fr"); -weechat_printf (NULL, "number comparison = %d", +weechat_printf (NULL, "comparison of buffer number = %d", weechat_hdata_compare (hdata, buffer1, buffer2, "number", 0)); +weechat_printf (NULL, "comparison of number of lines = %d", + weechat_hdata_compare (hdata, buffer1, buffer2, "own_lines.lines_count", 0)); +weechat_printf (NULL, "comparison of local variable = %d", + weechat_hdata_compare (hdata, buffer1, buffer2, "local_variables.myvar", 0)); ---- Script (Python): @@ -19456,7 +19460,9 @@ def hdata_compare(hdata: str, pointer1: str, pointer2: str, name: str, case_sens hdata = weechat.hdata_get("buffer") buffer1 = weechat.buffer_search("irc", "libera.#weechat") buffer2 = weechat.buffer_search("irc", "libera.#weechat-fr") -weechat.prnt("", "number comparison = %d" % weechat.hdata_compare(hdata, buffer1, buffer2, "number", 0)) +weechat.prnt("", "comparison of buffer number = %d" % weechat.hdata_compare(hdata, buffer1, buffer2, "number", 0)) +weechat.prnt("", "comparison of number of lines = %d" % weechat.hdata_compare(hdata, buffer1, buffer2, "own_lines.lines_count", 0)) +weechat.prnt("", "comparison of local variable = %d" % weechat.hdata_compare(hdata, buffer1, buffer2, "local_variables.myvar", 0)) ---- // TRANSLATION MISSING diff --git a/doc/ja/weechat_plugin_api.ja.adoc b/doc/ja/weechat_plugin_api.ja.adoc index fb0f1436a..b10360c0c 100644 --- a/doc/ja/weechat_plugin_api.ja.adoc +++ b/doc/ja/weechat_plugin_api.ja.adoc @@ -18778,7 +18778,8 @@ for key in hash: ==== hdata_compare -_WeeChat バージョン 1.9 以上で利用可。_ +// TRANSLATION MISSING +_WeeChat ≥ 1.9, updated in 4.1.0._ 2 つのオブジェクトの hdata 変数を比較。 @@ -18794,8 +18795,9 @@ int weechat_hdata_compare (struct t_hdata *hdata, void *pointer1, void *pointer2 * _hdata_: hdata へのポインタ * _pointer1_: 1 番目の WeeChat およびプラグインオブジェクトへのポインタ * _pointer2_: 2 番目の WeeChat およびプラグインオブジェクトへのポインタ -* _name_: 変数名; 配列の場合、変数名を "N|name" のように指定できます。ここで - N は配列のインデックス番号です (番号は 0 から始まります)。例: "2|name" +// TRANSLATION MISSING +* _name_: variable name or path to a variable name; 配列の場合、変数名を "N|name" + のように指定できます。ここで N は配列のインデックス番号です (番号は 0 から始まります)。例: "2|name" * _case_sensitive_: 大文字小文字を区別する場合 1、それ以外の場合 0 戻り値: @@ -18811,8 +18813,12 @@ C 言語での使用例: struct t_hdata *hdata = weechat_hdata_get ("buffer"); struct t_gui_buffer *buffer1 = weechat_buffer_search ("irc", "libera.#weechat"); struct t_gui_buffer *buffer2 = weechat_buffer_search ("irc", "libera.#weechat-fr"); -weechat_printf (NULL, "number comparison = %d", +weechat_printf (NULL, "comparison of buffer number = %d", weechat_hdata_compare (hdata, buffer1, buffer2, "number", 0)); +weechat_printf (NULL, "comparison of number of lines = %d", + weechat_hdata_compare (hdata, buffer1, buffer2, "own_lines.lines_count", 0)); +weechat_printf (NULL, "comparison of local variable = %d", + weechat_hdata_compare (hdata, buffer1, buffer2, "local_variables.myvar", 0)); ---- スクリプト (Python) での使用例: @@ -18826,7 +18832,9 @@ def hdata_compare(hdata: str, pointer1: str, pointer2: str, name: str, case_sens hdata = weechat.hdata_get("buffer") buffer1 = weechat.buffer_search("irc", "libera.#weechat") buffer2 = weechat.buffer_search("irc", "libera.#weechat-fr") -weechat.prnt("", "number comparison = %d" % weechat.hdata_compare(hdata, buffer1, buffer2, "number", 0)) +weechat.prnt("", "comparison of buffer number = %d" % weechat.hdata_compare(hdata, buffer1, buffer2, "number", 0)) +weechat.prnt("", "comparison of number of lines = %d" % weechat.hdata_compare(hdata, buffer1, buffer2, "own_lines.lines_count", 0)) +weechat.prnt("", "comparison of local variable = %d" % weechat.hdata_compare(hdata, buffer1, buffer2, "local_variables.myvar", 0)) ---- ==== hdata_set diff --git a/doc/sr/weechat_plugin_api.sr.adoc b/doc/sr/weechat_plugin_api.sr.adoc index 0bdac9668..07d8cd2fc 100644 --- a/doc/sr/weechat_plugin_api.sr.adoc +++ b/doc/sr/weechat_plugin_api.sr.adoc @@ -18011,7 +18011,7 @@ for key in hash: ==== hdata_compare -_WeeChat ≥ 1.9._ +_WeeChat ≥ 1.9, ажурирано у верзији 4.1.0._ Пореди hdata променљиву два објекта. @@ -18027,7 +18027,9 @@ int weechat_hdata_compare (struct t_hdata *hdata, void *pointer1, void *pointer2 * _hdata_: показивач на hdata * _pointer1_: показивач на први објекат програма WeeChat/додатка * _pointer2_: показивач на други објекат програма WeeChat/додатка -* _name_: име променљиве; у случају низова, име може бити „N|име” где је N индекс низа (који почиње од 0), на пример: „2|име” +// TRANSLATION MISSING +* _name_: variable name or path to a variable name; у случају низова, име може + бити „N|име” где је N индекс низа (који почиње од 0), на пример: „2|име” * _case_sensitive_: 1 за поређење стрингова које разликује величину слова, у супротном 0 Повратна вредност: @@ -18043,8 +18045,12 @@ C пример: struct t_hdata *hdata = weechat_hdata_get ("buffer"); struct t_gui_buffer *buffer1 = weechat_buffer_search ("irc", "libera.#weechat"); struct t_gui_buffer *buffer2 = weechat_buffer_search ("irc", "libera.#weechat-fr"); -weechat_printf (NULL, "number comparison = %d", +weechat_printf (NULL, "comparison of buffer number = %d", weechat_hdata_compare (hdata, buffer1, buffer2, "number", 0)); +weechat_printf (NULL, "comparison of number of lines = %d", + weechat_hdata_compare (hdata, buffer1, buffer2, "own_lines.lines_count", 0)); +weechat_printf (NULL, "comparison of local variable = %d", + weechat_hdata_compare (hdata, buffer1, buffer2, "local_variables.myvar", 0)); ---- Скрипта (Python): @@ -18058,7 +18064,9 @@ def hdata_compare(hdata: str, pointer1: str, pointer2: str, name: str, case_sens hdata = weechat.hdata_get("buffer") buffer1 = weechat.buffer_search("irc", "libera.#weechat") buffer2 = weechat.buffer_search("irc", "libera.#weechat-fr") -weechat.prnt("", "бројно поређење = %d" % weechat.hdata_compare(hdata, buffer1, buffer2, "number", 0)) +weechat.prnt("", "comparison of buffer number = %d" % weechat.hdata_compare(hdata, buffer1, buffer2, "number", 0)) +weechat.prnt("", "comparison of number of lines = %d" % weechat.hdata_compare(hdata, buffer1, buffer2, "own_lines.lines_count", 0)) +weechat.prnt("", "comparison of local variable = %d" % weechat.hdata_compare(hdata, buffer1, buffer2, "local_variables.myvar", 0)) ---- ==== hdata_set |