1997-08-21 22:57:35 +00:00
|
|
|
/* bcopy -- copy memory regions of arbitary length
|
|
|
|
|
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 18:16:17 +00:00
|
|
|
@deftypefn Supplemental void bcopy (char *@var{in}, char *@var{out}, int @var{length})
|
1997-08-21 22:57:35 +00: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 18:16:17 +00:00
|
|
|
Copies @var{length} bytes from memory region @var{in} to region
|
|
|
|
@var{out}. The use of @code{bcopy} is deprecated in new programs.
|
1997-08-21 22:57:35 +00: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 18:16:17 +00:00
|
|
|
@end deftypefn
|
1997-08-21 22:57:35 +00:00
|
|
|
|
|
|
|
*/
|
|
|
|
|
2005-04-02 20:28:00 +00:00
|
|
|
#include <stddef.h>
|
|
|
|
|
1997-08-21 22:57:35 +00:00
|
|
|
void
|
2005-04-02 20:28:00 +00:00
|
|
|
bcopy (const void *src, void *dest, size_t len)
|
1997-08-21 22:57:35 +00:00
|
|
|
{
|
|
|
|
if (dest < src)
|
2005-04-02 20:28:00 +00:00
|
|
|
{
|
2006-10-26 03:16:11 +00:00
|
|
|
const char *firsts = (const char *) src;
|
|
|
|
char *firstd = (char *) dest;
|
2005-04-02 20:28:00 +00:00
|
|
|
while (len--)
|
|
|
|
*firstd++ = *firsts++;
|
|
|
|
}
|
1997-08-21 22:57:35 +00:00
|
|
|
else
|
|
|
|
{
|
2005-04-02 20:28:00 +00:00
|
|
|
const char *lasts = (const char *)src + (len-1);
|
|
|
|
char *lastd = (char *)dest + (len-1);
|
1997-08-21 22:57:35 +00:00
|
|
|
while (len--)
|
2005-04-02 20:28:00 +00:00
|
|
|
*lastd-- = *lasts--;
|
1997-08-21 22:57:35 +00:00
|
|
|
}
|
|
|
|
}
|