diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2005-12-13 00:35:25 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2005-12-13 00:35:25 +0000 |
commit | b37c889bf62a36bfc3a70a30cb8c6e2e9b253d51 (patch) | |
tree | 12a945cbf5263926f1c35d9dab17e5ca17d14869 /include/string.h | |
parent | 4623e5435a9e80c267c1b601a543e14f95b883da (diff) |
First step in include files overhaul. Use __FOO_VISIBLE (as defined
in sys/cdefs.h) instead of _FOO_SOURCE. Also fix several namespace
pollution issues, including the byte order defines. OK deraadt@
Diffstat (limited to 'include/string.h')
-rw-r--r-- | include/string.h | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/include/string.h b/include/string.h index 745be2d62c0..7a3c533702b 100644 --- a/include/string.h +++ b/include/string.h @@ -1,4 +1,4 @@ -/* $OpenBSD: string.h,v 1.15 2005/03/30 03:04:16 deraadt Exp $ */ +/* $OpenBSD: string.h,v 1.16 2005/12/13 00:35:22 millert Exp $ */ /* $NetBSD: string.h,v 1.6 1994/10/26 00:56:30 cgd Exp $ */ /*- @@ -34,6 +34,8 @@ #ifndef _STRING_H_ #define _STRING_H_ + +#include <sys/cdefs.h> #include <machine/ansi.h> #ifdef _BSD_SIZE_T_ @@ -49,8 +51,6 @@ typedef _BSD_SIZE_T_ size_t; #endif #endif -#include <sys/cdefs.h> - __BEGIN_DECLS void *memchr(const void *, int, size_t); int memcmp(const void *, const void *, size_t); @@ -69,8 +69,6 @@ int strcoll(const char *, const char *); char *strcpy(char *, const char *); size_t strcspn(const char *, const char *); char *strerror(int); -int strerror_r(int, char *, size_t) - __attribute__ ((__bounded__(__string__,2,3))); size_t strlen(const char *); char *strncat(char *, const char *, size_t) __attribute__ ((__bounded__(__string__,1,3))); @@ -86,8 +84,12 @@ char *strtok_r(char *, const char *, char **); size_t strxfrm(char *, const char *, size_t) __attribute__ ((__bounded__(__string__,1,3))); -/* Nonstandard routines */ -#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE) +#if __BSD_VISIBLE || __XPG_VISIBLE +void *memccpy(void *, const void *, int, size_t) + __attribute__ ((__bounded__(__buffer__,1,4))); +#endif + +#if __BSD_VISIBLE || __XPG_VISIBLE >= 420 int bcmp(const void *, const void *, size_t); void bcopy(const void *, void *, size_t) __attribute__ ((__bounded__(__buffer__,1,3))) @@ -96,18 +98,24 @@ void bzero(void *, size_t) __attribute__ ((__bounded__(__buffer__,1,2))); int ffs(int); char *index(const char *, int); -void *memccpy(void *, const void *, int, size_t) - __attribute__ ((__bounded__(__buffer__,1,4))); char *rindex(const char *, int); int strcasecmp(const char *, const char *); +int strncasecmp(const char *, const char *, size_t); char *strdup(const char *); +#endif + +#if __BSD_VISIBLE || __XPG_VISIBLE >= 600 +int strerror_r(int, char *, size_t) + __attribute__ ((__bounded__(__string__,2,3))); +#endif + +#if __BSD_VISIBLE char *strcasestr(const char *, const char *); size_t strlcat(char *, const char *, size_t) __attribute__ ((__bounded__(__string__,1,3))); size_t strlcpy(char *, const char *, size_t) __attribute__ ((__bounded__(__string__,1,3))); void strmode(int, char *); -int strncasecmp(const char *, const char *, size_t); char *strsep(char **, const char *); char *strsignal(int); #endif |