Changeset 609 for branches/GNU/src/binutils/libiberty/memchr.c
- Timestamp:
- Aug 16, 2003, 6:59:22 PM (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GNU/src/binutils/libiberty/memchr.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 1 1 /* 2 FUNCTION3 <<memchr>>---find character in memory4 2 5 INDEX 6 memchr 3 @deftypefn Supplemental void* memchr (const void *@var{s}, int @var{c}, size_t @var{n}) 7 4 8 ANSI_SYNOPSIS 9 #include <string.h> 10 void *memchr(const void *<[src]>, int <[c]>, size_t <[length]>); 5 This function searches memory starting at @code{*@var{s}} for the 6 character @var{c}. The search only ends with the first occurrence of 7 @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. 11 12 12 TRAD_SYNOPSIS 13 #include <string.h> 14 void *memchr(<[src]>, <[c]>, <[length]>) 15 void *<[src]>; 16 void *<[c]>; 17 size_t <[length]>; 18 19 DESCRIPTION 20 This function searches memory starting at <<*<[src]>>> for the 21 character <[c]>. The search only ends with the first 22 occurrence of <[c]>, or after <[length]> characters; in 23 particular, <<NULL>> does not terminate the search. 24 25 RETURNS 26 If the character <[c]> is found within <[length]> characters 27 of <<*<[src]>>>, a pointer to the character is returned. If 28 <[c]> is not found, then <<NULL>> is returned. 29 30 PORTABILITY 31 <<memchr>> requires no supporting OS subroutines. 32 33 QUICKREF 34 memchr ansi pure 13 @end deftypefn 35 14 36 15 */ 37 16 38 17 #include <ansidecl.h> 39 #ifdef __STDC__18 #ifdef ANSI_PROTOTYPES 40 19 #include <stddef.h> 41 20 #else … … 51 30 const unsigned char *src = (const unsigned char *)src_void; 52 31 53 while ( --length >=0)32 while (length-- > 0) 54 33 { 55 34 if (*src == c) -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.