X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=strv.h;h=acaae9e7ea8b69c6ee026331370f7130890df37b;hb=2e478a46c3754ede1a7af57b961056a2a375a799;hp=abe91925456f177050201dd5e01149b36d5269ed;hpb=a7334b0952ab66c17ee787e36e6d2c5ceb387de6;p=elogind.git diff --git a/strv.h b/strv.h index abe919254..acaae9e7e 100644 --- a/strv.h +++ b/strv.h @@ -30,10 +30,24 @@ char **strv_copy(char **l); unsigned strv_length(char **l); char **strv_merge(char **a, char **b); +char **strv_merge_concat(char **a, char **b, const char *suffix); +char **strv_append(char **l, const char *s); -bool strv_contains(char **l, const char *s); +char **strv_remove(char **l, const char *s); +char **strv_uniq(char **l); -char **strv_new(const char *x, ...) __sentinel; +#define strv_contains(l, s) (!!strv_find((l), (s))) + +char **strv_new(const char *x, ...) _sentinel; + +static inline bool strv_isempty(char **l) { + return !l || !*l; +} + +char **strv_split(const char *s, const char *separator); +char **strv_split_quoted(const char *s); + +char *strv_join(char **l, const char *separator); #define STRV_FOREACH(s, l) \ for ((s) = (l); (s) && *(s); (s)++)