ReactOS  0.4.15-dev-2522-g9e0a3cd
putenv.c
Go to the documentation of this file.
1 /*
2  * COPYRIGHT: See COPYING in the top level directory
3  * PROJECT: ReactOS system libraries
4  * FILE: lib/sdk/crt/stdlib/putenv.c
5  * PURPOSE: Unknown
6  * PROGRAMER: Unknown
7  * UPDATE HISTORY:
8  * 25/11/05: Added license header
9  */
10 #include <precomp.h>
11 
12 /* misc/environ.c */
13 int SetEnv(const wchar_t *option);
14 
15 /*
16  * @implemented
17  */
18 int _putenv(const char* val)
19 {
20  int size, result;
21  wchar_t *woption;
22 
23  size = MultiByteToWideChar(CP_ACP, 0, val, -1, NULL, 0);
24  woption = malloc(size* sizeof(wchar_t));
25  if (woption == NULL)
26  return -1;
27  MultiByteToWideChar(CP_ACP, 0, val, -1, woption, size);
28  result = SetEnv(woption);
29  free(woption);
30  return result;
31 }
GLuint64EXT * result
Definition: glext.h:11304
#define CP_ACP
Definition: compat.h:109
#define free
Definition: debug_ros.c:5
int _putenv(const char *val)
Definition: putenv.c:18
Definition: getopt.h:108
GLuint GLfloat * val
Definition: glext.h:7180
GLsizeiptr size
Definition: glext.h:5919
#define NULL
Definition: types.h:112
#define MultiByteToWideChar
Definition: compat.h:110
#define malloc
Definition: debug_ros.c:4
int SetEnv(const wchar_t *option)
Definition: environ.c:210