.\" 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 17:56:43 1993 by Rik Faith (faith@cs.unc.edu) .\" Added history, aeb, 980113. .\" 2005-05-05 mtk: added strcasestr() .\" .\"******************************************************************* .\" .\" 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:54 JST 1997 .\" by HIROFUMI Nishizuka .\" Updated Sun Sep 5 JST 1999 by by Kentaro Shirakata .\" Updated Wed Apr 20 JST 2005 by by Kentaro Shirakata .\" .TH STRSTR 3 2015\-01\-10 GNU "Linux Programmer's Manual" .SH 名前 strstr, strcasestr \- 部分文字列の位置を示す .SH 書式 .nf \fB#include \fP .sp \fBchar *strstr(const char *\fP\fIhaystack\fP\fB, const char *\fP\fIneedle\fP\fB);\fP .sp \fB#define _GNU_SOURCE\fP /* feature_test_macros(7) 参照 */ .sp \fB#include \fP .sp \fBchar *strcasestr(const char *\fP\fIhaystack\fP\fB, const char *\fP\fIneedle\fP\fB);\fP .fi .SH 説明 \fBstrstr\fP() 関数は、部分文字列 \fIneedle\fP が文字列 \fIhaystack\fP 中 で最初に現れる位置を見つける。 文字列を終端ヌルバイト (\(aq\e0\(aq) は比較されない。 \fBstrcasestr\fP() 関数は \fBstrstr\fP() 関数と同様だが、 両方の引数に対して大文字小文字を無視する。 .SH 返り値 これらの関数は、見つかった部分文字列の開始を指すポインターを返し、 もし部分文字列が見つからない場合は NULL を返す。 .SH 属性 .SS "マルチスレッディング (pthreads(7) 参照)" \fBstrstr\fP() 関数はスレッドセーフである。 .LP \fBstrcasestr\fP() 関数は、例外付きのスレッドセーフである。実行中に \fBsetlocale\fP(3) を呼び出してロケールを変更しない限り、マルチスレッドアプリケーションで安全に使用することができる。 .SH 準拠 .\" .SH BUGS .\" Early versions of Linux libc (like 4.5.26) would not allow .\" an empty .\" .I needle .\" argument for .\" .BR strstr (). .\" Later versions (like 4.6.27) work correctly, .\" and return .\" .IR haystack .\" when .\" .I needle .\" is empty. \fBstrstr\fP() 関数は C89 と C99 に準拠している。 \fBstrcasestr\fP() 関数は非標準拡張である。 .SH 関連項目 \fBindex\fP(3), \fBmemchr\fP(3), \fBmemmem\fP(3), \fBrindex\fP(3), \fBstrcasecmp\fP(3), \fBstrchr\fP(3), \fBstring\fP(3), \fBstrpbrk\fP(3), \fBstrsep\fP(3), \fBstrspn\fP(3), \fBstrtok\fP(3), \fBwcsstr\fP(3) .SH この文書について この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.79 の一部 である。プロジェクトの説明とバグ報告に関する情報は http://www.kernel.org/doc/man\-pages/ に書かれている。