Blame string/string.h

Packit 6c4009
/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
Packit 6c4009
   This file is part of the GNU C Library.
Packit 6c4009
Packit 6c4009
   The GNU C Library is free software; you can redistribute it and/or
Packit 6c4009
   modify it under the terms of the GNU Lesser General Public
Packit 6c4009
   License as published by the Free Software Foundation; either
Packit 6c4009
   version 2.1 of the License, or (at your option) any later version.
Packit 6c4009
Packit 6c4009
   The GNU C Library is distributed in the hope that it will be useful,
Packit 6c4009
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 6c4009
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 6c4009
   Lesser General Public License for more details.
Packit 6c4009
Packit 6c4009
   You should have received a copy of the GNU Lesser General Public
Packit 6c4009
   License along with the GNU C Library; if not, see
Packit 6c4009
   <http://www.gnu.org/licenses/>.  */
Packit 6c4009
Packit 6c4009
/*
Packit 6c4009
 *	ISO C99 Standard: 7.21 String handling	<string.h>
Packit 6c4009
 */
Packit 6c4009
Packit 6c4009
#ifndef	_STRING_H
Packit 6c4009
#define	_STRING_H	1
Packit 6c4009
Packit 6c4009
#define __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION
Packit 6c4009
#include <bits/libc-header-start.h>
Packit 6c4009
Packit 6c4009
__BEGIN_DECLS
Packit 6c4009
Packit 6c4009
/* Get size_t and NULL from <stddef.h>.  */
Packit 6c4009
#define	__need_size_t
Packit 6c4009
#define	__need_NULL
Packit 6c4009
#include <stddef.h>
Packit 6c4009
Packit 6c4009
/* Tell the caller that we provide correct C++ prototypes.  */
Packit 6c4009
#if defined __cplusplus && __GNUC_PREREQ (4, 4)
Packit 6c4009
# define __CORRECT_ISO_CPP_STRING_H_PROTO
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* Copy N bytes of SRC to DEST.  */
Packit 6c4009
extern void *memcpy (void *__restrict __dest, const void *__restrict __src,
Packit 6c4009
		     size_t __n) __THROW __nonnull ((1, 2));
Packit 6c4009
/* Copy N bytes of SRC to DEST, guaranteeing
Packit 6c4009
   correct behavior for overlapping strings.  */
Packit 6c4009
extern void *memmove (void *__dest, const void *__src, size_t __n)
Packit 6c4009
     __THROW __nonnull ((1, 2));
Packit 6c4009
Packit 6c4009
/* Copy no more than N bytes of SRC to DEST, stopping when C is found.
Packit 6c4009
   Return the position in DEST one byte past where C was copied,
Packit 6c4009
   or NULL if C was not found in the first N bytes of SRC.  */
Packit 6c4009
#if defined __USE_MISC || defined __USE_XOPEN
Packit 6c4009
extern void *memccpy (void *__restrict __dest, const void *__restrict __src,
Packit 6c4009
		      int __c, size_t __n)
Packit 6c4009
     __THROW __nonnull ((1, 2));
Packit 6c4009
#endif /* Misc || X/Open.  */
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* Set N bytes of S to C.  */
Packit 6c4009
extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));
Packit 6c4009
Packit 6c4009
/* Compare N bytes of S1 and S2.  */
Packit 6c4009
extern int memcmp (const void *__s1, const void *__s2, size_t __n)
Packit 6c4009
     __THROW __attribute_pure__ __nonnull ((1, 2));
