summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2019-06-15 20:47:14 +0200
committerSébastien Helleu <flashcode@flashtux.org>2019-06-15 20:47:14 +0200
commit917815635415b523eaf58ed4c65757247d5cca99 (patch)
treeabac3f1894ed07cbf2caed70cc285bde87b3263c /doc
parent866a29c7e63bbda24e04fc36b34bbd798a8c98db (diff)
downloadweechat-917815635415b523eaf58ed4c65757247d5cca99.zip
api: add argument "strip_items" in function string_split
Diffstat (limited to 'doc')
-rw-r--r--doc/en/weechat_plugin_api.en.adoc28
-rw-r--r--doc/fr/weechat_plugin_api.fr.adoc28
-rw-r--r--doc/it/weechat_plugin_api.it.adoc29
-rw-r--r--doc/ja/weechat_plugin_api.ja.adoc29
4 files changed, 90 insertions, 24 deletions
diff --git a/doc/en/weechat_plugin_api.en.adoc b/doc/en/weechat_plugin_api.en.adoc
index 46914c9ae..a124aeb45 100644
--- a/doc/en/weechat_plugin_api.en.adoc
+++ b/doc/en/weechat_plugin_api.en.adoc
@@ -1483,7 +1483,7 @@ This function is not available in scripting API.
==== string_split
-_Updated in 2.5._
+_Updated in 2.5, 2.6._
Split a string according to one or more delimiter(s).
@@ -1492,13 +1492,16 @@ Prototype:
[source,C]
----
char **weechat_string_split (const char *string, const char *separators,
- int flags, int num_items_max, int *num_items);
+ const char *strip_items, int flags,
+ int num_items_max, int *num_items);
----
Arguments:
* _string_: string to split
* _separators_: delimiters used for split
+* _strip_items_: chars to strip from returned items (left/right);
+ optional, can be NULL
* _flags_: combination values to change the default behavior; if the value is 0,
the default behavior is used (no strip of separators at beginning/end of string,
multiple separators are kept as-is so empty strings can be returned);
@@ -1536,7 +1539,7 @@ C example:
char **argv;
int argc;
-argv = weechat_string_split ("abc de fghi ", " ", 0, 0, &argc);
+argv = weechat_string_split ("abc de fghi ", " ", NULL, 0, 0, &argc);
/* result: argv[0] == "abc"
argv[1] == "de"
argv[2] == ""
@@ -1547,7 +1550,7 @@ argv = weechat_string_split ("abc de fghi ", " ", 0, 0, &argc);
*/
weechat_string_free_split (argv);
-argv = weechat_string_split ("abc de fghi ", " ",
+argv = weechat_string_split ("abc de fghi ", " ", NULL,
WEECHAT_STRING_SPLIT_STRIP_LEFT
| WEECHAT_STRING_SPLIT_STRIP_RIGHT
| WEECHAT_STRING_SPLIT_COLLAPSE_SEPS,
@@ -1560,7 +1563,7 @@ argv = weechat_string_split ("abc de fghi ", " ",
*/
weechat_string_free_split (argv);
-argv = weechat_string_split ("abc de fghi ", " ",
+argv = weechat_string_split ("abc de fghi ", " ", NULL,
WEECHAT_STRING_SPLIT_STRIP_LEFT
| WEECHAT_STRING_SPLIT_STRIP_RIGHT
| WEECHAT_STRING_SPLIT_COLLAPSE_SEPS
@@ -1574,7 +1577,7 @@ argv = weechat_string_split ("abc de fghi ", " ",
*/
weechat_string_free_split (argv);
-argv = weechat_string_split ("abc de fghi ", " ",
+argv = weechat_string_split ("abc de fghi ", " ", NULL,
WEECHAT_STRING_SPLIT_STRIP_LEFT
| WEECHAT_STRING_SPLIT_COLLAPSE_SEPS
| WEECHAT_STRING_SPLIT_KEEP_EOL,
@@ -1586,6 +1589,19 @@ argv = weechat_string_split ("abc de fghi ", " ",
argc == 3
*/
weechat_string_free_split (argv);
+
+argv = weechat_string_split (" abc, de,, fghi ", ",", " ",
+ WEECHAT_STRING_SPLIT_STRIP_LEFT
+ | WEECHAT_STRING_SPLIT_STRIP_RIGHT
+ | WEECHAT_STRING_SPLIT_COLLAPSE_SEPS,
+ 0, &argc);
+/* result: argv[0] == "abc"
+ argv[1] == "de"
+ argv[2] == "fghi"
+ argv[3] == NULL
+ argc == 3
+*/
+weechat_string_free_split (argv);
----
[NOTE]
diff --git a/doc/fr/weechat_plugin_api.fr.adoc b/doc/fr/weechat_plugin_api.fr.adoc
index 3df7bc2d8..ac3ad25dc 100644
--- a/doc/fr/weechat_plugin_api.fr.adoc
+++ b/doc/fr/weechat_plugin_api.fr.adoc
@@ -1509,7 +1509,7 @@ Cette fonction n'est pas disponible dans l'API script.
==== string_split
-_Mis à jour dans la 2.5._
+_Mis à jour dans la 2.5, 2.6._
Découper une chaîne à l'aide de délimiteur(s).
@@ -1518,13 +1518,16 @@ Prototype :
[source,C]
----
char **weechat_string_split (const char *string, const char *separators,
- int flags, int num_items_max, int *num_items);
+ const char *strip_items, int flags,
+ int num_items_max, int *num_items);
----
Paramètres :
* _string_ : chaîne à découper
* _separators_ : délimiteurs utilisés pour le découpage
+* _strip_items_ : caractères à supprimer des chaînes retournées (gauche/droite) ;
+ optionnel, peut être NULL
* _flags_ : combinaison de valeurs pour changer le comportement par défaut ;
si la valeur est 0, le comportement par défaut est utilisé (pas de suppression
des séparateurs en début/fin de chaîne, plusieurs séparateurs consécutifs
@@ -1564,7 +1567,7 @@ Exemples en C :
char **argv;
int argc;
-argv = weechat_string_split ("abc de fghi ", " ", 0, 0, &argc);
+argv = weechat_string_split ("abc de fghi ", " ", NULL, 0, 0, &argc);
/* résultat : argv[0] == "abc"
argv[1] == "de"
argv[2] == ""
@@ -1575,7 +1578,7 @@ argv = weechat_string_split ("abc de fghi ", " ", 0, 0, &argc);
*/
weechat_string_free_split (argv);
-argv = weechat_string_split ("abc de fghi ", " ",
+argv = weechat_string_split ("abc de fghi ", " ", NULL,
WEECHAT_STRING_SPLIT_STRIP_LEFT
| WEECHAT_STRING_SPLIT_STRIP_RIGHT
| WEECHAT_STRING_SPLIT_COLLAPSE_SEPS,
@@ -1588,7 +1591,7 @@ argv = weechat_string_split ("abc de fghi ", " ",
*/
weechat_string_free_split (argv);
-argv = weechat_string_split ("abc de fghi ", " ",
+argv = weechat_string_split ("abc de fghi ", " ", NULL,
WEECHAT_STRING_SPLIT_STRIP_LEFT
| WEECHAT_STRING_SPLIT_STRIP_RIGHT
| WEECHAT_STRING_SPLIT_COLLAPSE_SEPS
@@ -1602,7 +1605,7 @@ argv = weechat_string_split ("abc de fghi ", " ",
*/
weechat_string_free_split (argv);
-argv = weechat_string_split ("abc de fghi ", " ",
+argv = weechat_string_split ("abc de fghi ", " ", NULL,
WEECHAT_STRING_SPLIT_STRIP_LEFT
| WEECHAT_STRING_SPLIT_COLLAPSE_SEPS
| WEECHAT_STRING_SPLIT_KEEP_EOL,
@@ -1614,6 +1617,19 @@ argv = weechat_string_split ("abc de fghi ", " ",
argc == 3
*/
weechat_string_free_split (argv);
+
+argv = weechat_string_split (" abc, de,, fghi ", ",", " ",
+ WEECHAT_STRING_SPLIT_STRIP_LEFT
+ | WEECHAT_STRING_SPLIT_STRIP_RIGHT
+ | WEECHAT_STRING_SPLIT_COLLAPSE_SEPS,
+ 0, &argc);
+/* résultat : argv[0] == "abc"
+ argv[1] == "de"
+ argv[2] == "fghi"
+ argv[3] == NULL
+ argc == 3
+*/
+weechat_string_free_split (argv);
----
[NOTE]
diff --git a/doc/it/weechat_plugin_api.it.adoc b/doc/it/weechat_plugin_api.it.adoc
index ff29620cf..27b40981e 100644
--- a/doc/it/weechat_plugin_api.it.adoc
+++ b/doc/it/weechat_plugin_api.it.adoc
@@ -1555,7 +1555,7 @@ Questa funzione non è disponibile nelle API per lo scripting.
==== string_split
// TRANSLATION MISSING
-_Updated in 2.5._
+_Updated in 2.5, 2.6._
Divide una stringa in base a uno o più delimitatori.
@@ -1564,13 +1564,17 @@ Prototipo:
[source,C]
----
char **weechat_string_split (const char *string, const char *separators,
- int flags, int num_items_max, int *num_items);
+ const char *strip_items, int flags,
+ int num_items_max, int *num_items);
----
Argomenti:
* _string_: stringa da dividere
* _separators_: delimitatori usati per dividere
+// TRANSLATION MISSING
+* _strip_items_: chars to strip from returned items (left/right);
+ optional, can be NULL
* _flags_: combination values to change the default behavior; if the value is 0,
the default behavior is used (no strip of separators at beginning/end of string,
multiple separators are kept as-is so empty strings can be returned);
@@ -1609,7 +1613,7 @@ Esempi:
char **argv;
int argc;
-argv = weechat_string_split ("abc de fghi ", " ", 0, 0, &argc);
+argv = weechat_string_split ("abc de fghi ", " ", NULL, 0, 0, &argc);
/* result: argv[0] == "abc"
argv[1] == "de"
argv[2] = ""
@@ -1620,7 +1624,7 @@ argv = weechat_string_split ("abc de fghi ", " ", 0, 0, &argc);
*/
weechat_string_free_split (argv);
-argv = weechat_string_split ("abc de fghi ", " ",
+argv = weechat_string_split ("abc de fghi ", " ", NULL,
WEECHAT_STRING_SPLIT_STRIP_LEFT
| WEECHAT_STRING_SPLIT_STRIP_RIGHT
| WEECHAT_STRING_SPLIT_COLLAPSE_SEPS,
@@ -1633,7 +1637,7 @@ argv = weechat_string_split ("abc de fghi ", " ",
*/
weechat_string_free_split (argv);
-argv = weechat_string_split ("abc de fghi ", " ",
+argv = weechat_string_split ("abc de fghi ", " ", NULL,
WEECHAT_STRING_SPLIT_STRIP_LEFT
| WEECHAT_STRING_SPLIT_STRIP_RIGHT
| WEECHAT_STRING_SPLIT_COLLAPSE_SEPS
@@ -1647,7 +1651,7 @@ argv = weechat_string_split ("abc de fghi ", " ",
*/
weechat_string_free_split (argv);
-argv = weechat_string_split ("abc de fghi ", " ",
+argv = weechat_string_split ("abc de fghi ", " ", NULL,
WEECHAT_STRING_SPLIT_STRIP_LEFT
| WEECHAT_STRING_SPLIT_COLLAPSE_SEPS
| WEECHAT_STRING_SPLIT_KEEP_EOL,
@@ -1659,6 +1663,19 @@ argv = weechat_string_split ("abc de fghi ", " ",
argc == 3
*/
weechat_string_free_split (argv);
+
+argv = weechat_string_split (" abc, de,, fghi ", ",", " ",
+ WEECHAT_STRING_SPLIT_STRIP_LEFT
+ | WEECHAT_STRING_SPLIT_STRIP_RIGHT
+ | WEECHAT_STRING_SPLIT_COLLAPSE_SEPS,
+ 0, &argc);
+/* result: argv[0] == "abc"
+ argv[1] == "de"
+ argv[2] == "fghi"
+ argv[3] == NULL
+ argc == 3
+*/
+weechat_string_free_split (argv);
----
[NOTE]
diff --git a/doc/ja/weechat_plugin_api.ja.adoc b/doc/ja/weechat_plugin_api.ja.adoc
index 9e5783288..b9da4e855 100644
--- a/doc/ja/weechat_plugin_api.ja.adoc
+++ b/doc/ja/weechat_plugin_api.ja.adoc
@@ -1489,7 +1489,7 @@ if (weechat_string_regcomp (&my_regex, "([0-9]{4})-([0-9]{2})-([0-9]{2})",
==== string_split
-_WeeChat バージョン 2.5 で更新。_
+_WeeChat バージョン 2.5、2.6 で更新。_
1 つ以上の区切り文字に従って文字列を分割。
@@ -1498,13 +1498,17 @@ _WeeChat バージョン 2.5 で更新。_
[source,C]
----
char **weechat_string_split (const char *string, const char *separators,
- int flags, int num_items_max, int *num_items);
+ const char *strip_items, int flags,
+ int num_items_max, int *num_items);
----
引数:
* _string_: 分割する文字列
* _separators_: 分割に使う区切り文字
+// TRANSLATION MISSING
+* _strip_items_: chars to strip from returned items (left/right);
+ optional, can be NULL
* _flags_:
デフォルト動作を変更するビットフラグの組合せ値; 値が 0 の場合、デフォルト動作
(文字列の先頭と末尾にある区切り文字を削除しない、連続する区切り文字を 1 つにまとめない)
@@ -1542,7 +1546,7 @@ C 言語での使用例:
char **argv;
int argc;
-argv = weechat_string_split ("abc de fghi ", " ", 0, 0, &argc);
+argv = weechat_string_split ("abc de fghi ", " ", NULL, 0, 0, &argc);
/* result: argv[0] == "abc"
argv[1] == "de"
argv[2] == ""
@@ -1553,7 +1557,7 @@ argv = weechat_string_split ("abc de fghi ", " ", 0, 0, &argc);
*/
weechat_string_free_split (argv);
-argv = weechat_string_split ("abc de fghi ", " ",
+argv = weechat_string_split ("abc de fghi ", " ", NULL,
WEECHAT_STRING_SPLIT_STRIP_LEFT
| WEECHAT_STRING_SPLIT_STRIP_RIGHT
| WEECHAT_STRING_SPLIT_COLLAPSE_SEPS,
@@ -1566,7 +1570,7 @@ argv = weechat_string_split ("abc de fghi ", " ",
*/
weechat_string_free_split (argv);
-argv = weechat_string_split ("abc de fghi ", " ",
+argv = weechat_string_split ("abc de fghi ", " ", NULL,
WEECHAT_STRING_SPLIT_STRIP_LEFT
| WEECHAT_STRING_SPLIT_STRIP_RIGHT
| WEECHAT_STRING_SPLIT_COLLAPSE_SEPS
@@ -1580,7 +1584,7 @@ argv = weechat_string_split ("abc de fghi ", " ",
*/
weechat_string_free_split (argv);
-argv = weechat_string_split ("abc de fghi ", " ",
+argv = weechat_string_split ("abc de fghi ", " ", NULL,
WEECHAT_STRING_SPLIT_STRIP_LEFT
| WEECHAT_STRING_SPLIT_COLLAPSE_SEPS
| WEECHAT_STRING_SPLIT_KEEP_EOL,
@@ -1592,6 +1596,19 @@ argv = weechat_string_split ("abc de fghi ", " ",
argc == 3
*/
weechat_string_free_split (argv);
+
+argv = weechat_string_split (" abc, de,, fghi ", ",", " ",
+ WEECHAT_STRING_SPLIT_STRIP_LEFT
+ | WEECHAT_STRING_SPLIT_STRIP_RIGHT
+ | WEECHAT_STRING_SPLIT_COLLAPSE_SEPS,
+ 0, &argc);
+/* result: argv[0] == "abc"
+ argv[1] == "de"
+ argv[2] == "fghi"
+ argv[3] == NULL
+ argc == 3
+*/
+weechat_string_free_split (argv);
----
[NOTE]