.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) .\" .\" %%%LICENSE_START(VERBATIM) .\" 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. .\" %%%LICENSE_END .\" .\" References consulted: .\" Linux libc source code .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) .\" 386BSD man pages .\" Modified Sat Jul 24 18:00:10 1993 by Rik Faith (faith@cs.unc.edu) .\" Modified Mon Jan 20 12:04:18 1997 by Andries Brouwer (aeb@cwi.nl) .\" Modified Tue Jan 23 20:23:07 2001 by Andries Brouwer (aeb@cwi.nl) .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .\" .\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka .\" all rights reserved. .\" Translated Tue Dec 16 10:06:16 JST 1997 .\" by HIROFUMI Nishizuka .\" Updated Tue Apr 10 11:19:58 JST 2001 by Kentaro Shirakata .\" Updated 2009-02-12 by Kentaro Shirakata .\" .TH STRSEP 3 2014\-02\-25 GNU "Linux Programmer's Manual" .SH 名前 strsep \- 文字列からトークンを取り出す .SH 書式 .nf \fB#include \fP .sp \fBchar *strsep(char **\fP\fIstringp\fP\fB, const char *\fP\fIdelim\fP\fB);\fP .fi .sp .in -4n glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp \fBstrsep\fP(): _BSD_SOURCE .SH 説明 \fI*stringp\fP が NULL の場合、 \fBstrsep\fP() 関数は何もせずに NULL を返す。 さもなければ、文字列 \fIstringp\fP を \fIdelim\fP に含まれるいずれかのバイトで区切ったトークンのうち最初のものを返す。 トークンは、区切り文字をヌルバイト (\(aq\e0\(aq) で上書きすることで 終端される。 \fI*stringp\fP は切り出されたトークンの次の位置を示すように更新される。 区切り文字が見つからない場合、\fI*stringp\fP 文字列全体がトークンとして 扱われ、\fI*stringp\fP は NULL となる。 .SH 返り値 \fBstrsep\fP() 関数は、トークンへのポインターを返す。 つまり、元の \fI*stringp\fP の値を返す。 .SH 属性 .SS "マルチスレッディング (pthreads(7) 参照)" \fBstrsep\fP() 関数はスレッドセーフである。 .SH 準拠 4.4BSD. .SH 注意 \fBstrsep\fP() 関数は、 \fBstrtok\fP(3) 関数が空のフィールドを 扱えないために、その代替品として導入された。 しかしながら、 \fBstrtok\fP(3) 関数は C89/C99 に準拠しており、より移植性がある。 .SH バグ この関数を使う時は注意すること。 もし使うなら、以下のことに注意すること。 .IP * 2 この関数は最初の引数を変更する。 .IP * この関数は定数文字列には使えない。 .IP * 区切り文字自体は失われてしまう。 .SH 関連項目 \fBindex\fP(3), \fBmemchr\fP(3), \fBrindex\fP(3), \fBstrchr\fP(3), \fBstring\fP(3), \fBstrpbrk\fP(3), \fBstrspn\fP(3), \fBstrstr\fP(3), \fBstrtok\fP(3) .SH この文書について この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.79 の一部 である。プロジェクトの説明とバグ報告に関する情報は http://www.kernel.org/doc/man\-pages/ に書かれている。