Packit 6c4009
Packit 6c4009
/* Search N bytes of S for C.  */
Packit 6c4009
#ifdef __CORRECT_ISO_CPP_STRING_H_PROTO
Packit 6c4009
extern "C++"
Packit 6c4009
{
Packit 6c4009
extern void *memchr (void *__s, int __c, size_t __n)
Packit 6c4009
      __THROW __asm ("memchr") __attribute_pure__ __nonnull ((1));
Packit 6c4009
extern const void *memchr (const void *__s, int __c, size_t __n)
Packit 6c4009
      __THROW __asm ("memchr") __attribute_pure__ __nonnull ((1));
Packit 6c4009
Packit 6c4009
# ifdef __OPTIMIZE__
Packit 6c4009
__extern_always_inline void *
Packit 6c4009
memchr (void *__s, int __c, size_t __n) __THROW
Packit 6c4009
{
Packit 6c4009
  return __builtin_memchr (__s, __c, __n);
Packit 6c4009
}
Packit 6c4009
Packit 6c4009
__extern_always_inline const void *
Packit 6c4009
memchr (const void *__s, int __c, size_t __n) __THROW
Packit 6c4009
{
Packit 6c4009
  return __builtin_memchr (__s, __c, __n);
Packit 6c4009
}
Packit 6c4009
# endif
Packit 6c4009
}
Packit 6c4009
#else
Packit 6c4009
extern void *memchr (const void *__s, int __c, size_t __n)
Packit 6c4009
      __THROW __attribute_pure__ __nonnull ((1));
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
#ifdef __USE_GNU
Packit 6c4009
/* Search in S for C.  This is similar to `memchr' but there is no
Packit 6c4009
   length limit.  */
Packit 6c4009
# ifdef __CORRECT_ISO_CPP_STRING_H_PROTO
Packit 6c4009
extern "C++" void *rawmemchr (void *__s, int __c)
Packit 6c4009
     __THROW __asm ("rawmemchr") __attribute_pure__ __nonnull ((1));
Packit 6c4009
extern "C++" const void *rawmemchr (const void *__s, int __c)
Packit 6c4009
     __THROW __asm ("rawmemchr") __attribute_pure__ __nonnull ((1));
Packit 6c4009
# else
Packit 6c4009
extern void *rawmemchr (const void *__s, int __c)
Packit 6c4009
     __THROW __attribute_pure__ __nonnull ((1));
Packit 6c4009
# endif
Packit 6c4009
Packit 6c4009
/* Search N bytes of S for the final occurrence of C.  */
Packit 6c4009
# ifdef __CORRECT_ISO_CPP_STRING_H_PROTO
Packit 6c4009
extern "C++" void *memrchr (void *__s, int __c, size_t __n)
Packit 6c4009
      __THROW __asm ("memrchr") __attribute_pure__ __nonnull ((1));
Packit 6c4009
extern "C++" const void *memrchr (const void *__s, int __c, size_t __n)
Packit 6c4009
      __THROW __asm ("memrchr") __attribute_pure__ __nonnull ((1));
Packit 6c4009
# else
Packit 6c4009
extern void *memrchr (const void *__s, int __c, size_t __n)
Packit 6c4009
      __THROW __attribute_pure__ __nonnull ((1));
Packit 6c4009
# endif
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* Copy SRC to DEST.  */
Packit 6c4009
extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
Packit 6c4009
     __THROW __nonnull ((1, 2));
Packit 6c4009
/* Copy no more than N characters of SRC to DEST.  */
Packit 6c4009
extern char *strncpy (char *__restrict __dest,
Packit 6c4009
		      const char *__restrict __src, size_t __n)
Packit 6c4009
     __THROW __nonnull ((1, 2));
Packit 6c4009
Packit 6c4009
/* Append SRC onto DEST.  */
Packit 6c4009
extern char *strcat (char *__restrict __dest, const char *__restrict __src)
Packit 6c4009
     __THROW __nonnull ((1, 2));
Packit 6c4009
/* Append no more than N characters from SRC onto DEST.  */
Packit 6c4009
extern char *strncat (char *__restrict __dest, const char *__restrict __src,
Packit 6c4009
		      size_t __n) __THROW __nonnull ((1, 2));
Packit 6c4009
Packit 6c4009
/* Compare S1 and S2.  */
Packit 6c4009
extern int strcmp (const char *__s1, const char *__s2)
Packit 6c4009
     __THROW __attribute_pure__ __nonnull ((1, 2));
Packit 6c4009
/* Compare N characters of S1 and S2.  */
Packit 6c4009
extern int strncmp (const char *__s1, const char *__s2, size_t __n)
Packit 6c4009
     __THROW __attribute_pure__ __nonnull ((1, 2));
