.TH LIBENV_FILTER_VARIABLE_LIST 3 libenv
.SH NAME
libenv_filter_variable_list - Remove unwanted environment variables
.SH SYNOPSIS
.nf
#include <libenv.h>
size_t libenv_filter_variable_list(const char **\fIvariables\fP, /* enum libenv_class */ ... /*, LIBENV_END */);
size_t libenv_vfilter_variable_list(const char **\fIvariables\fP, va_list);
size_t libenv_filter_variable_list_with_dealloc(char **\fIvariables\fP, /* enum libenv_class */ ... /*, LIBENV_END */);
size_t libenv_vfilter_variable_list_with_dealloc(char **\fIvariables\fP, va_list);
.fi
.PP
Link with
.IR -lenv .
.SH DESCRIPTION
The
.BR libenv_filter_variable_list ()
function removes elements in
.I variables
that match the name, with an equals sign
.RB ( = )
afterward followed by anything, of an environment variable
that belong to all the environment variable classes listed
after the
.I variables
argument. The list must end with
.I LIBENV_END
to signal 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_filter_variable_list_with_dealloc ()
function is a variant of the
.BR libenv_filter_variable_list ()
function that deallocates, using the
.BR free (3)
function, any removed element.
.PP
The
.BR libenv_vfilter_variable_list ()
and
.BR libenv_vfilter_variable_list_with_dealloc ()
functions are variants of the
.BR libenv_filter_variable_list ()
and
.BR libenv_filter_variable_list_with_dealloc ()
functions, respectively, that use
.I va_list
instead of being properly variadic.
.SH RETURN VALUE
The
.BR libenv_filter_variable_list (),
.BR libenv_vfilter_variable_list (),
.BR libenv_filter_variable_list_with_dealloc (),
and
.BR libenv_vfilter_variable_list_with_dealloc ()
functions return the new number of elements in
.IR variables ,
excluding the
.I NULL
element at the end of the list.
The functions return 0 if
.I variables
is
.IR NULL .
.SH ERRORS
None.
.SH SEE ALSO
.BR libenv (7),
.BR enum_libenv_class (3),
.BR libenv_filter_name_list (3),
.BR libenv_select_variable_list (3).