1 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
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.
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.
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
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" References consulted:
24 .\" Linux libc source code
26 .\" Modified Sat Jul 24 18:50:48 1993 by Rik Faith (faith@cs.unc.edu)
27 .\" Interchanged 'needle' and 'haystack'; added history, aeb, 980113.
29 .\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka
30 .\" all rights reserved.
31 .\" Translated Wed Dec 17 12:11:20 JST 1997
32 .\" by HIROFUMI Nishizuka <nishi@rpts.cl.nec.co.jp>
34 .TH MEMMEM 3 2008-12-05 "GNU" "Linux Programmer's Manual"
36 memmem \- Éôʬʸ»úÎó¤Î°ÌÃÖ¤ò¼¨¤¹
39 .B #define _GNU_SOURCE
40 .B #include <string.h>
42 .BI "void *memmem(const void *" haystack ", size_t " haystacklen ,
43 .BI " const void *" needle ", size_t " needlelen );
48 \fIhaystacklen\fP ¤ÎÂ礤µ¤ò»ý¤Ä¥á¥â¥êÎΰè \fIhaystack\fP ¤ÎÃæ¤Ç
49 \fIneedlelen\fP ¤ÎÂ礤µ¤ò»ý¤ÄÉôʬʸ»úÎó \fIneedle\fP ¤¬
50 ºÇ½é¤Ë¸½¤ì¤ë°ÌÃÖ¤ò¸«¤Ä¤±¤ë¡£
53 ´Ø¿ô¤Ï¡¢Éôʬʸ»úÎó¤Î³«»Ï¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤òÊÖ¤·¡¢¤â¤·Éôʬʸ»úÎó¤¬
54 ¸«¤Ä¤«¤é¤Ê¤¤¾ì¹ç¤Ï NULL ¤òÊÖ¤¹¡£
56 ¤³¤Î´Ø¿ô¤Ï GNU extension ¤Ç¤¢¤ë¡£
58 Linux ¤Î¥é¥¤¥Ö¥é¥ê¤Ë´Ø¤·¤Æ¤¤¤¦¤È¡¢ libc 5.0.9 ¤È
59 ¤½¤ì°ÊÁ°¤Î¤¹¤Ù¤Æ¤Î¥Ð¡¼¥¸¥ç¥ó¤Ç¡¢¤³¤Î´Ø¿ô¤Ï²õ¤ì¤Æ¤¤¤ë¡£
60 ¤½¤ì¤é¤Î¥é¥¤¥Ö¥é¥ê¤Ç¤Ï \fIneedle\fP ¤È \fIhaystack\fP °ú¿ô¤¬
61 Æþ¤ìÂؤï¤Ã¤Æ¤ª¤ê¡¢ \fIneedle\fP ¤¬ºÇ½é¤Ë½Ð¸½¤¹¤ëÉôʬ¤ÎºÇ¸å¤ò
62 ¼¨¤¹¥Ý¥¤¥ó¥¿¤¬ÊÖ¤µ¤ì¤Æ¤¤¤¿¤Î¤Ç¤¢¤ë¡£
64 ¿·µìξÊý¤Î libc ¥é¥¤¥Ö¥é¥ê¤¬¡¢
65 \fIneedle\fP ¤¬¶õ¤Î¾ì¹ç (\fIhaystack\fP ¤Î¤«¤ï¤ê¤Ë) \fIhaystack-1\fP\ ¤¬
66 ÊÖ¤µ¤ì¤ë¤È¤¤¤¦¥Ð¥°¤ò»ý¤Ã¤Æ¤¤¤ë¡£
67 ¤½¤·¤Æ¡¢glibc 2.0 ¤Ç¤Ï¤µ¤é¤Ë°¤¯¤Ê¤Ã¤Æ¤ª¤ê¡¢
68 \fIhaystack\fP ¤ÎºÇ¸å¤Î¥Ð¥¤¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£
69 ¤³¤ì¤Ï glibc 2.1 ¤Ç½¤Àµ¤µ¤ì¤¿¡£
72 .BR feature_test_macros (7)