diff options
author | Lennart Poettering <lennart@poettering.net> | 2009-11-19 00:47:41 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2009-11-19 00:47:41 +0100 |
commit | 04fd6fe45b6c4e245a621578d2913296d1bb3642 (patch) | |
tree | 18a3541262b52392a6750f0256020b832fab0969 /util.h | |
parent | 852618039bea9f6fa851a0ae3101f79b65d3cf6b (diff) |
util: add strna() and is_path_absolute()
Diffstat (limited to 'util.h')
-rw-r--r-- | util.h | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -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); |