123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489 |
- #ifndef _STRING_H
- #define _STRING_H 1
- #include <features.h>
- __BEGIN_DECLS
- #define __need_size_t
- #define __need_NULL
- #include <stddef.h>
- __BEGIN_NAMESPACE_STD
- extern void *memcpy (void *__restrict __dest,
- __const void *__restrict __src, size_t __n)
- __THROW __nonnull ((1, 2));
- libc_hidden_proto(memcpy)
- extern void *memmove (void *__dest, __const void *__src, size_t __n)
- __THROW __nonnull ((1, 2));
- libc_hidden_proto(memmove)
- __END_NAMESPACE_STD
- #if defined __USE_SVID || defined __USE_BSD || defined __USE_XOPEN
- extern void *memccpy (void *__restrict __dest, __const void *__restrict __src,
- int __c, size_t __n)
- __THROW __nonnull ((1, 2));
- libc_hidden_proto(memccpy)
- #endif
- __BEGIN_NAMESPACE_STD
- extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));
- libc_hidden_proto(memset)
- extern int memcmp (__const void *__s1, __const void *__s2, size_t __n)
- __THROW __attribute_pure__ __nonnull ((1, 2));
- libc_hidden_proto(memcmp)
- extern void *memchr (__const void *__s, int __c, size_t __n)
- __THROW __attribute_pure__ __nonnull ((1));
- libc_hidden_proto(memchr)
- __END_NAMESPACE_STD
- #ifdef __USE_GNU
- extern void *rawmemchr (__const void *__s, int __c)
- __THROW __attribute_pure__ __nonnull ((1));
- libc_hidden_proto(rawmemchr)
- extern void *memrchr (__const void *__s, int __c, size_t __n)
- __THROW __attribute_pure__ __nonnull ((1));
- libc_hidden_proto(memrchr)
- #endif
- __BEGIN_NAMESPACE_STD
- extern char *strcpy (char *__restrict __dest, __const char *__restrict __src)
- __THROW __nonnull ((1, 2));
- libc_hidden_proto(strcpy)
- extern char *strncpy (char *__restrict __dest,
- __const char *__restrict __src, size_t __n)
- __THROW __nonnull ((1, 2));
- libc_hidden_proto(strncpy)
- extern char *strcat (char *__restrict __dest, __const char *__restrict __src)
- __THROW __nonnull ((1, 2));
- libc_hidden_proto(strcat)
- extern char *strncat (char *__restrict __dest, __const char *__restrict __src,
- size_t __n) __THROW __nonnull ((1, 2));
- libc_hidden_proto(strncat)
- extern int strcmp (__const char *__s1, __const char *__s2)
- __THROW __attribute_pure__ __nonnull ((1, 2));
- libc_hidden_proto(strcmp)
- extern int strncmp (__const char *__s1, __const char *__s2, size_t __n)
- __THROW __attribute_pure__ __nonnull ((1, 2));
- libc_hidden_proto(strncmp)
- extern int strcoll (__const char *__s1, __const char *__s2)
- __THROW __attribute_pure__ __nonnull ((1, 2));
- libc_hidden_proto(strcoll)
- extern size_t strxfrm (char *__restrict __dest,
- __const char *__restrict __src, size_t __n)
- __THROW __nonnull ((2));
- __END_NAMESPACE_STD
- #if defined __USE_GNU && defined __UCLIBC_HAS_XLOCALE__
- # include <xlocale.h>
- extern int strcoll_l (__const char *__s1, __const char *__s2, __locale_t __l)
- __THROW __attribute_pure__ __nonnull ((1, 2, 3));
- libc_hidden_proto(strcoll_l)
- extern size_t strxfrm_l (char *__dest, __const char *__src, size_t __n,
- __locale_t __l) __THROW __nonnull ((2, 4));
- libc_hidden_proto(strxfrm_l)
- #endif
- #if defined __USE_SVID || defined __USE_BSD || defined __USE_XOPEN_EXTENDED
- extern char *strdup (__const char *__s)
- __THROW __attribute_malloc__ __nonnull ((1));
- libc_hidden_proto(strdup)
- #endif
- #if defined __USE_GNU
- extern char *strndup (__const char *__string, size_t __n)
- __THROW __attribute_malloc__ __nonnull ((1));
- libc_hidden_proto(strndup)
- #endif
- #if defined __USE_GNU && defined __GNUC__
- # define strdupa(s) \
- (__extension__ \
- ({ \
- __const char *__old = (s); \
- size_t __len = strlen (__old) + 1; \
- char *__new = (char *) __builtin_alloca (__len); \
- (char *) memcpy (__new, __old, __len); \
- }))
- # define strndupa(s, n) \
- (__extension__ \
- ({ \
- __const char *__old = (s); \
- size_t __len = strnlen (__old, (n)); \
- char *__new = (char *) __builtin_alloca (__len + 1); \
- __new[__len] = '\0'; \
- (char *) memcpy (__new, __old, __len); \
- }))
- #endif
- __BEGIN_NAMESPACE_STD
- extern char *strchr (__const char *__s, int __c)
- __THROW __attribute_pure__ __nonnull ((1));
- libc_hidden_proto(strchr)
- extern char *strrchr (__const char *__s, int __c)
- __THROW __attribute_pure__ __nonnull ((1));
- libc_hidden_proto(strrchr)
- __END_NAMESPACE_STD
- #ifdef __USE_GNU
- extern char *strchrnul (__const char *__s, int __c)
- __THROW __attribute_pure__ __nonnull ((1));
- libc_hidden_proto(strchrnul)
- #endif
- __BEGIN_NAMESPACE_STD
- extern size_t strcspn (__const char *__s, __const char *__reject)
- __THROW __attribute_pure__ __nonnull ((1, 2));
- libc_hidden_proto(strcspn)
- extern size_t strspn (__const char *__s, __const char *__accept)
- __THROW __attribute_pure__ __nonnull ((1, 2));
- libc_hidden_proto(strspn)
- extern char *strpbrk (__const char *__s, __const char *__accept)
- __THROW __attribute_pure__ __nonnull ((1, 2));
- libc_hidden_proto(strpbrk)
- extern char *strstr (__const char *__haystack, __const char *__needle)
- __THROW __attribute_pure__ __nonnull ((1, 2));
- libc_hidden_proto(strstr)
- extern char *strtok (char *__restrict __s, __const char *__restrict __delim)
- __THROW __nonnull ((2));
- libc_hidden_proto(strtok)
- __END_NAMESPACE_STD
- #if 0
- extern char *__strtok_r (char *__restrict __s,
- __const char *__restrict __delim,
- char **__restrict __save_ptr)
- __THROW __nonnull ((2, 3));
- #endif
- #if defined __USE_POSIX || defined __USE_MISC
- extern char *strtok_r (char *__restrict __s, __const char *__restrict __delim,
- char **__restrict __save_ptr)
- __THROW __nonnull ((2, 3));
- libc_hidden_proto(strtok_r)
- #endif
- #ifdef __USE_GNU
- extern char *strcasestr (__const char *__haystack, __const char *__needle)
- __THROW __attribute_pure__ __nonnull ((1, 2));
- libc_hidden_proto(strcasestr)
- #endif
- #ifdef __USE_GNU
- extern void *memmem (__const void *__haystack, size_t __haystacklen,
- __const void *__needle, size_t __needlelen)
- __THROW __attribute_pure__ __nonnull ((1, 3));
- #if 0
- extern void *__mempcpy (void *__restrict __dest,
- __const void *__restrict __src, size_t __n)
- __THROW __nonnull ((1, 2));
- #endif
- extern void *mempcpy (void *__restrict __dest,
- __const void *__restrict __src, size_t __n)
- __THROW __nonnull ((1, 2));
- libc_hidden_proto(mempcpy)
- #endif
- __BEGIN_NAMESPACE_STD
- extern size_t strlen (__const char *__s)
- __THROW __attribute_pure__ __nonnull ((1));
- libc_hidden_proto(strlen)
- __END_NAMESPACE_STD
- #ifdef __USE_GNU
- extern size_t strnlen (__const char *__string, size_t __maxlen)
- __THROW __attribute_pure__ __nonnull ((1));
- libc_hidden_proto(strnlen)
- #endif
- __BEGIN_NAMESPACE_STD
- extern char *strerror (int __errnum) __THROW;
- libc_hidden_proto(strerror)
- __END_NAMESPACE_STD
- #if defined __USE_XOPEN2K || defined __USE_MISC
- # if defined __USE_XOPEN2K && !defined __USE_GNU
- extern int __xpg_strerror_r (int __errnum, char *__buf, size_t __buflen)
- __THROW __nonnull ((2));
- libc_hidden_proto(__xpg_strerror_r)
- # ifdef __REDIRECT_NTH
- extern int __REDIRECT_NTH (strerror_r,
- (int __errnum, char *__buf, size_t __buflen),
- __xpg_strerror_r) __nonnull ((2));
- # else
- # define strerror_r __xpg_strerror_r
- # endif
- # else
- extern char *__glibc_strerror_r (int __errnum, char *__buf, size_t __buflen)
- __THROW __nonnull ((2));
- libc_hidden_proto(__glibc_strerror_r)
- # ifdef __REDIRECT_NTH
- extern char * __REDIRECT_NTH (strerror_r,
- (int __errnum, char *__buf, size_t __buflen),
- __glibc_strerror_r) __nonnull ((2));
- # else
- # define strerror_r __glibc_strerror_r
- # endif
- # endif
- #endif
- #if 0
- extern void __bzero (void *__s, size_t __n) __THROW __nonnull ((1));
- #endif
- #ifdef __USE_BSD
- # ifdef __UCLIBC_SUSV3_LEGACY__
- extern void bcopy (__const void *__src, void *__dest, size_t __n)
- __THROW __nonnull ((1, 2));
- extern void bzero (void *__s, size_t __n) __THROW __nonnull ((1));
- extern int bcmp (__const void *__s1, __const void *__s2, size_t __n)
- __THROW __attribute_pure__ __nonnull ((1, 2));
- extern char *index (__const char *__s, int __c)
- __THROW __attribute_pure__ __nonnull ((1));
- extern char *rindex (__const char *__s, int __c)
- __THROW __attribute_pure__ __nonnull ((1));
- # else
- # ifdef __UCLIBC_SUSV3_LEGACY_MACROS__
- # define bcopy(src,dest,n) (memmove((dest), (src), (n)), (void) 0)
- # define bzero(s,n) (memset((s), '\0', (n)), (void) 0)
- # define bcmp(s1,s2,n) memcmp((s1), (s2), (size_t)(n))
- # define index(s,c) strchr((s), (c))
- # define rindex(s,c) strrchr((s), (c))
- # endif
- # endif
- extern int ffs (int __i) __THROW __attribute__ ((__const__));
- libc_hidden_proto(ffs)
- #ifdef __USE_GNU
- extern int ffsl (long int __l) __THROW __attribute__ ((__const__));
- # ifdef __GNUC__
- __extension__ extern int ffsll (long long int __ll)
- __THROW __attribute__ ((__const__));
- # endif
- # endif
- extern int strcasecmp (__const char *__s1, __const char *__s2)
- __THROW __attribute_pure__ __nonnull ((1, 2));
- libc_hidden_proto(strcasecmp)
- extern int strncasecmp (__const char *__s1, __const char *__s2, size_t __n)
- __THROW __attribute_pure__ __nonnull ((1, 2));
- libc_hidden_proto(strncasecmp)
- #endif
- #if defined __USE_GNU && defined __UCLIBC_HAS_XLOCALE__
- extern int strcasecmp_l (__const char *__s1, __const char *__s2,
- __locale_t __loc)
- __THROW __attribute_pure__ __nonnull ((1, 2, 3));
- libc_hidden_proto(strcasecmp_l)
- extern int strncasecmp_l (__const char *__s1, __const char *__s2,
- size_t __n, __locale_t __loc)
- __THROW __attribute_pure__ __nonnull ((1, 2, 4));
- libc_hidden_proto(strncasecmp_l)
- #endif
- #ifdef __USE_BSD
- extern char *strsep (char **__restrict __stringp,
- __const char *__restrict __delim)
- __THROW __nonnull ((1, 2));
- libc_hidden_proto(strsep)
- #endif
- #ifdef __USE_GNU
- extern int strverscmp (__const char *__s1, __const char *__s2)
- __THROW __attribute_pure__ __nonnull ((1, 2));
- libc_hidden_proto(strverscmp)
- extern char *strsignal (int __sig) __THROW;
- libc_hidden_proto(strsignal)
- # if 0
- extern char *__stpcpy (char *__restrict __dest, __const char *__restrict __src)
- __THROW __nonnull ((1, 2));
- # endif
- extern char *stpcpy (char *__restrict __dest, __const char *__restrict __src)
- __THROW __nonnull ((1, 2));
- libc_hidden_proto(stpcpy)
- # if 0
- extern char *__stpncpy (char *__restrict __dest,
- __const char *__restrict __src, size_t __n)
- __THROW __nonnull ((1, 2));
- # endif
- extern char *stpncpy (char *__restrict __dest,
- __const char *__restrict __src, size_t __n)
- __THROW __nonnull ((1, 2));
- # if 0
- extern char *strfry (char *__string) __THROW __nonnull ((1));
- extern void *memfrob (void *__s, size_t __n) __THROW __nonnull ((1));
- # endif
- # ifndef basename
- extern char *basename (__const char *__filename) __THROW __nonnull ((1));
- libc_hidden_proto(basename)
- # endif
- #endif
- #ifdef __USE_BSD
- extern size_t strlcat(char *__restrict dst, const char *__restrict src,
- size_t n) __THROW __nonnull ((1, 2));
- libc_hidden_proto(strlcat)
- extern size_t strlcpy(char *__restrict dst, const char *__restrict src,
- size_t n) __THROW __nonnull ((1, 2));
- libc_hidden_proto(strlcpy)
- #endif
- __END_DECLS
- #if defined(_LIBC) && defined(__UCLIBC_HAS_STRING_ARCH_OPT__)
- # if defined __i386__
- # include <../libc/string/i386/string.h>
- # endif
- #endif
- #endif
|