#include "msvcrt.h"
#include "mtdll.h"
#include <winnls.h>
#include "wine/debug.h"
Go to the source code of this file.
|
| | WINE_DEFAULT_DEBUG_CHANNEL (msvcrt) |
| |
| int | env_init (BOOL unicode, BOOL modif) |
| |
| static int | env_get_index (const char *name) |
| |
| static int | wenv_get_index (const wchar_t *name) |
| |
| static int | env_set (char **env, wchar_t **wenv) |
| |
| static char * | getenv_helper (const char *name) |
| |
| char *CDECL | getenv (const char *name) |
| |
| static wchar_t * | wgetenv_helper (const wchar_t *name) |
| |
| wchar_t *CDECL | _wgetenv (const wchar_t *name) |
| |
| static int | putenv_helper (const char *name, const char *val, const char *eq) |
| |
| static char * | msvcrt_astrdupw (const wchar_t *wstr) |
| |
| static int | wputenv_helper (const wchar_t *name, const wchar_t *val, const wchar_t *eq) |
| |
| int CDECL | _putenv (const char *str) |
| |
| int CDECL | _wputenv (const wchar_t *str) |
| |
| errno_t CDECL | _putenv_s (const char *name, const char *value) |
| |
| errno_t CDECL | _wputenv_s (const wchar_t *name, const wchar_t *value) |
| |
| int CDECL | getenv_s (size_t *ret_len, char *buffer, size_t len, const char *varname) |
| |
| int CDECL | _wgetenv_s (size_t *ret_len, wchar_t *buffer, size_t len, const wchar_t *varname) |
| |
| void CDECL | _get_environ (char ***ptr) |
| |
| void CDECL | _get_wenviron (wchar_t ***ptr) |
| |
◆ _get_environ()
◆ _get_wenviron()
Definition at line 568 of file environ.c.
569{
571}
wchar_t ** MSVCRT__wenviron
◆ _putenv()
Definition at line 362 of file environ.c.
363{
365
367
369 return -1;
370
372}
static int putenv_helper(const char *name, const char *val, const char *eq)
_ACRTIMP char *__cdecl strchr(const char *, int)
#define eq(received, expected, label, type)
Referenced by test__environ(), test__tzset(), test__wenviron(), test_case_insensitive(), test_environment_manipulation(), and test_utf8().
◆ _putenv_s()
Definition at line 392 of file environ.c.
393{
395
397
400
402 {
405 }
406
408}
#define MSVCRT_CHECK_PMT(x)
DWORD WINAPI GetLastError(void)
◆ _wgetenv()
Definition at line 254 of file environ.c.
255{
257
259
264}
static wchar_t * wgetenv_helper(const wchar_t *name)
void CDECL _lock(int locknum)
void CDECL _unlock(int locknum)
Referenced by _tgetenv(), _wsearchenv_s(), _wsystem(), _wtempnam(), compat_getenv(), INTERNET_LoadProxySettings(), msvcrt_search_executable(), START_TEST(), test_case_insensitive(), test_environment_manipulation(), and test_utf8().
◆ _wgetenv_s()
Definition at line 533 of file environ.c.
535{
537
542
546 {
549 }
551
552 if (!
e || !
len)
return 0;
554 return 0;
555}
_ACRTIMP size_t __cdecl wcslen(const wchar_t *)
static JOBOBJECTINFOCLASS LPVOID DWORD LPDWORD ret_len
Referenced by get_tz_environment_variable().
◆ _wputenv()
◆ _wputenv_s()
Definition at line 413 of file environ.c.
414{
416
418
421
423 {
426 }
427
429}
◆ env_get_index()
Definition at line 121 of file environ.c.
122{
124
127 {
130 }
132}
_ACRTIMP size_t __cdecl strlen(const char *)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Referenced by env_set(), and getenv_helper().
◆ env_init()
Definition at line 30 of file environ.c.
31{
33 {
37
39 {
40
43 }
46 {
48 return -1;
49 }
50
53 {
54
56 }
59
61 }
62
64 {
66
73 }
74
76 {
79 wchar_t *wptr;
80
81 for (wptr = wenviron_strings; *wptr; wptr +=
wcslen(wptr) + 1)
82 {
83
84 if (*wptr !=
'=')
count++;
86 }
89 {
91 return -1;
92 }
93
96 {
97
99 }
102
104 }
105
107 {
109
116 }
117
118 return 0;
119}
BOOL WINAPI FreeEnvironmentStringsA(IN LPSTR EnvironmentStrings)
BOOL WINAPI FreeEnvironmentStringsW(IN LPWSTR EnvironmentStrings)
LPWSTR WINAPI DECLSPEC_HOTPATCH GetEnvironmentStringsW(void)
wchar_t ** MSVCRT___winitenv
static char * strdup(const char *buf)
static wchar_t * wcsdup(const wchar_t *str)
GLuint GLuint GLsizei count
#define memcpy(s1, s2, n)
#define GetEnvironmentStringsA
Referenced by __wgetmainargs(), env_set(), msvcrt_init_args(), wgetenv_helper(), and wputenv_helper().
◆ env_set()
Definition at line 147 of file environ.c.
148{
149 wchar_t *weq =
wcschr(*wenv,
'=');
152
153 *weq = 0;
156 return -1;
157
163 {
167 }
169 {
173 }
174 else
175 {
177 if (!new_env) return -1;
182 }
183
188 *weq = '=';
189 if (!weq[1])
190 {
194 }
196 {
200 }
201 else
202 {
204 if (!new_env) return -1;
209 }
210 return 0;
211}
static LPCWSTR LPCWSTR LPCWSTR env
BOOL WINAPI DECLSPEC_HOTPATCH SetEnvironmentVariableW(IN LPCWSTR lpName, IN LPCWSTR lpValue)
int env_init(BOOL unicode, BOOL modif)
static int env_get_index(const char *name)
static int wenv_get_index(const wchar_t *name)
#define ERROR_ENVVAR_NOT_FOUND
Referenced by putenv_helper(), and wputenv_helper().
◆ getenv()
Definition at line 227 of file environ.c.
228{
230
232
237}
static char * getenv_helper(const char *name)
Referenced by _getopt_initialize(), _Locale_aux_default(), _searchenv_s(), _tempnam(), _tgetenv(), _tzset(), compat_getenv(), get_locale(), get_wine_loader_name(), GetHomeDir(), getline(), GetPwByName(), GetScreenColumns(), GetUsrName(), gl_destroy_context(), gl_error(), gl_init(), gl_set_home_dir(), HelpCmd(), TConfig::inifile_init(), init_debug(), initialize_context(), InitOurDirectory(), InitPrefs(), InitTermcap(), InitUserInfo(), instrum_getenv(), is_wine_loader(), jinit_memory_mgr(), TConfig::keyfile_init(), load_licence(), main(), make_temp_dir(), matchSpecialFolderPathToEnv(), ODBC_LoadDriverManager(), OpenTrace(), optionInit(), parse_arguments(), printercache_load_blob(), printercache_rename_blob(), printercache_save_blob(), printercache_unlink_blob(), QMyDialog::QMyDialog(), rd_open_file(), rd_pstcache_mkdir(), read_rcfile(), TConfig::redir_init(), ruserpass(), save_licence(), QMyDialog::SaveClicked(), searchfileinpath(), select_file_name(), setnetpath(), shell(), START_TEST(), system(), telCommandLine(), test__tzset(), test_case_insensitive(), test_environment_manipulation(), test_localtime(), test_mktime(), test_searchenv(), test_utf8(), TIFFFetchStripThing(), wave_out_open(), WinHttpGetDefaultProxyConfiguration(), xkeymap_open(), and xmlInitMemory().
◆ getenv_helper()
◆ getenv_s()
Definition at line 507 of file environ.c.
508{
510
515
519 {
522 }
524
525 if (!
e || !
len)
return 0;
527 return 0;
528}
◆ msvcrt_astrdupw()
◆ putenv_helper()
Definition at line 266 of file environ.c.
267{
268 wchar_t *wenv;
271
273 {
276 }
277 else
278 {
280
287 }
288
290 if (!wenv)
291 {
293 return -1;
294 }
295
302}
wchar_t * msvcrt_wstrdupa(const char *str)
static int env_set(char **env, wchar_t **wenv)
GLdouble GLdouble GLdouble r
Referenced by _putenv(), and _putenv_s().
◆ wenv_get_index()
◆ wgetenv_helper()
◆ WINE_DEFAULT_DEBUG_CHANNEL()
| WINE_DEFAULT_DEBUG_CHANNEL |
( |
msvcrt |
| ) |
|
◆ wputenv_helper()
Definition at line 316 of file environ.c.
317{
318 wchar_t *wenv;
321
326
328 {
330 if (!wenv) return -1;
331 }
332 else
333 {
335
337 wenv =
malloc((name_len +
r + 2) *
sizeof(
wchar_t));
338 if (!wenv) return -1;
339 memcpy(wenv,
name, name_len *
sizeof(
wchar_t));
340 wenv[name_len] = '=';
342 }
343
346 {
348 return -1;
349 }
350
357}
static char * msvcrt_astrdupw(const wchar_t *wstr)
Referenced by _wputenv(), and _wputenv_s().