util: add strna() and is_path_absolute()

This commit is contained in:
Lennart Poettering 2009-11-19 00:47:41 +01:00
parent 852618039b
commit 04fd6fe45b
1 changed files with 8 additions and 0 deletions

8
util.h
View File

@ -41,6 +41,14 @@ static inline const char* strnull(const char *s) {
return s ? s : "(null)";
}
static inline const char *strna(const char *s) {
return s ? s : "n/a";
}
static inline bool is_path_absolute(const char *p) {
return *p == '/';
}
bool endswith(const char *s, const char *postfix);
bool startswith(const char *s, const char *prefix);