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 .\" Modified Mon Apr 12 12:49:57 1993, David Metcalfe
24 .\" Modified Sat Jul 24 18:56:22 1993, Rik Faith (faith@cs.unc.edu)
25 .\" Modified Wed Feb 20 21:09:36 2002, Ian Redfern (redferni@logica.com)
27 .TH MEMCHR 3 2003-11-01 "" "Linux Programmer's Manual"
29 memchr, memrchr \- scan memory for a character
32 .B #include <string.h>
34 .BI "void *memchr(const void *" s ", int " c ", size_t " n );
36 .BI "void *memrchr(const void *" s ", int " c ", size_t " n );
41 function scans the first \fIn\fP bytes of the memory
42 area pointed to by \fIs\fP for the character \fIc\fP. The first byte to
43 match \fIc\fP (interpreted as an unsigned character) stops the operation.
50 except that it searches backwards from the end of the \fIn\fP bytes
51 pointed to by \fIs\fP instead of forwards from the front.
53 The \fBmemchr\fP() and \fBmemrchr\fP() functions return a pointer
54 to the matching byte or NULL if the character does not occur in
55 the given memory area.
59 function conforms to SVr4, 4.3BSD, C89, C99, POSIX.1-2001.
62 function is a GNU extension, available since glibc 2.1.91.