Packit 6c4009
Packit 6c4009
/* Compare the collated forms of S1 and S2.  */
Packit 6c4009
extern int strcoll (const char *__s1, const char *__s2)
Packit 6c4009
     __THROW __attribute_pure__ __nonnull ((1, 2));
Packit 6c4009
/* Put a transformation of SRC into no more than N bytes of DEST.  */
Packit 6c4009
extern size_t strxfrm (char *__restrict __dest,
Packit 6c4009
		       const char *__restrict __src, size_t __n)
Packit 6c4009
     __THROW __nonnull ((2));
Packit 6c4009
Packit 6c4009
#ifdef __USE_XOPEN2K8
Packit 6c4009
/* POSIX.1-2008 extended locale interface (see locale.h).  */
Packit 6c4009
# include <bits/types/locale_t.h>
Packit 6c4009
Packit 6c4009
/* Compare the collated forms of S1 and S2, using sorting rules from L.  */
Packit 6c4009
extern int strcoll_l (const char *__s1, const char *__s2, locale_t __l)
Packit 6c4009
     __THROW __attribute_pure__ __nonnull ((1, 2, 3));
Packit 6c4009
/* Put a transformation of SRC into no more than N bytes of DEST,
Packit 6c4009
   using sorting rules from L.  */
Packit 6c4009
extern size_t strxfrm_l (char *__dest, const char *__src, size_t __n,
Packit 6c4009
			 locale_t __l) __THROW __nonnull ((2, 4));
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
#if (defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8	\
Packit 6c4009
     || __GLIBC_USE (LIB_EXT2))
Packit 6c4009
/* Duplicate S, returning an identical malloc'd string.  */
Packit 6c4009
extern char *strdup (const char *__s)
Packit 6c4009
     __THROW __attribute_malloc__ __nonnull ((1));
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
/* Return a malloc'd copy of at most N bytes of STRING.  The
Packit 6c4009
   resultant string is terminated even if no null terminator
Packit 6c4009
   appears before STRING[N].  */
Packit 6c4009
#if defined __USE_XOPEN2K8 || __GLIBC_USE (LIB_EXT2)
Packit 6c4009
extern char *strndup (const char *__string, size_t __n)
Packit 6c4009
     __THROW __attribute_malloc__ __nonnull ((1));
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
#if defined __USE_GNU && defined __GNUC__
Packit 6c4009
/* Duplicate S, returning an identical alloca'd string.  */
Packit 6c4009
# define strdupa(s)							      \
Packit 6c4009
  (__extension__							      \
Packit 6c4009
    ({									      \
Packit 6c4009
      const char *__old = (s);						      \
Packit 6c4009
      size_t __len = strlen (__old) + 1;				      \
Packit 6c4009
      char *__new = (char *) __builtin_alloca (__len);			      \
Packit 6c4009
      (char *) memcpy (__new, __old, __len);				      \
Packit 6c4009
    }))
Packit 6c4009
Packit 6c4009
/* Return an alloca'd copy of at most N bytes of string.  */
Packit 6c4009
# define strndupa(s, n)							      \
Packit 6c4009
  (__extension__							      \
Packit 6c4009
    ({									      \
Packit 6c4009
      const char *__old = (s);						      \
Packit 6c4009
      size_t __len = strnlen (__old, (n));				      \
Packit 6c4009
      char *__new = (char *) __builtin_alloca (__len + 1);		      \
Packit 6c4009
      __new[__len] = '\0';						      \
Packit 6c4009
      (char *) memcpy (__new, __old, __len);				      \
Packit 6c4009
    }))
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
/* Find the first occurrence of C in S.  */
Packit 6c4009
#ifdef __CORRECT_ISO_CPP_STRING_H_PROTO
Packit 6c4009
extern "C++"
Packit 6c4009
{
Packit 6c4009
extern char *strchr (char *__s, int __c)
Packit 6c4009
     __THROW __asm ("strchr") __attribute_pure__ __nonnull ((1));
Packit 6c4009
extern const char *strchr (const char *__s, int __c)
Packit 6c4009
     __THROW __asm ("strchr") __attribute_pure__ __nonnull ((1));
Packit 6c4009
Packit 6c4009
# ifdef __OPTIMIZE__
Packit 6c4009
__extern_always_inline char *
Packit 6c4009
strchr (char *__s, int __c) __THROW
Packit 6c4009
{
Packit 6c4009
  return __builtin_strchr (__s, __c);
Packit 6c4009
}
Packit 6c4009
Packit 6c4009
__extern_always_inline const char *
Packit 6c4009
strchr (const char *__s, int __c) __THROW
Packit 6c4009
{
Packit 6c4009
  return __builtin_strchr (__s, __c);
Packit 6c4009
}
Packit 6c4009
# endif
Packit 6c4009
}
Packit 6c4009
#else
Packit 6c4009
extern char *strchr (const char *__s, int __c)
Packit 6c4009
     __THROW __attribute_pure__ __nonnull ((1));
