Scroll to navigation

wcstok(3) Library Functions Manual wcstok(3)

NOM

wcstok - Scinder en séquences une chaîne de caractères larges

BIBLIOTHÈQUE

Bibliothèque C standard (libc, -lc)

SYNOPSIS

#include <wchar.h>
wchar_t *wcstok(wchar_t *restrict wcs, const wchar_t *restrict delim,
                wchar_t **restrict ptr);

DESCRIPTION

La fonction wcstok() est l'équivalent pour les caractères larges de la fonction strtok(3), avec un argument supplémentaire permettant de l'employer dans un contexte multithread. On peut l'utiliser pour scinder la chaîne de caractères larges wcs en séquences définies comme des sous-chaînes ne contenant aucun caractère large contenu dans la chaîne delim.

The search starts at wcs, if wcs is not NULL, or at *ptr, if wcs is NULL. First, any delimiter wide-characters are skipped, that is, the pointer is advanced beyond any wide-characters which occur in delim. If the end of the wide-character string is now reached, wcstok() returns NULL, to indicate that no tokens were found, and stores an appropriate value in *ptr, so that subsequent calls to wcstok() will continue to return NULL. Otherwise, the wcstok() function recognizes the beginning of a token and returns a pointer to it, but before doing that, it zero-terminates the token by replacing the next wide-character which occurs in delim with a null wide character (L'\0'), and it updates *ptr so that subsequent calls will continue searching after the end of recognized token.

VALEUR RENVOYÉE

La fonction wcstok() renvoie un pointeur sur la séquence suivante ou NULL si aucune séquence n'a été trouvée.

ATTRIBUTS

Pour une explication des termes utilisés dans cette section, consulter attributes(7).

Interface Attribut Valeur
wcstok() Sécurité des threads MT-Safe

STANDARDS

C11, POSIX.1-2008.

HISTORIQUE

POSIX.1-2001, C99.

NOTES

La chaîne de caractères larges wcs originale est modifiée de manière destructrice durant l'opération.

EXEMPLES

Le code suivant parcourt les séquences (token) contenues dans la chaîne de caractères larges.

wchar_t *wcs = ...;
wchar_t *token;
wchar_t *state;
for (token = wcstok(wcs, L" \t\n", &state);

token != NULL;
token = wcstok(NULL, L" \t\n", &state)) {
... }

VOIR AUSSI

strtok(3), wcschr(3)

TRADUCTION

La traduction française de cette page de manuel a été créée par Christophe Blaess <https://www.blaess.fr/christophe/>, Stéphan Rafin <stephan.rafin@laposte.net>, Thierry Vignaud <tvignaud@mandriva.com>, François Micaux, Alain Portal <aportal@univ-montp2.fr>, Jean-Philippe Guérard <fevrier@tigreraye.org>, Jean-Luc Coulon (f5ibh) <jean-luc.coulon@wanadoo.fr>, Julien Cristau <jcristau@debian.org>, Thomas Huriaux <thomas.huriaux@gmail.com>, Nicolas François <nicolas.francois@centraliens.net>, Florentin Duneau <fduneau@gmail.com>, Simon Paillard <simon.paillard@resel.enst-bretagne.fr>, Denis Barbier <barbier@debian.org>, David Prévot <david@tilapin.org>, Jean-Baptiste Holcroft <jean-baptiste@holcroft.fr> et Grégoire Scano <gregoire.scano@malloc.fr>

Cette traduction est une documentation libre ; veuillez vous reporter à la GNU General Public License version 3 concernant les conditions de copie et de distribution. Il n'y a aucune RESPONSABILITÉ LÉGALE.

Si vous découvrez un bogue dans la traduction de cette page de manuel, veuillez envoyer un message à debian-l10n-french@lists.debian.org.

15 juin 2024 Pages du manuel de Linux 6.9.1