string.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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. #include <bits/alltypes.h>
  14. void *memcpy (void *, const void *, size_t);
  15. void *memmove (void *, const void *, size_t);
  16. void *memset (void *, int, size_t);
  17. int memcmp (const void *, const void *, size_t);
  18. void *memchr (const void *, int, size_t);
  19. char *strcpy (char *, const char *);
  20. char *strncpy (char *, const char *, size_t);
  21. char *strcat (char *, const char *);
  22. char *strncat (char *, const char *, size_t);
  23. int strcmp (const char *, const char *);
  24. int strncmp (const char *, const char *, size_t);
  25. int strcoll (const char *, const char *);
  26. size_t strxfrm (char *, const char *, size_t);
  27. char *strchr (const char *, int);
  28. char *strrchr (const char *, int);
  29. size_t strcspn (const char *, const char *);
  30. size_t strspn (const char *, const char *);
  31. char *strpbrk (const char *, const char *);
  32. char *strstr (const char *, const char *);
  33. char *strtok (char *, const char *);
  34. size_t strlen (const char *);
  35. char *strerror (int);
  36. #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
  37. || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE)
  38. char *strtok_r (char *, const char *, char **);
  39. int strerror_r (int, char *, size_t);
  40. char *stpcpy(char *, const char *);
  41. char *stpncpy(char *, const char *, size_t);
  42. size_t strnlen (const char *, size_t);
  43. char *strdup (const char *);
  44. char *strndup (const char *, size_t);
  45. #endif
  46. #if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE)
  47. void *memccpy (void *, const void *, int, size_t);
  48. #endif
  49. #ifdef _BSD_SOURCE
  50. size_t strlcat (char *, const char *, size_t);
  51. size_t strlcpy (char *, const char *, size_t);
  52. #endif
  53. #ifdef _GNU_SOURCE
  54. int strcasecmp (const char *, const char *);
  55. int strncasecmp (const char *, const char *, size_t);
  56. char *strchrnul(const char *, int);
  57. char *strcasestr(const char *, const char *);
  58. #endif
  59. #ifdef __cplusplus
  60. }
  61. #endif
  62. #endif