chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
basic/strv: introduce STRV_IGNORE macro (#3601)
[elogind.git]
/
src
/
basic
/
strv.h
diff --git
a/src/basic/strv.h
b/src/basic/strv.h
index 591a452e90d032234b6f9e594cae0ddccccaafa8..c95a637b43d811b229b5eddf7328c2970142207a 100644
(file)
--- a/
src/basic/strv.h
+++ b/
src/basic/strv.h
@@
-77,8
+77,10
@@
bool strv_equal(char **a, char **b);
char **strv_new(const char *x, ...) _sentinel_;
char **strv_new_ap(const char *x, va_list ap);
char **strv_new(const char *x, ...) _sentinel_;
char **strv_new_ap(const char *x, va_list ap);
+#define STRV_IGNORE ((const char *) -1)
+
static inline const char* STRV_IFNOTNULL(const char *x) {
static inline const char* STRV_IFNOTNULL(const char *x) {
- return x ? x :
(const char *) -1
;
+ return x ? x :
STRV_IGNORE
;
}
static inline bool strv_isempty(char * const *l) {
}
static inline bool strv_isempty(char * const *l) {