From dbb41ce2b7f309d394054a6bd1e33afd578798a5 Mon Sep 17 00:00:00 2001 From: Manuel Bentele Date: Fri, 23 Oct 2020 15:18:01 +0200 Subject: Move the source code of all xloop components to the common 'src' directory --- utils/include/strv.h | 55 ---------------------------------------------------- 1 file changed, 55 deletions(-) delete mode 100644 utils/include/strv.h (limited to 'utils/include/strv.h') diff --git a/utils/include/strv.h b/utils/include/strv.h deleted file mode 100644 index 260ad12..0000000 --- a/utils/include/strv.h +++ /dev/null @@ -1,55 +0,0 @@ -#ifndef UTIL_LINUX_STRV -#define UTIL_LINUX_STRV - -#include - -#include "c.h" - -char **strv_free(char **l); -void strv_clear(char **l); -char **strv_copy(char * const *l); -unsigned strv_length(char * const *l); - -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_extendv(char ***l, const char *format, va_list ap); -int strv_extendf(char ***l, const char *format, ...) - __attribute__ ((__format__ (__printf__, 2, 0))); -int strv_push(char ***l, char *value); -int strv_push_prepend(char ***l, char *value); -int strv_consume(char ***l, char *value); -int strv_consume_prepend(char ***l, char *value); - -char **strv_remove(char **l, const char *s); - -char **strv_new(const char *x, ...); -char **strv_new_ap(const char *x, va_list ap); - -static inline const char* STRV_IFNOTNULL(const char *x) { - return x ? x : (const char *) -1; -} - -static inline int strv_isempty(char * const *l) { - return !l || !*l; -} - -char **strv_split(const char *s, const char *separator); -char *strv_join(char **l, const char *separator); - -#define STRV_FOREACH(s, l) \ - for ((s) = (l); (s) && *(s); (s)++) - -#define STRV_FOREACH_BACKWARDS(s, l) \ - STRV_FOREACH(s, l) \ - ; \ - for ((s)--; (l) && ((s) >= (l)); (s)--) - - -#define STRV_MAKE_EMPTY ((char*[1]) { NULL }) - -char **strv_reverse(char **l); - -#endif /* UTIL_LINUX_STRV */ - - -- cgit v1.2.3-55-g7522