Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/devman/util.h

    r38b3baf r791f58c  
    4141extern char *get_path_elem_end(char *);
    4242
    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 }
     43extern bool skip_spaces(char **);
     44extern size_t get_nonspace_len(const char *);
     45extern void free_not_null(const void *);
     46extern char *clone_string(const char *);
     47extern void replace_char(char *, char, char);
    8648
    8749#endif
Note: See TracChangeset for help on using the changeset viewer.