summaryrefslogtreecommitdiff
path: root/doc/it/weechat_plugin_api.it.txt
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2013-04-21 11:26:52 +0200
committerSebastien Helleu <flashcode@flashtux.org>2013-04-21 11:26:52 +0200
commit509a58b1d54420c62b1d9069e91512983f7ca44a (patch)
tree892345b0e8787e2fe8f1d6c45e81ef6079942b78 /doc/it/weechat_plugin_api.it.txt
parentfcd71d14bc23a908f33224f1de91ab740dd40ff0 (diff)
downloadweechat-509a58b1d54420c62b1d9069e91512983f7ca44a.zip
api: add new function hdata_search
Diffstat (limited to 'doc/it/weechat_plugin_api.it.txt')
-rw-r--r--doc/it/weechat_plugin_api.it.txt66
1 files changed, 66 insertions, 0 deletions
diff --git a/doc/it/weechat_plugin_api.it.txt b/doc/it/weechat_plugin_api.it.txt
index 953efab7d..60fabb516 100644
--- a/doc/it/weechat_plugin_api.it.txt
+++ b/doc/it/weechat_plugin_api.it.txt
@@ -14018,6 +14018,72 @@ if buffer:
buffer = weechat.hdata_move(hdata, buffer, -1)
----------------------------------------
+weechat_hdata_search
+^^^^^^^^^^^^^^^^^^^^
+
+_Novità nella versione 0.4.1._
+
+// TRANSLATION MISSING
+Search element in a list: the expression 'search' is evaluated for each element
+in list, until element is found (or end of list).
+
+Prototipo:
+
+[source,C]
+----------------------------------------
+void *weechat_hdata_search (struct t_hdata *hdata, void *pointer, const char *search, int move);
+----------------------------------------
+
+Argomenti:
+
+* 'hdata': puntatore hdata
+* 'pointer': puntatore ad un oggetto di WeeChat/plugin
+// TRANSLATION MISSING
+* 'search': expression to evaluate, default pointer in expression is the name of
+ hdata (and this pointer changes for each element in list); for help on
+ expression, see command `/eval` in 'WeeChat User's guide'
+// TRANSLATION MISSING
+* 'move': number of jump(s) to execute after unsuccessful search (negative or
+ positive integer, different from 0)
+
+Valore restituito:
+
+// TRANSLATION MISSING
+* pointer to element found, NULL if not found
+
+Esempio in C:
+
+[source,C]
+----------------------------------------
+struct t_hdata *hdata = weechat_hdata_get ("irc_server");
+void *servers = weechat_hdata_get (hdata, "irc_servers");
+
+/* search irc server with name "freenode" */
+void *server = weechat_hdata_search (hdata, servers, "${irc_server.name} == freenode", 1);
+if (server)
+{
+ /* ... */
+}
+----------------------------------------
+
+Script (Python):
+
+// TRANSLATION MISSING
+[source,python]
+----------------------------------------
+# prototipo
+pointer = weechat.hdata_search(hdata, pointer, search, count)
+
+# esempio
+hdata = weechat.hdata_get("irc_server")
+servers = weechat.hdata_get_list(hdata, "irc_servers")
+
+# search irc server with name "freenode"
+server = weechat.hdata_search(hdata, servers, "${irc_server.name} == freenode", 1)
+if server:
+ # ...
+----------------------------------------
+
weechat_hdata_char
^^^^^^^^^^^^^^^^^^