Packit 6c4009
#endif
Packit 6c4009
/* Find the last occurrence of C in S.  */
Packit 6c4009
#ifdef __CORRECT_ISO_CPP_STRING_H_PROTO
Packit 6c4009
extern "C++"
Packit 6c4009
{
Packit 6c4009
extern char *strrchr (char *__s, int __c)
Packit 6c4009
     __THROW __asm ("strrchr") __attribute_pure__ __nonnull ((1));
Packit 6c4009
extern const char *strrchr (const char *__s, int __c)
Packit 6c4009
     __THROW __asm ("strrchr") __attribute_pure__ __nonnull ((1));
Packit 6c4009
Packit 6c4009
# ifdef __OPTIMIZE__
Packit 6c4009
__extern_always_inline char *
Packit 6c4009
strrchr (char *__s, int __c) __THROW
Packit 6c4009
{
Packit 6c4009
  return __builtin_strrchr (__s, __c);
Packit 6c4009
}
Packit 6c4009
Packit 6c4009
__extern_always_inline const char *
Packit 6c4009
strrchr (const char *__s, int __c) __THROW
Packit 6c4009
{
Packit 6c4009
  return __builtin_strrchr (__s, __c);
Packit 6c4009
}
Packit 6c4009
# endif
Packit 6c4009
}
Packit 6c4009
#else
Packit 6c4009
extern char *strrchr (const char *__s, int __c)
Packit 6c4009
     __THROW __attribute_pure__ __nonnull ((1));
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
#ifdef __USE_GNU
Packit 6c4009
/* This function is similar to `strchr'.  But it returns a pointer to
Packit 6c4009
   the closing NUL byte in case C is not found in S.  */
Packit 6c4009
# ifdef __CORRECT_ISO_CPP_STRING_H_PROTO
Packit 6c4009
extern "C++" char *strchrnul (char *__s, int __c)
Packit 6c4009
     __THROW __asm ("strchrnul") __attribute_pure__ __nonnull ((1));
Packit 6c4009
extern "C++" const char *strchrnul (const char *__s, int __c)
Packit 6c4009
     __THROW __asm ("strchrnul") __attribute_pure__ __nonnull ((1));
Packit 6c4009
# else
Packit 6c4009
extern char *strchrnul (const char *__s, int __c)
Packit 6c4009
     __THROW __attribute_pure__ __nonnull ((1));
Packit 6c4009
# endif
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
/* Return the length of the initial segment of S which
Packit 6c4009
   consists entirely of characters not in REJECT.  */
Packit 6c4009
extern size_t strcspn (const char *__s, const char *__reject)
Packit 6c4009
     __THROW __attribute_pure__ __nonnull ((1, 2));
Packit 6c4009
/* Return the length of the initial segment of S which
Packit 6c4009
   consists entirely of characters in ACCEPT.  */
Packit 6c4009
extern size_t strspn (const char *__s, const char *__accept)
Packit 6c4009
     __THROW __attribute_pure__ __nonnull ((1, 2));
