OSDN Git Service

(split) LDP_man-pages: release ioctl.2 [JM:00378]
[linuxjm/LDP_man-pages.git] / draft / man3 / strchr.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 Mon Apr 12 12:51:24 1993, David Metcalfe
28 .\" 2006-05-19, Justin Pryzby <pryzbyj@justinpryzby.com>
29 .\"     Document strchrnul(3).
30 .\"
31 .\"
32 .\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka
33 .\"     all rights reserved.
34 .\" Translated Tue Dec 16 10:29:05 JST 1997
35 .\"     by HIROFUMI Nishizuka <nishi@rpts.cl.nec.co.jp>
36 .\" Updated & Modified 2001-10-16, Yuichi SATO <ysato@h4.dion.ne.jp>
37 .\" Updated 2006-07-20, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
38 .\"
39 .TH STRCHR 3  2010-09-20 "GNU" "Linux Programmer's Manual"
40 .\"O .SH NAME
41 .SH Ì¾Á°
42 .\"O strchr, strrchr, strchrnul \- locate character in string
43 strchr, strrchr, strchrnul \- Ê¸»úÎóÃæ¤Îʸ»ú¤Î°ÌÃÖ¤òÆÃÄꤹ¤ë
44 .\"O .SH SYNOPSIS
45 .SH ½ñ¼°
46 .nf
47 .B #include <string.h>
48 .sp
49 .BI "char *strchr(const char *" s ", int " c );
50 .sp
51 .BI "char *strrchr(const char *" s ", int " c );
52 .sp
53 .\"O .BR "#define _GNU_SOURCE" "         /* See feature_test_macros(7) */"
54 .BR "#define _GNU_SOURCE" "         /* feature_test_macros(7) »²¾È */"
55 .B #include <string.h>
56 .sp
57 .BI "char *strchrnul(const char *" s ", int " c );
58 .fi
59 .\"O .SH DESCRIPTION
60 .SH ÀâÌÀ
61 .\"O The
62 .\"O .BR strchr ()
63 .\"O function returns a pointer to the first occurrence
64 .\"O of the character \fIc\fP in the string \fIs\fP.
65 .BR strchr ()
66 ´Ø¿ô¤Ï¡¢Ê¸»úÎó \fIs\fP Ãæ¤ËºÇ½é¤Ëʸ»ú \fIc\fP
67 ¤¬¸½¤ì¤¿°ÌÃ֤ؤΥݥ¤¥ó¥¿¤òÊÖ¤¹¡£
68 .PP
69 .\"O The
70 .\"O .BR strrchr ()
71 .\"O function returns a pointer to the last occurrence
72 .\"O of the character \fIc\fP in the string \fIs\fP.
73 .BR strrchr ()
74 ´Ø¿ô¤Ï¡¢Ê¸»úÎó \fIs\fP Ãæ¤ËºÇ¸å¤Ëʸ»ú \fIc\fP
75 ¤¬¸½¤ì¤¿°ÌÃ֤ؤΥݥ¤¥ó¥¿¤òÊÖ¤¹¡£
76 .PP
77 .\"O The \fBstrchrnul\fP() function is like
78 .\"O .BR strchr ()
79 .\"O except that if \fIc\fP is not found in \fIs\fP,
80 .\"O then it returns a pointer to the null byte
81 .\"O at the end of \fIs\fP, rather than NULL.
82 .BR strchrnul ()
83 ´Ø¿ô¤Ï
84 .BR strchr ()
85 ¤ÈƱÍͤÀ¤¬¡¢
86 \fIc\fP ¤¬ \fIs\fP Ãæ¤Ë¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¡¢ÊÖ¤êÃͤȤ·¤Æ
87 NULL ¤Ç¤Ê¤¯¡¢\fIs\fP ¤ÎËöÈø¤Î¥Ì¥ë¥Ð¥¤¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹ÅÀ¤¬°Û¤Ê¤ë¡£
88 .PP
89 .\"O Here "character" means "byte"; these functions do not work with
90 .\"O wide or multibyte characters.
91 ¤³¤³¤Ç¤¤¤¦¡Öʸ»ú¡×¤Ï¡Ö¥Ð¥¤¥È¡×¤Î°ÕÌ£¤Ê¤Î¤Ç¡¢
92 ¤³¤ì¤é¤Î´Ø¿ô¤Ï¥ï¥¤¥Éʸ»ú¤ä¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»ú¤Ç¤ÏÆ°ºî¤·¤Ê¤¤¡£
93 .\"O .SH "RETURN VALUE"
94 .SH ÊÖ¤êÃÍ
95 .\"O The
96 .\"O .BR strchr ()
97 .\"O and
98 .\"O .BR strrchr ()
99 .\"O functions return a pointer to
100 .\"O the matched character or NULL if the character is not found.
101 .BR strchr ()
102 ¤È
103 .BR strrchr ()
104 ´Ø¿ô¤Ï°ìÃפ·¤¿Ê¸»ú¤Ø¤Î¥Ý¥¤¥ó¥¿¤ò
105 ÊÖ¤·¡¢¤â¤·Ê¸»ú¤¬¸«¤Ä¤«¤é¤Ê¤¤¾ì¹ç¤Ï NULL ¤òÊÖ¤¹¡£
106
107 .\"O The
108 .\"O .BR strchrnul ()
109 .\"O function returns a pointer to
110 .\"O the matched character,
111 .\"O or a pointer to the null
112 .\"O byte at the end of \fIs\fP (i.e., \fIs+strlen(s)\fP)
113 .\"O if the character is not found.
114 .BR strchrnul ()
115 ´Ø¿ô¤Ï°ìÃפ·¤¿Ê¸»ú¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£
116 ʸ»ú¤¬¸«¤Ä¤«¤é¤Ê¤¤¾ì¹ç¤Ï¡¢\fIs\fP ¤ÎËöÈø¤Î¥Ì¥ë¥Ð¥¤¥È¤Ø¤Î
117 ¥Ý¥¤¥ó¥¿ (¤Ä¤Þ¤ê \fIs+strlen(s)\fP) ¤òÊÖ¤¹¡£
118 .\"O .SH VERSIONS
119 .SH ¥Ð¡¼¥¸¥ç¥ó
120 .\"O .BR strchrnul ()
121 .\"O first appeared in glibc in version 2.1.1.
122 .BR strchrnul ()
123 ¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.1.1 ¤Ç½é¤á¤ÆÅо줷¤¿¡£
124 .\"O .SH "CONFORMING TO"
125 .SH ½àµò
126 .\"O .BR strchr ()
127 .\"O and
128 .\"O .BR strrchr ()
129 .\"O are in SVr4, 4.3BSD, C89, C99.
130 .\"O .BR strchrnul ()
131 .\"O is a GNU extension.
132 .BR strchr ()
133 ¤È
134 .BR strrchr ()
135 ¤Ï SVr4, 4.3BSD, C89, C99 ¤Ë½àµò¤·¤Æ¤¤¤ë¡£
136 .BR strchrnul ()
137 ¤Ï GNU ³ÈÄ¥¤Ç¤¢¤ë¡£
138 .\"O .SH "SEE ALSO"
139 .SH ´ØÏ¢¹àÌÜ
140 .BR index (3),
141 .BR memchr (3),
142 .BR rindex (3),
143 .BR string (3),
144 .BR strlen (3),
145 .BR strpbrk (3),
146 .BR strsep (3),
147 .BR strspn (3),
148 .BR strstr (3),
149 .BR strtok (3),
150 .BR wcschr (3),
151 .BR wcsrchr (3)