OSDN Git Service

(split) LDP v3.30, v3.31 の定型的な変更内容を反映。
[linuxjm/LDP_man-pages.git] / draft / man3 / strsep.3
1 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
2 .\"
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.
6 .\"
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.
11 .\"
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
18 .\" professionally.
19 .\"
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
22 .\"
23 .\" References consulted:
24 .\"     Linux libc source code
25 .\"     Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
26 .\"     386BSD man pages
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)
30 .\"
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>
37 .\"
38 .\" WORD:       delimiter       ¶èÀÚ¤êʸ»ú
39 .\"
40 .TH STRSEP 3  2010-09-20 "GNU" "Linux Programmer's Manual"
41 .\"O .SH NAME
42 .SH Ì¾Á°
43 .\"O strsep \- extract token from string
44 strsep \- Ê¸»úÎ󤫤é¥È¡¼¥¯¥ó¤ò¼è¤ê½Ð¤¹
45 .\"O .SH SYNOPSIS
46 .SH ½ñ¼°
47 .nf
48 .B #include <string.h>
49 .sp
50 .BI "char *strsep(char **" stringp ", const char *" delim );
51 .fi
52 .sp
53 .in -4n
54 .\"O Feature Test Macro Requirements for glibc (see
55 .\"O .BR feature_test_macros (7)):
56 glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
57 .RB ( feature_test_macros (7)
58 »²¾È):
59 .in
60 .sp
61 .BR strsep ():
62 _BSD_SOURCE
63 .\"O .SH DESCRIPTION
64 .SH ÀâÌÀ
65 .\"O If \fI*stringp\fP is NULL, the
66 .\"O .BR strsep ()
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 ¤Î¾ì¹ç¡¢
73 .BR strsep ()
74 ´Ø¿ô¤Ï²¿¤â¤»¤º¤Ë NULL ¤òÊÖ¤¹¡£
75 ¤µ¤â¤Ê¤±¤ì¤Ð¡¢Ê¸»úÎó \fIstringp\fP ¤ò
76 \fIdelim\fP ¤Ë´Þ¤Þ¤ì¤ëʸ»ú¤Ç¶èÀڤä¿
77 ¥È¡¼¥¯¥ó¤Î¤¦¤ÁºÇ½é¤Î¤â¤Î¤òÊÖ¤¹¡£
78 .\"O This token is terminated with a \(aq\\0\(aq character
79 .\"O (by overwriting the delimiter)
80 .\"O and \fI*stringp\fP is updated to point past the token.
81 ¥È¡¼¥¯¥ó¤Ï (¶èÀÚ¤êʸ»ú¤ò¾å½ñ¤­¤¹¤ë¤³¤È¤Ë¤è¤Ã¤Æ) \(aq\\0\(aq Ê¸»ú¤Ç½ªÃ¼¤µ¤ì¡¢
82 \fI*stringp\fP ¤ÏÀÚ¤ê½Ð¤µ¤ì¤¿¥È¡¼¥¯¥ó¤Î¼¡¤Î°ÌÃÖ¤ò¼¨¤¹¤è¤¦¤Ë¹¹¿·¤µ¤ì¤ë¡£
83 .\"O In case no delimiter was found, the token is taken to be
84 .\"O the entire string \fI*stringp\fP, and \fI*stringp\fP is made NULL.
85 ¶èÀÚ¤êʸ»ú¤¬¸«¤Ä¤«¤é¤Ê¤¤¾ì¹ç¡¢\fI*stringp\fP Ê¸»úÎóÁ´ÂΤ¬¥È¡¼¥¯¥ó¤È¤·¤Æ
86 °·¤ï¤ì¡¢\fI*stringp\fP ¤Ï NULL ¤È¤Ê¤ë¡£
87 .\"O .SH "RETURN VALUE"
88 .SH ÊÖ¤êÃÍ
89 .\"O The
90 .\"O .BR strsep ()
91 .\"O function returns a pointer to the token,
92 .\"O that is, it returns the original value of \fI*stringp\fP.
93 .BR strsep ()
94 ´Ø¿ô¤Ï¡¢¥È¡¼¥¯¥ó¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£
95 ¤Ä¤Þ¤ê¡¢¸µ¤Î \fI*stringp\fP ¤ÎÃͤòÊÖ¤¹¡£
96 .\"O .SH "CONFORMING TO"
97 .SH ½àµò
98 4.4BSD.
99 .\"O .SH NOTES
100 .SH Ãí°Õ
101 .\"O The
102 .\"O .BR strsep ()
103 .\"O function was introduced as a replacement for
104 .\"O .BR strtok (3),
105 .\"O since the latter cannot handle empty fields.
106 .BR strsep ()
107 ´Ø¿ô¤Ï¡¢
108 .BR strtok (3)
109 ´Ø¿ô¤¬¶õ¤Î¥Õ¥£¡¼¥ë¥É¤ò
110 °·¤¨¤Ê¤¤¤¿¤á¤Ë¡¢¤½¤ÎÂåÂØÉʤȤ·¤ÆƳÆþ¤µ¤ì¤¿¡£
111 .\"O However,
112 .\"O .BR strtok (3)
113 .\"O conforms to C89/C99 and hence is more portable.
114 ¤·¤«¤·¤Ê¤¬¤é¡¢
115 .BR strtok (3)
116 ´Ø¿ô¤Ï C89/C99 ¤Ë½àµò¤·¤Æ¤ª¤ê¡¢¤è¤ê°Ü¿¢À­¤¬¤¢¤ë¡£
117 .\"O .SH BUGS
118 .SH ¥Ð¥°
119 .\"O Be cautious when using this function.
120 .\"O If you do use it, note that:
121 ¤³¤Î´Ø¿ô¤ò»È¤¦»þ¤ÏÃí°Õ¤¹¤ë¤³¤È¡£
122 ¤â¤·»È¤¦¤Ê¤é¡¢°Ê²¼¤Î¤³¤È¤ËÃí°Õ¤¹¤ë¤³¤È¡£
123 .IP * 2
124 .\"O This function modifies its first argument.
125 ¤³¤Î´Ø¿ô¤ÏºÇ½é¤Î°ú¿ô¤òÊѹ¹¤¹¤ë¡£
126 .IP *
127 .\"O This function cannot be used on constant strings.
128 ¤³¤Î´Ø¿ô¤ÏÄê¿ôʸ»úÎó¤Ë¤Ï»È¤¨¤Ê¤¤¡£
129 .IP *
130 .\"O The identity of the delimiting character is lost.
131 ¶èÀÚ¤êʸ»ú¤¬²¿¤Ç¤¢¤Ã¤¿¤«Ê¬¤«¤é¤Ê¤¯¤Ê¤ë¡£
132 .\"O .SH "SEE ALSO"
133 .SH ´ØÏ¢¹àÌÜ
134 .BR index (3),
135 .BR memchr (3),
136 .BR rindex (3),
137 .BR strchr (3),
138 .BR string (3),
139 .BR strpbrk (3),
140 .BR strspn (3),
141 .BR strstr (3),
142 .BR strtok (3)