wcstok.3 (616e099e5c4664adc444ccfcc511118f62c07eee) wcstok.3 (9ad391340ed786640390cea55667544e006f26fd)
1.\" Copyright (c) 1998 Softweyr LLC. All rights reserved.
2.\"
3.\" strtok_r, from Berkeley strtok
4.\" Oct 13, 1998 by Wes Peters <wes@softweyr.com>
5.\"
6.\" Copyright (c) 1988, 1991, 1993
7.\" The Regents of the University of California. All rights reserved.
8.\"

--- 35 unchanged lines hidden (view full) ---

44.\" USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
45.\" ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
46.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
47.\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
48.\" SUCH DAMAGE.
49.\"
50.\" $FreeBSD$
51.\"
1.\" Copyright (c) 1998 Softweyr LLC. All rights reserved.
2.\"
3.\" strtok_r, from Berkeley strtok
4.\" Oct 13, 1998 by Wes Peters <wes@softweyr.com>
5.\"
6.\" Copyright (c) 1988, 1991, 1993
7.\" The Regents of the University of California. All rights reserved.
8.\"

--- 35 unchanged lines hidden (view full) ---

44.\" USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
45.\" ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
46.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
47.\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
48.\" SUCH DAMAGE.
49.\"
50.\" $FreeBSD$
51.\"
52.Dd October 3, 2002
52.Dd September 7, 2002
53.Dt WCSTOK 3
54.Os
55.Sh NAME
56.Nm wcstok
57.Nd split wide-character string into tokens
58.Sh LIBRARY
59.Lb libc
60.Sh SYNOPSIS

--- 6 unchanged lines hidden (view full) ---

67function
68is used to isolate sequential tokens in a null-terminated wide character
69string,
70.Fa str .
71These tokens are separated in the string by at least one of the
72characters in
73.Fa sep .
74The first time that
53.Dt WCSTOK 3
54.Os
55.Sh NAME
56.Nm wcstok
57.Nd split wide-character string into tokens
58.Sh LIBRARY
59.Lb libc
60.Sh SYNOPSIS

--- 6 unchanged lines hidden (view full) ---

67function
68is used to isolate sequential tokens in a null-terminated wide character
69string,
70.Fa str .
71These tokens are separated in the string by at least one of the
72characters in
73.Fa sep .
74The first time that
75.Fn wcstok
75.Fn strtok
76is called,
77.Fa str
78should be specified; subsequent calls, wishing to obtain further tokens
79from the same string, should pass a null pointer instead.
80The separator string,
81.Fa sep ,
82must be supplied each time, and may change between calls.
83The context pointer

--- 7 unchanged lines hidden (view full) ---

91function.
92.Sh RETURN VALUES
93The
94.Fn wcstok
95function
96returns a pointer to the beginning of each subsequent token in the string,
97after replacing the token itself with a null wide character (L'\e0').
98When no more tokens remain, a null pointer is returned.
76is called,
77.Fa str
78should be specified; subsequent calls, wishing to obtain further tokens
79from the same string, should pass a null pointer instead.
80The separator string,
81.Fa sep ,
82must be supplied each time, and may change between calls.
83The context pointer

--- 7 unchanged lines hidden (view full) ---

91function.
92.Sh RETURN VALUES
93The
94.Fn wcstok
95function
96returns a pointer to the beginning of each subsequent token in the string,
97after replacing the token itself with a null wide character (L'\e0').
98When no more tokens remain, a null pointer is returned.
99.Sh EXAMPLES
100The following code fragment splits a wide character string on
101.Tn ASCII
102space, tab and newline characters and writes the tokens to
103standard output:
104.Bd -literal -offset indent
105const wchar_t *seps = L" \et\en";
106wchar_t *last, *tok, text[] = L" \enone\ettwo\et\etthree \en";
107
108for (tok = wcstok(text, seps, &last); tok != NULL;
109 tok = wcstok(NULL, seps, &last))
110 wprintf(L"%ls\en", tok);
111.Ed
112.Sh COMPATIBILITY
113Some early implementations of
114.Fn wcstok
115omit the
116context pointer argument,
117.Fa last ,
118and maintain state across calls in a static variable like
119.Fn strtok
120does.
121.Sh SEE ALSO
99.Sh COMPATIBILITY
100Some early implementations of
101.Fn wcstok
102omit the
103context pointer argument,
104.Fa last ,
105and maintain state across calls in a static variable like
106.Fn strtok
107does.
108.Sh SEE ALSO
122.Xr strtok 3 ,
123.Xr wcschr 3 ,
124.Xr wcscspn 3 ,
125.Xr wcspbrk 3 ,
126.Xr wcsrchr 3 ,
109.Xr wcschr 3 ,
110.Xr wcscspn 3 ,
111.Xr wcspbrk 3 ,
112.Xr wcsrchr 3 ,
127.Xr wcsspn 3
113.Xr wcsspn 3 ,
114.Xr strtok 3
128.Sh STANDARDS
129The
130.Fn wcstok
131function
132conforms to
133.St -isoC-99 .
115.Sh STANDARDS
116The
117.Fn wcstok
118function
119conforms to
120.St -isoC-99 .