diff options
author | Robert Drehmel <robert@FreeBSD.org> | 2002-09-01 21:53:46 +0000 |
---|---|---|
committer | Robert Drehmel <robert@FreeBSD.org> | 2002-09-01 21:53:46 +0000 |
commit | bc0ad8e7a1c5acaebd9516356b2c00619f77a053 (patch) | |
tree | e5800830b427bd6f024dc17e7f70e2cde2514fa4 /lib/libc/string/bcopy.c | |
parent | f36ba45234e29c86aa1d00093022d2f6c49f9c38 (diff) | |
download | src-bc0ad8e7a1c5acaebd9516356b2c00619f77a053.tar.gz src-bc0ad8e7a1c5acaebd9516356b2c00619f77a053.zip |
- 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.
Notes
Notes:
svn path=/head/; revision=102809
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 2a6343b9c018..8f8a8cf51ef9 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; |