1 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one.
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date. The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein. The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" References consulted:
24 .\" Linux libc source code
25 .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
27 .\" Modified Sat Jul 24 18:00:10 1993 by Rik Faith (faith@cs.unc.edu)
28 .\" Modified Mon Jan 20 12:04:18 1997 by Andries Brouwer (aeb@cwi.nl)
29 .\" Modified Tue Jan 23 20:23:07 2001 by Andries Brouwer (aeb@cwi.nl)
31 .\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka
32 .\" all rights reserved.
33 .\" Translated Tue Dec 16 10:06:16 JST 1997
34 .\" by HIROFUMI Nishizuka <nishi@rpts.cl.nec.co.jp>
35 .\" Updated Tue Apr 10 11:19:58 JST 2001 by Kentaro Shirakata <argrath@ub32.org>
36 .\" Updated 2009-02-12 by Kentaro Shirakata <argrath@ub32.org>
38 .\" WORD: delimiter 区切り文字
40 .TH STRSEP 3 2011-09-28 "GNU" "Linux Programmer's Manual"
43 .\"O strsep \- extract token from string
44 strsep \- 文字列からトークンを取り出す
48 .B #include <string.h>
50 .BI "char *strsep(char **" stringp ", const char *" delim );
54 .\"O Feature Test Macro Requirements for glibc (see
55 .\"O .BR feature_test_macros (7)):
57 .RB ( feature_test_macros (7)
65 .\"O If \fI*stringp\fP is NULL, the
67 .\"O function returns NULL
68 .\"O and does nothing else.
69 .\"O Otherwise, this function finds the first token
70 .\"O in the string \fI*stringp\fP, where tokens
71 .\"O are delimited by symbols in the string \fIdelim\fP.
72 \fI*stringp\fP が NULL の場合、
75 さもなければ、文字列 \fIstringp\fP を
76 \fIdelim\fP に含まれる文字で区切った
78 .\"O This token is terminated by overwriting the delimiter
79 .\"O with a null byte (\(aq\\0\(aq)
80 .\"O and \fI*stringp\fP is updated to point past the token.
81 トークンは、区切り文字を NULL バイト (\(aq\\0\(aq) で上書きすることで
83 \fI*stringp\fP は切り出されたトークンの次の位置を示すように更新される。
84 .\"O In case no delimiter was found, the token is taken to be
85 .\"O the entire string \fI*stringp\fP, and \fI*stringp\fP is made NULL.
86 区切り文字が見つからない場合、\fI*stringp\fP 文字列全体がトークンとして
87 扱われ、\fI*stringp\fP は NULL となる。
88 .\"O .SH "RETURN VALUE"
92 .\"O function returns a pointer to the token,
93 .\"O that is, it returns the original value of \fI*stringp\fP.
96 つまり、元の \fI*stringp\fP の値を返す。
97 .\"O .SH "CONFORMING TO"
104 .\"O function was introduced as a replacement for
106 .\"O since the latter cannot handle empty fields.
111 扱えないために、その代替品として導入された。
114 .\"O conforms to C89/C99 and hence is more portable.
117 関数は C89/C99 に準拠しており、より移植性がある。
120 .\"O Be cautious when using this function.
121 .\"O If you do use it, note that:
125 .\"O This function modifies its first argument.
128 .\"O This function cannot be used on constant strings.
131 .\"O The identity of the delimiting character is lost.