xref: /rk3399_rockchip-uboot/include/linux/string.h (revision 6b45ba45fbcd1acc11c88ee1c15ed5fcb49f9e32)
1 #ifndef _LINUX_STRING_H_
2 #define _LINUX_STRING_H_
3 
4 #include <linux/types.h>	/* for size_t */
5 #include <linux/stddef.h>	/* for NULL */
6 
7 #ifdef __cplusplus
8 extern "C" {
9 #endif
10 
11 extern char * ___strtok;
12 extern char * strpbrk(const char *,const char *);
13 extern char * strtok(char *,const char *);
14 extern char * strsep(char **,const char *);
15 extern __kernel_size_t strspn(const char *,const char *);
16 
17 
18 /*
19  * Include machine specific inline routines
20  */
21 #include <asm/string.h>
22 
23 #ifndef __HAVE_ARCH_STRCPY
24 extern char * strcpy(char *,const char *);
25 #endif
26 #ifndef __HAVE_ARCH_STRNCPY
27 extern char * strncpy(char *,const char *, __kernel_size_t);
28 #endif
29 #ifndef __HAVE_ARCH_STRLCPY
30 size_t strlcpy(char *, const char *, size_t);
31 #endif
32 #ifndef __HAVE_ARCH_STRCAT
33 extern char * strcat(char *, const char *);
34 #endif
35 #ifndef __HAVE_ARCH_STRNCAT
36 extern char * strncat(char *, const char *, __kernel_size_t);
37 #endif
38 #ifndef __HAVE_ARCH_STRCMP
39 extern int strcmp(const char *,const char *);
40 #endif
41 #ifndef __HAVE_ARCH_STRNCMP
42 extern int strncmp(const char *,const char *,__kernel_size_t);
43 #endif
44 #ifndef __HAVE_ARCH_STRCASECMP
45 int strcasecmp(const char *s1, const char *s2);
46 #endif
47 #ifndef __HAVE_ARCH_STRNCASECMP
48 extern int strncasecmp(const char *s1, const char *s2, __kernel_size_t len);
49 #endif
50 #ifndef __HAVE_ARCH_STRCHR
51 extern char * strchr(const char *,int);
52 #endif
53 
54 /**
55  * strchrnul() - return position of a character in the string, or end of string
56  *
57  * The strchrnul() function is like strchr() except that if c is not found
58  * in s, then it returns a pointer to the nul byte at the end of s, rather than
59  * NULL
60  * @s: string to search
61  * @c: character to search for
62  * @return position of @c in @s, or end of @s if not found
63  */
64 const char *strchrnul(const char *s, int c);
65 
66 #ifndef __HAVE_ARCH_STRRCHR
67 extern char * strrchr(const char *,int);
68 #endif
69 #include <linux/linux_string.h>
70 #ifndef __HAVE_ARCH_STRSTR
71 extern char * strstr(const char *,const char *);
72 #endif
73 #ifndef __HAVE_ARCH_STRLEN
74 extern __kernel_size_t strlen(const char *);
75 #endif
76 #ifndef __HAVE_ARCH_STRNLEN
77 extern __kernel_size_t strnlen(const char *,__kernel_size_t);
78 #endif
79 #ifndef __HAVE_ARCH_STRDUP
80 extern char * strdup(const char *);
81 #endif
82 #ifndef __HAVE_ARCH_STRSWAB
83 extern char * strswab(const char *);
84 #endif
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 #ifndef __HAVE_ARCH_MEMCHR_INV
105 void *memchr_inv(const void *, int, size_t);
106 #endif
107 
108 unsigned long ustrtoul(const char *cp, char **endp, unsigned int base);
109 unsigned long long ustrtoull(const char *cp, char **endp, unsigned int base);
110 
111 #ifdef __cplusplus
112 }
113 #endif
114 
115 #endif /* _LINUX_STRING_H_ */
116