string.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. #ifndef _STRING_H
  2. #define _STRING_H
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. #include <features.h>
  7. #ifdef __cplusplus
  8. #define NULL 0L
  9. #else
  10. #define NULL ((void*)0)
  11. #endif
  12. #define __NEED_size_t
  13. #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
  14. || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
  15. || defined(_BSD_SOURCE)
  16. #define __NEED_locale_t
  17. #endif
  18. #include <bits/alltypes.h>
  19. void *memcpy (void *__restrict, const void *__restrict, size_t);
  20. void *memmove (void *, const void *, size_t);
  21. void *memset (void *, int, size_t);
  22. int memcmp (const void *, const void *, size_t);
  23. void *memchr (const void *, int, size_t);
  24. char *strcpy (char *__restrict, const char *__restrict);
  25. char *strncpy (char *__restrict, const char *__restrict, size_t);
  26. char *strcat (char *__restrict, const char *__restrict);
  27. char *strncat (char *__restrict, const char *__restrict, size_t);
  28. int strcmp (const char *, const char *);
  29. int strncmp (const char *, const char *, size_t);
  30. int strcoll (const char *, const char *);
  31. size_t strxfrm (char *__restrict, const char *__restrict, size_t);
  32. char *strchr (const char *, int);
  33. char *strrchr (const char *, int);
  34. size_t strcspn (const char *, const char *);
  35. size_t strspn (const char *, const char *);
  36. char *strpbrk (const char *, const char *);
  37. char *strstr (const char *, const char *);
  38. char *strtok (char *__restrict, const char *__restrict);
  39. size_t strlen (const char *);
  40. char *strerror (int);
  41. #if defined(_BSD_SOURCE) || defined(_GNU_SOURCE)
  42. #include <strings.h>
  43. #endif
  44. #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
  45. || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
  46. || defined(_BSD_SOURCE)
  47. char *strtok_r (char *__restrict, const char *__restrict, char **__restrict);
  48. int strerror_r (int, char *, size_t);
  49. char *stpcpy(char *__restrict, const char *__restrict);
  50. char *stpncpy(char *__restrict, const char *__restrict, size_t);
  51. size_t strnlen (const char *, size_t);
  52. char *strdup (const char *);
  53. char *strndup (const char *, size_t);
  54. char *strsignal(int);
  55. char *strerror_l (int, locale_t);
  56. int strcoll_l (const char *, const char *, locale_t);
  57. size_t strxfrm_l (char *__restrict, const char *__restrict, size_t, locale_t);
  58. #endif
  59. #if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
  60. || defined(_BSD_SOURCE)
  61. void *memccpy (void *__restrict, const void *__restrict, int, size_t);
  62. #endif
  63. #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  64. char *strsep(char **, const char *);
  65. size_t strlcat (char *, const char *, size_t);
  66. size_t strlcpy (char *, const char *, size_t);
  67. void explicit_bzero (void *, size_t);
  68. #endif
  69. #ifdef _GNU_SOURCE
  70. #define strdupa(x) strcpy(alloca(strlen(x)+1),x)
  71. int strverscmp (const char *, const char *);
  72. char *strchrnul(const char *, int);
  73. char *strcasestr(const char *, const char *);
  74. void *memmem(const void *, size_t, const void *, size_t);
  75. void *memrchr(const void *, int, size_t);
  76. void *mempcpy(void *, const void *, size_t);
  77. #ifndef __cplusplus
  78. char *basename();
  79. #endif
  80. #endif
  81. #ifdef __cplusplus
  82. }
  83. #endif
  84. #endif