diff options
author | robert <robert@FreeBSD.org> | 2002-09-01 21:53:46 +0000 |
---|---|---|
committer | robert <robert@FreeBSD.org> | 2002-09-01 21:53:46 +0000 |
commit | 27ec88afb518866209c0c57333dd48c02609623a (patch) | |
tree | e5800830b427bd6f024dc17e7f70e2cde2514fa4 /lib/libc/string/bcopy.c | |
parent | ce650f8c333de3130e1beb1e3caa213af385e085 (diff) | |
download | FreeBSD-src-27ec88afb518866209c0c57333dd48c02609623a.zip FreeBSD-src-27ec88afb518866209c0c57333dd48c02609623a.tar.gz |
- Let their manual pages show the reader that the bzero(3) and
bcopy(3) functions are prototyped in <strings.h> and not in
<string.h> anymore.
- Add a sentence about that to the respective HISTORY sections.
In the C source files:
- Include <string.h> or <strings.h> depending on what function
is to be compiled.
- Use ANSI-C function definitions.
Diffstat (limited to 'lib/libc/string/bcopy.c')
-rw-r--r-- | lib/libc/string/bcopy.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/lib/libc/string/bcopy.c b/lib/libc/string/bcopy.c index 2a6343b..8f8a8cf 100644 --- a/lib/libc/string/bcopy.c +++ b/lib/libc/string/bcopy.c @@ -40,8 +40,6 @@ static char sccsid[] = "@(#)bcopy.c 8.1 (Berkeley) 6/4/93"; #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); -#include <string.h> - /* * sizeof(word) MUST BE A POWER OF TWO * SO THAT wmask BELOW IS ALL ONES @@ -56,21 +54,22 @@ typedef int word; /* "word" used for optimal copy speed */ * This is the routine that actually implements * (the portable versions of) bcopy, memcpy, and memmove. */ -#ifdef MEMCOPY +#if defined(MEMCOPY) || defined(MEMMOVE) +#include <string.h> + void * -memcpy(dst0, src0, length) +#ifdef MEMCOPY +memcpy #else -#ifdef MEMMOVE -void * -memmove(dst0, src0, length) +memmove +#endif +(void *dst0, const void *src0, size_t length) #else +#include <strings.h> + void -bcopy(src0, dst0, length) -#endif +bcopy(const void *src0, void *dst0, size_t length) #endif - void *dst0; - const void *src0; - size_t length; { char *dst = dst0; const char *src = src0; |