diff options
author | Lennart Poettering <lennart@poettering.net> | 2010-02-13 01:04:44 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2010-02-13 01:04:44 +0100 |
commit | 5f9a22c3745a588883695e90bca00776b79610a4 (patch) | |
tree | af29852ddd8646cc0312486826d14f191433fd51 /strv.h | |
parent | dfcd764ea64a61280eeb3902505b58aca06111f9 (diff) |
strv: add various strv calls
Diffstat (limited to 'strv.h')
-rw-r--r-- | strv.h | 16 |
1 files changed, 15 insertions, 1 deletions
@@ -30,11 +30,25 @@ 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); + +#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)++) |