X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=util.h;h=60dc04e961cadb778a1617041bf48d559091c5d8;hb=ed5bcfbe3c3b68e59242c03649eea03a9707d318;hp=2df67b73df5af2934c5b6edcdf17e7772c43151f;hpb=852618039bea9f6fa851a0ae3101f79b65d3cf6b;p=elogind.git diff --git a/util.h b/util.h index 2df67b73d..60dc04e96 100644 --- a/util.h +++ b/util.h @@ -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);