summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/en/weechat_plugin_api.en.txt45
-rw-r--r--doc/fr/weechat_plugin_api.fr.txt48
-rw-r--r--doc/it/weechat_plugin_api.it.txt47
-rw-r--r--doc/ja/weechat_plugin_api.ja.txt47
4 files changed, 187 insertions, 0 deletions
diff --git a/doc/en/weechat_plugin_api.en.txt b/doc/en/weechat_plugin_api.en.txt
index 0bbdf514d..9d3d8ebc5 100644
--- a/doc/en/weechat_plugin_api.en.txt
+++ b/doc/en/weechat_plugin_api.en.txt
@@ -1326,6 +1326,51 @@ weechat_string_free_split (argv);
[NOTE]
This function is not available in scripting API.
+==== weechat_string_split_shell
+
+_WeeChat ≥ 0.4.4._
+
+Split a string like the shell does for a command with arguments.
+
+This function is a C conversion of Python class "shlex" (file: Lib/shlex.py in
+Python repository), see: http://docs.python.org/3/library/shlex.html.
+
+Prototype:
+
+[source,C]
+----
+char **weechat_string_split_shell (const char *string, int *num_items);
+----
+
+Arguments:
+
+* 'string': string to split
+* 'num_items': pointer to int which will contain number of items created
+
+Return value:
+
+* array of strings, NULL if problem (must be freed by calling
+ <<_weechat_string_free_split,weechat_string_free_split>> after use)
+
+C example:
+
+[source,C]
+----
+char **argv;
+int argc;
+argv = weechat_string_split_shell ("test 'first arg' \"second arg\"", &argc);
+/* result: argv[0] == "test"
+ argv[1] == "first arg"
+ argv[2] == "second arg"
+ argv[3] == NULL
+ argc == 3
+*/
+weechat_string_free_split (argv);
+----
+
+[NOTE]
+This function is not available in scripting API.
+
==== weechat_string_free_split
Free memory used by a split string.
diff --git a/doc/fr/weechat_plugin_api.fr.txt b/doc/fr/weechat_plugin_api.fr.txt
index 186cc0874..5f09302d2 100644
--- a/doc/fr/weechat_plugin_api.fr.txt
+++ b/doc/fr/weechat_plugin_api.fr.txt
@@ -1350,6 +1350,54 @@ weechat_string_free_split (argv);
[NOTE]
Cette fonction n'est pas disponible dans l'API script.
+==== weechat_string_split_shell
+
+_WeeChat ≥ 0.4.4._
+
+Découper une chaîne comme le shell le fait pour une commande avec ses
+paramètres.
+
+Cette fonction est une conversion en C de la classe Python "shlex" (fichier :
+Lib/shlex.py dans le dépôt Python), voir :
+http://docs.python.org/3/library/shlex.html.
+
+Prototype :
+
+[source,C]
+----
+char **weechat_string_split_shell (const char *string, int *num_items);
+----
+
+Paramètres :
+
+* 'string' : chaîne à découper
+* 'num_items' : pointeur vers un entier qui contiendra le nombre de chaînes
+ créées
+
+Valeur de retour :
+
+* tableau de chaînes, NULL en cas de problème (doit être supprimé par un appel à
+ <<_weechat_string_free_split,weechat_string_free_split>> après utilisation)
+
+Exemple en C :
+
+[source,C]
+----
+char **argv;
+int argc;
+argv = weechat_string_split_shell ("test 'first arg' \"second arg\"", &argc);
+/* résultat: argv[0] == "test"
+ argv[1] == "first arg"
+ argv[2] == "second arg"
+ argv[3] == NULL
+ argc == 3
+*/
+weechat_string_free_split (argv);
+----
+
+[NOTE]
+Cette fonction n'est pas disponible dans l'API script.
+
==== weechat_string_free_split
Supprimer une chaîne découpée.
diff --git a/doc/it/weechat_plugin_api.it.txt b/doc/it/weechat_plugin_api.it.txt
index 08f18b799..363a62654 100644
--- a/doc/it/weechat_plugin_api.it.txt
+++ b/doc/it/weechat_plugin_api.it.txt
@@ -1361,6 +1361,53 @@ weechat_string_free_split (argv);
[NOTE]
Questa funzione non è disponibile nelle API per lo scripting.
+==== weechat_string_split_shell
+
+_WeeChat ≥ 0.4.4._
+
+// TRANSLATION MISSING
+Split a string like the shell does for a command with arguments.
+
+// TRANSLATION MISSING
+This function is a C conversion of Python class "shlex" (file: Lib/shlex.py in
+Python repository), see: http://docs.python.org/3/library/shlex.html.
+
+Prototipo:
+
+[source,C]
+----
+char **weechat_string_split_shell (const char *string, int *num_items);
+----
+
+Argomenti:
+
+* 'string': stringa da dividere
+* 'num_items': puntatore ad int che conterrà il numero di elementi creati
+
+Valore restituito:
+
+* array di stringhe, NULL se si verifica un problema (deve essere liberata chiamando
+ <<_weechat_string_free_split,weechat_string_free_split>> dopo l'uso)
+
+Esempio in C:
+
+[source,C]
+----
+char **argv;
+int argc;
+argv = weechat_string_split_shell ("test 'first arg' \"second arg\"", &argc);
+/* result: argv[0] == "test"
+ argv[1] == "first arg"
+ argv[2] == "second arg"
+ argv[3] == NULL
+ argc == 3
+*/
+weechat_string_free_split (argv);
+----
+
+[NOTE]
+Questa funzione non è disponibile nelle API per lo scripting.
+
==== weechat_string_free_split
Libera la memoria usata per la divisione di una stringa.
diff --git a/doc/ja/weechat_plugin_api.ja.txt b/doc/ja/weechat_plugin_api.ja.txt
index b35c5ccc6..e634409ca 100644
--- a/doc/ja/weechat_plugin_api.ja.txt
+++ b/doc/ja/weechat_plugin_api.ja.txt
@@ -1327,6 +1327,53 @@ weechat_string_free_split (argv);
[NOTE]
スクリプト API ではこの関数を利用できません。
+==== weechat_string_split_shell
+
+_WeeChat バージョン 0.4.4 以上で利用可。_
+
+// TRANSLATION MISSING
+Split a string like the shell does for a command with arguments.
+
+// TRANSLATION MISSING
+This function is a C conversion of Python class "shlex" (file: Lib/shlex.py in
+Python repository), see: http://docs.python.org/3/library/shlex.html.
+
+プロトタイプ:
+
+[source,C]
+----
+char **weechat_string_split_shell (const char *string, int *num_items);
+----
+
+引数:
+
+* 'string': 分割する文字列
+* 'num_items': 分割回数を返す整数型変数へのポインタ
+
+戻り値:
+
+* 文字列の配列、分割に失敗した場合は NULL (使用後には必ず
+ <<_weechat_string_free_split,weechat_string_free_split>> を呼び出して領域を開放してください)
+
+C 言語での使用例:
+
+[source,C]
+----
+char **argv;
+int argc;
+argv = weechat_string_split_shell ("test 'first arg' \"second arg\"", &argc);
+/* result: argv[0] == "test"
+ argv[1] == "first arg"
+ argv[2] == "second arg"
+ argv[3] == NULL
+ argc == 3
+*/
+weechat_string_free_split (argv);
+----
+
+[NOTE]
+スクリプト API ではこの関数を利用できません。
+
==== weechat_string_free_split
文字列分割に使用したメモリを開放。