1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117
|
.\" Copyright (C) 1996 Andries Brouwer (aeb@cwi.nl)
.\"
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
.\" preserved on all copies.
.\"
.\" Permission is granted to copy and distribute modified versions of this
.\" manual under the conditions for verbatim copying, provided that the
.\" entire resulting derived work is distributed under the terms of a
.\" permission notice identical to this one.
.\"
.\" Since the Linux kernel and libraries are constantly changing, this
.\" manual page may be incorrect or out-of-date. The author(s) assume no
.\" responsibility for errors or omissions, or for damages resulting from
.\" the use of the information contained herein. The author(s) may not
.\" have taken the same level of care in the production of this manual,
.\" which is licensed free of charge, as they might when working
.\" professionally.
.\"
.\" Formatted or processed versions of this manual, if unaccompanied by
.\" the source, must acknowledge the copyright and authors of this work.
.\"
.\" Rewritten old page, 960210, aeb@cwi.nl
.\" Updated, added strtok_r. 2000-02-13 Nicol Lichtmaier <nick@debian.org>
.\"
.\" Japanese Version Copyright (c) 1998 Ishii Tatsuo all rights reserved.
.\" Translated Wed May 27 1998 by Ishii Tatsuo <rfun@azusa.shinshu-u.ac.jp>
.\" Updated Wed Apr 5 2000 by Kentaro Shirakata <argrath@ub32.org>
.\" Updated Thu Sep 21 2000 by Kentaro Shirakata <argrath@ub32.org>
.\" Updated Thu Mar 28 2002 by Kentaro Shirakata <argrath@ub32.org>
.TH STRTOK 3 2000-02-13 "GNU" "Linux Programmer's Manual"
.SH ̾
strtok, strtok_r \- ʸȡФ
.SH
.nf
.B #include <string.h>
.sp
.BI "char *strtok(char *" s ", const char *" delim );
.sp
.BI "char *strtok_r(char *" s ", const char *" delim ", char **" ptrptr );
.fi
.SH
֥ȡפȤϡǤʤʸǡ\fIdelim\fP ʸˤ¸ߤʤ
ʸ롣ȡμˤ \e0 \fIdelim\fP ¸ߤ
ʸ³
.PP
\fBstrtok()\fP ؿʸ \fIs\fP ѡƥȡʬ䤹롣
\fBstrtok()\fP ؤκǽθƤӽФǤ \fIs\fP ˼롣
ʹߤθƤӽФǤ NULL ˤ롣
줾θƤӽФȤ˼ؤΥȡؤΥݥ֤ꡢ
ʾȡʤ NULL ֤롣
.PP
ȡüʸ (\fIdelim\fP ʸˤʸ) ǽäƤȡ
üʸ \e0 Ǿ졢
ʸؤΥݥ \fBstrtok()\fP θƤӽФΤ¸롣
üʸʸ \fIdelim\fP ϸƤӽФѹƤ褤
.PP
.B strtok_r()
ؿ
.B strtok()
ؿΥꥨȥǤǤꡢؿȤŪХåեȤ
桼ݤХåե char* ݥ᤹롣
ΥݥǤ
.I ptrptr
ϡƱʸѡƤ֤ƱͤˤƤʤФʤʤ
.\" .SH EXAMPLE
.\" The following parses words out of a string, using 'white space'
.\" separators, with
.\" .BR strtok_r() :
.\" .PP
.\" .nf
.\" char buf[128];
.\" char *sep = " \\t\\n";
.\" char *tok, *cb;
.\"
.\" snprintf(buf, sizeof(buf), "%s", " One Two\\tThree\\nFour\\n\\n");
.\"
.\" for ( tok = strtok_r(buf, sep, &cb); tok;
.\" tok = strtok_r(NULL, sep, &cb) )
.\" printf("%s\\n", tok);
.\" .fi
.SH Х
δؿФ˻Ѥʤȡ
⤷ѤϡʲΤȤդ뤳ȡ
.PP
.RS
δؿϤκǽΰѹ롣
.PP
δؿ const ʸǤϻȤʤ
.PP
üʸϤ٤ \e0 ˤʤäƤޤ
.PP
.BR strtok ()
ؿϥѡŪХåեѤΤǡåɥդǤʤ
⤷줬ˤʤ
.BR strtok_r ()
Ѥ뤳ȡ
.RE
.SH ֤
\fBstrtok()\fP ؿϼΥȡؤΥݥ
ȡʤ NULL ֤
.SH
.TP
strtok()
SVID 3, POSIX, BSD 4.3, ISO 9899
.TP
strtok_r()
POSIX.1c
.SH Ϣ
.BR index (3),
.BR memchr (3),
.BR rindex (3),
.BR strchr (3),
.BR strpbrk (3),
.BR strsep (3),
.BR strspn (3),
.BR strstr (3)
|