Added SILC Thread Queue API
[silc.git] / lib / silcutil / silcenv.h
1 /*
2
3   silcenv.h
4
5   Author: Pekka Riikonen <priikone@silcnet.org>
6
7   Copyright (C) 2007 Pekka Riikonen
8
9   This program is free software; you can redistribute it and/or modify
10   it under the terms of the GNU General Public License as published by
11   the Free Software Foundation; version 2 of the License.
12
13   This program is distributed in the hope that it will be useful,
14   but WITHOUT ANY WARRANTY; without even the implied warranty of
15   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16   GNU General Public License for more details.
17
18 */
19
20 /****h* silcutil/Environment Manipulation Interface
21  *
22  * DESCRIPTION
23  *
24  * This interface provides utility functions for manipulating environment
25  * variables.  On platforms that do not support environment variables this
26  * interfaces does nothing.
27  *
28  ***/
29
30 #ifndef SILCENV_H
31 #define SILCENV_H
32
33 /****f* silcutil/SilcEnvAPI/silc_setenv
34  *
35  * SYNOPSIS
36  *
37  *    SilcBool silc_setenv(const char *variable, const char *value);
38  *
39  * DESCRIPTION
40  *
41  *    Sets the environment variable named `variable' with value `value'
42  *    to the environment.  If the `variable' already exists in the
43  *    environment its value is changed to `value'.  Returns FALSE if the
44  *    value could not be set or if environment variables are not supported.
45  *
46  ***/
47 SilcBool silc_setenv(const char *variable, const char *value);
48
49 /****f* silcutil/SilcEnvAPI/silc_getenv
50  *
51  * SYNOPSIS
52  *
53  *    const char *silc_getenv(const char *variable);
54  *
55  * DESCRIPTION
56  *
57  *    Returns the value of the environment variable `variable' or NULL if
58  *    such variable does not exist in the environment.
59  *
60  ***/
61 const char *silc_getenv(const char *variable);
62
63 /****f* silcutil/SilcEnvAPI/silc_unsetenv
64  *
65  * SYNOPSIS
66  *
67  *    SilcBool silc_unsetenv(const char *variable);
68  *
69  * DESCRIPTION
70  *
71  *    Clears the value of the environment variable `variable'.  Returns FALSE
72  *    if the value could not be cleared or if environment variables are not
73  *    supported.
74  *
75  ***/
76 SilcBool silc_unsetenv(const char *variable);
77
78 /****f* silcutil/SilcEnvAPI/silc_clearenv
79  *
80  * SYNOPSIS
81  *
82  *    SilcBool silc_clearenv(void);
83  *
84  * DESCRIPTION
85  *
86  *    Clears the environment of all environment variables.  Returns FALSE
87  *    if the environment could not be cleared or if environment variables are
88  *    not supported.
89  *
90  ***/
91 SilcBool silc_clearenv(void);
92
93
94 #endif /* SILCENV_H */