summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2017-05-30 20:26:19 +0200
committerSébastien Helleu <flashcode@flashtux.org>2017-05-30 20:29:17 +0200
commit7621939a7a40a0e535b5b2ef67c2cb60e12208e3 (patch)
treee6a62315f4dd7addb5fd93d912242da0d2360a8a /doc
parentf6a8c28d2dcf4d4ed6f87e7e94574b331455b40a (diff)
downloadweechat-7621939a7a40a0e535b5b2ef67c2cb60e12208e3.zip
api: add function hdata_compare
Diffstat (limited to 'doc')
-rw-r--r--doc/en/weechat_plugin_api.en.adoc53
-rw-r--r--doc/fr/weechat_plugin_api.fr.adoc53
-rw-r--r--doc/it/weechat_plugin_api.it.adoc54
-rw-r--r--doc/ja/weechat_plugin_api.ja.adoc54
4 files changed, 214 insertions, 0 deletions
diff --git a/doc/en/weechat_plugin_api.en.adoc b/doc/en/weechat_plugin_api.en.adoc
index f2929d3b2..4fb28a02c 100644
--- a/doc/en/weechat_plugin_api.en.adoc
+++ b/doc/en/weechat_plugin_api.en.adoc
@@ -16034,6 +16034,59 @@ for key in hash:
weechat.prnt("", " %s == %s" % (key, hash[key]))
----
+==== hdata_compare
+
+_WeeChat ≥ 1.9._
+
+Compare a hdata variable of two objects.
+
+Prototype:
+
+[source,C]
+----
+int weechat_hdata_compare (struct t_hdata *hdata, void *pointer1, void *pointer2, const char *name, int case_sensitive);
+----
+
+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"
+* _case_sensitive_: 1 for case sensitive comparison of strings, otherwise 0
+
+Return value:
+
+* -1 if variable1 < variable2
+* 0 if variable1 == variable2
+* 1 if variable1 > variable2
+
+C example:
+
+[source,C]
+----
+struct t_hdata *hdata = weechat_hdata_get ("buffer");
+struct t_gui_buffer *buffer1 = weechat_buffer_search ("irc", "freenode.#weechat");
+struct t_gui_buffer *buffer2 = weechat_buffer_search ("irc", "freenode.#weechat-fr");
+weechat_printf (NULL, "number comparison = %d",
+ weechat_hdata_compare (hdata, buffer1, buffer2, "number", 0));
+----
+
+Script (Python):
+
+[source,python]
+----
+# prototype
+rc = weechat.hdata_compare(hdata, pointer1, pointer2, name, case_sensitive)
+
+# example
+hdata = weechat.hdata_get("buffer")
+buffer1 = weechat.buffer_search("irc", "freenode.#weechat")
+buffer2 = weechat.buffer_search("irc", "freenode.#weechat-fr")
+weechat.prnt("", "number comparison = %d" % weechat.hdata_compare(hdata, buffer1, buffer2, "number", 0))
+----
+
==== hdata_set
_WeeChat ≥ 0.3.9._
diff --git a/doc/fr/weechat_plugin_api.fr.adoc b/doc/fr/weechat_plugin_api.fr.adoc
index 67b27a493..792f66001 100644
--- a/doc/fr/weechat_plugin_api.fr.adoc
+++ b/doc/fr/weechat_plugin_api.fr.adoc
@@ -16371,6 +16371,59 @@ for key in hash:
weechat.prnt("", " %s == %s" % (key, hash[key]))
----
+==== hdata_compare
+
+_WeeChat ≥ 1.9._
+
+Comparer une variable hdata de deux objets.
+
+Prototype :
+
+[source,C]
+----
+int weechat_hdata_compare (struct t_hdata *hdata, void *pointer1, void *pointer2, const char *name, int case_sensitive);
+----
+
+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"
+* _case_sensitive_ : 1 pour une comparaison tenant compte de la casse pour les chaînes,
+ sinon 0
+
+Valeur de retour :
+
+* -1 si variable1 < variable2
+* 0 si variable1 == variable2
+* 1 si variable1 > variable2
+
+Exemple en C :
+
+[source,C]
+----
+struct t_hdata *hdata = weechat_hdata_get ("buffer");
+struct t_gui_buffer *buffer1 = weechat_buffer_search ("irc", "freenode.#weechat");
+struct t_gui_buffer *buffer2 = weechat_buffer_search ("irc", "freenode.#weechat-fr");
+weechat_printf (NULL, "comparaison de numéro = %d", weechat_hdata_compare (hdata, buffer1, buffer2, "number", 0));
+----
+
+Script (Python) :
+
+[source,python]
+----
+# prototype
+rc = weechat.hdata_compare(hdata, pointer1, pointer2, name, case_sensitive)
+
+# exemple
+hdata = weechat.hdata_get("buffer")
+buffer1 = weechat.buffer_search("irc", "freenode.#weechat")
+buffer2 = weechat.buffer_search("irc", "freenode.#weechat-fr")
+weechat.prnt("", "comparaison de numéro = %d" % weechat.hdata_compare(hdata, buffer1, buffer2, "number", 0))
+----
+
==== hdata_set
_WeeChat ≥ 0.3.9._
diff --git a/doc/it/weechat_plugin_api.it.adoc b/doc/it/weechat_plugin_api.it.adoc
index 795aa9cbd..1ceeff90d 100644
--- a/doc/it/weechat_plugin_api.it.adoc
+++ b/doc/it/weechat_plugin_api.it.adoc
@@ -16632,6 +16632,60 @@ for key in hash:
----
// TRANSLATION MISSING
+==== hdata_compare
+
+_WeeChat ≥ 1.9._
+
+Compare a hdata variable of two objects.
+
+Prototipo:
+
+[source,C]
+----
+int weechat_hdata_compare (struct t_hdata *hdata, void *pointer1, void *pointer2, const char *name, int case_sensitive);
+----
+
+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"
+* _case_sensitive_: 1 for case sensitive comparison of strings, otherwise 0
+
+Valore restituito:
+
+* -1 if variable1 < variable2
+* 0 if variable1 == variable2
+* 1 if variable1 > variable2
+
+Esempio in C:
+
+[source,C]
+----
+struct t_hdata *hdata = weechat_hdata_get ("buffer");
+struct t_gui_buffer *buffer1 = weechat_buffer_search ("irc", "freenode.#weechat");
+struct t_gui_buffer *buffer2 = weechat_buffer_search ("irc", "freenode.#weechat-fr");
+weechat_printf (NULL, "number comparison = %d",
+ weechat_hdata_compare (hdata, buffer1, buffer2, "number", 0));
+----
+
+Script (Python):
+
+[source,python]
+----
+# prototype
+rc = weechat.hdata_compare(hdata, pointer1, pointer2, name, case_sensitive)
+
+# example
+hdata = weechat.hdata_get("buffer")
+buffer1 = weechat.buffer_search("irc", "freenode.#weechat")
+buffer2 = weechat.buffer_search("irc", "freenode.#weechat-fr")
+weechat.prnt("", "number comparison = %d" % weechat.hdata_compare(hdata, buffer1, buffer2, "number", 0))
+----
+
+// TRANSLATION MISSING
==== hdata_set
_WeeChat ≥ 0.3.9._
diff --git a/doc/ja/weechat_plugin_api.ja.adoc b/doc/ja/weechat_plugin_api.ja.adoc
index 3109f8e89..d6be49278 100644
--- a/doc/ja/weechat_plugin_api.ja.adoc
+++ b/doc/ja/weechat_plugin_api.ja.adoc
@@ -16039,6 +16039,60 @@ for key in hash:
weechat.prnt("", " %s == %s" % (key, hash[key]))
----
+// TRANSLATION MISSING
+==== hdata_compare
+
+_WeeChat バージョン 1.9 以上で利用可。_
+
+Compare a hdata variable of two objects.
+
+プロトタイプ:
+
+[source,C]
+----
+int weechat_hdata_compare (struct t_hdata *hdata, void *pointer1, void *pointer2, const char *name, int case_sensitive);
+----
+
+引数:
+
+* _hdata_: hdata へのポインタ
+* _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"
+* _case_sensitive_: 1 for case sensitive comparison of strings, otherwise 0
+
+戻り値:
+
+* -1 if variable1 < variable2
+* 0 if variable1 == variable2
+* 1 if variable1 > variable2
+
+C 言語での使用例:
+
+[source,C]
+----
+struct t_hdata *hdata = weechat_hdata_get ("buffer");
+struct t_gui_buffer *buffer1 = weechat_buffer_search ("irc", "freenode.#weechat");
+struct t_gui_buffer *buffer2 = weechat_buffer_search ("irc", "freenode.#weechat-fr");
+weechat_printf (NULL, "number comparison = %d",
+ weechat_hdata_compare (hdata, buffer1, buffer2, "number", 0));
+----
+
+スクリプト (Python) での使用例:
+
+[source,python]
+----
+# プロトタイプ
+rc = weechat.hdata_compare(hdata, pointer1, pointer2, name, case_sensitive)
+
+# 例
+hdata = weechat.hdata_get("buffer")
+buffer1 = weechat.buffer_search("irc", "freenode.#weechat")
+buffer2 = weechat.buffer_search("irc", "freenode.#weechat-fr")
+weechat.prnt("", "number comparison = %d" % weechat.hdata_compare(hdata, buffer1, buffer2, "number", 0))
+----
+
==== hdata_set
_WeeChat バージョン 0.3.9 以上で利用可。_