1 |
/* |
/* |
|
FUNCTION |
|
|
<<memchr>>---find character in memory |
|
2 |
|
|
3 |
INDEX |
@deftypefn Supplemental void* memchr (const void *@var{s}, int @var{c}, size_t @var{n}) |
|
memchr |
|
4 |
|
|
5 |
ANSI_SYNOPSIS |
This function searches memory starting at @code{*@var{s}} for the |
6 |
#include <string.h> |
character @var{c}. The search only ends with the first occurrence of |
7 |
void *memchr(const void *<[src]>, int <[c]>, size_t <[length]>); |
@var{c}, or after @var{length} characters; in particular, a null |
8 |
|
character does not terminate the search. If the character @var{c} is |
9 |
|
found within @var{length} characters of @code{*@var{s}}, a pointer |
10 |
|
to the character is returned. If @var{c} is not found, then @code{NULL} is |
11 |
|
returned. |
12 |
|
|
13 |
TRAD_SYNOPSIS |
@end deftypefn |
|
#include <string.h> |
|
|
void *memchr(<[src]>, <[c]>, <[length]>) |
|
|
void *<[src]>; |
|
|
void *<[c]>; |
|
|
size_t <[length]>; |
|
|
|
|
|
DESCRIPTION |
|
|
This function searches memory starting at <<*<[src]>>> for the |
|
|
character <[c]>. The search only ends with the first |
|
|
occurrence of <[c]>, or after <[length]> characters; in |
|
|
particular, <<NULL>> does not terminate the search. |
|
|
|
|
|
RETURNS |
|
|
If the character <[c]> is found within <[length]> characters |
|
|
of <<*<[src]>>>, a pointer to the character is returned. If |
|
|
<[c]> is not found, then <<NULL>> is returned. |
|
|
|
|
|
PORTABILITY |
|
|
<<memchr>> requires no supporting OS subroutines. |
|
|
|
|
|
QUICKREF |
|
|
memchr ansi pure |
|
14 |
|
|
15 |
*/ |
*/ |
16 |
|
|
17 |
#include <ansidecl.h> |
#include <ansidecl.h> |
18 |
#ifdef __STDC__ |
#ifdef ANSI_PROTOTYPES |
19 |
#include <stddef.h> |
#include <stddef.h> |
20 |
#else |
#else |
21 |
#define size_t unsigned long |
#define size_t unsigned long |