1997-08-22 00:57:35 +02:00
|
|
|
/*
|
|
|
|
|
configure.in (MAKEINFO, PERL): Detect these.
* configure.in (MAKEINFO, PERL): Detect these.
(--enable-maintainer-mode): Add.
* configure: Regenerate.
* Makefile.in (MAKEINFO, PERL): Define.
(libiberty.info, libiberty.dvi, libiberty.html): New.
(CFILES): Add bsearch.c.
(CONFIGURED_OFILES): New, list of objects configure might add.
(maint-missing, maint-buildall): New, for maintainers only.
(clean, mostlyclean): Add info/dvi/html files.
* libiberty.texi, copying-lib.texi, obstacks.texi, functions.texi: New.
* gather-docs: New, for maintainers.
* maint-tool: New, for maintainers.
* alloca.c, atexit.c, basename.c, bcmp.c, bcopy.c, bsearch.c,
bzero.c, calloc.c, clock.c, configure.in, configure, getcwd.c,
getpagesize.c, getpwd.c, index.c, memchr.c, memcmp.c, memcpy.c,
memmove.c, memset.c, putenv.c, rename.c, rindex.c, setenv.c,
sigsetmask.c, strcasecmp.c, strchr.c, strdup.c, strerror.c,
strncasecmp.c, strncmp.c, strrchr.c, strstr.c, strtod.c, strtol.c,
tmpnam.c, vfork.c, vprintf.c, waitpid.c, xatexit.c, xexit.c,
xmalloc.c, xmemdup.c, xstrdup.c, xstrerror.c: Add or update
documentation.
Co-Authored-By: Phil Edwards <pedwards@disaster.jaj.com>
From-SVN: r45828
2001-09-26 20:16:17 +02:00
|
|
|
@deftypefn Supplemental void* memchr (const void *@var{s}, int @var{c}, size_t @var{n})
|
1997-08-22 00:57:35 +02:00
|
|
|
|
alloca.c, [...]: Improve manual formatting.
* alloca.c, clock.c, getcwd.c, getpagesize.c, getpwd.c, index.c,
libiberty.texi, memchr.c, putenv.c, rindex.c, strchr.c, strdup.c,
strerror.c, strrchr.c, strstr.c, strtod.c, tmpnam.c, vfork.c,
xatexit.c, xmalloc.c, xstrerror.c: Improve manual formatting. Fix
spelling. Give names to function arguments in documentation. Use
(void) prototypes in documentation.
* functions.texi: Regenerate.
From-SVN: r46068
2001-10-07 23:53:31 +02:00
|
|
|
This function searches memory starting at @code{*@var{s}} for the
|
configure.in (MAKEINFO, PERL): Detect these.
* configure.in (MAKEINFO, PERL): Detect these.
(--enable-maintainer-mode): Add.
* configure: Regenerate.
* Makefile.in (MAKEINFO, PERL): Define.
(libiberty.info, libiberty.dvi, libiberty.html): New.
(CFILES): Add bsearch.c.
(CONFIGURED_OFILES): New, list of objects configure might add.
(maint-missing, maint-buildall): New, for maintainers only.
(clean, mostlyclean): Add info/dvi/html files.
* libiberty.texi, copying-lib.texi, obstacks.texi, functions.texi: New.
* gather-docs: New, for maintainers.
* maint-tool: New, for maintainers.
* alloca.c, atexit.c, basename.c, bcmp.c, bcopy.c, bsearch.c,
bzero.c, calloc.c, clock.c, configure.in, configure, getcwd.c,
getpagesize.c, getpwd.c, index.c, memchr.c, memcmp.c, memcpy.c,
memmove.c, memset.c, putenv.c, rename.c, rindex.c, setenv.c,
sigsetmask.c, strcasecmp.c, strchr.c, strdup.c, strerror.c,
strncasecmp.c, strncmp.c, strrchr.c, strstr.c, strtod.c, strtol.c,
tmpnam.c, vfork.c, vprintf.c, waitpid.c, xatexit.c, xexit.c,
xmalloc.c, xmemdup.c, xstrdup.c, xstrerror.c: Add or update
documentation.
Co-Authored-By: Phil Edwards <pedwards@disaster.jaj.com>
From-SVN: r45828
2001-09-26 20:16:17 +02:00
|
|
|
character @var{c}. The search only ends with the first occurrence of
|
|
|
|
@var{c}, or after @var{length} characters; in particular, a null
|
|
|
|
character does not terminate the search. If the character @var{c} is
|
alloca.c, [...]: Improve manual formatting.
* alloca.c, clock.c, getcwd.c, getpagesize.c, getpwd.c, index.c,
libiberty.texi, memchr.c, putenv.c, rindex.c, strchr.c, strdup.c,
strerror.c, strrchr.c, strstr.c, strtod.c, tmpnam.c, vfork.c,
xatexit.c, xmalloc.c, xstrerror.c: Improve manual formatting. Fix
spelling. Give names to function arguments in documentation. Use
(void) prototypes in documentation.
* functions.texi: Regenerate.
From-SVN: r46068
2001-10-07 23:53:31 +02:00
|
|
|
found within @var{length} characters of @code{*@var{s}}, a pointer
|
|
|
|
to the character is returned. If @var{c} is not found, then @code{NULL} is
|
configure.in (MAKEINFO, PERL): Detect these.
* configure.in (MAKEINFO, PERL): Detect these.
(--enable-maintainer-mode): Add.
* configure: Regenerate.
* Makefile.in (MAKEINFO, PERL): Define.
(libiberty.info, libiberty.dvi, libiberty.html): New.
(CFILES): Add bsearch.c.
(CONFIGURED_OFILES): New, list of objects configure might add.
(maint-missing, maint-buildall): New, for maintainers only.
(clean, mostlyclean): Add info/dvi/html files.
* libiberty.texi, copying-lib.texi, obstacks.texi, functions.texi: New.
* gather-docs: New, for maintainers.
* maint-tool: New, for maintainers.
* alloca.c, atexit.c, basename.c, bcmp.c, bcopy.c, bsearch.c,
bzero.c, calloc.c, clock.c, configure.in, configure, getcwd.c,
getpagesize.c, getpwd.c, index.c, memchr.c, memcmp.c, memcpy.c,
memmove.c, memset.c, putenv.c, rename.c, rindex.c, setenv.c,
sigsetmask.c, strcasecmp.c, strchr.c, strdup.c, strerror.c,
strncasecmp.c, strncmp.c, strrchr.c, strstr.c, strtod.c, strtol.c,
tmpnam.c, vfork.c, vprintf.c, waitpid.c, xatexit.c, xexit.c,
xmalloc.c, xmemdup.c, xstrdup.c, xstrerror.c: Add or update
documentation.
Co-Authored-By: Phil Edwards <pedwards@disaster.jaj.com>
From-SVN: r45828
2001-09-26 20:16:17 +02:00
|
|
|
returned.
|
1997-08-22 00:57:35 +02:00
|
|
|
|
configure.in (MAKEINFO, PERL): Detect these.
* configure.in (MAKEINFO, PERL): Detect these.
(--enable-maintainer-mode): Add.
* configure: Regenerate.
* Makefile.in (MAKEINFO, PERL): Define.
(libiberty.info, libiberty.dvi, libiberty.html): New.
(CFILES): Add bsearch.c.
(CONFIGURED_OFILES): New, list of objects configure might add.
(maint-missing, maint-buildall): New, for maintainers only.
(clean, mostlyclean): Add info/dvi/html files.
* libiberty.texi, copying-lib.texi, obstacks.texi, functions.texi: New.
* gather-docs: New, for maintainers.
* maint-tool: New, for maintainers.
* alloca.c, atexit.c, basename.c, bcmp.c, bcopy.c, bsearch.c,
bzero.c, calloc.c, clock.c, configure.in, configure, getcwd.c,
getpagesize.c, getpwd.c, index.c, memchr.c, memcmp.c, memcpy.c,
memmove.c, memset.c, putenv.c, rename.c, rindex.c, setenv.c,
sigsetmask.c, strcasecmp.c, strchr.c, strdup.c, strerror.c,
strncasecmp.c, strncmp.c, strrchr.c, strstr.c, strtod.c, strtol.c,
tmpnam.c, vfork.c, vprintf.c, waitpid.c, xatexit.c, xexit.c,
xmalloc.c, xmemdup.c, xstrdup.c, xstrerror.c: Add or update
documentation.
Co-Authored-By: Phil Edwards <pedwards@disaster.jaj.com>
From-SVN: r45828
2001-09-26 20:16:17 +02:00
|
|
|
@end deftypefn
|
1997-08-22 00:57:35 +02:00
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <ansidecl.h>
|
|
|
|
#ifdef __STDC__
|
|
|
|
#include <stddef.h>
|
|
|
|
#else
|
|
|
|
#define size_t unsigned long
|
|
|
|
#endif
|
|
|
|
|
|
|
|
PTR
|
|
|
|
memchr (src_void, c, length)
|
1998-12-14 08:01:03 +01:00
|
|
|
register const PTR src_void;
|
1997-08-22 00:57:35 +02:00
|
|
|
int c;
|
|
|
|
size_t length;
|
|
|
|
{
|
1998-12-14 08:01:03 +01:00
|
|
|
const unsigned char *src = (const unsigned char *)src_void;
|
1997-08-22 00:57:35 +02:00
|
|
|
|
2001-03-28 06:10:24 +02:00
|
|
|
while (length-- > 0)
|
1997-08-22 00:57:35 +02:00
|
|
|
{
|
|
|
|
if (*src == c)
|
|
|
|
return (PTR)src;
|
|
|
|
src++;
|
|
|
|
}
|
|
|
|
return NULL;
|
|
|
|
}
|