3 .\" Manual for environment variable table
5 .\" (c) 1999, 2001, 2005, 2009, 2024 Straylight/Edgeware
8 .\"----- Licensing notice ---------------------------------------------------
10 .\" This file is part of the mLib utilities library.
12 .\" mLib is free software: you can redistribute it and/or modify it under
13 .\" the terms of the GNU Library General Public License as published by
14 .\" the Free Software Foundation; either version 2 of the License, or (at
15 .\" your option) any later version.
17 .\" mLib is distributed in the hope that it will be useful, but WITHOUT
18 .\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
19 .\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
20 .\" License for more details.
22 .\" You should have received a copy of the GNU Library General Public
23 .\" License along with mLib. If not, write to the Free Software
24 .\" Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
27 .\"--------------------------------------------------------------------------
28 .so ../defs.man \" @@@PRE@@@
30 .\"--------------------------------------------------------------------------
31 .TH env 3mLib "26 July 1999" "Straylight/Edgeware" "mLib utilities library"
38 .\"--------------------------------------------------------------------------
40 env \- efficient fiddling with environment variables
42 .\"--------------------------------------------------------------------------
46 .B "#include <mLib/env.h>"
48 .BI "char *env_get(sym_table *" t ", const char *" name );
49 .BI "void env_put(sym_table *" t ,
50 .BI " const char *" name ", const char *" value );
51 .BI "void env_import(sym_table *" t ", char **" env );
52 .BI "char **env_export(sym_table *" t );
55 .\"--------------------------------------------------------------------------
60 header manipulate environment variables stored in a hash table.
64 reads a standard Unix environment array and stores the variables in the
65 symbol table. (A standard Unix environment array is an array of
66 pointers to strings of the form
68 terminated by a null pointer. This format is used for the global
72 function.) The symbol table must have already been created (see
77 creates a Unix environment array from a symbol table. The environment
78 array is one big block of memory allocated using
82 releases all the memory used for the pointer array and the strings.
86 function looks up a variable in an environment symbol table. The
87 returned result is the variable's value if it exists, or a null pointer
92 function sets or deletes environment variables. If the
96 character, it is assumed to be of the form
100 argument is ignored, and the variable
102 is assigned the value
106 is not a null pointer, the variable
112 is null, the variable
118 function frees an environment symbol table, together with all of the
119 environment variables.
121 .\"--------------------------------------------------------------------------
127 .\"--------------------------------------------------------------------------
130 Mark Wooding, <mdw@distorted.org.uk>
132 .\"----- That's all, folks --------------------------------------------------