Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


Merge branch 'devel'
[palacios.git] / kitten / include / lwk / string.h
1 #ifndef _LWK_STRING_H
2 #define _LWK_STRING_H
3
4 /* We don't want strings.h stuff being used by user stuff by accident */
5
6 #ifndef __KERNEL__
7 #include <string.h>
8 #endif
9
10 #ifdef __KERNEL__
11
12 #include <lwk/compiler.h>       /* for inline */
13 #include <lwk/types.h>          /* for size_t */
14 #include <lwk/stddef.h>         /* for NULL */
15
16 #ifdef __cplusplus
17 extern "C" {
18 #endif
19
20 extern char *strndup_user(const char __user *, long);
21
22 /*
23  * Include machine specific inline routines
24  */
25 #include <arch/string.h>
26
27 #ifndef __HAVE_ARCH_STRCPY
28 extern char * strcpy(char *,const char *);
29 #endif
30 #ifndef __HAVE_ARCH_STRNCPY
31 extern char * strncpy(char *,const char *, __kernel_size_t);
32 #endif
33 #ifndef __HAVE_ARCH_STRLCPY
34 size_t strlcpy(char *, const char *, size_t);
35 #endif
36 #ifndef __HAVE_ARCH_STRCAT
37 extern char * strcat(char *, const char *);
38 #endif
39 #ifndef __HAVE_ARCH_STRNCAT
40 extern char * strncat(char *, const char *, __kernel_size_t);
41 #endif
42 #ifndef __HAVE_ARCH_STRLCAT
43 extern size_t strlcat(char *, const char *, __kernel_size_t);
44 #endif
45 #ifndef __HAVE_ARCH_STRCMP
46 extern int strcmp(const char *,const char *);
47 #endif
48 #ifndef __HAVE_ARCH_STRNCMP
49 extern int strncmp(const char *,const char *,__kernel_size_t);
50 #endif
51 #ifndef __HAVE_ARCH_STRNICMP
52 extern int strnicmp(const char *, const char *, __kernel_size_t);
53 #endif
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
63 #ifndef __HAVE_ARCH_STRSTR
64 extern char * strstr(const char *,const char *);
65 #endif
66 #ifndef __HAVE_ARCH_STRLEN
67 extern __kernel_size_t strlen(const char *);
68 #endif
69 #ifndef __HAVE_ARCH_STRNLEN
70 extern __kernel_size_t strnlen(const char *,__kernel_size_t);
71 #endif
72 #ifndef __HAVE_ARCH_STRPBRK
73 extern char * strpbrk(const char *,const char *);
74 #endif
75 #ifndef __HAVE_ARCH_STRSEP
76 extern char * strsep(char **,const char *);
77 #endif
78 #ifndef __HAVE_ARCH_STRSPN
79 extern __kernel_size_t strspn(const char *,const char *);
80 #endif
81 #ifndef __HAVE_ARCH_STRCSPN
82 extern __kernel_size_t strcspn(const char *,const char *);
83 #endif
84
85 #ifndef __HAVE_ARCH_MEMSET
86 extern void * memset(void *,int,__kernel_size_t);
87 #endif
88 #ifndef __HAVE_ARCH_MEMCPY
89 extern void * memcpy(void *,const void *,__kernel_size_t);
90 #endif
91 #ifndef __HAVE_ARCH_MEMMOVE
92 extern void * memmove(void *,const void *,__kernel_size_t);
93 #endif
94 #ifndef __HAVE_ARCH_MEMSCAN
95 extern void * memscan(void *,int,__kernel_size_t);
96 #endif
97 #ifndef __HAVE_ARCH_MEMCMP
98 extern int memcmp(const void *,const void *,__kernel_size_t);
99 #endif
100 #ifndef __HAVE_ARCH_MEMCHR
101 extern void * memchr(const void *,int,__kernel_size_t);
102 #endif
103
104 extern char *kstrdup(const char *s, gfp_t gfp);
105
106 extern char *strerror(int errnum);
107
108 #ifdef __cplusplus
109 }
110 #endif
111
112 #endif
113 #endif /* _LWK_STRING_H */