strv: add helper to extend strv from both sides
Also, use the more correct type of 'const char* const*' for the input strv. This requires adding the cast in a few places, but also allows to remove some casts in others.
This commit is contained in:
+4
-1
@@ -43,7 +43,10 @@ int strv_copy_unless_empty(char * const *l, char ***ret);
|
||||
size_t strv_length(char * const *l) _pure_;
|
||||
|
||||
int strv_extend_strv(char ***a, char * const *b, bool filter_duplicates);
|
||||
int strv_extend_strv_concat(char ***a, char * const *b, const char *suffix);
|
||||
int strv_extend_strv_biconcat(char ***a, const char *prefix, const char* const *b, const char *suffix);
|
||||
static inline int strv_extend_strv_concat(char ***a, const char* const *b, const char *suffix) {
|
||||
return strv_extend_strv_biconcat(a, NULL, b, suffix);
|
||||
}
|
||||
int strv_prepend(char ***l, const char *value);
|
||||
|
||||
/* _with_size() are lower-level functions where the size can be provided externally,
|
||||
|
||||
Reference in New Issue
Block a user