diff options
Diffstat (limited to 'doc')
-rw-r--r-- | doc/en/weechat_plugin_api.en.adoc | 13 | ||||
-rw-r--r-- | doc/fr/weechat_plugin_api.fr.adoc | 13 | ||||
-rw-r--r-- | doc/it/weechat_plugin_api.it.adoc | 14 | ||||
-rw-r--r-- | doc/ja/weechat_plugin_api.ja.adoc | 14 |
4 files changed, 50 insertions, 4 deletions
diff --git a/doc/en/weechat_plugin_api.en.adoc b/doc/en/weechat_plugin_api.en.adoc index 03a8982a0..b81440b2b 100644 --- a/doc/en/weechat_plugin_api.en.adoc +++ b/doc/en/weechat_plugin_api.en.adoc @@ -1334,14 +1334,25 @@ Return value: * same return code as function `regcomp` (0 if OK, other value for error, see `man regcomp`) +[NOTE] +Regular expression _preg_ must be cleaned by calling "regfree" after use, +if the function returned 0 (OK). + C example: [source,C] ---- regex_t my_regex; -if (weechat_string_regcomp (&my_regex, "(?i)test", REG_EXTENDED) != 0) +if (weechat_string_regcomp (&my_regex, "(?i)test", REG_EXTENDED) == 0) +{ + /* OK */ + /* ... */ + regfree (&my_regex); +} +else { /* error */ + /* ... */ } ---- diff --git a/doc/fr/weechat_plugin_api.fr.adoc b/doc/fr/weechat_plugin_api.fr.adoc index b8a740d7e..9aa26db39 100644 --- a/doc/fr/weechat_plugin_api.fr.adoc +++ b/doc/fr/weechat_plugin_api.fr.adoc @@ -1355,14 +1355,25 @@ Valeur de retour : * même code retour que la fonction `regcomp` (0 si ok, autre valeur pour une erreur, voir `man regcomp`) +[NOTE] +L'expression régulière _preg_ doit être nettoyée par un appel à "regfree" après +utilisation, si la fonction a retourné 0 (OK). + Exemple en C : [source,C] ---- regex_t my_regex; -if (weechat_string_regcomp (&my_regex, "(?i)test", REG_EXTENDED) != 0) +if (weechat_string_regcomp (&my_regex, "(?i)test", REG_EXTENDED) == 0) +{ + /* OK */ + /* ... */ + regfree (&my_regex); +} +else { /* erreur */ + /* ... */ } ---- diff --git a/doc/it/weechat_plugin_api.it.adoc b/doc/it/weechat_plugin_api.it.adoc index f32fe47c5..029a71557 100644 --- a/doc/it/weechat_plugin_api.it.adoc +++ b/doc/it/weechat_plugin_api.it.adoc @@ -1400,14 +1400,26 @@ Valore restituito: * same return code as function `regcomp` (0 if ok, other value for error, see `man regcomp`) +[NOTE] +// TRANSLATION MISSING +Regular expression _preg_ must be cleaned by calling "regfree" after use, +if the function returned 0 (OK). + Esempio in C: [source,C] ---- regex_t my_regex; -if (weechat_string_regcomp (&my_regex, "(?i)test", REG_EXTENDED) != 0) +if (weechat_string_regcomp (&my_regex, "(?i)test", REG_EXTENDED) == 0) +{ + /* OK */ + /* ... */ + regfree (&my_regex); +} +else { /* error */ + /* ... */ } ---- diff --git a/doc/ja/weechat_plugin_api.ja.adoc b/doc/ja/weechat_plugin_api.ja.adoc index 32c1d4400..91d6f886a 100644 --- a/doc/ja/weechat_plugin_api.ja.adoc +++ b/doc/ja/weechat_plugin_api.ja.adoc @@ -1344,14 +1344,26 @@ int weechat_string_regcomp (void *preg, const char *regex, int default_flags) * `regcomp` 関数と同じ戻り値 (成功の場合は 0、エラーが起きた場合は 0 以外、`man regcomp` を参照) +[NOTE] +// TRANSLATION MISSING +Regular expression _preg_ must be cleaned by calling "regfree" after use, +if the function returned 0 (OK). + C 言語での使用例: [source,C] ---- regex_t my_regex; -if (weechat_string_regcomp (&my_regex, "(?i)test", REG_EXTENDED) != 0) +if (weechat_string_regcomp (&my_regex, "(?i)test", REG_EXTENDED) == 0) +{ + /* OK */ + /* ... */ + regfree (&my_regex); +} +else { /* error */ + /* ... */ } ---- |