PS2SDK
PS2 Homebrew Libraries
Loading...
Searching...
No Matches
main.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
16
#include "types.h"
17
#include "
defs.h
"
18
#include "
irx.h
"
19
#include "
iomanX.h
"
20
#include "
stdio.h
"
21
22
#include "
iopmgr.h
"
23
26
IRX_ID(IOPMGR_MODNAME, IOPMGR_VERSION_HIGH, IOPMGR_VERSION_LOW);
27
28
extern
struct
irx_export_table
_exp_iopmgr;
29
30
extern
void
cmdline_handle
(
char
*command,
char
*arg1);
31
46
int
_start(
int
argc,
char
*argv[])
47
{
48
printf(
"%s - Version %d.%d\nCopyright (c) 2003,2004 adresd\n\n"
,
49
IOPMGR_MODNAME, IOPMGR_VERSION_HIGH, IOPMGR_VERSION_LOW);
50
51
if
(argc > 1)
52
{
/* Execute in command line mode, so parse command */
53
if
(argc>2)
54
{
55
cmdline_handle
(argv[1],argv[2]);
56
}
57
else
58
{
59
cmdline_handle
(argv[1],NULL);
60
}
61
}
62
else
63
{
/* no params, so set into resident mode */
64
if
(RegisterLibraryEntries(&_exp_iopmgr) == 0)
65
{
66
printf(
"Registered.\n"
);
67
return
MODULE_RESIDENT_END;
68
}
69
else
70
{
71
/* luckily the previously installed one will be higher up the list, so will
72
* be the first one found , so get the version
73
*/
74
int
version
=
smod_get_modversion_by_name
(IOPMGR_MODNAME);
75
printf (
"Error Registering - "
);
76
if
(
version
>= 0)
77
printf(
"Already Registered , version : %d.%d\n"
,
78
(
version
&0xff00)>>8,
version
&0xff);
79
else
80
printf(
"Error : %d\n"
,
version
);
81
}
82
}
83
printf(
"\nExiting.\n"
);
84
return
MODULE_NO_RESIDENT_END;
85
}
86
99
int
shutdown
()
100
{
101
switch
(
slib_release_library
(IOPMGR_LIBNAME))
102
{
103
case
0: printf(
"UnRegistered\n"
);
break
;
104
case
-1: printf(
"Failed to UnRegister\n"
);
return
MODULE_RESIDENT_END;
break
;
105
case
-2: printf(
"Library Not Present\n"
);
break
;
106
}
107
return
MODULE_NO_RESIDENT_END;
108
}
109
defs.h
version
unsigned int version
Definition
fileXio.h:3
cmdline_handle
void cmdline_handle(char *command, char *arg1)
Definition
commandline.c:161
smod_get_modversion_by_name
int smod_get_modversion_by_name(const char *name)
Definition
smod.c:115
slib_release_library
int slib_release_library(const char *name)
Definition
slib.c:103
shutdown
int shutdown()
Definition
main.c:99
iomanX.h
iopmgr.h
irx.h
irx_export_table
Definition
irx.h:90
stdio.h
iop
system
iopmgr
src
main.c
Generated on Thu Nov 14 2024 05:25:26 for PS2SDK by
1.9.8