sdk-core
v2026.11.05
PS2 SDK - core tier (build-critical EE/IOP modules)
Toggle main menu visibility
Loading...
Searching...
No Matches
smod.c
Go to the documentation of this file.
1
/*
2
# _____ ___ ____ ___ ____
3
# ____| | ____| | | |____|
4
# | ___| |____ ___| ____| | \ PS2DEV Open Source Project.
5
#-----------------------------------------------------------------------
6
# Copyright (c) 2003 Marcus R. Brown <mrbrown@0xd6.org>
7
# Copyright (c) 2003, 2004 adresd <adresd_ps2dev@yahoo.com>
8
# Licenced under Academic Free License version 2.0
9
# Review ps2sdk README & LICENSE files for further details.
10
*/
11
16
17
#include "types.h"
18
#include "
defs.h
"
19
#include "
irx.h
"
20
21
#include "
loadcore.h
"
22
#include "
ioman.h
"
23
#include "
stdio.h
"
24
#include "
sysclib.h
"
25
26
#include "
iopmgr.h
"
27
39
ModuleInfo_t
*
smod_get_next_mod
(
ModuleInfo_t
*cur_mod)
40
{
41
/* If cur_mod is 0, return the head of the list. */
42
if
(!cur_mod) {
43
return
GetLoadcoreInternalData()->image_info;
44
}
else
{
45
if
(!cur_mod->next)
46
return
0;
47
else
48
return
cur_mod->next;
49
}
50
return
0;
51
}
52
63
ModuleInfo_t
*
smod_get_mod_by_name
(
const
char
*name)
64
{
65
ModuleInfo_t
*modptr;
66
int
len = strlen(name)+1;
67
68
modptr =
smod_get_next_mod
(0);
69
while
(modptr != 0)
70
{
71
if
(!memcmp(modptr->name, name, len))
72
return
modptr;
73
modptr = modptr->next;
74
}
75
return
0;
76
}
77
88
int
smod_get_modcount_by_name
(
const
char
*name)
89
{
90
ModuleInfo_t
*modptr = 0;
91
int
len = strlen(name)+1;
92
int
count
= 0;
93
94
modptr =
smod_get_next_mod
(0);
95
while
(modptr != 0)
96
{
97
if
(!memcmp(modptr->name, name, len))
98
count
++;
99
modptr = modptr->next;
100
}
101
102
return
count
;
103
}
104
115
int
smod_get_modversion_by_name
(
const
char
*name)
116
{
117
ModuleInfo_t
*modptr = 0;
118
modptr =
smod_get_mod_by_name
(name);
119
if
(modptr != 0)
120
return
(
int
)modptr->version;
121
else
122
return
-1;
123
}
124
136
int
smod_unload_module
(
const
char
*name)
137
{
138
(void)name;
139
140
return
-2;
141
}
defs.h
smod_get_modversion_by_name
int smod_get_modversion_by_name(const char *name)
Definition
smod.c:115
smod_get_next_mod
ModuleInfo_t * smod_get_next_mod(ModuleInfo_t *cur_mod)
Definition
smod.c:39
smod_get_modcount_by_name
int smod_get_modcount_by_name(const char *name)
Definition
smod.c:88
smod_get_mod_by_name
ModuleInfo_t * smod_get_mod_by_name(const char *name)
Definition
smod.c:63
smod_unload_module
int smod_unload_module(const char *name)
Definition
smod.c:136
ioman.h
iopmgr.h
irx.h
loadcore.h
ModuleInfo_t
struct _ModuleInfo ModuleInfo_t
stdio.h
sysclib.h
count
u32 count
start sector of fragmented bd/file
Definition
usbhdfsd-common.h:1
core
iopmgr
src
smod.c
Generated by
1.18.0