Packit 6c4009
/* Find the first occurrence in S of any character in ACCEPT.  */
Packit 6c4009
#ifdef __CORRECT_ISO_CPP_STRING_H_PROTO
Packit 6c4009
extern "C++"
Packit 6c4009
{
Packit 6c4009
extern char *strpbrk (char *__s, const char *__accept)
Packit 6c4009
     __THROW __asm ("strpbrk") __attribute_pure__ __nonnull ((1, 2));
Packit 6c4009
extern const char *strpbrk (const char *__s, const char *__accept)
Packit 6c4009
     __THROW __asm ("strpbrk") __attribute_pure__ __nonnull ((1, 2));
Packit 6c4009
Packit 6c4009
# ifdef __OPTIMIZE__
Packit 6c4009
__extern_always_inline char *
Packit 6c4009
strpbrk (char *__s, const char *__accept) __THROW
Packit 6c4009
{
Packit 6c4009
  return __builtin_strpbrk (__s, __accept);
Packit 6c4009
}
Packit 6c4009
Packit 6c4009
__extern_always_inline const char *
Packit 6c4009
strpbrk (const char *__s, const char *__accept) __THROW
Packit 6c4009
{
Packit 6c4009
  return __builtin_strpbrk (__s, __accept);
Packit 6c4009
}
Packit 6c4009
# endif
Packit 6c4009
}
Packit 6c4009
#else
Packit 6c4009
extern char *strpbrk (const char *__s, const char *__accept)
Packit 6c4009
     __THROW __attribute_pure__ __nonnull ((1, 2));
Packit 6c4009
#endif
Packit 6c4009
/* Find the first occurrence of NEEDLE in HAYSTACK.  */
Packit 6c4009
#ifdef __CORRECT_ISO_CPP_STRING_H_PROTO
Packit 6c4009
extern "C++"
Packit 6c4009
{
Packit 6c4009
extern char *strstr (char *__haystack, const char *__needle)
Packit 6c4009
     __THROW __asm ("strstr") __attribute_pure__ __nonnull ((1, 2));
Packit 6c4009
extern const char *strstr (const char *__haystack, const char *__needle)
Packit 6c4009
     __THROW __asm ("strstr") __attribute_pure__ __nonnull ((1, 2));
Packit 6c4009
Packit 6c4009
# ifdef __OPTIMIZE__
Packit 6c4009
__extern_always_inline char *
Packit 6c4009
strstr (char *__haystack, const char *__needle) __THROW
Packit 6c4009
{
Packit 6c4009
  return __builtin_strstr (__haystack, __needle);
Packit 6c4009
}
Packit 6c4009
Packit 6c4009
__extern_always_inline const char *
Packit 6c4009
strstr (const char *__haystack, const char *__needle) __THROW
Packit 6c4009
{
Packit 6c4009
  return __builtin_strstr (__haystack, __needle);
Packit 6c4009
}
Packit 6c4009
# endif
Packit 6c4009
}
Packit 6c4009
#else
Packit 6c4009
extern char *strstr (const char *__haystack, const char *__needle)
Packit 6c4009
     __THROW __attribute_pure__ __nonnull ((1, 2));
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* Divide S into tokens separated by characters in DELIM.  */
Packit 6c4009
extern char *strtok (char *__restrict __s, const char *__restrict __delim)
Packit 6c4009
     __THROW __nonnull ((2));
Packit 6c4009
Packit 6c4009
/* Divide S into tokens separated by characters in DELIM.  Information
Packit 6c4009
   passed between calls are stored in SAVE_PTR.  */
Packit 6c4009
extern char *__strtok_r (char *__restrict __s,
Packit 6c4009
			 const char *__restrict __delim,
Packit 6c4009
			 char **__restrict __save_ptr)
Packit 6c4009
     __THROW __nonnull ((2, 3));
Packit 6c4009
#ifdef __USE_POSIX
Packit 6c4009
extern char *strtok_r (char *__restrict __s, const char *__restrict __delim,
Packit 6c4009
		       char **__restrict __save_ptr)
Packit 6c4009
     __THROW __nonnull ((2, 3));
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
#ifdef __USE_GNU
Packit 6c4009
/* Similar to `strstr' but this function ignores the case of both strings.  */
Packit 6c4009
# ifdef __CORRECT_ISO_CPP_STRING_H_PROTO
Packit 6c4009
extern "C++" char *strcasestr (char *__haystack, const char *__needle)
Packit 6c4009
     __THROW __asm ("strcasestr") __attribute_pure__ __nonnull ((1, 2));
Packit 6c4009
extern "C++" const char *strcasestr (const char *__haystack,
Packit 6c4009
				     const char *__needle)
