1WCSTOK(3P)                 POSIX Programmer's Manual                WCSTOK(3P)
2
3
4

PROLOG

6       This  manual  page is part of the POSIX Programmer's Manual.  The Linux
7       implementation of this interface may differ (consult the  corresponding
8       Linux  manual page for details of Linux behavior), or the interface may
9       not be implemented on Linux.
10
11

NAME

13       wcstok — split a wide-character string into tokens
14

SYNOPSIS

16       #include <wchar.h>
17
18       wchar_t *wcstok(wchar_t *restrict ws1, const wchar_t *restrict ws2,
19           wchar_t **restrict ptr);
20

DESCRIPTION

22       The functionality described on this reference page is aligned with  the
23       ISO C  standard.  Any  conflict between the requirements described here
24       and the ISO C standard is unintentional. This  volume  of  POSIX.1‐2008
25       defers to the ISO C standard.
26
27       A  sequence  of calls to wcstok() shall break the wide-character string
28       pointed to by ws1 into a sequence of tokens, each  of  which  shall  be
29       delimited  by  a  wide-character  code  from  the wide-character string
30       pointed to by ws2.   The  ptr  argument  points  to  a  caller-provided
31       wchar_t  pointer  into which the wcstok() function shall store informa‐
32       tion necessary for it to  continue  scanning  the  same  wide-character
33       string.
34
35       The  first  call  in the sequence has ws1 as its first argument, and is
36       followed by calls with a null pointer as their first argument. The sep‐
37       arator string pointed to by ws2 may be different from call to call.
38
39       The  first  call in the sequence shall search the wide-character string
40       pointed to by ws1 for the first wide-character code that  is  not  con‐
41       tained  in  the current separator string pointed to by ws2.  If no such
42       wide-character code is found, then there are no  tokens  in  the  wide-
43       character  string  pointed  to  by ws1 and wcstok() shall return a null
44       pointer. If such a wide-character code is found, it shall be the  start
45       of the first token.
46
47       The wcstok() function shall then search from there for a wide-character
48       code that is contained in the current  separator  string.  If  no  such
49       wide-character  code  is found, the current token extends to the end of
50       the wide-character string pointed to by ws1,  and  subsequent  searches
51       for  a token shall return a null pointer. If such a wide-character code
52       is found, it shall be overwritten by a null wide character, which  ter‐
53       minates  the  current token. The wcstok() function shall save a pointer
54       to the following wide-character code, from which the next search for  a
55       token shall start.
56
57       Each  subsequent  call,  with  a null pointer as the value of the first
58       argument, shall start searching from the saved pointer  and  behave  as
59       described above.
60
61       The implementation shall behave as if no function calls wcstok().
62

RETURN VALUE

64       Upon  successful  completion,  the  wcstok()  function  shall  return a
65       pointer to the first wide-character code  of  a  token.  Otherwise,  if
66       there is no token, wcstok() shall return a null pointer.
67

ERRORS

69       No errors are defined.
70
71       The following sections are informative.
72

EXAMPLES

74       None.
75

APPLICATION USAGE

77       None.
78

RATIONALE

80       None.
81

FUTURE DIRECTIONS

83       None.
84

SEE ALSO

86       The Base Definitions volume of POSIX.1‐2008, <wchar.h>
87
89       Portions  of  this text are reprinted and reproduced in electronic form
90       from IEEE Std 1003.1, 2013 Edition, Standard for Information Technology
91       --  Portable  Operating  System  Interface (POSIX), The Open Group Base
92       Specifications Issue 7, Copyright (C) 2013 by the Institute of Electri‐
93       cal  and  Electronics  Engineers,  Inc  and  The  Open Group.  (This is
94       POSIX.1-2008 with the 2013 Technical Corrigendum  1  applied.)  In  the
95       event of any discrepancy between this version and the original IEEE and
96       The Open Group Standard, the original IEEE and The Open Group  Standard
97       is  the  referee document. The original Standard can be obtained online
98       at http://www.unix.org/online.html .
99
100       Any typographical or formatting errors that appear  in  this  page  are
101       most likely to have been introduced during the conversion of the source
102       files to man page format. To report such errors,  see  https://www.ker
103       nel.org/doc/man-pages/reporting_bugs.html .
104
105
106
107IEEE/The Open Group                  2013                           WCSTOK(3P)
Impressum