.. | .. |
---|
2 | 2 | #ifndef _LINUX_STRING_HELPERS_H_ |
---|
3 | 3 | #define _LINUX_STRING_HELPERS_H_ |
---|
4 | 4 | |
---|
| 5 | +#include <linux/ctype.h> |
---|
5 | 6 | #include <linux/types.h> |
---|
6 | 7 | |
---|
7 | 8 | struct file; |
---|
.. | .. |
---|
54 | 55 | int string_escape_mem(const char *src, size_t isz, char *dst, size_t osz, |
---|
55 | 56 | unsigned int flags, const char *only); |
---|
56 | 57 | |
---|
| 58 | +int string_escape_mem_ascii(const char *src, size_t isz, char *dst, |
---|
| 59 | + size_t osz); |
---|
| 60 | + |
---|
57 | 61 | static inline int string_escape_mem_any_np(const char *src, size_t isz, |
---|
58 | 62 | char *dst, size_t osz, const char *only) |
---|
59 | 63 | { |
---|
.. | .. |
---|
72 | 76 | return string_escape_str(src, dst, sz, ESCAPE_ANY_NP, only); |
---|
73 | 77 | } |
---|
74 | 78 | |
---|
| 79 | +static inline void string_upper(char *dst, const char *src) |
---|
| 80 | +{ |
---|
| 81 | + do { |
---|
| 82 | + *dst++ = toupper(*src); |
---|
| 83 | + } while (*src++); |
---|
| 84 | +} |
---|
| 85 | + |
---|
| 86 | +static inline void string_lower(char *dst, const char *src) |
---|
| 87 | +{ |
---|
| 88 | + do { |
---|
| 89 | + *dst++ = tolower(*src); |
---|
| 90 | + } while (*src++); |
---|
| 91 | +} |
---|
| 92 | + |
---|
75 | 93 | char *kstrdup_quotable(const char *src, gfp_t gfp); |
---|
76 | 94 | char *kstrdup_quotable_cmdline(struct task_struct *task, gfp_t gfp); |
---|
77 | 95 | char *kstrdup_quotable_file(struct file *file, gfp_t gfp); |
---|
78 | 96 | |
---|
| 97 | +void kfree_strarray(char **array, size_t n); |
---|
| 98 | + |
---|
79 | 99 | #endif |
---|