xref: /OK3568_Linux_fs/u-boot/include/linux/string.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun #ifndef _LINUX_STRING_H_
2*4882a593Smuzhiyun #define _LINUX_STRING_H_
3*4882a593Smuzhiyun 
4*4882a593Smuzhiyun #include <linux/types.h>	/* for size_t */
5*4882a593Smuzhiyun #include <linux/stddef.h>	/* for NULL */
6*4882a593Smuzhiyun 
7*4882a593Smuzhiyun #ifdef __cplusplus
8*4882a593Smuzhiyun extern "C" {
9*4882a593Smuzhiyun #endif
10*4882a593Smuzhiyun 
11*4882a593Smuzhiyun extern char * ___strtok;
12*4882a593Smuzhiyun extern char * strpbrk(const char *,const char *);
13*4882a593Smuzhiyun extern char * strtok(char *,const char *);
14*4882a593Smuzhiyun extern char * strsep(char **,const char *);
15*4882a593Smuzhiyun extern __kernel_size_t strspn(const char *,const char *);
16*4882a593Smuzhiyun 
17*4882a593Smuzhiyun 
18*4882a593Smuzhiyun /*
19*4882a593Smuzhiyun  * Include machine specific inline routines
20*4882a593Smuzhiyun  */
21*4882a593Smuzhiyun #include <asm/string.h>
22*4882a593Smuzhiyun 
23*4882a593Smuzhiyun #ifndef __HAVE_ARCH_STRCPY
24*4882a593Smuzhiyun extern char * strcpy(char *,const char *);
25*4882a593Smuzhiyun #endif
26*4882a593Smuzhiyun #ifndef __HAVE_ARCH_STRNCPY
27*4882a593Smuzhiyun extern char * strncpy(char *,const char *, __kernel_size_t);
28*4882a593Smuzhiyun #endif
29*4882a593Smuzhiyun #ifndef __HAVE_ARCH_STRLCPY
30*4882a593Smuzhiyun size_t strlcpy(char *, const char *, size_t);
31*4882a593Smuzhiyun #endif
32*4882a593Smuzhiyun #ifndef __HAVE_ARCH_STRCAT
33*4882a593Smuzhiyun extern char * strcat(char *, const char *);
34*4882a593Smuzhiyun #endif
35*4882a593Smuzhiyun #ifndef __HAVE_ARCH_STRNCAT
36*4882a593Smuzhiyun extern char * strncat(char *, const char *, __kernel_size_t);
37*4882a593Smuzhiyun #endif
38*4882a593Smuzhiyun #ifndef __HAVE_ARCH_STRCMP
39*4882a593Smuzhiyun extern int strcmp(const char *,const char *);
40*4882a593Smuzhiyun #endif
41*4882a593Smuzhiyun #ifndef __HAVE_ARCH_STRNCMP
42*4882a593Smuzhiyun extern int strncmp(const char *,const char *,__kernel_size_t);
43*4882a593Smuzhiyun #endif
44*4882a593Smuzhiyun #ifndef __HAVE_ARCH_STRCASECMP
45*4882a593Smuzhiyun int strcasecmp(const char *s1, const char *s2);
46*4882a593Smuzhiyun #endif
47*4882a593Smuzhiyun #ifndef __HAVE_ARCH_STRNCASECMP
48*4882a593Smuzhiyun extern int strncasecmp(const char *s1, const char *s2, __kernel_size_t len);
49*4882a593Smuzhiyun #endif
50*4882a593Smuzhiyun #ifndef __HAVE_ARCH_STRCHR
51*4882a593Smuzhiyun extern char * strchr(const char *,int);
52*4882a593Smuzhiyun #endif
53*4882a593Smuzhiyun 
54*4882a593Smuzhiyun /**
55*4882a593Smuzhiyun  * strchrnul() - return position of a character in the string, or end of string
56*4882a593Smuzhiyun  *
57*4882a593Smuzhiyun  * The strchrnul() function is like strchr() except that if c is not found
58*4882a593Smuzhiyun  * in s, then it returns a pointer to the nul byte at the end of s, rather than
59*4882a593Smuzhiyun  * NULL
60*4882a593Smuzhiyun  * @s: string to search
61*4882a593Smuzhiyun  * @c: character to search for
62*4882a593Smuzhiyun  * @return position of @c in @s, or end of @s if not found
63*4882a593Smuzhiyun  */
64*4882a593Smuzhiyun const char *strchrnul(const char *s, int c);
65*4882a593Smuzhiyun 
66*4882a593Smuzhiyun #ifndef __HAVE_ARCH_STRRCHR
67*4882a593Smuzhiyun extern char * strrchr(const char *,int);
68*4882a593Smuzhiyun #endif
69*4882a593Smuzhiyun #include <linux/linux_string.h>
70*4882a593Smuzhiyun #ifndef __HAVE_ARCH_STRSTR
71*4882a593Smuzhiyun extern char * strstr(const char *,const char *);
72*4882a593Smuzhiyun #endif
73*4882a593Smuzhiyun #ifndef __HAVE_ARCH_STRLEN
74*4882a593Smuzhiyun extern __kernel_size_t strlen(const char *);
75*4882a593Smuzhiyun #endif
76*4882a593Smuzhiyun #ifndef __HAVE_ARCH_STRNLEN
77*4882a593Smuzhiyun extern __kernel_size_t strnlen(const char *,__kernel_size_t);
78*4882a593Smuzhiyun #endif
79*4882a593Smuzhiyun 
80*4882a593Smuzhiyun #ifndef __HAVE_ARCH_STRCSPN
81*4882a593Smuzhiyun /**
82*4882a593Smuzhiyun  * strcspn() - find span of string without given characters
83*4882a593Smuzhiyun  *
84*4882a593Smuzhiyun  * Calculates the length of the initial segment of @s which consists entirely
85*4882a593Smuzhiyun  * of bsytes not in reject.
86*4882a593Smuzhiyun  *
87*4882a593Smuzhiyun  * @s: string to search
88*4882a593Smuzhiyun  * @reject: strings which cause the search to halt
89*4882a593Smuzhiyun  * @return number of characters at the start of @s which are not in @reject
90*4882a593Smuzhiyun  */
91*4882a593Smuzhiyun size_t strcspn(const char *s, const char *reject);
92*4882a593Smuzhiyun #endif
93*4882a593Smuzhiyun 
94*4882a593Smuzhiyun #ifndef __HAVE_ARCH_STRDUP
95*4882a593Smuzhiyun extern char * strdup(const char *);
96*4882a593Smuzhiyun #endif
97*4882a593Smuzhiyun #ifndef __HAVE_ARCH_STRSWAB
98*4882a593Smuzhiyun extern char * strswab(const char *);
99*4882a593Smuzhiyun #endif
100*4882a593Smuzhiyun 
101*4882a593Smuzhiyun #ifndef __HAVE_ARCH_MEMSET
102*4882a593Smuzhiyun extern void * memset(void *,int,__kernel_size_t);
103*4882a593Smuzhiyun #endif
104*4882a593Smuzhiyun #ifndef __HAVE_ARCH_MEMCPY
105*4882a593Smuzhiyun extern void * memcpy(void *,const void *,__kernel_size_t);
106*4882a593Smuzhiyun #endif
107*4882a593Smuzhiyun #ifndef __HAVE_ARCH_MEMMOVE
108*4882a593Smuzhiyun extern void * memmove(void *,const void *,__kernel_size_t);
109*4882a593Smuzhiyun #endif
110*4882a593Smuzhiyun #ifndef __HAVE_ARCH_MEMSCAN
111*4882a593Smuzhiyun extern void * memscan(void *,int,__kernel_size_t);
112*4882a593Smuzhiyun #endif
113*4882a593Smuzhiyun #ifndef __HAVE_ARCH_MEMCMP
114*4882a593Smuzhiyun extern int memcmp(const void *,const void *,__kernel_size_t);
115*4882a593Smuzhiyun #endif
116*4882a593Smuzhiyun #ifndef __HAVE_ARCH_MEMCHR
117*4882a593Smuzhiyun extern void * memchr(const void *,int,__kernel_size_t);
118*4882a593Smuzhiyun #endif
119*4882a593Smuzhiyun #ifndef __HAVE_ARCH_MEMCHR_INV
120*4882a593Smuzhiyun void *memchr_inv(const void *, int, size_t);
121*4882a593Smuzhiyun #endif
122*4882a593Smuzhiyun 
123*4882a593Smuzhiyun unsigned long ustrtoul(const char *cp, char **endp, unsigned int base);
124*4882a593Smuzhiyun unsigned long long ustrtoull(const char *cp, char **endp, unsigned int base);
125*4882a593Smuzhiyun 
126*4882a593Smuzhiyun #ifdef __cplusplus
127*4882a593Smuzhiyun }
128*4882a593Smuzhiyun #endif
129*4882a593Smuzhiyun 
130*4882a593Smuzhiyun #endif /* _LINUX_STRING_H_ */
131