]>
Commit | Line | Data |
---|---|---|
fea681da MK |
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. | |
c13182ef | 11 | .\" |
fea681da MK |
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. | |
c13182ef | 19 | .\" |
fea681da MK |
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 | |
c13182ef | 39 | The |
63aa9df0 | 40 | .BR memchr () |
fea681da | 41 | function scans the first \fIn\fP bytes of the memory |
1c44bd5b MK |
42 | area pointed to by \fIs\fP for the character \fIc\fP. |
43 | The first byte to | |
fea681da MK |
44 | match \fIc\fP (interpreted as an unsigned character) stops the operation. |
45 | .PP | |
c13182ef | 46 | The |
63aa9df0 | 47 | .BR memrchr () |
c13182ef | 48 | function is like the |
63aa9df0 | 49 | .BR memchr () |
fea681da MK |
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" | |
63aa9df0 | 54 | The \fBmemchr\fP() and \fBmemrchr\fP() functions return a pointer |
fea681da MK |
55 | to the matching byte or NULL if the character does not occur in |
56 | the given memory area. | |
57 | .SH "CONFORMING TO" | |
c13182ef | 58 | The |
63aa9df0 | 59 | .BR memchr () |
1eb85d14 | 60 | function conforms to SVr4, 4.3BSD, C89, C99, POSIX.1-2001. |
c13182ef | 61 | The |
63aa9df0 | 62 | .BR memrchr () |
fea681da MK |
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) |