OSDN Git Service

(split) Import translated manuals from JM CVS Repository.
[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  2008-08-11 "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 .B #define _GNU_SOURCE
54 .B #include <string.h>
55 .sp
56 .BI "char *strchrnul(const char *" s ", int " c );
57 .fi
58 .\"O .SH DESCRIPTION
59 .SH ÀâÌÀ
60 .\"O The
61 .\"O .BR strchr ()
62 .\"O function returns a pointer to the first occurrence
63 .\"O of the character \fIc\fP in the string \fIs\fP.
64 .BR strchr ()
65 ´Ø¿ô¤Ï¡¢Ê¸»úÎó \fIs\fP Ãæ¤ËºÇ½é¤Ëʸ»ú \fIc\fP
66 ¤¬¸½¤ì¤¿°ÌÃ֤ؤΥݥ¤¥ó¥¿¤òÊÖ¤¹¡£
67 .PP
68 .\"O The
69 .\"O .BR strrchr ()
70 .\"O function returns a pointer to the last occurrence
71 .\"O of the character \fIc\fP in the string \fIs\fP.
72 .BR strrchr ()
73 ´Ø¿ô¤Ï¡¢Ê¸»úÎó \fIs\fP Ãæ¤ËºÇ¸å¤Ëʸ»ú \fIc\fP
74 ¤¬¸½¤ì¤¿°ÌÃ֤ؤΥݥ¤¥ó¥¿¤òÊÖ¤¹¡£
75 .PP
76 .\"O The \fBstrchrnul\fP() function is like
77 .\"O .BR strchr ()
78 .\"O except that if \fIc\fP is not found in \fIs\fP,
79 .\"O then it returns a pointer to the null byte
80 .\"O at the end of \fIs\fP, rather than NULL.
81 .BR strchrnul ()
82 ´Ø¿ô¤Ï
83 .BR strchr ()
84 ¤ÈƱÍͤÀ¤¬¡¢
85 \fIc\fP ¤¬ \fIs\fP Ãæ¤Ë¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¡¢ÊÖ¤êÃͤȤ·¤Æ
86 NULL ¤Ç¤Ê¤¯¡¢\fIs\fP ¤ÎËöÈø¤Î¥Ì¥ë¥Ð¥¤¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹ÅÀ¤¬°Û¤Ê¤ë¡£
87 .PP
88 .\"O Here "character" means "byte"; these functions do not work with
89 .\"O wide or multibyte characters.
90 ¤³¤³¤Ç¤¤¤¦¡Öʸ»ú¡×¤Ï¡Ö¥Ð¥¤¥È¡×¤Î°ÕÌ£¤Ê¤Î¤Ç¡¢
91 ¤³¤ì¤é¤Î´Ø¿ô¤Ï¥ï¥¤¥Éʸ»ú¤ä¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»ú¤Ç¤ÏÆ°ºî¤·¤Ê¤¤¡£
92 .\"O .SH "RETURN VALUE"
93 .SH ÊÖ¤êÃÍ
94 .\"O The
95 .\"O .BR strchr ()
96 .\"O and
97 .\"O .BR strrchr ()
98 .\"O functions return a pointer to
99 .\"O the matched character or NULL if the character is not found.
100 .BR strchr ()
101 ¤È
102 .BR strrchr ()
103 ´Ø¿ô¤Ï°ìÃפ·¤¿Ê¸»ú¤Ø¤Î¥Ý¥¤¥ó¥¿¤ò
104 ÊÖ¤·¡¢¤â¤·Ê¸»ú¤¬¸«¤Ä¤«¤é¤Ê¤¤¾ì¹ç¤Ï NULL ¤òÊÖ¤¹¡£
105
106 .\"O The
107 .\"O .BR strchrnul ()
108 .\"O function returns a pointer to
109 .\"O the matched character,
110 .\"O or a pointer to the null
111 .\"O byte at the end of \fIs\fP (i.e., \fIs+strlen(s)\fP)
112 .\"O if the character is not found.
113 .BR strchrnul ()
114 ´Ø¿ô¤Ï°ìÃפ·¤¿Ê¸»ú¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£
115 ʸ»ú¤¬¸«¤Ä¤«¤é¤Ê¤¤¾ì¹ç¤Ï¡¢\fIs\fP ¤ÎËöÈø¤Î¥Ì¥ë¥Ð¥¤¥È¤Ø¤Î
116 ¥Ý¥¤¥ó¥¿ (¤Ä¤Þ¤ê \fIs+strlen(s)\fP) ¤òÊÖ¤¹¡£
117 .\"O .SH VERSIONS
118 .SH ¥Ð¡¼¥¸¥ç¥ó
119 .\"O .BR strchrnul ()
120 .\"O first appeared in glibc in version 2.1.1.
121 .BR strchrnul ()
122 ¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.1.1 ¤Ç½é¤á¤ÆÅо줷¤¿¡£
123 .\"O .SH "CONFORMING TO"
124 .SH ½àµò
125 .\"O .BR strchr ()
126 .\"O and
127 .\"O .BR strrchr ()
128 .\"O are in SVr4, 4.3BSD, C89, C99.
129 .\"O .BR strchrnul ()
130 .\"O is a GNU extension.
131 .BR strchr ()
132 ¤È
133 .BR strrchr ()
134 ¤Ï SVr4, 4.3BSD, C89, C99 ¤Ë½àµò¤·¤Æ¤¤¤ë¡£
135 .BR strchrnul ()
136 ¤Ï GNU ³ÈÄ¥¤Ç¤¢¤ë¡£
137 .\"O .SH "SEE ALSO"
138 .SH ´ØÏ¢¹àÌÜ
139 .BR index (3),
140 .BR memchr (3),
141 .BR rindex (3),
142 .BR strlen (3),
143 .BR strpbrk (3),
144 .BR strsep (3),
145 .BR strspn (3),
146 .BR strstr (3),
147 .BR strtok (3),
148 .BR wcschr (3),
149 .BR wcsrchr (3),
150 .BR feature_test_macros (7)