2001-10-17 20:21:50 +00:00
|
|
|
#ifndef _LINUX_STRING_H_
|
|
|
|
#define _LINUX_STRING_H_
|
|
|
|
|
|
|
|
#include <linux/types.h> /* for size_t */
|
|
|
|
#include <linux/stddef.h> /* for NULL */
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
extern char * ___strtok;
|
|
|
|
extern char * strpbrk(const char *,const char *);
|
|
|
|
extern char * strtok(char *,const char *);
|
|
|
|
extern char * strsep(char **,const char *);
|
|
|
|
extern __kernel_size_t strspn(const char *,const char *);
|
|
|
|
|
|
|
|
|
2008-08-20 15:44:35 +00:00
|
|
|
#define strchr(s, c) ({ \
|
|
|
|
(typeof(&(s)[0]))(_strchr((s), c)); \
|
|
|
|
})
|
|
|
|
|
|
|
|
#define strrchr(s, c) ({ \
|
|
|
|
(typeof(&(s)[0]))(_strrchr((s), c)); \
|
|
|
|
})
|
|
|
|
|
|
|
|
#define strstr(s1, s2) ({ \
|
|
|
|
(typeof(&(s1)[0]))(_strstr((s1), (s2))); \
|
|
|
|
})
|
|
|
|
|
2001-10-17 20:21:50 +00:00
|
|
|
/*
|
|
|
|
* Include machine specific inline routines
|
|
|
|
*/
|
|
|
|
#include <asm/string.h>
|
|
|
|
|
|
|
|
#ifndef __HAVE_ARCH_STRCPY
|
|
|
|
extern char * strcpy(char *,const char *);
|
|
|
|
#endif
|
|
|
|
#ifndef __HAVE_ARCH_STRNCPY
|
|
|
|
extern char * strncpy(char *,const char *, __kernel_size_t);
|
|
|
|
#endif
|
2010-08-04 01:43:54 +00:00
|
|
|
#ifndef __HAVE_ARCH_STRLCPY
|
|
|
|
size_t strlcpy(char *, const char *, size_t);
|
|
|
|
#endif
|
2001-10-17 20:21:50 +00:00
|
|
|
#ifndef __HAVE_ARCH_STRCAT
|
|
|
|
extern char * strcat(char *, const char *);
|
|
|
|
#endif
|
|
|
|
#ifndef __HAVE_ARCH_STRNCAT
|
|
|
|
extern char * strncat(char *, const char *, __kernel_size_t);
|
|
|
|
#endif
|
|
|
|
#ifndef __HAVE_ARCH_STRCMP
|
|
|
|
extern int strcmp(const char *,const char *);
|
|
|
|
#endif
|
|
|
|
#ifndef __HAVE_ARCH_STRNCMP
|
|
|
|
extern int strncmp(const char *,const char *,__kernel_size_t);
|
|
|
|
#endif
|
2013-06-11 12:57:26 +00:00
|
|
|
#ifndef __HAVE_ARCH_STRNICMP
|
|
|
|
extern int strnicmp(const char *, const char *, __kernel_size_t);
|
|
|
|
#endif
|
|
|
|
#ifndef __HAVE_ARCH_STRCASECMP
|
|
|
|
extern int strcasecmp(const char *s1, const char *s2);
|
|
|
|
#endif
|
|
|
|
#ifndef __HAVE_ARCH_STRNCASECMP
|
|
|
|
extern int strncasecmp(const char *s1, const char *s2, size_t n);
|
|
|
|
#endif
|
2001-10-17 20:21:50 +00:00
|
|
|
#ifndef __HAVE_ARCH_STRCHR
|
2008-08-20 15:44:35 +00:00
|
|
|
extern char * _strchr(const char *,int);
|
2001-10-17 20:21:50 +00:00
|
|
|
#endif
|
|
|
|
#ifndef __HAVE_ARCH_STRRCHR
|
2008-08-20 15:44:35 +00:00
|
|
|
extern char * _strrchr(const char *,int);
|
2001-10-17 20:21:50 +00:00
|
|
|
#endif
|
|
|
|
#ifndef __HAVE_ARCH_STRSTR
|
2008-08-20 15:44:35 +00:00
|
|
|
extern char * _strstr(const char *,const char *);
|
2001-10-17 20:21:50 +00:00
|
|
|
#endif
|
|
|
|
#ifndef __HAVE_ARCH_STRLEN
|
|
|
|
extern __kernel_size_t strlen(const char *);
|
|
|
|
#endif
|
|
|
|
#ifndef __HAVE_ARCH_STRNLEN
|
|
|
|
extern __kernel_size_t strnlen(const char *,__kernel_size_t);
|
|
|
|
#endif
|
|
|
|
#ifndef __HAVE_ARCH_STRDUP
|
|
|
|
extern char * strdup(const char *);
|
|
|
|
#endif
|
2004-03-23 22:37:33 +00:00
|
|
|
#ifndef __HAVE_ARCH_STRSWAB
|
2004-03-14 00:59:59 +00:00
|
|
|
extern char * strswab(const char *);
|
|
|
|
#endif
|
2001-10-17 20:21:50 +00:00
|
|
|
|
|
|
|
#ifndef __HAVE_ARCH_MEMSET
|
|
|
|
extern void * memset(void *,int,__kernel_size_t);
|
|
|
|
#endif
|
|
|
|
#ifndef __HAVE_ARCH_MEMCPY
|
|
|
|
extern void * memcpy(void *,const void *,__kernel_size_t);
|
|
|
|
#endif
|
|
|
|
#ifndef __HAVE_ARCH_MEMMOVE
|
|
|
|
extern void * memmove(void *,const void *,__kernel_size_t);
|
|
|
|
#endif
|
|
|
|
#ifndef __HAVE_ARCH_MEMSCAN
|
|
|
|
extern void * memscan(void *,int,__kernel_size_t);
|
|
|
|
#endif
|
|
|
|
#ifndef __HAVE_ARCH_MEMCMP
|
|
|
|
extern int memcmp(const void *,const void *,__kernel_size_t);
|
|
|
|
#endif
|
|
|
|
#ifndef __HAVE_ARCH_MEMCHR
|
|
|
|
extern void * memchr(const void *,int,__kernel_size_t);
|
|
|
|
#endif
|
2012-07-05 10:22:45 +00:00
|
|
|
extern char * skip_spaces(const char *);
|
|
|
|
|
|
|
|
extern char *strim(char *);
|
2001-10-17 20:21:50 +00:00
|
|
|
|
2013-07-18 12:26:44 +00:00
|
|
|
void *memchr_inv(const void *start, int c, size_t bytes);
|
|
|
|
|
2001-10-17 20:21:50 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* _LINUX_STRING_H_ */
|