OSDN Git Service

76db725b1e6b525ecfd68c5a12bee2e6cc7b8b8e
[linuxjm/LDP_man-pages.git] / release / man3 / memchr.3
1 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
2 .\" and Copyright (c) 2008 Linux Foundation, written by Michael Kerrisk
3 .\"     <mtk.manpages@gmail.com>
4 .\"
5 .\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka
6 .\"     all rights reserved.
7 .\" Translated 1997-12-16, HIROFUMI Nishizuka <nishi@rpts.cl.nec.co.jp>
8 .\" Updated & Modified 2002-03-24, Yuichi SATO <ysato@h4.dion.ne.jp>
9 .\" Updated & Modified 2003-11-27, Yuichi SATO <ysato444@yahoo.co.jp>
10 .\" Updated 2008-08-11, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
11 .\"
12 .\" Permission is granted to make and distribute verbatim copies of this
13 .\" manual provided the copyright notice and this permission notice are
14 .\" preserved on all copies.
15 .\"
16 .\" Permission is granted to copy and distribute modified versions of this
17 .\" manual under the conditions for verbatim copying, provided that the
18 .\" entire resulting derived work is distributed under the terms of a
19 .\" permission notice identical to this one.
20 .\"
21 .\" Since the Linux kernel and libraries are constantly changing, this
22 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
23 .\" responsibility for errors or omissions, or for damages resulting from
24 .\" the use of the information contained herein.  The author(s) may not
25 .\" have taken the same level of care in the production of this manual,
26 .\" which is licensed free of charge, as they might when working
27 .\" professionally.
28 .\"
29 .\" Formatted or processed versions of this manual, if unaccompanied by
30 .\" the source, must acknowledge the copyright and authors of this work.
31 .\"
32 .\" Modified Mon Apr 12 12:49:57 1993, David Metcalfe
33 .\" Modified Sat Jul 24 18:56:22 1993, Rik Faith (faith@cs.unc.edu)
34 .\" Modified Wed Feb 20 21:09:36 2002, Ian Redfern (redferni@logica.com)
35 .\" 2008-07-09, mtk, add rawmemchr()
36 .\"
37 .TH MEMCHR 3  2009-12-04 "" "Linux Programmer's Manual"
38 .SH Ì¾Á°
39 memchr, memrchr, rawmemchr \- Ê¸»ú¤òõ¤¹¤¿¤á¤Ë¥á¥â¥ê¤ò¥¹¥­¥ã¥ó¤¹¤ë
40 .SH ½ñ¼°
41 .nf
42 .B #include <string.h>
43
44 .BI "void *memchr(const void *" s ", int " c ", size_t " n );
45
46 .BI "void *memrchr(const void *" s ", int " c ", size_t " n );
47
48 .BI "void *rawmemchr(const void *" s ", int " c );
49 .fi
50 .sp
51 .in -4n
52 glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
53 .RB ( feature_test_macros (7)
54 »²¾È):
55 .in
56 .sp
57 .BR memrchr ():
58 .BR rawmemchr ():
59 _GNU_SOURCE
60 .SH ÀâÌÀ
61 .BR memchr ()
62 ´Ø¿ô¤Ï¡¢¥Ý¥¤¥ó¥¿ \fIs\fP ¤¬»Ø¤·¼¨¤¹¥á¥â¥ê¥Ö¥í¥Ã¥¯¤Î
63 ÀèƬ¤Î \fIn\fP ¥Ð¥¤¥È¤«¤éʸ»ú \fIc\fP ¤òõ¤¹¡£
64 ºÇ½é¤Ë \fIc\fP (unsigned char ¤È²ò¼á¤µ¤ì¤ë) ¤¬¸«¤Ä¤«¤Ã¤¿»þÅÀ¤ÇÆ°ºî¤¬Ää»ß¤¹¤ë¡£
65 .PP
66 .BR memrchr ()
67 ´Ø¿ô¤Ï
68 .BR memchr ()
69 ´Ø¿ô¤Ë»÷¤Æ¤¤¤ë¤¬¡¢
70 ÀèƬ¤«¤é½çÊý¸þ¤Ëõ¤¹¤Î¤Ç¤Ï¤Ê¤¯¡¢
71 ¥Ý¥¤¥ó¥¿ \fIs\fP ¤¬»Ø¤·¼¨¤¹ \fIn\fP ¥Ð¥¤¥È¤Î¥á¥â¥ê¥Ö¥í¥Ã¥¯¤Î
72 ËöÈø¤«¤éµÕ¸þ¤­¤Ëõ¤¹¡£
73
74 .BR rawmemchr ()
75 ´Ø¿ô¤Ï
76 .BR memchr ()
77 ¤ÈƱÍͤÀ¤¬¡¢
78 ʸ»ú
79 .I c
80 ¤¬Ê¸»úÎó
81 .I s
82 Æâ¤Î¤É¤³¤«¤Ë¤¢¤ë¤³¤È¤òÁ°Äó¤Ë¤·¤Æ
83 (¤Ä¤Þ¤ê¡¢¥×¥í¥°¥é¥Þ¤Ï¤½¤Î¤³¤È¤òÃΤäƤ¤¤ë)¡¢
84 ºÇŬ²½¤·¤¿ÊýË¡¤Çʸ»ú
85 .I c
86 ¤Î¸¡º÷¤ò¼Â¹Ô¤¹¤ë
87 (¤¹¤Ê¤ï¤Á¡¢½ªÃ¼¤Î NULL ¥Ð¥¤¥È¤Î¥Á¥§¥Ã¥¯¤â¹Ô¤ï¤ì¤Ê¤¤¤·¡¢
88 ¸¡º÷ÈϰϤξå¸Â¤ò¼¨¤¹°ú¤­¿ô
89 .I n
90 ¤â»ÈÍѤµ¤ì¤Ê¤¤)¡£
91 ʸ»ú
92 .I c
93 ¤¬Ê¸»úÎó
94 .I s
95 Æâ¤Ë¤Ê¤¤¾ì¹ç¡¢
96 .BR rawmemchr ()
97 ¤Ïʸ»úÎóËöÈø¤ò±Û¤¨¤Æ¸¡º÷¤ò¼Â¹Ô¤¹¤ë¤«¤â¤·¤ì¤º¡¢·ë²Ì¤ÏÉÔÄê¤Ç¤¢¤ë¡£
98 ¼¡¤Ë¼¨¤¹¸Æ¤Ó½Ð¤·¤Ï¡¢Ê¸»úÎó½ªÃ¼¤Î NULL ¥Ð¥¤¥È¤Î°ÌÃÖ¤òÆÃÄꤹ¤ë
99 ¹â®¤Ê¼êÃʤǤ¢¤ë¡£
100 .in +4n
101 .nf
102
103 char *p = rawmemchr(s,\ \(aq\\0\(aq);
104 .fi
105 .in
106 .SH ÊÖ¤êÃÍ
107 .BR memchr ()
108 ´Ø¿ô¤È
109 .BR memrchr ()
110 ´Ø¿ô¤Ï°ìÃפ¹¤ëʸ»ú¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤·¡¢
111 ¤â¤·Ê¸»ú¤¬»ØÄê¥á¥â¥êÎΰè¤Ë¸½¤ì¤Ê¤¤¾ì¹ç¤Ï NULL ¤òÊÖ¤¹¡£
112
113 .BR rawmemchr ()
114 ´Ø¿ô¤Ï¥Þ¥Ã¥Á¤¹¤ë¥Ð¥¤¥È¤¬¸«¤Ä¤«¤Ã¤¿¾ì¹ç¤Ï¥Þ¥Ã¥Á¤·¤¿¥Ð¥¤¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£
115 ¥Þ¥Ã¥Á¤¹¤ë¥Ð¥¤¥È¤¬¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¾ì¹ç¡¢·ë²Ì¤ÏÉÔÄê¤Ç¤¢¤ë¡£
116 .SH ¥Ð¡¼¥¸¥ç¥ó
117 .BR rawmemchr ()
118 ¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.1 ¤Ç½é¤á¤ÆÅо줷¤¿¡£
119
120 .BR memrchr ()
121 ¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.2 ¤Ç½é¤á¤ÆÅо줷¤¿¡£
122 .SH ½àµò
123 .BR memchr ()
124 ´Ø¿ô¤Ï SVr4, 4.3BSD, C89, C99, POSIX.1-2001 ¤Ë½àµò¤¹¤ë¡£
125
126 .BR memrchr ()
127 ´Ø¿ô¤Ï GNU ³ÈÄ¥¤Ç¤¢¤ê¡¢glibc 2.1.91 ¤«¤é»ÈÍѲÄǽ¤Ç¤¢¤ë¡£
128
129 .BR rawmemchr ()
130 ´Ø¿ô¤Ï GNU ³ÈÄ¥¤Ç¤¢¤ê¡¢glibc 2.1 ¤«¤é»ÈÍѲÄǽ¤Ç¤¢¤ë¡£
131 .SH ´ØÏ¢¹àÌÜ
132 .BR ffs (3),
133 .BR index (3),
134 .BR rindex (3),
135 .BR strchr (3),
136 .BR strpbrk (3),
137 .BR strrchr (3),
138 .BR strsep (3),
139 .BR strspn (3),
140 .BR strstr (3),
141 .BR wmemchr (3)