From aebf2524909f0c0e3aec7f78fa01ad908f7da3a0 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Thu, 30 Jan 2025 18:42:27 +0100 Subject: First commit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- common.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 common.h (limited to 'common.h') diff --git a/common.h b/common.h new file mode 100644 index 0000000..02af2a1 --- /dev/null +++ b/common.h @@ -0,0 +1,30 @@ +/* See LICENSE file for copyright and license details. */ +#include "libenv.h" +#include + + +#define HAVE_HEAD 1 +#define NO_HEAD 0 + +#define NAMES 1 +#define VARIABLES 0 + +#define FILTER 1, 1 +#define SELECT 0, 0 + + +size_t libenv_vprocess_list__(void *, enum libenv_class, va_list, int have_head, int names, int filter, int all, int dealloc); + +static inline size_t +libenv_vprocess_list_without_dealloc__(const char **variables, enum libenv_class classes_head, va_list classes_tail, + int have_head, int names, int filter, int all) +{ + return libenv_vprocess_list__(variables, classes_head, classes_tail, have_head, names, filter, all, 0); +} + +static inline size_t +libenv_vprocess_list_with_dealloc__(char **variables, enum libenv_class classes_head, va_list classes_tail, + int have_head, int names, int filter, int all) +{ + return libenv_vprocess_list__(variables, classes_head, classes_tail, have_head, names, filter, all, 1); +} -- cgit v1.2.3-70-g09d2