diff options
author | Simon Peeters <peeters.simon@gmail.com> | 2014-01-04 02:35:27 +0100 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2014-01-05 09:16:15 -0500 |
commit | e3e45d4f82daa5cd85ba40dde9127df900096c0c (patch) | |
tree | 307e427adfd64298ff3f21f6c6fd97aca1e17d42 /src/shared/strv.h | |
parent | bf85c24daaf63f72562bbe4c627ca8b963dfb964 (diff) |
strv: multiple cleanups
- turn strv_merge into strv_extend_strv.
appending strv b to the end of strv a instead of creating a new strv
- strv_append: remove in favor of strv_extend and strv_push.
- strv_remove: write slightly more elegant
- strv_remove_prefix: remove unused function
- strv_overlap: use strv_contains
- strv_printf: STRV_FOREACH handles NULL correctly
Diffstat (limited to 'src/shared/strv.h')
-rw-r--r-- | src/shared/strv.h | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/shared/strv.h b/src/shared/strv.h index daf9ad0d0b..715bc5419c 100644 --- a/src/shared/strv.h +++ b/src/shared/strv.h @@ -36,14 +36,12 @@ DEFINE_TRIVIAL_CLEANUP_FUNC(char**, strv_free); char **strv_copy(char * const *l); unsigned strv_length(char * const *l) _pure_; -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); +int strv_extend_strv(char ***a, char **b); +int strv_extend_strv_concat(char ***a, char **b, const char *suffix); int strv_extend(char ***l, const char *value); int strv_push(char ***l, char *value); char **strv_remove(char **l, const char *s); -char **strv_remove_prefix(char **l, const char *s); char **strv_uniq(char **l); #define strv_contains(l, s) (!!strv_find((l), (s))) |