]> bbs.cooldavid.org Git - net-next-2.6.git/blame - include/linux/string.h
vsprintf: add binary printf
[net-next-2.6.git] / include / linux / string.h
CommitLineData
1da177e4
LT
1#ifndef _LINUX_STRING_H_
2#define _LINUX_STRING_H_
3
4ac96572 4/* We don't want strings.h stuff being used by user stuff by accident */
1da177e4 5
97ef1bb0
DM
6#ifndef __KERNEL__
7#include <string.h>
8#else
1da177e4
LT
9
10#include <linux/compiler.h> /* for inline */
11#include <linux/types.h> /* for size_t */
12#include <linux/stddef.h> /* for NULL */
4370aa4a 13#include <stdarg.h>
1da177e4 14
96840aa0
DA
15extern char *strndup_user(const char __user *, long);
16
1da177e4
LT
17/*
18 * Include machine specific inline routines
19 */
20#include <asm/string.h>
21
22#ifndef __HAVE_ARCH_STRCPY
23extern char * strcpy(char *,const char *);
24#endif
25#ifndef __HAVE_ARCH_STRNCPY
26extern char * strncpy(char *,const char *, __kernel_size_t);
27#endif
28#ifndef __HAVE_ARCH_STRLCPY
29size_t strlcpy(char *, const char *, size_t);
30#endif
31#ifndef __HAVE_ARCH_STRCAT
32extern char * strcat(char *, const char *);
33#endif
34#ifndef __HAVE_ARCH_STRNCAT
35extern char * strncat(char *, const char *, __kernel_size_t);
36#endif
37#ifndef __HAVE_ARCH_STRLCAT
38extern size_t strlcat(char *, const char *, __kernel_size_t);
39#endif
40#ifndef __HAVE_ARCH_STRCMP
41extern int strcmp(const char *,const char *);
42#endif
43#ifndef __HAVE_ARCH_STRNCMP
44extern int strncmp(const char *,const char *,__kernel_size_t);
45#endif
46#ifndef __HAVE_ARCH_STRNICMP
47extern int strnicmp(const char *, const char *, __kernel_size_t);
48#endif
ded220bd
DM
49#ifndef __HAVE_ARCH_STRCASECMP
50extern int strcasecmp(const char *s1, const char *s2);
51#endif
52#ifndef __HAVE_ARCH_STRNCASECMP
53extern int strncasecmp(const char *s1, const char *s2, size_t n);
54#endif
1da177e4
LT
55#ifndef __HAVE_ARCH_STRCHR
56extern char * strchr(const char *,int);
57#endif
58#ifndef __HAVE_ARCH_STRNCHR
59extern char * strnchr(const char *, size_t, int);
60#endif
61#ifndef __HAVE_ARCH_STRRCHR
62extern char * strrchr(const char *,int);
63#endif
481fad48 64extern char * strstrip(char *);
1da177e4
LT
65#ifndef __HAVE_ARCH_STRSTR
66extern char * strstr(const char *,const char *);
67#endif
68#ifndef __HAVE_ARCH_STRLEN
69extern __kernel_size_t strlen(const char *);
70#endif
71#ifndef __HAVE_ARCH_STRNLEN
72extern __kernel_size_t strnlen(const char *,__kernel_size_t);
73#endif
8833d328
KM
74#ifndef __HAVE_ARCH_STRPBRK
75extern char * strpbrk(const char *,const char *);
76#endif
77#ifndef __HAVE_ARCH_STRSEP
78extern char * strsep(char **,const char *);
79#endif
80#ifndef __HAVE_ARCH_STRSPN
81extern __kernel_size_t strspn(const char *,const char *);
82#endif
83#ifndef __HAVE_ARCH_STRCSPN
84extern __kernel_size_t strcspn(const char *,const char *);
85#endif
1da177e4
LT
86
87#ifndef __HAVE_ARCH_MEMSET
88extern void * memset(void *,int,__kernel_size_t);
89#endif
90#ifndef __HAVE_ARCH_MEMCPY
91extern void * memcpy(void *,const void *,__kernel_size_t);
92#endif
93#ifndef __HAVE_ARCH_MEMMOVE
94extern void * memmove(void *,const void *,__kernel_size_t);
95#endif
96#ifndef __HAVE_ARCH_MEMSCAN
97extern void * memscan(void *,int,__kernel_size_t);
98#endif
99#ifndef __HAVE_ARCH_MEMCMP
100extern int memcmp(const void *,const void *,__kernel_size_t);
101#endif
102#ifndef __HAVE_ARCH_MEMCHR
103extern void * memchr(const void *,int,__kernel_size_t);
104#endif
105
dd0fc66f 106extern char *kstrdup(const char *s, gfp_t gfp);
1e66df3e 107extern char *kstrndup(const char *s, size_t len, gfp_t gfp);
1a2f67b4 108extern void *kmemdup(const void *src, size_t len, gfp_t gfp);
543537bd 109
d84d1cc7
JF
110extern char **argv_split(gfp_t gfp, const char *str, int *argcp);
111extern void argv_free(char **argv);
112
34990cf7
DB
113extern bool sysfs_streq(const char *s1, const char *s2);
114
4370aa4a
LJ
115#ifdef CONFIG_BINARY_PRINTF
116int vbin_printf(u32 *bin_buf, size_t size, const char *fmt, va_list args);
117int bstr_printf(char *buf, size_t size, const char *fmt, const u32 *bin_buf);
118int bprintf(u32 *bin_buf, size_t size, const char *fmt, ...) __printf(3, 4);
119#endif
120
e108526e
AM
121extern ssize_t memory_read_from_buffer(void *to, size_t count, loff_t *ppos,
122 const void *from, size_t available);
123
1da177e4
LT
124#endif
125#endif /* _LINUX_STRING_H_ */