diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2021-01-01 18:10:47 +0100 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2021-01-01 18:10:47 +0100 |
commit | 943374f7898cd975a34bfa9df1ba7693be744ef0 (patch) | |
tree | fa8cafdd8afa1df8f40347f66bf29dff74059deb /doc | |
parent | d413ccdf4fbab249084afa0b73393b947415d02c (diff) | |
download | weechat-943374f7898cd975a34bfa9df1ba7693be744ef0.zip |
doc: add note about call to "regfree" after call to "string_regcomp" (plugin API reference)
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 */ + /* ... */ } ---- |