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 | |
| parent | f36ba45234e29c86aa1d00093022d2f6c49f9c38 (diff) | |
Notes
Diffstat (limited to 'lib/libc/string')
| -rw-r--r-- | lib/libc/string/bcopy.3 | 9 | ||||
| -rw-r--r-- | lib/libc/string/bcopy.c | 23 | ||||
| -rw-r--r-- | lib/libc/string/bzero.3 | 9 | ||||
| -rw-r--r-- | lib/libc/string/memset.c | 14 | 
4 files changed, 33 insertions, 22 deletions
| diff --git a/lib/libc/string/bcopy.3 b/lib/libc/string/bcopy.3 index 5fecc5bd400d..48b3d5385aea 100644 --- a/lib/libc/string/bcopy.3 +++ b/lib/libc/string/bcopy.3 @@ -44,7 +44,7 @@  .Sh LIBRARY  .Lb libc  .Sh SYNOPSIS -.In string.h +.In strings.h  .Ft void  .Fn bcopy "const void *src" "void *dst" "size_t len"  .Sh DESCRIPTION @@ -72,3 +72,10 @@ A  .Fn bcopy  function appeared in  .Bx 4.2 . +Its prototype existed previously in +.Aq Pa string.h +before it was moved to +.Aq Pa strings.h +for +.St -p1003.1-2001 +compliance. 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; diff --git a/lib/libc/string/bzero.3 b/lib/libc/string/bzero.3 index 78038352e376..71b8520fd3fd 100644 --- a/lib/libc/string/bzero.3 +++ b/lib/libc/string/bzero.3 @@ -44,7 +44,7 @@  .Sh LIBRARY  .Lb libc  .Sh SYNOPSIS -.In string.h +.In strings.h  .Ft void  .Fn bzero "void *b" "size_t len"  .Sh DESCRIPTION @@ -69,3 +69,10 @@ A  function  appeared in  .Bx 4.3 . +Its prototype existed previously in +.Aq Pa string.h +before it was moved to +.Aq Pa strings.h +for +.St -p1003.1-2001 +compliance. diff --git a/lib/libc/string/memset.c b/lib/libc/string/memset.c index 462dbe9a1008..17683aeda183 100644 --- a/lib/libc/string/memset.c +++ b/lib/libc/string/memset.c @@ -43,30 +43,28 @@ __FBSDID("$FreeBSD$");  #include <sys/types.h>  #include <limits.h> -#include <string.h>  #define	wsize	sizeof(u_int)  #define	wmask	(wsize - 1)  #ifdef BZERO +#include <strings.h> +  #define	RETURN	return  #define	VAL	0  #define	WIDEVAL	0  void -bzero(dst0, length) -	void *dst0; -	size_t length; +bzero(void *dst0, size_t length)  #else +#include <string.h> +  #define	RETURN	return (dst0)  #define	VAL	c0  #define	WIDEVAL	c  void * -memset(dst0, c0, length) -	void *dst0; -	int c0; -	size_t length; +memset(void *dst0, int c0, size_t length)  #endif  {  	size_t t; | 
