Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 32 lines (25 sloc) 0.694 kb
28e9041c »
1997-08-21 Initial revision
1 /* bcopy -- copy memory regions of arbitary length
2
614a23c6 »
2001-09-26 * configure.in (MAKEINFO, PERL): Detect these.
3 @deftypefn Supplemental void bcopy (char *@var{in}, char *@var{out}, int @var{length})
28e9041c »
1997-08-21 Initial revision
4
614a23c6 »
2001-09-26 * configure.in (MAKEINFO, PERL): Detect these.
5 Copies @var{length} bytes from memory region @var{in} to region
6 @var{out}. The use of @code{bcopy} is deprecated in new programs.
28e9041c »
1997-08-21 Initial revision
7
614a23c6 »
2001-09-26 * configure.in (MAKEINFO, PERL): Detect these.
8 @end deftypefn
28e9041c »
1997-08-21 Initial revision
9
10 */
11
943c390a »
2005-04-02 * bcmp.c: Fix warnings and implement using memcmp.
12 #include <stddef.h>
13
28e9041c »
1997-08-21 Initial revision
14 void
943c390a »
2005-04-02 * bcmp.c: Fix warnings and implement using memcmp.
15 bcopy (const void *src, void *dest, size_t len)
28e9041c »
1997-08-21 Initial revision
16 {
17 if (dest < src)
943c390a »
2005-04-02 * bcmp.c: Fix warnings and implement using memcmp.
18 {
1dc5cee9 »
2006-10-26 pex-win32.c (argv_to_cmdline): Replace xmalloc with XNEWVEC.
19 const char *firsts = (const char *) src;
20 char *firstd = (char *) dest;
943c390a »
2005-04-02 * bcmp.c: Fix warnings and implement using memcmp.
21 while (len--)
22 *firstd++ = *firsts++;
23 }
28e9041c »
1997-08-21 Initial revision
24 else
25 {
943c390a »
2005-04-02 * bcmp.c: Fix warnings and implement using memcmp.
26 const char *lasts = (const char *)src + (len-1);
27 char *lastd = (char *)dest + (len-1);
28e9041c »
1997-08-21 Initial revision
28 while (len--)
943c390a »
2005-04-02 * bcmp.c: Fix warnings and implement using memcmp.
29 *lastd-- = *lasts--;
28e9041c »
1997-08-21 Initial revision
30 }
31 }
Something went wrong with that request. Please try again.