1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-12-22 13:33:56 +03:00

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

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);