Changeset 60898b6 in mainline for uspace/srv/devman/util.h


Ignore:
Timestamp:
2010-11-05T16:17:48Z (14 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
08042bd
Parents:
a63ff7d (diff), a66e2993 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes.

File:
1 edited

Legend:

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

    ra63ff7d r60898b6  
    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.