ReactOS 0.4.15-dev-7918-g2a2556c
getenv.c File Reference
#include <precomp.h>
Include dependency graph for getenv.c:

Go to the source code of this file.

Functions

chargetenv (const char *name)
 
wchar_t_wgetenv (const wchar_t *name)
 

Function Documentation

◆ _wgetenv()

wchar_t * _wgetenv ( const wchar_t name)

Definition at line 35 of file getenv.c.

36{
37 wchar_t **env;
38 size_t length = wcslen(name);
39
40 for (env = *__p__wenviron(); *env; env++)
41 {
42 wchar_t *str = *env;
43 wchar_t *pos = wcschr(str, L'=');
44 if (pos && ((unsigned int)(pos - str) == length) && !_wcsnicmp(str, name, length))
45 return pos + 1;
46 }
47 return NULL;
48}
static LPCWSTR LPCWSTR LPCWSTR env
Definition: db.cpp:170
#define NULL
Definition: types.h:112
#define wcschr
Definition: compat.h:17
GLuint GLsizei GLsizei * length
Definition: glext.h:6040
_CRTIMP wchar_t ***__cdecl __p__wenviron()
Definition: environ.c:392
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define L(x)
Definition: ntvdm.h:50
const WCHAR * str
_Check_return_ _CRTIMP int __cdecl _wcsnicmp(_In_reads_or_z_(_MaxCount) const wchar_t *_Str1, _In_reads_or_z_(_MaxCount) const wchar_t *_Str2, _In_ size_t _MaxCount)
Definition: name.c:39

◆ getenv()

char * getenv ( const char name)

Definition at line 17 of file getenv.c.

18{
19 char **env;
20 size_t length = strlen(name);
21
22 for (env = *__p__environ(); *env; env++)
23 {
24 char *str = *env;
25 char *pos = strchr(str,'=');
26 if (pos && ((unsigned int)(pos - str) == length) && !_strnicmp(str, name, length))
27 return pos + 1;
28 }
29 return NULL;
30}
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
char * strchr(const char *String, int ch)
Definition: utclib.c:501
#define _strnicmp(_String1, _String2, _MaxCount)
Definition: compat.h:23
_CRTIMP char ***__cdecl __p__environ()
Definition: environ.c:384