diff options
author | Mattias Andrée <m@maandree.se> | 2025-01-30 18:42:27 +0100 |
---|---|---|
committer | Mattias Andrée <m@maandree.se> | 2025-01-30 18:42:27 +0100 |
commit | aebf2524909f0c0e3aec7f78fa01ad908f7da3a0 (patch) | |
tree | 86881e1b1b299990e6726eda5dde3f1f77c4f180 /common.h | |
download | libenv-aebf2524909f0c0e3aec7f78fa01ad908f7da3a0.tar.gz libenv-aebf2524909f0c0e3aec7f78fa01ad908f7da3a0.tar.bz2 libenv-aebf2524909f0c0e3aec7f78fa01ad908f7da3a0.tar.xz |
First commit
Signed-off-by: Mattias Andrée <m@maandree.se>
Diffstat (limited to '')
-rw-r--r-- | common.h | 30 |
1 files changed, 30 insertions, 0 deletions
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 <stdlib.h> + + +#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); +} |