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 /libenv_get_chosen_list.3 | |
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 'libenv_get_chosen_list.3')
-rw-r--r-- | libenv_get_chosen_list.3 | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/libenv_get_chosen_list.3 b/libenv_get_chosen_list.3 new file mode 100644 index 0000000..0b87403 --- /dev/null +++ b/libenv_get_chosen_list.3 @@ -0,0 +1,69 @@ +.TH LIBENV_GET_CHOSEN_LIST 3 libenv +.SH NAME +libenv_get_chosen_list - List recognised environment variables by class + +.SH SYNOPSIS +.nf +#include <libenv.h> + +const char **libenv_get_chosen_list(enum libenv_class, ... /*, LIBENV_END */); +const char **libenv_vget_chosen_list(enum libenv_class, va_list); +.fi +.PP +Link with +.IR -lenv . + +.SH DESCRIPTION +The +.BR libenv_get_chosen_list () +function returns a +.I NULL +terminated list of the names of all environment variables, that it knows of, +regardless if they are set in the environemnt, and that belong to at least +one of the environment variable classes listed in the functions argument list. +The argument list must be termianted with +.I LIBENV_END +so that the function knonws when there are no more arguments to read. +.PP +The +.BR libenv_vget_chosen_list () +function is a variant of the +.BR libenv_get_chosen_list () +function that uses +.I va_list +rather than being properly variadic. + +.SH RETURN VALUE +Upon successful completion, the +.BR libenv_get_chosen_list () +and +.BR libenv_vget_chosen_list () +functions return a +.IR NULL - +terminated list of statically allocated +strings, representing environment variable names. +The returned list, but not it's element, shall +be deallocated using the +.BR free (3) +function. On failure +.I NULL +is returned and +.I errno +is appropriately set to describe the error. + +.SH ERRORS +The +.BR libenv_get_chosen_list () +and +.BR libenv_vget_chosen_list () +functions may fail if: +.TP +.B ENOMEM +Insufficient memory available. + +.SH SEE ALSO +.BR libenv (7), +.BR enum_libenv_class (3), +.BR libenv_get_complete_list (3), +.BR libenv_filter_variable_list (3), +.BR libenv_select_variable_list (3). |