blob: 36066207392e9c478b1e7a08c389ba34196827a3 [file] [log] [blame]
wdenk60b1bd02001-10-17 20:21:50 +00001#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
8extern "C" {
9#endif
10
11extern char * ___strtok;
12extern char * strpbrk(const char *,const char *);
13extern char * strtok(char *,const char *);
14extern char * strsep(char **,const char *);
15extern __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
24extern char * strcpy(char *,const char *);
25#endif
26#ifndef __HAVE_ARCH_STRNCPY
27extern char * strncpy(char *,const char *, __kernel_size_t);
28#endif
Masahiro Yamada80d9ef82014-11-20 21:20:32 +090029#ifndef __HAVE_ARCH_STRLCPY
30size_t strlcpy(char *, const char *, size_t);
31#endif
wdenk60b1bd02001-10-17 20:21:50 +000032#ifndef __HAVE_ARCH_STRCAT
33extern char * strcat(char *, const char *);
34#endif
35#ifndef __HAVE_ARCH_STRNCAT
36extern char * strncat(char *, const char *, __kernel_size_t);
37#endif
38#ifndef __HAVE_ARCH_STRCMP
39extern int strcmp(const char *,const char *);
40#endif
41#ifndef __HAVE_ARCH_STRNCMP
42extern int strncmp(const char *,const char *,__kernel_size_t);
43#endif
Simon Glassb1f17bf2012-12-05 14:46:35 +000044#ifndef __HAVE_ARCH_STRCASECMP
45int strcasecmp(const char *s1, const char *s2);
46#endif
47#ifndef __HAVE_ARCH_STRNCASECMP
48extern int strncasecmp(const char *s1, const char *s2, __kernel_size_t len);
wdenk60b1bd02001-10-17 20:21:50 +000049#endif
50#ifndef __HAVE_ARCH_STRCHR
51extern char * strchr(const char *,int);
52#endif
Simon Glass6b45ba42017-05-18 20:09:28 -060053
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 */
64const char *strchrnul(const char *s, int c);
65
wdenk60b1bd02001-10-17 20:21:50 +000066#ifndef __HAVE_ARCH_STRRCHR
67extern char * strrchr(const char *,int);
68#endif
Joe Hershbergere772cb32012-12-11 22:16:18 -060069#include <linux/linux_string.h>
wdenk60b1bd02001-10-17 20:21:50 +000070#ifndef __HAVE_ARCH_STRSTR
71extern char * strstr(const char *,const char *);
72#endif
73#ifndef __HAVE_ARCH_STRLEN
74extern __kernel_size_t strlen(const char *);
75#endif
76#ifndef __HAVE_ARCH_STRNLEN
77extern __kernel_size_t strnlen(const char *,__kernel_size_t);
78#endif
Simon Glassa7d00212017-05-18 20:09:29 -060079
80#ifndef __HAVE_ARCH_STRCSPN
81/**
82 * strcspn() - find span of string without given characters
83 *
84 * Calculates the length of the initial segment of @s which consists entirely
85 * of bsytes not in reject.
86 *
87 * @s: string to search
88 * @reject: strings which cause the search to halt
89 * @return number of characters at the start of @s which are not in @reject
90 */
91size_t strcspn(const char *s, const char *reject);
92#endif
93
wdenk60b1bd02001-10-17 20:21:50 +000094#ifndef __HAVE_ARCH_STRDUP
95extern char * strdup(const char *);
96#endif
wdenk27aa8182004-03-23 22:37:33 +000097#ifndef __HAVE_ARCH_STRSWAB
wdenkc3f9d492004-03-14 00:59:59 +000098extern char * strswab(const char *);
99#endif
wdenk60b1bd02001-10-17 20:21:50 +0000100
101#ifndef __HAVE_ARCH_MEMSET
102extern void * memset(void *,int,__kernel_size_t);
103#endif
104#ifndef __HAVE_ARCH_MEMCPY
105extern void * memcpy(void *,const void *,__kernel_size_t);
106#endif
107#ifndef __HAVE_ARCH_MEMMOVE
108extern void * memmove(void *,const void *,__kernel_size_t);
109#endif
110#ifndef __HAVE_ARCH_MEMSCAN
111extern void * memscan(void *,int,__kernel_size_t);
112#endif
113#ifndef __HAVE_ARCH_MEMCMP
114extern int memcmp(const void *,const void *,__kernel_size_t);
115#endif
116#ifndef __HAVE_ARCH_MEMCHR
117extern void * memchr(const void *,int,__kernel_size_t);
118#endif
Sergey Lapindfe64e22013-01-14 03:46:50 +0000119#ifndef __HAVE_ARCH_MEMCHR_INV
120void *memchr_inv(const void *, int, size_t);
121#endif
wdenk60b1bd02001-10-17 20:21:50 +0000122
Jeroen Hofstee5afe73f2014-10-08 22:57:49 +0200123unsigned long ustrtoul(const char *cp, char **endp, unsigned int base);
124unsigned long long ustrtoull(const char *cp, char **endp, unsigned int base);
125
wdenk60b1bd02001-10-17 20:21:50 +0000126#ifdef __cplusplus
127}
128#endif
129
130#endif /* _LINUX_STRING_H_ */