1 .\" Copyright (c) Bruno Haible <haible@clisp.cons.org>
3 .\" %%%LICENSE_START(GPLv2+_DOC_ONEPARA)
4 .\" This is free documentation; you can redistribute it and/or
5 .\" modify it under the terms of the GNU General Public License as
6 .\" published by the Free Software Foundation; either version 2 of
7 .\" the License, or (at your option) any later version.
10 .\" References consulted:
11 .\" GNU glibc-2 source code and manual
12 .\" Dinkumware C library reference http://www.dinkumware.com/
13 .\" OpenGroup's Single UNIX specification http://www.UNIX-systems.org/online.html
16 .TH WCSTOK 3 2013-11-18 "GNU" "Linux Programmer's Manual"
18 wcstok \- split wide-character string into tokens
23 .BI "wchar_t *wcstok(wchar_t *" wcs ", const wchar_t *" delim \
29 function is the wide-character equivalent of the
32 with an added argument to make it multithread-safe.
34 to split a wide-character string
36 into tokens, where a token is
37 defined as a substring not containing any wide-characters from
50 First, any delimiter wide-characters are skipped, that is, the
51 pointer is advanced beyond any wide-characters which occur in
53 If the end of the wide-character string is now
56 returns NULL, to indicate that no tokens
57 were found, and stores an appropriate value in
59 so that subsequent calls to
61 will continue to return NULL.
64 function recognizes the beginning of a token
65 and returns a pointer to it, but before doing that, it zero-terminates the
66 token by replacing the next wide-character which occurs in
69 a null wide character (L\(aq\\0\(aq),
72 so that subsequent calls will
73 continue searching after the end of recognized token.
77 function returns a pointer to the next token,
78 or NULL if no further token was found.
80 .SS Multithreading (see pthreads(7))
83 function is thread-safe.
89 wide-character string is destructively modified during
92 The following code loops over the tokens contained in a wide-character string.
98 for (token = wcstok(wcs, " \\t\\n", &state);
100 token = wcstok(NULL, " \\t\\n", &state)) {