chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
8526180
)
util: add strna() and is_path_absolute()
author
Lennart Poettering
<lennart@poettering.net>
Wed, 18 Nov 2009 23:47:41 +0000
(
00:47
+0100)
committer
Lennart Poettering
<lennart@poettering.net>
Wed, 18 Nov 2009 23:47:41 +0000
(
00:47
+0100)
util.h
patch
|
blob
|
history
diff --git
a/util.h
b/util.h
index 2df67b73df5af2934c5b6edcdf17e7772c43151f..60dc04e961cadb778a1617041bf48d559091c5d8 100644
(file)
--- a/
util.h
+++ b/
util.h
@@
-41,6
+41,14
@@
static inline const char* strnull(const char *s) {
return s ? s : "(null)";
}
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);
bool endswith(const char *s, const char *postfix);
bool startswith(const char *s, const char *prefix);