aboutsummaryrefslogtreecommitdiffstats
path: root/libenv_get_complete_list.3
diff options
context:
space:
mode:
authorMattias Andrée <m@maandree.se>2025-01-30 18:42:27 +0100
committerMattias Andrée <m@maandree.se>2025-01-30 18:42:27 +0100
commitaebf2524909f0c0e3aec7f78fa01ad908f7da3a0 (patch)
tree86881e1b1b299990e6726eda5dde3f1f77c4f180 /libenv_get_complete_list.3
downloadlibenv-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_complete_list.3')
-rw-r--r--libenv_get_complete_list.382
1 files changed, 82 insertions, 0 deletions
diff --git a/libenv_get_complete_list.3 b/libenv_get_complete_list.3
new file mode 100644
index 0000000..83038a3
--- /dev/null
+++ b/libenv_get_complete_list.3
@@ -0,0 +1,82 @@
+.TH LIBENV_GET_COMPLETE_LIST 3 libenv
+.SH NAME
+libenv_get_complete_list - List all recognised environment variables
+
+.SH SYNOPSIS
+.nf
+#include <libenv.h>
+
+struct libenv_variable {
+ const char *\fIname\fP;
+ const uint64_t *\fIclasses\fP;
+};
+
+const struct libenv_variable *libenv_get_complete_list(size_t *\fInclasswords_out\fP, size_t *\fIcount_out\fP);
+.fi
+.PP
+Link with
+.IR -lenv .
+
+.SH DESCRIPTION
+The
+.BR libenv_get_complete_list ()
+function returns a list of all environment variables the library knows of,
+regardless of whether they are set in the environment. The function returns
+a list of
+.I struct libenv_variable
+elements, for each of them,
+.I .name
+will be set to the name of the environment variable and
+.I .classes
+will be set to a bit field of classes the environment variable
+belongs to. If
+.IR (.classes[i]>>b)&1 ,
+then the
+.BR "enum libenv_class" (3)
+member with the value
+.I i*64+b
+describes a class the environment variable belongs to. (Make sure that you
+do not compare against values greeater than or equal to
+.IR *nclasswords_out*64 .)
+The bit corresponding to
+.I LIBENV_END
+will always be 0.
+.PP
+Unless
+.I nclasswords_out
+is
+.IR NULL ,
+.I *nclasswords_out
+will be set to the number of elements
+.RB ( uint64_t 's)
+in each
+.I .classes
+for each returned
+.IR "struct libenv_variable" .
+.PP
+Unless
+.I count_out
+is
+.IR NULL ,
+.I *count_out
+will be set to the number of returned environment variables.
+
+.SH RETURN VALUE
+The
+.BR libenv_get_complete_list (3)
+function returns a statically allocated list of environment variables
+along with the classifications; the list will contain
+.I *count_out
+(as set when the function returns) elements, plus one extra element,
+at the end, having both its fields set to
+.IR NULL .
+
+.SH ERRORS
+None.
+
+.SH SEE ALSO
+.BR libenv (7),
+.BR enum_libenv_class (3),
+.BR libenv_get_chosen_list (3),
+.BR libenv_filter_variable_list (3),
+.BR libenv_select_variable_list (3).