Provide the helpers for string conversions to upper and lower cases.
Showing the changes to include/linux (1 of 1 file). Show all
Unified · Split
| @@ -2,6 +2,7 @@ · 1 unmodified line | |||
| 2 | #ifndef _LINUX_STRING_HELPERS_H_ | 2 | #ifndef _LINUX_STRING_HELPERS_H_ |
| 3 | #define _LINUX_STRING_HELPERS_H_ | 3 | #define _LINUX_STRING_HELPERS_H_ |
| 4 | 4 | ||
| 5 | #include <linux/ctype.h> | ||
| 5 | #include <linux/types.h> | 6 | #include <linux/types.h> |
| 6 | 7 | ||
| 7 | struct file; | 8 | struct file; |
| @@ -75,6 +76,20 @@ static inline int string_escape_str_any_np(const char *src, char *dst, · 67 unmodified lines | |||
| 75 | return string_escape_str(src, dst, sz, ESCAPE_ANY_NP, only); | 76 | return string_escape_str(src, dst, sz, ESCAPE_ANY_NP, only); |
| 76 | } | 77 | } |
| 77 | 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 | |||
| 78 | char *kstrdup_quotable(const char *src, gfp_t gfp); | 93 | char *kstrdup_quotable(const char *src, gfp_t gfp); |
| 79 | char *kstrdup_quotable_cmdline(struct task_struct *task, gfp_t gfp); | 94 | char *kstrdup_quotable_cmdline(struct task_struct *task, gfp_t gfp); |
| 80 | char *kstrdup_quotable_file(struct file *file, gfp_t gfp); | 95 | char *kstrdup_quotable_file(struct file *file, gfp_t gfp); |