]>
Commit | Line | Data |
---|---|---|
1da177e4 LT |
1 | #ifndef _LINUX_STRING_H_ |
2 | #define _LINUX_STRING_H_ | |
3 | ||
4ac96572 | 4 | /* We don't want strings.h stuff being used by user stuff by accident */ |
1da177e4 | 5 | |
97ef1bb0 DM |
6 | #ifndef __KERNEL__ |
7 | #include <string.h> | |
8 | #else | |
1da177e4 LT |
9 | |
10 | #include <linux/compiler.h> /* for inline */ | |
11 | #include <linux/types.h> /* for size_t */ | |
12 | #include <linux/stddef.h> /* for NULL */ | |
13 | ||
96840aa0 DA |
14 | extern char *strndup_user(const char __user *, long); |
15 | ||
1da177e4 LT |
16 | /* |
17 | * Include machine specific inline routines | |
18 | */ | |
19 | #include <asm/string.h> | |
20 | ||
21 | #ifndef __HAVE_ARCH_STRCPY | |
22 | extern char * strcpy(char *,const char *); | |
23 | #endif | |
24 | #ifndef __HAVE_ARCH_STRNCPY | |
25 | extern char * strncpy(char *,const char *, __kernel_size_t); | |
26 | #endif | |
27 | #ifndef __HAVE_ARCH_STRLCPY | |
28 | size_t strlcpy(char *, const char *, size_t); | |
29 | #endif | |
30 | #ifndef __HAVE_ARCH_STRCAT | |
31 | extern char * strcat(char *, const char *); | |
32 | #endif | |
33 | #ifndef __HAVE_ARCH_STRNCAT | |
34 | extern char * strncat(char *, const char *, __kernel_size_t); | |
35 | #endif | |
36 | #ifndef __HAVE_ARCH_STRLCAT | |
37 | extern size_t strlcat(char *, const char *, __kernel_size_t); | |
38 | #endif | |
39 | #ifndef __HAVE_ARCH_STRCMP | |
40 | extern int strcmp(const char *,const char *); | |
41 | #endif | |
42 | #ifndef __HAVE_ARCH_STRNCMP | |
43 | extern int strncmp(const char *,const char *,__kernel_size_t); | |
44 | #endif | |
45 | #ifndef __HAVE_ARCH_STRNICMP | |
46 | extern int strnicmp(const char *, const char *, __kernel_size_t); | |
47 | #endif | |
ded220bd DM |
48 | #ifndef __HAVE_ARCH_STRCASECMP |
49 | extern int strcasecmp(const char *s1, const char *s2); | |
50 | #endif | |
51 | #ifndef __HAVE_ARCH_STRNCASECMP | |
52 | extern int strncasecmp(const char *s1, const char *s2, size_t n); | |
53 | #endif | |
1da177e4 LT |
54 | #ifndef __HAVE_ARCH_STRCHR |
55 | extern char * strchr(const char *,int); | |
56 | #endif | |
57 | #ifndef __HAVE_ARCH_STRNCHR | |
58 | extern char * strnchr(const char *, size_t, int); | |
59 | #endif | |
60 | #ifndef __HAVE_ARCH_STRRCHR | |
61 | extern char * strrchr(const char *,int); | |
62 | #endif | |
481fad48 | 63 | extern char * strstrip(char *); |
1da177e4 LT |
64 | #ifndef __HAVE_ARCH_STRSTR |
65 | extern char * strstr(const char *,const char *); | |
66 | #endif | |
67 | #ifndef __HAVE_ARCH_STRLEN | |
68 | extern __kernel_size_t strlen(const char *); | |
69 | #endif | |
70 | #ifndef __HAVE_ARCH_STRNLEN | |
71 | extern __kernel_size_t strnlen(const char *,__kernel_size_t); | |
72 | #endif | |
8833d328 KM |
73 | #ifndef __HAVE_ARCH_STRPBRK |
74 | extern char * strpbrk(const char *,const char *); | |
75 | #endif | |
76 | #ifndef __HAVE_ARCH_STRSEP | |
77 | extern char * strsep(char **,const char *); | |
78 | #endif | |
79 | #ifndef __HAVE_ARCH_STRSPN | |
80 | extern __kernel_size_t strspn(const char *,const char *); | |
81 | #endif | |
82 | #ifndef __HAVE_ARCH_STRCSPN | |
83 | extern __kernel_size_t strcspn(const char *,const char *); | |
84 | #endif | |
1da177e4 LT |
85 | |
86 | #ifndef __HAVE_ARCH_MEMSET | |
87 | extern void * memset(void *,int,__kernel_size_t); | |
88 | #endif | |
89 | #ifndef __HAVE_ARCH_MEMCPY | |
90 | extern void * memcpy(void *,const void *,__kernel_size_t); | |
91 | #endif | |
92 | #ifndef __HAVE_ARCH_MEMMOVE | |
93 | extern void * memmove(void *,const void *,__kernel_size_t); | |
94 | #endif | |
95 | #ifndef __HAVE_ARCH_MEMSCAN | |
96 | extern void * memscan(void *,int,__kernel_size_t); | |
97 | #endif | |
98 | #ifndef __HAVE_ARCH_MEMCMP | |
99 | extern int memcmp(const void *,const void *,__kernel_size_t); | |
100 | #endif | |
101 | #ifndef __HAVE_ARCH_MEMCHR | |
102 | extern void * memchr(const void *,int,__kernel_size_t); | |
103 | #endif | |
104 | ||
dd0fc66f | 105 | extern char *kstrdup(const char *s, gfp_t gfp); |
1e66df3e | 106 | extern char *kstrndup(const char *s, size_t len, gfp_t gfp); |
1a2f67b4 | 107 | extern void *kmemdup(const void *src, size_t len, gfp_t gfp); |
543537bd | 108 | |
d84d1cc7 JF |
109 | extern char **argv_split(gfp_t gfp, const char *str, int *argcp); |
110 | extern void argv_free(char **argv); | |
111 | ||
34990cf7 DB |
112 | extern bool sysfs_streq(const char *s1, const char *s2); |
113 | ||
e108526e AM |
114 | extern ssize_t memory_read_from_buffer(void *to, size_t count, loff_t *ppos, |
115 | const void *from, size_t available); | |
116 | ||
1da177e4 LT |
117 | #endif |
118 | #endif /* _LINUX_STRING_H_ */ |