Changes in uspace/srv/devman/util.h [38b3baf:791f58c] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/devman/util.h
r38b3baf r791f58c 41 41 extern char *get_path_elem_end(char *); 42 42 43 static inline bool skip_spaces(char **buf) 44 { 45 while (isspace(**buf)) 46 (*buf)++; 47 return *buf != 0; 48 } 49 50 static inline size_t get_nonspace_len(const char *str) 51 { 52 size_t len = 0; 53 54 while(*str != 0 && !isspace(*str)) { 55 len++; 56 str++; 57 } 58 return len; 59 } 60 61 static inline void free_not_null(const void *ptr) 62 { 63 if (NULL != ptr) 64 free(ptr); 65 } 66 67 static inline char *clone_string(const char *s) 68 { 69 size_t size = str_size(s) + 1; 70 char *str; 71 72 str = (char *) malloc(size); 73 if (NULL != str) 74 str_cpy(str, size, s); 75 return str; 76 } 77 78 static inline void replace_char(char *str, char orig, char repl) 79 { 80 while (*str) { 81 if (orig == *str) 82 *str = repl; 83 str++; 84 } 85 } 43 extern bool skip_spaces(char **); 44 extern size_t get_nonspace_len(const char *); 45 extern void free_not_null(const void *); 46 extern char *clone_string(const char *); 47 extern void replace_char(char *, char, char); 86 48 87 49 #endif
Note:
See TracChangeset
for help on using the changeset viewer.