Packit 6c4009
     __THROW __asm ("strcasestr") __attribute_pure__ __nonnull ((1, 2));
Packit 6c4009
# else
Packit 6c4009
extern char *strcasestr (const char *__haystack, const char *__needle)
Packit 6c4009
     __THROW __attribute_pure__ __nonnull ((1, 2));
Packit 6c4009
# endif
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
#ifdef __USE_GNU
Packit 6c4009
/* Find the first occurrence of NEEDLE in HAYSTACK.
Packit 6c4009
   NEEDLE is NEEDLELEN bytes long;
Packit 6c4009
   HAYSTACK is HAYSTACKLEN bytes long.  */
Packit 6c4009
extern void *memmem (const void *__haystack, size_t __haystacklen,
Packit 6c4009
		     const void *__needle, size_t __needlelen)
Packit 6c4009
     __THROW __attribute_pure__ __nonnull ((1, 3));
Packit 6c4009
Packit 6c4009
/* Copy N bytes of SRC to DEST, return pointer to bytes after the
Packit 6c4009
   last written byte.  */
Packit 6c4009
extern void *__mempcpy (void *__restrict __dest,
Packit 6c4009
			const void *__restrict __src, size_t __n)
Packit 6c4009
     __THROW __nonnull ((1, 2));
Packit 6c4009
extern void *mempcpy (void *__restrict __dest,
Packit 6c4009
		      const void *__restrict __src, size_t __n)
Packit 6c4009
     __THROW __nonnull ((1, 2));
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* Return the length of S.  */
Packit 6c4009
extern size_t strlen (const char *__s)
Packit 6c4009
     __THROW __attribute_pure__ __nonnull ((1));
Packit 6c4009
Packit 6c4009
#ifdef	__USE_XOPEN2K8
Packit 6c4009
/* Find the length of STRING, but scan at most MAXLEN characters.
Packit 6c4009
   If no '\0' terminator is found in that many characters, return MAXLEN.  */
Packit 6c4009
extern size_t strnlen (const char *__string, size_t __maxlen)
Packit 6c4009
     __THROW __attribute_pure__ __nonnull ((1));
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* Return a string describing the meaning of the `errno' code in ERRNUM.  */
Packit 6c4009
extern char *strerror (int __errnum) __THROW;
Packit 6c4009
#ifdef __USE_XOPEN2K
Packit 6c4009
/* Reentrant version of `strerror'.
Packit 6c4009
   There are 2 flavors of `strerror_r', GNU which returns the string
Packit 6c4009
   and may or may not use the supplied temporary buffer and POSIX one
Packit 6c4009
   which fills the string into the buffer.
Packit 6c4009
   To use the POSIX version, -D_XOPEN_SOURCE=600 or -D_POSIX_C_SOURCE=200112L
Packit 6c4009
   without -D_GNU_SOURCE is needed, otherwise the GNU version is
Packit 6c4009
   preferred.  */
Packit 6c4009
# if defined __USE_XOPEN2K && !defined __USE_GNU
Packit 6c4009
/* Fill BUF with a string describing the meaning of the `errno' code in
Packit 6c4009
   ERRNUM.  */
Packit 6c4009
#  ifdef __REDIRECT_NTH
Packit 6c4009
extern int __REDIRECT_NTH (strerror_r,
Packit 6c4009
			   (int __errnum, char *__buf, size_t __buflen),
Packit 6c4009
			   __xpg_strerror_r) __nonnull ((2));
Packit 6c4009
#  else
Packit 6c4009
extern int __xpg_strerror_r (int __errnum, char *__buf, size_t __buflen)
Packit 6c4009
     __THROW __nonnull ((2));
Packit 6c4009
#   define strerror_r __xpg_strerror_r
Packit 6c4009
#  endif
Packit 6c4009
# else
Packit 6c4009
/* If a temporary buffer is required, at most BUFLEN bytes of BUF will be
Packit 6c4009
   used.  */
Packit 6c4009
extern char *strerror_r (int __errnum, char *__buf, size_t __buflen)
Packit 6c4009
     __THROW __nonnull ((2)) __wur;
