Add string_contains_word_strv()
I had to move STRV_MAKE to macro.h. There is a circular dependency between extract-word.h, strv.h, and string-util.h that makes it hard to define the inline function otherwise.
This commit is contained in:
@@ -538,6 +538,9 @@ static inline int __coverity_check_and_return__(int condition) {
|
||||
(y) = (_t); \
|
||||
} while (false)
|
||||
|
||||
#define STRV_MAKE(...) ((char**) ((const char*[]) { __VA_ARGS__, NULL }))
|
||||
#define STRV_MAKE_EMPTY ((char*[1]) { NULL })
|
||||
|
||||
/* Iterates through a specified list of pointers. Accepts NULL pointers, but uses (void*) -1 as internal marker for EOL. */
|
||||
#define FOREACH_POINTER(p, x, ...) \
|
||||
for (typeof(p) *_l = (typeof(p)[]) { ({ p = x; }), ##__VA_ARGS__, (void*) -1 }; \
|
||||
|
||||
Reference in New Issue
Block a user