diff options
Diffstat (limited to 'include/linux/string.h')
| -rw-r--r-- | include/linux/string.h | 16 | 
1 files changed, 16 insertions, 0 deletions
diff --git a/include/linux/string.h b/include/linux/string.h index 8852739f36df..489019ef1694 100644 --- a/include/linux/string.h +++ b/include/linux/string.h  | |||
| @@ -10,6 +10,7 @@ | |||
| 10 | #include <linux/compiler.h> /* for inline */ | 10 | #include <linux/compiler.h> /* for inline */ | 
| 11 | #include <linux/types.h> /* for size_t */ | 11 | #include <linux/types.h> /* for size_t */ | 
| 12 | #include <linux/stddef.h> /* for NULL */ | 12 | #include <linux/stddef.h> /* for NULL */ | 
| 13 | #include <stdarg.h> | ||
| 13 | 14 | ||
| 14 | extern char *strndup_user(const char __user *, long); | 15 | extern char *strndup_user(const char __user *, long); | 
| 15 | extern void *memdup_user(const void __user *, size_t); | 16 | extern void *memdup_user(const void __user *, size_t); | 
| @@ -112,8 +113,23 @@ extern void argv_free(char **argv); | |||
| 112 | 113 | ||
| 113 | extern bool sysfs_streq(const char *s1, const char *s2); | 114 | extern bool sysfs_streq(const char *s1, const char *s2); | 
| 114 | 115 | ||
| 116 | #ifdef CONFIG_BINARY_PRINTF | ||
| 117 | int vbin_printf(u32 *bin_buf, size_t size, const char *fmt, va_list args); | ||
| 118 | int bstr_printf(char *buf, size_t size, const char *fmt, const u32 *bin_buf); | ||
| 119 | int bprintf(u32 *bin_buf, size_t size, const char *fmt, ...) __printf(3, 4); | ||
| 120 | #endif | ||
| 121 | |||
| 115 | extern ssize_t memory_read_from_buffer(void *to, size_t count, loff_t *ppos, | 122 | extern ssize_t memory_read_from_buffer(void *to, size_t count, loff_t *ppos, | 
| 116 | const void *from, size_t available); | 123 | const void *from, size_t available); | 
| 117 | 124 | ||
| 125 | /** | ||
| 126 | * strstarts - does @str start with @prefix? | ||
| 127 | * @str: string to examine | ||
| 128 | * @prefix: prefix to look for. | ||
| 129 | */ | ||
| 130 | static inline bool strstarts(const char *str, const char *prefix) | ||
| 131 | { | ||
| 132 | return strncmp(str, prefix, strlen(prefix)) == 0; | ||
| 133 | } | ||
| 118 | #endif | 134 | #endif | 
| 119 | #endif /* _LINUX_STRING_H_ */ | 135 | #endif /* _LINUX_STRING_H_ */ | 
