ps2sdk  1.1
A collection of Open Source libraries used for developing applications on Sony's PlayStation 2® (PS2).
init.c
Go to the documentation of this file.
1 /*
2 # _____ ___ ____ ___ ____
3 # ____| | ____| | | |____|
4 # | ___| |____ ___| ____| | \ PS2DEV Open Source Project.
5 #-----------------------------------------------------------------------
6 # Copyright 2001-2004, ps2dev - http://www.ps2dev.org
7 # Licenced under Academic Free License version 2.0
8 # Review ps2sdk README & LICENSE files for further details.
9 */
10 
19 
20 int chdir(const char *path);
21 
22 #ifdef F_init_libc
23 __attribute__((weak))
24 void _ps2sdk_libc_init()
25 {
28 }
29 
30 __attribute__((weak))
31 void _ps2sdk_libc_deinit()
32 {
34 }
35 #endif
36 
37 #ifdef F_init_args
38 __attribute__((weak))
39 void _ps2sdk_args_parse(int argc, char ** argv)
40 {
41  if (argc == 0) // naplink!
42  {
43  chdir("host:");
44  } else {
45  char * p, * s = 0;
46  // let's find the last slash, or at worst, the :
47  for (p = argv[0]; *p; p++) {
48  if ((*p == '/') || (*p == '\\') || (*p == ':')) {
49  s = p;
50  }
51  }
52  // Nothing?! strange, let's use host.
53  if (!s) {
54  chdir("host:");
55  } else {
56  char backup = *(++s);
57  *s = 0;
58  chdir(argv[0]);
59  *s = backup;
60  }
61  }
62 }
63 #endif
64 
int chdir(const char *path)
Definition: ps2sdkapi.c:461
void _ps2sdk_timezone_update()
Definition: timezone.c:26
void _ps2sdk_time_init()
void _ps2sdk_time_deinit()
s32 s
Definition: ps2ipc.c:30