string.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. #ifndef _LINUX_STRING_H_
  2. #define _LINUX_STRING_H_
  3. /* We don't want strings.h stuff being user by user stuff by accident */
  4. #ifdef __KERNEL__
  5. #include <linux/compiler.h> /* for inline */
  6. #include <linux/types.h> /* for size_t */
  7. #include <linux/stddef.h> /* for NULL */
  8. #ifdef __cplusplus
  9. extern "C" {
  10. #endif
  11. extern char *strndup_user(const char __user *, long);
  12. /*
  13. * Include machine specific inline routines
  14. */
  15. #include <asm/string.h>
  16. #ifndef __HAVE_ARCH_STRCPY
  17. extern char * strcpy(char *,const char *);
  18. #endif
  19. #ifndef __HAVE_ARCH_STRNCPY
  20. extern char * strncpy(char *,const char *, __kernel_size_t);
  21. #endif
  22. #ifndef __HAVE_ARCH_STRLCPY
  23. size_t strlcpy(char *, const char *, size_t);
  24. #endif
  25. #ifndef __HAVE_ARCH_STRCAT
  26. extern char * strcat(char *, const char *);
  27. #endif
  28. #ifndef __HAVE_ARCH_STRNCAT
  29. extern char * strncat(char *, const char *, __kernel_size_t);
  30. #endif
  31. #ifndef __HAVE_ARCH_STRLCAT
  32. extern size_t strlcat(char *, const char *, __kernel_size_t);
  33. #endif
  34. #ifndef __HAVE_ARCH_STRCMP
  35. extern int strcmp(const char *,const char *);
  36. #endif
  37. #ifndef __HAVE_ARCH_STRNCMP
  38. extern int strncmp(const char *,const char *,__kernel_size_t);
  39. #endif
  40. #ifndef __HAVE_ARCH_STRNICMP
  41. extern int strnicmp(const char *, const char *, __kernel_size_t);
  42. #endif
  43. #ifndef __HAVE_ARCH_STRCHR
  44. extern char * strchr(const char *,int);
  45. #endif
  46. #ifndef __HAVE_ARCH_STRNCHR
  47. extern char * strnchr(const char *, size_t, int);
  48. #endif
  49. #ifndef __HAVE_ARCH_STRRCHR
  50. extern char * strrchr(const char *,int);
  51. #endif
  52. extern char * strstrip(char *);
  53. #ifndef __HAVE_ARCH_STRSTR
  54. extern char * strstr(const char *,const char *);
  55. #endif
  56. #ifndef __HAVE_ARCH_STRLEN
  57. extern __kernel_size_t strlen(const char *);
  58. #endif
  59. #ifndef __HAVE_ARCH_STRNLEN
  60. extern __kernel_size_t strnlen(const char *,__kernel_size_t);
  61. #endif
  62. #ifndef __HAVE_ARCH_STRPBRK
  63. extern char * strpbrk(const char *,const char *);
  64. #endif
  65. #ifndef __HAVE_ARCH_STRSEP
  66. extern char * strsep(char **,const char *);
  67. #endif
  68. #ifndef __HAVE_ARCH_STRSPN
  69. extern __kernel_size_t strspn(const char *,const char *);
  70. #endif
  71. #ifndef __HAVE_ARCH_STRCSPN
  72. extern __kernel_size_t strcspn(const char *,const char *);
  73. #endif
  74. #ifndef __HAVE_ARCH_MEMSET
  75. extern void * memset(void *,int,__kernel_size_t);
  76. #endif
  77. #ifndef __HAVE_ARCH_MEMCPY
  78. extern void * memcpy(void *,const void *,__kernel_size_t);
  79. #endif
  80. #ifndef __HAVE_ARCH_MEMMOVE
  81. extern void * memmove(void *,const void *,__kernel_size_t);
  82. #endif
  83. #ifndef __HAVE_ARCH_MEMSCAN
  84. extern void * memscan(void *,int,__kernel_size_t);
  85. #endif
  86. #ifndef __HAVE_ARCH_MEMCMP
  87. extern int memcmp(const void *,const void *,__kernel_size_t);
  88. #endif
  89. #ifndef __HAVE_ARCH_MEMCHR
  90. extern void * memchr(const void *,int,__kernel_size_t);
  91. #endif
  92. extern char *kstrdup(const char *s, gfp_t gfp);
  93. extern void *kmemdup(const void *src, size_t len, gfp_t gfp);
  94. #ifdef __cplusplus
  95. }
  96. #endif
  97. #endif
  98. #endif /* _LINUX_STRING_H_ */