]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/memchr.3
Wrap long lines; start sentences on new lines
[thirdparty/man-pages.git] / man3 / memchr.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 .\" 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)
26 .\"
27 .TH MEMCHR 3 2003-11-01 "" "Linux Programmer's Manual"
28 .SH NAME
29 memchr, memrchr \- scan memory for a character
30 .SH SYNOPSIS
31 .nf
32 .B #include <string.h>
33 .sp
34 .BI "void *memchr(const void *" s ", int " c ", size_t " n );
35 .sp
36 .BI "void *memrchr(const void *" s ", int " c ", size_t " n );
37 .fi
38 .SH DESCRIPTION
39 The
40 .BR memchr ()
41 function scans the first \fIn\fP bytes of the memory
42 area pointed to by \fIs\fP for the character \fIc\fP.
43 The first byte to
44 match \fIc\fP (interpreted as an unsigned character) stops the operation.
45 .PP
46 The
47 .BR memrchr ()
48 function is like the
49 .BR memchr ()
50 function,
51 except that it searches backwards from the end of the \fIn\fP bytes
52 pointed to by \fIs\fP instead of forwards from the front.
53 .SH "RETURN VALUE"
54 The \fBmemchr\fP() and \fBmemrchr\fP() functions return a pointer
55 to the matching byte or NULL if the character does not occur in
56 the given memory area.
57 .SH "CONFORMING TO"
58 The
59 .BR memchr ()
60 function conforms to SVr4, 4.3BSD, C89, C99, POSIX.1-2001.
61 The
62 .BR memrchr ()
63 function is a GNU extension, available since glibc 2.1.91.
64 .SH "SEE ALSO"
65 .BR index (3),
66 .BR rindex (3),
67 .BR strchr (3),
68 .BR strpbrk (3),
69 .BR strrchr (3),
70 .BR strsep (3),
71 .BR strspn (3),
72 .BR strstr (3),
73 .BR wmemchr (3)