]>
Commit | Line | Data |
---|---|---|
392d7920 | 1 | /* Routines for dealing with '\0' separated environment vectors |
75cd5204 | 2 | Copyright (C) 1995, 1996 Free Software Foundation, Inc. |
392d7920 RM |
3 | Written by Miles Bader <miles@gnu.ai.mit.edu> |
4 | ||
54d79e99 UD |
5 | The GNU C Library is free software; you can redistribute it and/or |
6 | modify it under the terms of the GNU Library General Public License as | |
7 | published by the Free Software Foundation; either version 2 of the | |
8 | License, or (at your option) any later version. | |
392d7920 | 9 | |
54d79e99 UD |
10 | The GNU C Library is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
392d7920 | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
54d79e99 | 13 | Library General Public License for more details. |
392d7920 | 14 | |
54d79e99 UD |
15 | You should have received a copy of the GNU Library General Public |
16 | License along with the GNU C Library; see the file COPYING.LIB. If not, | |
17 | write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
18 | Boston, MA 02111-1307, USA. */ | |
392d7920 RM |
19 | |
20 | #ifndef __ENVZ_H__ | |
23396375 UD |
21 | |
22 | #define __ENVZ_H__ 1 | |
23 | #include <features.h> | |
392d7920 RM |
24 | |
25 | #include <errno.h> | |
26 | ||
27 | /* Envz's are argz's too, and should be created etc., using the same | |
28 | routines. */ | |
29 | #include <argz.h> | |
30 | ||
54d79e99 UD |
31 | __BEGIN_DECLS |
32 | ||
392d7920 | 33 | /* Returns a pointer to the entry in ENVZ for NAME, or 0 if there is none. */ |
23396375 UD |
34 | extern char *envz_entry __P ((__const char *__envz, size_t __envz_len, |
35 | __const char *__name)); | |
392d7920 RM |
36 | |
37 | /* Returns a pointer to the value portion of the entry in ENVZ for NAME, or 0 | |
38 | if there is none. */ | |
23396375 UD |
39 | extern char *envz_get __P ((__const char *__envz, size_t __envz_len, |
40 | __const char *__name)); | |
392d7920 RM |
41 | |
42 | /* Adds an entry for NAME with value VALUE to ENVZ & ENVZ_LEN. If an entry | |
43 | with the same name already exists in ENVZ, it is removed. If VALUE is | |
44 | NULL, then the new entry will a special null one, for which envz_get will | |
45 | return NULL, although envz_entry will still return an entry; this is handy | |
46 | because when merging with another envz, the null entry can override an | |
47 | entry in the other one. Null entries can be removed with envz_strip (). */ | |
23396375 UD |
48 | extern error_t envz_add __P ((char **__envz, size_t *__envz_len, |
49 | __const char *__name, __const char *__value)); | |
392d7920 RM |
50 | |
51 | /* Adds each entry in ENVZ2 to ENVZ & ENVZ_LEN, as if with envz_add(). If | |
52 | OVERRIDE is true, then values in ENVZ2 will supercede those with the same | |
53 | name in ENV, otherwise not. */ | |
23396375 UD |
54 | extern error_t envz_merge __P ((char **__envz, size_t *__envz_len, |
55 | __const char *__envz2, size_t __envz2_len, | |
56 | int __override)); | |
392d7920 RM |
57 | |
58 | /* Remove null entries. */ | |
23396375 | 59 | extern void envz_strip __P ((char **__envz, size_t *__envz_len)); |
392d7920 | 60 | |
54d79e99 UD |
61 | __END_DECLS |
62 | ||
392d7920 | 63 | #endif /* __ENVZ_H__ */ |