-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathceinit.c
67 lines (51 loc) · 1.04 KB
/
ceinit.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
// ceinit.c
//
// Time-stamp: <24/01/02 21:16:42 [email protected]>
#include "celib.h"
#include "version.h"
int __xceargc;
char **__xceargv;
char **__xceenviron;
#undef environ
char **environ;
char *_commandline;
char *__progname;
void
xceinit(const wchar_t *commandlinew)
{
int len;
char path[MAX_PATH];
char *p;
_init_multithread();
if(commandlinew != NULL)
{
len = wcslen(commandlinew) + 1;
_commandline = malloc(len);
WideCharToMultiByte(CP_ACP, 0,
commandlinew, -1,
_commandline, len,
NULL, NULL);
}
else
{
_commandline = xcestrdup("");
}
_initenv();
// needed for globbing!!!
if((p = xcegetenv("PWD")) != NULL)
XCESetCurrentDirectoryA(p);
else
XCESetCurrentDirectoryA("\\");
_setargv();
__progname = __xceargv[0];
_init_io();
palm_init_stdio();
// reset shared stuff...
xceshared_reset();
xcesetenv("CELIBVERSION", VERSION, 0);
}
void
xcedllinit()
{
xceshared_init();
}