OSDN Git Service

(split) LDP: Release pages for LDP v3.39.
[linuxjm/LDP_man-pages.git] / release / man3 / strstr.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 17:56:43 1993 by Rik Faith (faith@cs.unc.edu)
28 .\" Added history, aeb, 980113.
29 .\" 2005-05-05 mtk: added strcasestr()
30 .\"
31 .\"*******************************************************************
32 .\"
33 .\" This file was generated with po4a. Translate the source file.
34 .\"
35 .\"*******************************************************************
36 .TH STRSTR 3 2011\-09\-28 GNU "Linux Programmer's Manual"
37 .SH 名前
38 strstr, strcasestr \- 部分文字列の位置を示す
39 .SH 書式
40 .nf
41 \fB#include <string.h>\fP
42 .sp
43 \fBchar *strstr(const char *\fP\fIhaystack\fP\fB, const char *\fP\fIneedle\fP\fB);\fP
44 .sp
45 \fB#define _GNU_SOURCE\fP         /* feature_test_macros(7) 参照 */
46 .sp
47 \fB#include <string.h>\fP
48 .sp
49 \fBchar *strcasestr(const char *\fP\fIhaystack\fP\fB, const char *\fP\fIneedle\fP\fB);\fP
50 .fi
51 .SH 説明
52 \fBstrstr\fP()  関数は、部分文字列 \fIneedle\fP が文字列 \fIhaystack\fP 中 で最初に現れる位置を見つける。 文字列を終端
53 NULL バイト (\(aq\e0\(aq) は比較されない。
54
55 \fBstrcasestr\fP()  関数は \fBstrstr\fP()  関数と同様だが、 両方の引数に対して大文字小文字を無視する。
56 .SH 返り値
57 これらの関数は、部分文字列の開始を指すポインタを返し、 もし部分文字列が見つからない場合は NULL を返す。
58 .SH 準拠
59 \fBstrstr\fP()  関数は C89 と C99 に準拠している。 \fBstrcasestr\fP()  関数は非標準拡張である。
60 .SH バグ
61 Linux libc の初期のバージョン(4.5.26 まで)は \fBstrstr\fP()  関数の \fIneedle\fP 引数に空文字列を指定できない。
62 最近のバージョン(4.6.27 以降)は正しく動作し、 \fIneedle\fP が空の時は \fIhaystack\fP を返す。
63 .SH 関連項目
64 \fBindex\fP(3), \fBmemchr\fP(3), \fBrindex\fP(3), \fBstrcasecmp\fP(3), \fBstrchr\fP(3),
65 \fBstring\fP(3), \fBstrpbrk\fP(3), \fBstrsep\fP(3), \fBstrspn\fP(3), \fBstrtok\fP(3),
66 \fBwcsstr\fP(3)