Back to index

glibc  2.9
string.h
Go to the documentation of this file.
00001 #ifndef _STRING_H
00002 
00003 #include <sys/types.h>
00004 
00005 extern void *__memccpy (void *__dest, __const void *__src,
00006                      int __c, size_t __n);
00007 
00008 extern size_t __strnlen (__const char *__string, size_t __maxlen)
00009      __attribute_pure__;
00010 
00011 extern char *__strsep (char **__stringp, __const char *__delim);
00012 
00013 extern int __strverscmp (__const char *__s1, __const char *__s2)
00014      __attribute_pure__;
00015 
00016 extern int __strncasecmp (__const char *__s1, __const char *__s2,
00017                        size_t __n)
00018      __attribute_pure__;
00019 
00020 extern int __strcasecmp (__const char *__s1, __const char *__s2)
00021      __attribute_pure__;
00022 
00023 extern char *__strcasestr (__const char *__haystack, __const char *__needle)
00024      __attribute_pure__;
00025 
00026 extern char *__strdup (__const char *__string)
00027      __attribute_malloc__;
00028 extern char *__strndup (__const char *__string, size_t __n)
00029      __attribute_malloc__;
00030 
00031 extern void *__rawmemchr (__const void *__s, int __c)
00032      __attribute_pure__;
00033 
00034 extern char *__strchrnul (__const char *__s, int __c)
00035      __attribute_pure__;
00036 
00037 extern void *__memrchr (__const void *__s, int __c, size_t __n)
00038      __attribute_pure__;
00039 
00040 extern void *__memchr (__const void *__s, int __c, size_t __n)
00041      __attribute_pure__;
00042 
00043 extern int __ffs (int __i) __attribute__ ((const));
00044 
00045 extern char *__strerror_r (int __errnum, char *__buf, size_t __buflen);
00046 
00047 /* Now the real definitions.  We do this here since some of the functions
00048    above are defined as macros in the headers.  */
00049 #include <string/string.h>
00050 
00051 extern __typeof (strcoll_l) __strcoll_l;
00052 extern __typeof (strxfrm_l) __strxfrm_l;
00053 extern __typeof (strcasecmp_l) __strcasecmp_l;
00054 extern __typeof (strncasecmp_l) __strncasecmp_l;
00055 
00056 /* Alternative version which doesn't pollute glibc's namespace.  */
00057 #ifndef NOT_IN_libc
00058 # undef strndupa
00059 # define strndupa(s, n)                                                     \
00060   (__extension__                                                     \
00061     ({                                                               \
00062       __const char *__old = (s);                                     \
00063       size_t __len = __strnlen (__old, (n));                                \
00064       char *__new = (char *) __builtin_alloca (__len + 1);                  \
00065       __new[__len] = '\0';                                           \
00066       (char *) memcpy (__new, __old, __len);                                \
00067     }))
00068 #endif
00069 
00070 libc_hidden_proto (__mempcpy)
00071 libc_hidden_proto (__stpcpy)
00072 libc_hidden_proto (__stpncpy)
00073 libc_hidden_proto (__rawmemchr)
00074 libc_hidden_proto (__strcasecmp)
00075 libc_hidden_proto (__strcasecmp_l)
00076 libc_hidden_proto (__strncasecmp_l)
00077 libc_hidden_proto (__strdup)
00078 libc_hidden_proto (__strndup)
00079 libc_hidden_proto (__strerror_r)
00080 libc_hidden_proto (__strverscmp)
00081 libc_hidden_proto (basename)
00082 libc_hidden_proto (strcoll)
00083 libc_hidden_proto (__strcoll_l)
00084 libc_hidden_proto (__strxfrm_l)
00085 libc_hidden_proto (__strtok_r)
00086 extern char *__strsep_g (char **__stringp, __const char *__delim);
00087 libc_hidden_proto (__strsep_g)
00088 libc_hidden_proto (strnlen)
00089 
00090 libc_hidden_builtin_proto (memchr)
00091 libc_hidden_builtin_proto (memcpy)
00092 libc_hidden_builtin_proto (mempcpy)
00093 libc_hidden_builtin_proto (memcmp)
00094 libc_hidden_builtin_proto (memmove)
00095 libc_hidden_builtin_proto (memset)
00096 libc_hidden_builtin_proto (strcat)
00097 libc_hidden_builtin_proto (strchr)
00098 libc_hidden_builtin_proto (strcmp)
00099 libc_hidden_builtin_proto (strcpy)
00100 libc_hidden_builtin_proto (strcspn)
00101 libc_hidden_builtin_proto (strlen)
00102 libc_hidden_builtin_proto (strncmp)
00103 libc_hidden_builtin_proto (strncpy)
00104 libc_hidden_builtin_proto (strpbrk)
00105 libc_hidden_builtin_proto (stpcpy)
00106 libc_hidden_builtin_proto (strrchr)
00107 libc_hidden_builtin_proto (strspn)
00108 libc_hidden_builtin_proto (strstr)
00109 libc_hidden_builtin_proto (ffs)
00110 
00111 # ifndef _ISOMAC
00112 #  ifndef index
00113 #   define index(s, c)      (strchr ((s), (c)))
00114 #  endif
00115 #  ifndef rindex
00116 #   define rindex(s, c)     (strrchr ((s), (c)))
00117 #  endif
00118 # endif
00119 
00120 extern void *__memcpy_chk (void *__restrict __dest,
00121                         const void *__restrict __src, size_t __len,
00122                         size_t __destlen) __THROW;
00123 extern void *__memmove_chk (void *__dest, const void *__src, size_t __len,
00124                          size_t __destlen) __THROW;
00125 extern void *__mempcpy_chk (void *__restrict __dest,
00126                          const void *__restrict __src, size_t __len,
00127                          size_t __destlen) __THROW;
00128 extern void *__memset_chk (void *__dest, int __ch, size_t __len,
00129                         size_t __destlen) __THROW;
00130 extern char *__strcpy_chk (char *__restrict __dest,
00131                         const char *__restrict __src,
00132                         size_t __destlen) __THROW;
00133 extern char *__stpcpy_chk (char *__restrict __dest,
00134                         const char *__restrict __src,
00135                         size_t __destlen) __THROW;
00136 extern char *__strncpy_chk (char *__restrict __dest,
00137                          const char *__restrict __src,
00138                          size_t __len, size_t __destlen) __THROW;
00139 extern char *__strcat_chk (char *__restrict __dest,
00140                         const char *__restrict __src,
00141                         size_t __destlen) __THROW;
00142 extern char *__strncat_chk (char *__restrict __dest,
00143                          const char *__restrict __src,
00144                          size_t __len, size_t __destlen) __THROW;
00145 
00146 #endif