1 | /** @file
|
---|
2 | * InnoTek Portable Runtime - Process Environment Strings.
|
---|
3 | */
|
---|
4 |
|
---|
5 | /*
|
---|
6 | * Copyright (C) 2006 InnoTek Systemberatung GmbH
|
---|
7 | *
|
---|
8 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
9 | * available from http://www.virtualbox.org. This file is free software;
|
---|
10 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
11 | * General Public License as published by the Free Software Foundation,
|
---|
12 | * in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
|
---|
13 | * distribution. VirtualBox OSE is distributed in the hope that it will
|
---|
14 | * be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
15 | *
|
---|
16 | * If you received this file as part of a commercial VirtualBox
|
---|
17 | * distribution, then only the terms of your commercial VirtualBox
|
---|
18 | * license agreement apply instead of the previous paragraph.
|
---|
19 | */
|
---|
20 |
|
---|
21 | #ifndef __iprt_env_h__
|
---|
22 | #define __iprt_env_h__
|
---|
23 |
|
---|
24 | #include <iprt/cdefs.h>
|
---|
25 | #include <iprt/types.h>
|
---|
26 |
|
---|
27 | __BEGIN_DECLS
|
---|
28 |
|
---|
29 | /** @defgroup grp_rt_env RTProc - Process Environment Strings
|
---|
30 | * @ingroup grp_rt
|
---|
31 | * @{
|
---|
32 | */
|
---|
33 |
|
---|
34 | #ifdef IN_RING3
|
---|
35 |
|
---|
36 | /**
|
---|
37 | * Gets an environment variable (getenv).
|
---|
38 | *
|
---|
39 | * The caller is responsible for ensuring that nobody changes the environment
|
---|
40 | * while it's using the returned string pointer!
|
---|
41 | *
|
---|
42 | * @returns Pointer to read only string on success, NULL if the variable wasn't found.
|
---|
43 | *
|
---|
44 | * @param pszVar The environment variable name.
|
---|
45 | */
|
---|
46 | RTDECL(const char *) RTEnvGet(const char *pszVar);
|
---|
47 |
|
---|
48 | /**
|
---|
49 | * Puts an variable=value string into the environment (putenv).
|
---|
50 | *
|
---|
51 | * @returns IPRT status code. Typical error is VERR_NO_MEMORY.
|
---|
52 | *
|
---|
53 | * @param pszVarEqualValue The variable '=' value string. If the value and '=' is
|
---|
54 | * omitted, the variable is removed from the environment.
|
---|
55 | */
|
---|
56 | RTDECL(int) RTEnvPut(const char *pszVarEqualValue);
|
---|
57 |
|
---|
58 | /** @todo Add the missing environment APIs: safe, printf like, and various modifications. */
|
---|
59 |
|
---|
60 | #endif /* IN_RING3 */
|
---|
61 |
|
---|
62 | /** @} */
|
---|
63 |
|
---|
64 | __END_DECLS
|
---|
65 |
|
---|
66 | #endif
|
---|
67 |
|
---|