string.h 2.4 KB

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