modernc.org/cc@v1.0.1/v2/headers/linux_amd64/usr/include/string.h (about)

     1  /* Copyright (C) 1991-2015 Free Software Foundation, Inc.
     2     This file is part of the GNU C Library.
     3  
     4     The GNU C Library is free software; you can redistribute it and/or
     5     modify it under the terms of the GNU Lesser General Public
     6     License as published by the Free Software Foundation; either
     7     version 2.1 of the License, or (at your option) any later version.
     8  
     9     The GNU C Library is distributed in the hope that it will be useful,
    10     but WITHOUT ANY WARRANTY; without even the implied warranty of
    11     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    12     Lesser General Public License for more details.
    13  
    14     You should have received a copy of the GNU Lesser General Public
    15     License along with the GNU C Library; if not, see
    16     <http://www.gnu.org/licenses/>.  */
    17  
    18  /*
    19   *	ISO C99 Standard: 7.21 String handling	<string.h>
    20   */
    21  
    22  #ifndef	_STRING_H
    23  #define	_STRING_H	1
    24  
    25  #include <features.h>
    26  
    27  __BEGIN_DECLS
    28  /* Get size_t and NULL from <stddef.h>.  */
    29  #define	__need_size_t
    30  #define	__need_NULL
    31  #include <stddef.h>
    32  /* Tell the caller that we provide correct C++ prototypes.  */
    33  #if defined __cplusplus && __GNUC_PREREQ (4, 4)
    34  # define __CORRECT_ISO_CPP_STRING_H_PROTO
    35  #endif
    36      __BEGIN_NAMESPACE_STD
    37  /* Copy N bytes of SRC to DEST.  */
    38  extern void *memcpy(void *__restrict __dest, const void *__restrict __src, size_t __n)
    39  __THROW __nonnull((1, 2));
    40  /* Copy N bytes of SRC to DEST, guaranteeing
    41     correct behavior for overlapping strings.  */
    42  extern void *memmove(void *__dest, const void *__src, size_t __n)
    43  __THROW __nonnull((1, 2));
    44  __END_NAMESPACE_STD
    45  /* Copy no more than N bytes of SRC to DEST, stopping when C is found.
    46     Return the position in DEST one byte past where C was copied,
    47     or NULL if C was not found in the first N bytes of SRC.  */
    48  #if defined __USE_MISC || defined __USE_XOPEN
    49  extern void *memccpy(void *__restrict __dest, const void *__restrict __src, int __c, size_t __n)
    50  __THROW __nonnull((1, 2));
    51  #endif				/* Misc || X/Open.  */
    52  
    53  __BEGIN_NAMESPACE_STD
    54  /* Set N bytes of S to C.  */
    55  extern void *memset(void *__s, int __c, size_t __n)
    56  __THROW __nonnull((1));
    57  
    58  /* Compare N bytes of S1 and S2.  */
    59  extern int memcmp(const void *__s1, const void *__s2, size_t __n)
    60  __THROW __attribute_pure__ __nonnull((1, 2));
    61  
    62  /* Search N bytes of S for C.  */
    63  #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO
    64  extern "C++" {
    65  	extern void *memchr(void *__s, int __c, size_t __n)
    66  	__THROW __asm("memchr") __attribute_pure__ __nonnull((1));
    67  	extern const void *memchr(const void *__s, int __c, size_t __n)
    68  	__THROW __asm("memchr") __attribute_pure__ __nonnull((1));
    69  
    70  # ifdef __OPTIMIZE__
    71  	__extern_always_inline void *memchr(void *__s, int __c, size_t __n) __THROW
    72  {
    73  	return __builtin_memchr(__s, __c, __n);
    74  } __extern_always_inline const void *memchr(const void *__s, int __c, size_t __n) __THROW {
    75  		return __builtin_memchr(__s, __c, __n);
    76  }
    77  # endif
    78  }
    79  #else
    80  extern void *memchr(const void *__s, int __c, size_t __n)
    81  __THROW __attribute_pure__ __nonnull((1));
    82  #endif
    83  __END_NAMESPACE_STD
    84  #ifdef __USE_GNU
    85  /* Search in S for C.  This is similar to `memchr' but there is no
    86     length limit.  */
    87  # ifdef __CORRECT_ISO_CPP_STRING_H_PROTO
    88  extern "C++" void *rawmemchr(void *__s, int __c)
    89  __THROW __asm("rawmemchr")
    90  __attribute_pure__ __nonnull((1));
    91  extern "C++" const void *rawmemchr(const void *__s, int __c)
    92  __THROW __asm("rawmemchr")
    93  __attribute_pure__ __nonnull((1));
    94  # else
    95  extern void *rawmemchr(const void *__s, int __c)
    96  __THROW __attribute_pure__ __nonnull((1));
    97  # endif
    98  
    99  /* Search N bytes of S for the final occurrence of C.  */
   100  # ifdef __CORRECT_ISO_CPP_STRING_H_PROTO
   101  extern "C++" void *memrchr(void *__s, int __c, size_t __n)
   102  __THROW __asm("memrchr")
   103  __attribute_pure__ __nonnull((1));
   104  extern "C++" const void *memrchr(const void *__s, int __c, size_t __n)
   105  __THROW __asm("memrchr")
   106  __attribute_pure__ __nonnull((1));
   107  # else
   108  extern void *memrchr(const void *__s, int __c, size_t __n)
   109  __THROW __attribute_pure__ __nonnull((1));
   110  # endif
   111  #endif
   112  
   113  __BEGIN_NAMESPACE_STD
   114  /* Copy SRC to DEST.  */
   115  extern char *strcpy(char *__restrict __dest, const char *__restrict __src)
   116  __THROW __nonnull((1, 2));
   117  /* Copy no more than N characters of SRC to DEST.  */
   118  extern char *strncpy(char *__restrict __dest, const char *__restrict __src, size_t __n)
   119  __THROW __nonnull((1, 2));
   120  
   121  /* Append SRC onto DEST.  */
   122  extern char *strcat(char *__restrict __dest, const char *__restrict __src)
   123  __THROW __nonnull((1, 2));
   124  /* Append no more than N characters from SRC onto DEST.  */
   125  extern char *strncat(char *__restrict __dest, const char *__restrict __src, size_t __n)
   126  __THROW __nonnull((1, 2));
   127  
   128  /* Compare S1 and S2.  */
   129  extern int strcmp(const char *__s1, const char *__s2)
   130  __THROW __attribute_pure__ __nonnull((1, 2));
   131  /* Compare N characters of S1 and S2.  */
   132  extern int strncmp(const char *__s1, const char *__s2, size_t __n)
   133  __THROW __attribute_pure__ __nonnull((1, 2));
   134  
   135  /* Compare the collated forms of S1 and S2.  */
   136  extern int strcoll(const char *__s1, const char *__s2)
   137  __THROW __attribute_pure__ __nonnull((1, 2));
   138  /* Put a transformation of SRC into no more than N bytes of DEST.  */
   139  extern size_t strxfrm(char *__restrict __dest, const char *__restrict __src, size_t __n)
   140  __THROW __nonnull((2));
   141  __END_NAMESPACE_STD
   142  #ifdef __USE_XOPEN2K8
   143  /* The following functions are equivalent to the both above but they
   144     take the locale they use for the collation as an extra argument.
   145     This is not standardsized but something like will come.  */
   146  # include <xlocale.h>
   147  /* Compare the collated forms of S1 and S2 using rules from L.  */
   148  extern int strcoll_l(const char *__s1, const char *__s2, __locale_t __l)
   149  __THROW __attribute_pure__ __nonnull((1, 2, 3));
   150  /* Put a transformation of SRC into no more than N bytes of DEST.  */
   151  extern size_t strxfrm_l(char *__dest, const char *__src, size_t __n, __locale_t __l)
   152  __THROW __nonnull((2, 4));
   153  #endif
   154  
   155  #if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8
   156  /* Duplicate S, returning an identical malloc'd string.  */
   157  extern char *strdup(const char *__s)
   158  __THROW __attribute_malloc__ __nonnull((1));
   159  #endif
   160  
   161  /* Return a malloc'd copy of at most N bytes of STRING.  The
   162     resultant string is terminated even if no null terminator
   163     appears before STRING[N].  */
   164  #if defined __USE_XOPEN2K8
   165  extern char *strndup(const char *__string, size_t __n)
   166  __THROW __attribute_malloc__ __nonnull((1));
   167  #endif
   168  
   169  #if defined __USE_GNU && defined __GNUC__
   170  /* Duplicate S, returning an identical alloca'd string.  */
   171  # define strdupa(s)							      \
   172    (__extension__							      \
   173      ({									      \
   174        const char *__old = (s);						      \
   175        size_t __len = strlen (__old) + 1;				      \
   176        char *__new = (char *) __builtin_alloca (__len);			      \
   177        (char *) memcpy (__new, __old, __len);				      \
   178      }))
   179  
   180  /* Return an alloca'd copy of at most N bytes of string.  */
   181  # define strndupa(s, n)							      \
   182    (__extension__							      \
   183      ({									      \
   184        const char *__old = (s);						      \
   185        size_t __len = strnlen (__old, (n));				      \
   186        char *__new = (char *) __builtin_alloca (__len + 1);		      \
   187        __new[__len] = '\0';						      \
   188        (char *) memcpy (__new, __old, __len);				      \
   189      }))
   190  #endif
   191  
   192  __BEGIN_NAMESPACE_STD
   193  /* Find the first occurrence of C in S.  */
   194  #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO
   195  extern "C++" {
   196  	extern char *strchr(char *__s, int __c)
   197  	__THROW __asm("strchr") __attribute_pure__ __nonnull((1));
   198  	extern const char *strchr(const char *__s, int __c)
   199  	__THROW __asm("strchr") __attribute_pure__ __nonnull((1));
   200  
   201  # ifdef __OPTIMIZE__
   202  	__extern_always_inline char *strchr(char *__s, int __c) __THROW
   203  {
   204  	return __builtin_strchr(__s, __c);
   205  } __extern_always_inline const char *strchr(const char *__s, int __c) __THROW {
   206  		return __builtin_strchr(__s, __c);
   207  }
   208  # endif
   209  }
   210  #else
   211  extern char *strchr(const char *__s, int __c)
   212  __THROW __attribute_pure__ __nonnull((1));
   213  #endif
   214  /* Find the last occurrence of C in S.  */
   215  #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO
   216  extern "C++" {
   217  	extern char *strrchr(char *__s, int __c)
   218  	__THROW __asm("strrchr") __attribute_pure__ __nonnull((1));
   219  	extern const char *strrchr(const char *__s, int __c)
   220  	__THROW __asm("strrchr") __attribute_pure__ __nonnull((1));
   221  
   222  # ifdef __OPTIMIZE__
   223  	__extern_always_inline char *strrchr(char *__s, int __c) __THROW
   224  {
   225  	return __builtin_strrchr(__s, __c);
   226  } __extern_always_inline const char *strrchr(const char *__s, int __c) __THROW {
   227  		return __builtin_strrchr(__s, __c);
   228  }
   229  # endif
   230  }
   231  #else
   232  extern char *strrchr(const char *__s, int __c)
   233  __THROW __attribute_pure__ __nonnull((1));
   234  #endif
   235  __END_NAMESPACE_STD
   236  #ifdef __USE_GNU
   237  /* This function is similar to `strchr'.  But it returns a pointer to
   238     the closing NUL byte in case C is not found in S.  */
   239  # ifdef __CORRECT_ISO_CPP_STRING_H_PROTO
   240  extern "C++" char *strchrnul(char *__s, int __c)
   241  __THROW __asm("strchrnul")
   242  __attribute_pure__ __nonnull((1));
   243  extern "C++" const char *strchrnul(const char *__s, int __c)
   244  __THROW __asm("strchrnul")
   245  __attribute_pure__ __nonnull((1));
   246  # else
   247  extern char *strchrnul(const char *__s, int __c)
   248  __THROW __attribute_pure__ __nonnull((1));
   249  # endif
   250  #endif
   251  
   252  __BEGIN_NAMESPACE_STD
   253  /* Return the length of the initial segment of S which
   254     consists entirely of characters not in REJECT.  */
   255  extern size_t strcspn(const char *__s, const char *__reject)
   256  __THROW __attribute_pure__ __nonnull((1, 2));
   257  /* Return the length of the initial segment of S which
   258     consists entirely of characters in ACCEPT.  */
   259  extern size_t strspn(const char *__s, const char *__accept)
   260  __THROW __attribute_pure__ __nonnull((1, 2));
   261  /* Find the first occurrence in S of any character in ACCEPT.  */
   262  #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO
   263  extern "C++" {
   264  	extern char *strpbrk(char *__s, const char *__accept)
   265  	__THROW __asm("strpbrk") __attribute_pure__ __nonnull((1, 2));
   266  	extern const char *strpbrk(const char *__s, const char *__accept)
   267  	__THROW __asm("strpbrk") __attribute_pure__ __nonnull((1, 2));
   268  
   269  # ifdef __OPTIMIZE__
   270  	__extern_always_inline char *strpbrk(char *__s, const char *__accept) __THROW
   271  {
   272  	return __builtin_strpbrk(__s, __accept);
   273  } __extern_always_inline const char *strpbrk(const char *__s, const char *__accept) __THROW {
   274  		return __builtin_strpbrk(__s, __accept);
   275  }
   276  # endif
   277  }
   278  #else
   279  extern char *strpbrk(const char *__s, const char *__accept)
   280  __THROW __attribute_pure__ __nonnull((1, 2));
   281  #endif
   282  /* Find the first occurrence of NEEDLE in HAYSTACK.  */
   283  #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO
   284  extern "C++" {
   285  	extern char *strstr(char *__haystack, const char *__needle)
   286  	__THROW __asm("strstr") __attribute_pure__ __nonnull((1, 2));
   287  	extern const char *strstr(const char *__haystack, const char *__needle)
   288  	__THROW __asm("strstr") __attribute_pure__ __nonnull((1, 2));
   289  
   290  # ifdef __OPTIMIZE__
   291  	__extern_always_inline char *strstr(char *__haystack, const char *__needle) __THROW
   292  {
   293  	return __builtin_strstr(__haystack, __needle);
   294  } __extern_always_inline const char *strstr(const char *__haystack, const char *__needle) __THROW {
   295  		return __builtin_strstr(__haystack, __needle);
   296  }
   297  # endif
   298  }
   299  #else
   300  extern char *strstr(const char *__haystack, const char *__needle)
   301  __THROW __attribute_pure__ __nonnull((1, 2));
   302  #endif
   303  
   304  /* Divide S into tokens separated by characters in DELIM.  */
   305  extern char *strtok(char *__restrict __s, const char *__restrict __delim)
   306  __THROW __nonnull((2));
   307  __END_NAMESPACE_STD
   308  /* Divide S into tokens separated by characters in DELIM.  Information
   309     passed between calls are stored in SAVE_PTR.  */
   310  extern char *__strtok_r(char *__restrict __s, const char *__restrict __delim, char **__restrict __save_ptr)
   311  __THROW __nonnull((2, 3));
   312  #ifdef __USE_POSIX
   313  extern char *strtok_r(char *__restrict __s, const char *__restrict __delim, char **__restrict __save_ptr)
   314  __THROW __nonnull((2, 3));
   315  #endif
   316  
   317  #ifdef __USE_GNU
   318  /* Similar to `strstr' but this function ignores the case of both strings.  */
   319  # ifdef __CORRECT_ISO_CPP_STRING_H_PROTO
   320  extern "C++" char *strcasestr(char *__haystack, const char *__needle)
   321  __THROW __asm("strcasestr")
   322  __attribute_pure__ __nonnull((1, 2));
   323  extern "C++" const char *strcasestr(const char *__haystack, const char *__needle)
   324  __THROW __asm("strcasestr")
   325  __attribute_pure__ __nonnull((1, 2));
   326  # else
   327  extern char *strcasestr(const char *__haystack, const char *__needle)
   328  __THROW __attribute_pure__ __nonnull((1, 2));
   329  # endif
   330  #endif
   331  
   332  #ifdef __USE_GNU
   333  /* Find the first occurrence of NEEDLE in HAYSTACK.
   334     NEEDLE is NEEDLELEN bytes long;
   335     HAYSTACK is HAYSTACKLEN bytes long.  */
   336  extern void *memmem(const void *__haystack, size_t __haystacklen, const void *__needle, size_t __needlelen)
   337  __THROW __attribute_pure__ __nonnull((1, 3));
   338  
   339  /* Copy N bytes of SRC to DEST, return pointer to bytes after the
   340     last written byte.  */
   341  extern void *__mempcpy(void *__restrict __dest, const void *__restrict __src, size_t __n)
   342  __THROW __nonnull((1, 2));
   343  extern void *mempcpy(void *__restrict __dest, const void *__restrict __src, size_t __n)
   344  __THROW __nonnull((1, 2));
   345  #endif
   346  
   347  __BEGIN_NAMESPACE_STD
   348  /* Return the length of S.  */
   349  extern size_t strlen(const char *__s)
   350  __THROW __attribute_pure__ __nonnull((1));
   351  __END_NAMESPACE_STD
   352  #ifdef	__USE_XOPEN2K8
   353  /* Find the length of STRING, but scan at most MAXLEN characters.
   354     If no '\0' terminator is found in that many characters, return MAXLEN.  */
   355  extern size_t strnlen(const char *__string, size_t __maxlen)
   356  __THROW __attribute_pure__ __nonnull((1));
   357  #endif
   358  
   359  __BEGIN_NAMESPACE_STD
   360  /* Return a string describing the meaning of the `errno' code in ERRNUM.  */
   361  extern char *strerror(int __errnum) __THROW;
   362  __END_NAMESPACE_STD
   363  #ifdef __USE_XOPEN2K
   364  /* Reentrant version of `strerror'.
   365     There are 2 flavors of `strerror_r', GNU which returns the string
   366     and may or may not use the supplied temporary buffer and POSIX one
   367     which fills the string into the buffer.
   368     To use the POSIX version, -D_XOPEN_SOURCE=600 or -D_POSIX_C_SOURCE=200112L
   369     without -D_GNU_SOURCE is needed, otherwise the GNU version is
   370     preferred.  */
   371  # if defined __USE_XOPEN2K && !defined __USE_GNU
   372  /* Fill BUF with a string describing the meaning of the `errno' code in
   373     ERRNUM.  */
   374  #  ifdef __REDIRECT_NTH
   375  extern int __REDIRECT_NTH(strerror_r, (int __errnum, char *__buf, size_t __buflen), __xpg_strerror_r) __nonnull((2));
   376  #  else
   377  extern int __xpg_strerror_r(int __errnum, char *__buf, size_t __buflen)
   378  __THROW __nonnull((2));
   379  #   define strerror_r __xpg_strerror_r
   380  #  endif
   381  # else
   382  /* If a temporary buffer is required, at most BUFLEN bytes of BUF will be
   383     used.  */
   384  extern char *strerror_r(int __errnum, char *__buf, size_t __buflen)
   385  __THROW __nonnull((2)) __wur;
   386  # endif
   387  #endif
   388  
   389  #ifdef __USE_XOPEN2K8
   390  /* Translate error number to string according to the locale L.  */
   391  extern char *strerror_l(int __errnum, __locale_t __l) __THROW;
   392  #endif
   393  
   394  /* We define this function always since `bzero' is sometimes needed when
   395     the namespace rules does not allow this.  */
   396  extern void __bzero(void *__s, size_t __n)
   397  __THROW __nonnull((1));
   398  
   399  #ifdef __USE_MISC
   400  /* Copy N bytes of SRC to DEST (like memmove, but args reversed).  */
   401  extern void bcopy(const void *__src, void *__dest, size_t __n)
   402  __THROW __nonnull((1, 2));
   403  
   404  /* Set N bytes of S to 0.  */
   405  extern void bzero(void *__s, size_t __n)
   406  __THROW __nonnull((1));
   407  
   408  /* Compare N bytes of S1 and S2 (same as memcmp).  */
   409  extern int bcmp(const void *__s1, const void *__s2, size_t __n)
   410  __THROW __attribute_pure__ __nonnull((1, 2));
   411  
   412  /* Find the first occurrence of C in S (same as strchr).  */
   413  # ifdef __CORRECT_ISO_CPP_STRING_H_PROTO
   414  extern "C++" {
   415  	extern char *index(char *__s, int __c)
   416  	__THROW __asm("index") __attribute_pure__ __nonnull((1));
   417  	extern const char *index(const char *__s, int __c)
   418  	__THROW __asm("index") __attribute_pure__ __nonnull((1));
   419  
   420  #  if defined __OPTIMIZE__ && !defined __CORRECT_ISO_CPP_STRINGS_H_PROTO
   421  	__extern_always_inline char *index(char *__s, int __c) __THROW
   422  {
   423  	return __builtin_index(__s, __c);
   424  } __extern_always_inline const char *index(const char *__s, int __c) __THROW {
   425  		return __builtin_index(__s, __c);
   426  }
   427  #  endif
   428  }
   429  # else
   430  extern char *index(const char *__s, int __c)
   431  __THROW __attribute_pure__ __nonnull((1));
   432  # endif
   433  
   434  /* Find the last occurrence of C in S (same as strrchr).  */
   435  # ifdef __CORRECT_ISO_CPP_STRING_H_PROTO
   436  extern "C++" {
   437  	extern char *rindex(char *__s, int __c)
   438  	__THROW __asm("rindex") __attribute_pure__ __nonnull((1));
   439  	extern const char *rindex(const char *__s, int __c)
   440  	__THROW __asm("rindex") __attribute_pure__ __nonnull((1));
   441  
   442  #  if defined __OPTIMIZE__ && !defined __CORRECT_ISO_CPP_STRINGS_H_PROTO
   443  	__extern_always_inline char *rindex(char *__s, int __c) __THROW
   444  {
   445  	return __builtin_rindex(__s, __c);
   446  } __extern_always_inline const char *rindex(const char *__s, int __c) __THROW {
   447  		return __builtin_rindex(__s, __c);
   448  }
   449  #endif
   450  }
   451  # else
   452  extern char *rindex(const char *__s, int __c)
   453  __THROW __attribute_pure__ __nonnull((1));
   454  # endif
   455  
   456  /* Return the position of the first bit set in I, or 0 if none are set.
   457     The least-significant bit is position 1, the most-significant 32.  */
   458  extern int ffs(int __i)
   459  __THROW __attribute__ ((__const__));
   460  
   461  /* The following two functions are non-standard but necessary for non-32 bit
   462     platforms.  */
   463  # ifdef	__USE_GNU
   464  extern int ffsl(long int __l)
   465  __THROW __attribute__ ((__const__));
   466  __extension__ extern int ffsll(long long int __ll)
   467  __THROW __attribute__ ((__const__));
   468  # endif
   469  
   470  /* Compare S1 and S2, ignoring case.  */
   471  extern int strcasecmp(const char *__s1, const char *__s2)
   472  __THROW __attribute_pure__ __nonnull((1, 2));
   473  
   474  /* Compare no more than N chars of S1 and S2, ignoring case.  */
   475  extern int strncasecmp(const char *__s1, const char *__s2, size_t __n)
   476  __THROW __attribute_pure__ __nonnull((1, 2));
   477  #endif				/* Use misc.  */
   478  
   479  #ifdef	__USE_GNU
   480  /* Again versions of a few functions which use the given locale instead
   481     of the global one.  */
   482  extern int strcasecmp_l(const char *__s1, const char *__s2, __locale_t __loc)
   483  __THROW __attribute_pure__ __nonnull((1, 2, 3));
   484  
   485  extern int strncasecmp_l(const char *__s1, const char *__s2, size_t __n, __locale_t __loc)
   486  __THROW __attribute_pure__ __nonnull((1, 2, 4));
   487  #endif
   488  
   489  #ifdef	__USE_MISC
   490  /* Return the next DELIM-delimited token from *STRINGP,
   491     terminating it with a '\0', and update *STRINGP to point past it.  */
   492  extern char *strsep(char **__restrict __stringp, const char *__restrict __delim)
   493  __THROW __nonnull((1, 2));
   494  #endif
   495  
   496  #ifdef	__USE_XOPEN2K8
   497  /* Return a string describing the meaning of the signal number in SIG.  */
   498  extern char *strsignal(int __sig) __THROW;
   499  
   500  /* Copy SRC to DEST, returning the address of the terminating '\0' in DEST.  */
   501  extern char *__stpcpy(char *__restrict __dest, const char *__restrict __src)
   502  __THROW __nonnull((1, 2));
   503  extern char *stpcpy(char *__restrict __dest, const char *__restrict __src)
   504  __THROW __nonnull((1, 2));
   505  
   506  /* Copy no more than N characters of SRC to DEST, returning the address of
   507     the last character written into DEST.  */
   508  extern char *__stpncpy(char *__restrict __dest, const char *__restrict __src, size_t __n)
   509  __THROW __nonnull((1, 2));
   510  extern char *stpncpy(char *__restrict __dest, const char *__restrict __src, size_t __n)
   511  __THROW __nonnull((1, 2));
   512  #endif
   513  
   514  #ifdef	__USE_GNU
   515  /* Compare S1 and S2 as strings holding name & indices/version numbers.  */
   516  extern int strverscmp(const char *__s1, const char *__s2)
   517  __THROW __attribute_pure__ __nonnull((1, 2));
   518  
   519  /* Sautee STRING briskly.  */
   520  extern char *strfry(char *__string)
   521  __THROW __nonnull((1));
   522  
   523  /* Frobnicate N bytes of S.  */
   524  extern void *memfrob(void *__s, size_t __n)
   525  __THROW __nonnull((1));
   526  
   527  # ifndef basename
   528  /* Return the file name within directory of FILENAME.  We don't
   529     declare the function if the `basename' macro is available (defined
   530     in <libgen.h>) which makes the XPG version of this function
   531     available.  */
   532  #  ifdef __CORRECT_ISO_CPP_STRING_H_PROTO
   533  extern "C++" char *basename(char *__filename)
   534  __THROW __asm("basename") __nonnull((1));
   535  extern "C++" const char *basename(const char *__filename)
   536  __THROW __asm("basename") __nonnull((1));
   537  #  else
   538  extern char *basename(const char *__filename)
   539  __THROW __nonnull((1));
   540  #  endif
   541  # endif
   542  #endif
   543  
   544  #if defined __GNUC__ && __GNUC__ >= 2
   545  # if defined __OPTIMIZE__ && !defined __OPTIMIZE_SIZE__ \
   546       && !defined __NO_INLINE__ && !defined __cplusplus
   547  /* When using GNU CC we provide some optimized versions of selected
   548     functions from this header.  There are two kinds of optimizations:
   549  
   550     - machine-dependent optimizations, most probably using inline
   551       assembler code; these might be quite expensive since the code
   552       size can increase significantly.
   553       These optimizations are not used unless the symbol
   554  	__USE_STRING_INLINES
   555       is defined before including this header.
   556  
   557     - machine-independent optimizations which do not increase the
   558       code size significantly and which optimize mainly situations
   559       where one or more arguments are compile-time constants.
   560       These optimizations are used always when the compiler is
   561       taught to optimize.
   562  
   563     One can inhibit all optimizations by defining __NO_STRING_INLINES.  */
   564  
   565  /* Get the machine-dependent optimizations (if any).  */
   566  #  include <bits/string.h>
   567  
   568  /* These are generic optimizations which do not add too much inline code.  */
   569  #  include <bits/string2.h>
   570  # endif
   571  
   572  # if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function
   573  /* Functions with security checks.  */
   574  #  include <bits/string3.h>
   575  # endif
   576  #endif
   577  
   578  __END_DECLS
   579  #endif				/* string.h  */