1 /* SPDX-License-Identifier: GPL-2.0 */ 2 #ifndef _SKC_LINUX_STRING_H 3 #define _SKC_LINUX_STRING_H 4 5 #include <string.h> 6 7 /* Copied from lib/string.c */ skip_spaces(const char * str)8static inline char *skip_spaces(const char *str) 9 { 10 while (isspace(*str)) 11 ++str; 12 return (char *)str; 13 } 14 strim(char * s)15static inline char *strim(char *s) 16 { 17 size_t size; 18 char *end; 19 20 size = strlen(s); 21 if (!size) 22 return s; 23 24 end = s + size - 1; 25 while (end >= s && isspace(*end)) 26 end--; 27 *(end + 1) = '\0'; 28 29 return skip_spaces(s); 30 } 31 32 #endif 33