1 .\" Copyright (c) Bruno Haible <haible@clisp.cons.org>
3 .\" This is free documentation; you can redistribute it and/or
4 .\" modify it under the terms of the GNU General Public License as
5 .\" published by the Free Software Foundation; either version 2 of
6 .\" the License, or (at your option) any later version.
8 .\" References consulted:
9 .\" GNU glibc-2 source code and manual
10 .\" Dinkumware C library reference http://www.dinkumware.com/
11 .\" OpenGroup's Single UNIX specification http://www.UNIX-systems.org/online.html
14 .\" About this Japanese page, please contact to JM Project <JM@linux.or.jp>
15 .\" Translated Sat Oct 23 17:53:50 JST 1999
16 .\" by FUJIWARA Teruyoshi <fujiwara@linux.or.jp>
18 .TH WCSTOK 3 2011-09-28 "GNU" "Linux Programmer's Manual"
21 .\"O wcstok \- split wide-character string into tokens
22 wcstok \- ワイド文字文字列をトークンに分割する
28 .BI "wchar_t *wcstok(wchar_t *" wcs ", const wchar_t *" delim \
35 .\"O function is the wide-character equivalent of the
38 .\"O with an added argument to make it multithread-safe. It can be used
39 .\"O to split a wide-character string \fIwcs\fP into tokens, where a token is
40 .\"O defined as a substring not containing any wide-characters from \fIdelim\fP.
45 マルチスレッドセーフの動作をさせるための引き数を追加したものである。
46 この関数を用いて、ワイド文字文字列 \fIwcs\fP をトークンに分解すること
47 ができる。ここで、トークンは \fIdelim\fP に列挙されている文字を含まな
50 .\"O The search starts at \fIwcs\fP, if \fIwcs\fP is not NULL,
51 .\"O or at \fI*ptr\fP, if \fIwcs\fP is NULL.
52 .\"O First, any delimiter wide-characters are skipped, that is, the
53 .\"O pointer is advanced beyond any wide-characters which occur in \fIdelim\fP.
54 検索は \fIwcs\fP が NULL でなければ \fIwcs\fP から開始され、\fIwcs\fP
55 が NULL ならば \fI*ptr\fP から開始される。まず、全ての区切りワイド文字
56 がスキップされる。つまり、\fIdelim\fP に含まれるワイド文字を超えるよう
58 .\"O If the end of the wide-character string is now reached,
60 .\"O returns NULL, to indicate that no tokens
61 .\"O were found, and stores an appropriate value in \fI*ptr\fP,
62 .\"O so that subsequent calls to
64 .\"O will continue to return NULL.
67 .\"O function recognizes the beginning of a token
68 .\"O and returns a pointer to it, but before doing that, it zero-terminates the
69 .\"O token by replacing the next wide-character which occurs in \fIdelim\fP with
70 .\"O a null wide character (L\(aq\\0\(aq),
71 .\"O and it updates \fI*ptr\fP so that subsequent calls will
72 .\"O continue searching after the end of recognized token.
76 トークンが全く見つからなかったことを示し、この後に
79 出しても NULL が返されるように \fI*ptr\fP に適切な値を設定する。それ
83 ポインタを返す。ただしこれを行う前に、トークンの後にある、\fIdelim\fP
84 に含まれている文字を NULL ワイド文字 (L\(aq\\0\(aq) に置き換えること
85 によってトークンを 0 で終端させる。さらに \fI*ptr\fP を更新し、後で
88 際に、識別されたトークンの続きから検索できるようにする。
89 .\"O .SH "RETURN VALUE"
93 .\"O function returns a pointer to the next token,
94 .\"O or NULL if no further token was found.
96 関数は次のトークンへのポインタを返す。トークンが見つから
98 .\"O .SH "CONFORMING TO"
103 .\"O The original \fIwcs\fP wide-character string is destructively modified during
105 関数に与えたワイド文字列 \fIwcs\fP は、関数の動作によって完全に書き換
109 .\"O The following code loops over the tokens contained in a wide-character string.
110 以下のコードは、ワイド文字文字列に含まれるトークンを取り出しながら
117 for (token = wcstok(wcs, " \\t\\n", &state);
119 token = wcstok(NULL, " \\t\\n", &state)) {