OSDN Git Service

(split) LDP v3.30, v3.31 の定型的な変更内容を反映。
[linuxjm/LDP_man-pages.git] / draft / 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 .\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka
32 .\"     all rights reserved.
33 .\" Translated Tue Dec 16 10:06:54 JST 1997
34 .\"     by HIROFUMI Nishizuka <nishi@rpts.cl.nec.co.jp>
35 .\" Updated Sun Sep  5 JST 1999 by by Kentaro Shirakata <argrath@yo.rim.or.jp>
36 .\" Updated Wed Apr 20 JST 2005 by by Kentaro Shirakata <argrath@ub32.org>
37 .\"
38 .TH STRSTR 3  2010-09-20 "GNU" "Linux Programmer's Manual"
39 .\"O .SH NAME
40 .SH Ì¾Á°
41 .\"O strstr, strcasestr \- locate a substring
42 strstr, strcasestr \- Éôʬʸ»úÎó¤Î°ÌÃÖ¤ò¼¨¤¹
43 .\"O .SH SYNOPSIS
44 .SH ½ñ¼°
45 .nf
46 .B #include <string.h>
47 .sp
48 .BI "char *strstr(const char *" haystack ", const char *" needle );
49 .sp
50 .\"O .BR "#define _GNU_SOURCE" "         /* See feature_test_macros(7) */"
51 .BR "#define _GNU_SOURCE" "         /* feature_test_macros(7) »²¾È */"
52 .sp
53 .B #include <string.h>
54 .sp
55 .BI "char *strcasestr(const char *" haystack ", const char *" needle );
56 .fi
57 .\"O .SH DESCRIPTION
58 .SH ÀâÌÀ
59 .\"O The
60 .\"O .BR strstr ()
61 .\"O function finds the first occurrence of the substring
62 .\"O \fIneedle\fP in the string \fIhaystack\fP.
63 .\"O The terminating \(aq\\0\(aq characters are not compared.
64 .BR strstr ()
65 ´Ø¿ô¤Ï¡¢Éôʬʸ»úÎó \fIneedle\fP ¤¬Ê¸»úÎó \fIhaystack\fP Ãæ
66 ¤ÇºÇ½é¤Ë¸½¤ì¤ë°ÌÃÖ¤ò¸«¤Ä¤±¤ë¡£
67 ʸ»úÎó¤ò½ªÃ¼¤¹¤ë \(aq\\0\(aq Ê¸»ú¤ÏÈæ³Ó¤µ¤ì¤Ê¤¤¡£
68
69 .\"O The
70 .\"O .BR strcasestr ()
71 .\"O function is like
72 .\"O .BR strstr (),
73 .\"O but ignores the case of both arguments.
74 .BR strcasestr ()
75 ´Ø¿ô¤Ï
76 .BR strstr ()
77 ´Ø¿ô¤ÈƱÍͤÀ¤¬¡¢
78 ξÊý¤Î°ú¿ô¤ËÂФ·¤ÆÂçʸ»ú¾®Ê¸»ú¤ò̵»ë¤¹¤ë¡£
79 .\"O .SH "RETURN VALUE"
80 .SH ÊÖ¤êÃÍ
81 .\"O These functions return a pointer to the beginning of the
82 .\"O substring, or NULL if the substring is not found.
83 ¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢Éôʬʸ»úÎó¤Î³«»Ï¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤òÊÖ¤·¡¢
84 ¤â¤·Éôʬʸ»úÎ󤬸«¤Ä¤«¤é¤Ê¤¤¾ì¹ç¤Ï NULL ¤òÊÖ¤¹¡£
85 .\"O .SH "CONFORMING TO"
86 .SH ½àµò
87 .\"O The
88 .\"O .BR strstr ()
89 .\"O function conforms to C89 and C99.
90 .\"O The
91 .\"O .BR strcasestr ()
92 .\"O function is a nonstandard extension.
93 .BR strstr ()
94 ´Ø¿ô¤Ï C89 ¤È C99 ¤Ë½àµò¤·¤Æ¤¤¤ë¡£
95 .BR strcasestr ()
96 ´Ø¿ô¤ÏÈóɸ½à³ÈÄ¥¤Ç¤¢¤ë¡£
97 .\"O .SH BUGS
98 .SH ¥Ð¥°
99 .\"O Early versions of Linux libc (like 4.5.26) would not allow
100 .\"O an empty \fIneedle\fP argument for
101 .\"O .BR strstr ().
102 .\"O Later versions (like 4.6.27) work correctly,
103 .\"O and return \fIhaystack\fP when \fIneedle\fP is empty.
104 Linux libc ¤Î½é´ü¤Î¥Ð¡¼¥¸¥ç¥ó(4.5.26 ¤Þ¤Ç)¤Ï
105 .BR strstr ()
106 ´Ø¿ô¤Î \fIneedle\fP °ú¿ô¤Ë¶õʸ»úÎó¤ò»ØÄê¤Ç¤­¤Ê¤¤¡£
107 ºÇ¶á¤Î¥Ð¡¼¥¸¥ç¥ó(4.6.27 °Ê¹ß)¤ÏÀµ¤·¤¯Æ°ºî¤·¡¢
108 \fIneedle\fP ¤¬¶õ¤Î»þ¤Ï \fIhaystack\fP ¤òÊÖ¤¹¡£
109 .SH ´ØÏ¢¹àÌÜ
110 .BR index (3),
111 .BR memchr (3),
112 .BR rindex (3),
113 .BR strcasecmp (3),
114 .BR strchr (3),
115 .BR string (3),
116 .BR strpbrk (3),
117 .BR strsep (3),
118 .BR strspn (3),
119 .BR strtok (3),
120 .BR wcsstr (3)