path-util: express PATH_IN_SET() through path_strv_contains()

This commit is contained in:
Lennart Poettering 2020-01-08 12:23:57 +01:00
parent 3841fee822
commit 3593fa60f2
1 changed files with 1 additions and 11 deletions

View File

@ -71,17 +71,7 @@ static inline bool path_equal_ptr(const char *a, const char *b) {
}
/* Note: the search terminates on the first NULL item. */
#define PATH_IN_SET(p, ...) \
({ \
char **_s; \
bool _found = false; \
STRV_FOREACH(_s, STRV_MAKE(__VA_ARGS__)) \
if (path_equal(p, *_s)) { \
_found = true; \
break; \
} \
_found; \
})
#define PATH_IN_SET(p, ...) path_strv_contains(STRV_MAKE(__VA_ARGS__), p)
char* path_startswith_strv(const char *p, char **set);
#define PATH_STARTSWITH_SET(p, ...) path_startswith_strv(p, STRV_MAKE(__VA_ARGS__))