Packit 6c4009
# endif
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
#ifdef __USE_XOPEN2K8
Packit 6c4009
/* Translate error number to string according to the locale L.  */
Packit 6c4009
extern char *strerror_l (int __errnum, locale_t __l) __THROW;
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
#ifdef __USE_MISC
Packit 6c4009
# include <strings.h>
Packit 6c4009
Packit 6c4009
/* Set N bytes of S to 0.  The compiler will not delete a call to this
Packit 6c4009
   function, even if S is dead after the call.  */
Packit 6c4009
extern void explicit_bzero (void *__s, size_t __n) __THROW __nonnull ((1));
Packit 6c4009
Packit 6c4009
/* Return the next DELIM-delimited token from *STRINGP,
Packit 6c4009
   terminating it with a '\0', and update *STRINGP to point past it.  */
Packit 6c4009
extern char *strsep (char **__restrict __stringp,
Packit 6c4009
		     const char *__restrict __delim)
Packit 6c4009
     __THROW __nonnull ((1, 2));
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
#ifdef	__USE_XOPEN2K8
Packit 6c4009
/* Return a string describing the meaning of the signal number in SIG.  */
Packit 6c4009
extern char *strsignal (int __sig) __THROW;
Packit 6c4009
Packit 6c4009
/* Copy SRC to DEST, returning the address of the terminating '\0' in DEST.  */
Packit 6c4009
extern char *__stpcpy (char *__restrict __dest, const char *__restrict __src)
Packit 6c4009
     __THROW __nonnull ((1, 2));
Packit 6c4009
extern char *stpcpy (char *__restrict __dest, const char *__restrict __src)
Packit 6c4009
     __THROW __nonnull ((1, 2));
Packit 6c4009
Packit 6c4009
/* Copy no more than N characters of SRC to DEST, returning the address of
Packit 6c4009
   the last character written into DEST.  */
Packit 6c4009
extern char *__stpncpy (char *__restrict __dest,
Packit 6c4009
			const char *__restrict __src, size_t __n)
Packit 6c4009
     __THROW __nonnull ((1, 2));
Packit 6c4009
extern char *stpncpy (char *__restrict __dest,
Packit 6c4009
		      const char *__restrict __src, size_t __n)
Packit 6c4009
     __THROW __nonnull ((1, 2));
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
#ifdef	__USE_GNU
Packit 6c4009
/* Compare S1 and S2 as strings holding name & indices/version numbers.  */
Packit 6c4009
extern int strverscmp (const char *__s1, const char *__s2)
Packit 6c4009
     __THROW __attribute_pure__ __nonnull ((1, 2));
Packit 6c4009
Packit 6c4009
/* Sautee STRING briskly.  */
Packit 6c4009
extern char *strfry (char *__string) __THROW __nonnull ((1));
Packit 6c4009
Packit 6c4009
/* Frobnicate N bytes of S.  */
Packit 6c4009
extern void *memfrob (void *__s, size_t __n) __THROW __nonnull ((1));
Packit 6c4009
Packit 6c4009
# ifndef basename
Packit 6c4009
/* Return the file name within directory of FILENAME.  We don't
Packit 6c4009
   declare the function if the `basename' macro is available (defined
Packit 6c4009
   in <libgen.h>) which makes the XPG version of this function
Packit 6c4009
   available.  */
Packit 6c4009
#  ifdef __CORRECT_ISO_CPP_STRING_H_PROTO
Packit 6c4009
extern "C++" char *basename (char *__filename)
Packit 6c4009
     __THROW __asm ("basename") __nonnull ((1));
Packit 6c4009
extern "C++" const char *basename (const char *__filename)
Packit 6c4009
     __THROW __asm ("basename") __nonnull ((1));
Packit 6c4009
#  else
Packit 6c4009
extern char *basename (const char *__filename) __THROW __nonnull ((1));
Packit 6c4009
#  endif
Packit 6c4009
# endif
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
#if __GNUC_PREREQ (3,4)
Packit 6c4009
# if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function
Packit 6c4009
/* Functions with security checks.  */
Packit 6c4009
#  include <bits/string_fortified.h>
Packit 6c4009
# endif
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
__END_DECLS
Packit 6c4009
Packit 6c4009
#endif /* string.h  */