diff options
author | Carlos Eduardo <carana2099@gmail.com> | 2024-05-17 17:16:06 -0300 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2024-05-17 22:10:26 +0000 |
commit | bcb8e950789c173c387bea5c8a6906f9e26a8038 (patch) | |
tree | 39df50d1fa0e875189fe8cacfbced764f8f8a637 /doc/libstddjb/envalloc.html | |
parent | 6d35cf64e8a40b1d6d5073ba91593078065762ea (diff) | |
download | skalibs-bcb8e950789c173c387bea5c8a6906f9e26a8038.tar.xz |
document env.h
Singling out envdir_chomp might sound a bit snarky, but it's somewhat
contradictory, so I believe it's better to document it separately.
Diffstat (limited to 'doc/libstddjb/envalloc.html')
-rw-r--r-- | doc/libstddjb/envalloc.html | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/doc/libstddjb/envalloc.html b/doc/libstddjb/envalloc.html index cda94ad..fcc2534 100644 --- a/doc/libstddjb/envalloc.html +++ b/doc/libstddjb/envalloc.html @@ -21,7 +21,37 @@ <h1> The <tt>skalibs/envalloc.h</tt> header </h1> <p> - TODO: write this documentation page. (Sorry!) + The following functions are declared in the <tt>skalibs/env.h</tt> header, +and implemented in the <tt>libskarnet.a</tt> or <tt>libskarnet.so</tt> library. +</p> + +<h2> General information </h2> + +<p> +<tt>envalloc.h</tt> is a supplement of <a href="env.html"><tt>env.h</tt></a> +header that lets one use <a href="stralloc.html">genallocs</a> of +<tt>char const *</tt> instead of fixed-size <tt>char const *[]</tt>. +</p> + +<h2> Functions </h2> + +<p> +<code>int envalloc_uniq (genalloc *v, char delim)</code><br /> +Removes strings in the <em>v</em> that share the same prefix up to the first +<em>delim</em> character. For instance, if delim is <tt>=</tt>, duplicate +environment variables are removed. Returns the number of removed entries on +success, -1 (and sets errno) on failure. +</p> + +<p> +<code>int envalloc_0 (genalloc *v)</code><br /> +Appends a null pointer to <em>v</em>. Returns 1 on sucess, 0 (and sets errno) +on failure. +</p> + +<p> +<tt>envalloc_make</tt> and <tt>envalloc_merge</tt> work exactly like their +<tt>env.h</tt> counterparts. </p> </body> |