X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fshared%2Fstrv.h;h=a899395ba4efb1ebc0c439a1b4474d75828b0e3d;hb=bceccd5ecc393c344ab008737ba6aab211a5ea9f;hp=e385bf73b841b3e24986c4eb3d35ad7682d04f35;hpb=488c8d08c322471f2e702e25b75f31bed7ae5975;p=elogind.git diff --git a/src/shared/strv.h b/src/shared/strv.h index e385bf73b..a899395ba 100644 --- a/src/shared/strv.h +++ b/src/shared/strv.h @@ -23,6 +23,7 @@ #include #include +#include #include "util.h" @@ -144,3 +145,11 @@ void strv_print(char **l); })) char **strv_reverse(char **l); + +bool strv_fnmatch(const char *s, char* const* patterns, int flags); + +static inline bool strv_fnmatch_or_empty(const char *s, char* const* patterns, int flags) { + assert(s); + return strv_isempty(patterns) || + strv_fnmatch(s, patterns, flags); +}