aboutsummaryrefslogtreecommitdiffstats
path: root/libenv_select_name_list.3
blob: 6addcd1bf64c02fe8d6d44f6261e97c9107fb7c6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
.TH LIBENV_SELECT_NAME_LIST 3 libenv
.SH NAME
libenv_select_name_list - Keep wanted environment variables

.SH SYNOPSIS
.nf
#include <libenv.h>

size_t libenv_select_name_list(const char **\fIvariables\fP, /* enum libenv_class */ ... /*, LIBENV_END */);
size_t libenv_vselect_name_list(const char **\fIvariables\fP, va_list \fIclasses\fP);
size_t libenv_select_name_list_with_dealloc(char **\fIvariables\fP, /* enum libenv_class */ ... /*, LIBENV_END */);
size_t libenv_vselect_name_list_with_dealloc(char **\fIvariables\fP, va_list \fIclasses\fP);
.fi
.PP
Link with
.IR -lenv .

.SH DESCRIPTION
The
.BR libenv_select_name_list ()
function removes element in
.I variables
that matches the name of an environment variable that
do not belong to ant 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_name_list_with_dealloc ()
fucntion is a variant of the
.BR libenv_select_name_list ()
function that deallocates, using the
.BR free (3)
function, any remove element.
.PP
The
.BR libenv_vselect_name_list ()
and
.BR libenv_vselect_name_list_with_dealloc ()
functions are variants of the
.BR libenv_select_name_list ()
and
.BR libenv_select_name_list_with_dealloc ()
functions, respectively, that uses
.I va_list
instead of being properly variadic.

.SH RETURN VALUE
The
.BR libenv_select_name_list (),
.BR libenv_vselect_name_list (),
.BR libenv_select_name_list_with_dealloc (),
and
.BR libenv_vselect_name_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_variable_list (3),
.BR libenv_filter_name_list (3).