Ignore:
Timestamp:
Aug 16, 2003, 6:59:22 PM (22 years ago)
Author:
bird
Message:

binutils v2.14 - offical sources.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/GNU/src/binutils/libiberty/memchr.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.1.1.2
    r608 r609  
    11/*
    2 FUNCTION
    3         <<memchr>>---find character in memory
    42
    5 INDEX
    6         memchr
     3@deftypefn Supplemental void* memchr (const void *@var{s}, int @var{c}, size_t @var{n})
    74
    8 ANSI_SYNOPSIS
    9         #include <string.h>
    10         void *memchr(const void *<[src]>, int <[c]>, size_t <[length]>);
     5This function searches memory starting at @code{*@var{s}} for the
     6character @var{c}.  The search only ends with the first occurrence of
     7@var{c}, or after @var{length} characters; in particular, a null
     8character does not terminate the search.  If the character @var{c} is
     9found within @var{length} characters of @code{*@var{s}}, a pointer
     10to the character is returned.  If @var{c} is not found, then @code{NULL} is
     11returned.
    1112
    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
    3514
    3615*/
    3716
    3817#include <ansidecl.h>
    39 #ifdef __STDC__
     18#ifdef ANSI_PROTOTYPES
    4019#include <stddef.h>
    4120#else
     
    5130  const unsigned char *src = (const unsigned char *)src_void;
    5231 
    53   while (--length >= 0)
     32  while (length-- > 0)
    5433  {
    5534    if (*src == c)
Note: See TracChangeset for help on using the changeset viewer.