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 --- libenv_select_variable_list.3 | 84 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 libenv_select_variable_list.3 (limited to 'libenv_select_variable_list.3') diff --git a/libenv_select_variable_list.3 b/libenv_select_variable_list.3 new file mode 100644 index 0000000..2ec8427 --- /dev/null +++ b/libenv_select_variable_list.3 @@ -0,0 +1,84 @@ +.TH LIBENV_SELECT_VARIABLE_LIST 3 libenv +.SH NAME +libenv_select_variable_list - Keep wanted environment variables + +.SH SYNOPSIS +.nf +#include + +size_t libenv_select_variable_list(const char **\fIvariables\fP, /* enum libenv_class */ ... /*, LIBENV_END */); +size_t libenv_vselect_variable_list(const char **\fIvariables\fP, va_list \fIclasses\fP); +size_t libenv_select_variable_list_with_dealloc(char **\fIvariables\fP, /* enum libenv_class */ ... /*, LIBENV_END */); +size_t libenv_vselect_variable_list_with_dealloc(char **\fIvariables\fP, va_list \fIclasses\fP); +.fi +.PP +Link with +.IR -lenv . + +.SH DESCRIPTION +The +.BR libenv_select_variable_list () +function removes element in +.I variables +that matches the name, optionally with an equals sign +.RB ( = ) +followed by anything, of an environment variable that +do not belong to any of the environment variable classes +listed after the +.I variables +argument. The list must end with +.I LIBENV_END +to mark indicate to the function that there are no +more arguments to read. +.PP +.I variables +should be a +.I NULL +terminated list, but may be +.IR NULL . +.PP +The +.BR libenv_select_variable_list_with_dealloc () +fucntion is a variant of the +.BR libenv_select_variable_list () +function that deallocates, using the +.BR free (3) +function, any remove element. +.PP +The +.BR libenv_vselect_variable_list () +and +.BR libenv_vselect_variable_list_with_dealloc () +functions are variants of the +.BR libenv_select_variable_list () +and +.BR libenv_select_variable_list_with_dealloc () +functions, respectively, that uses +.I va_list +instead of being properly variadic. + +.SH RETURN VALUE +The +.BR libenv_select_variable_list (), +.BR libenv_vselect_variable_list (), +.BR libenv_select_variable_list_with_dealloc (), +and +.BR libenv_vselect_variable_list_with_dealloc () +functions return the new number of elements in +.IR variables , +exclucing the +.I NULL +element at the end of the list. +0 if +.I variables +is +.IR NULL . + +.SH ERRORS +None. + +.SH SEE ALSO +.BR libenv (7), +.BR enum_libenv_class (3), +.BR libenv_select_name_list (3), +.BR libenv_filter_variable_list (3). -- cgit v1.2.3-70-g09d2