Last change
on this file since 5881 was 5775, checked in by vboxsync, 17 years ago |
Corrected the copyright header.
|
-
Property svn:eol-style
set to
native
-
Property svn:keywords
set to
Id Revision
|
File size:
1.4 KB
|
Line | |
---|
1 | /* $Id: kHlpEnv-iprt.cpp 5775 2007-11-16 15:47:20Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * kHlpEnv - Environment Manipulation, IPRT based implementation.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2007 innotek GmbH
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | * available from http://www.virtualbox.org. This file is free software;
|
---|
11 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | * General Public License as published by the Free Software Foundation,
|
---|
13 | * in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
|
---|
14 | * distribution. VirtualBox OSE is distributed in the hope that it will
|
---|
15 | * be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | *
|
---|
17 | */
|
---|
18 |
|
---|
19 | /*******************************************************************************
|
---|
20 | * Header Files *
|
---|
21 | *******************************************************************************/
|
---|
22 | #include <k/kHlpEnv.h>
|
---|
23 | #include <k/kErrors.h>
|
---|
24 | #include <iprt/env.h>
|
---|
25 | #include <iprt/assert.h>
|
---|
26 | #include <iprt/err.h>
|
---|
27 |
|
---|
28 |
|
---|
29 | KHLP_DECL(int) kHlpGetEnv(const char *pszVar, char *pszVal, KSIZE cchVal)
|
---|
30 | {
|
---|
31 | int rc = RTEnvGetEx(RTENV_DEFAULT, pszVar, pszVal, cchVal, NULL);
|
---|
32 | switch (rc)
|
---|
33 | {
|
---|
34 | case VINF_SUCCESS: return 0;
|
---|
35 | case VERR_ENV_VAR_NOT_FOUND: return KERR_ENVVAR_NOT_FOUND;
|
---|
36 | case VERR_BUFFER_OVERFLOW: return KERR_BUFFER_OVERFLOW;
|
---|
37 | default: AssertMsgFailedReturn(("%Rrc\n", rc), rc);
|
---|
38 | }
|
---|
39 | }
|
---|
40 |
|
---|
41 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.