PS2SDK
PS2 Homebrew Libraries
Loading...
Searching...
No Matches
slib.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
20#include "loadcore.h"
21#include "ioman.h"
22#include "stdio.h"
23#include "sysclib.h"
24
25#include "iopmgr.h"
26
38{
39 iop_library_t *libptr;
40 int len = strlen(name) + 1;
41
42 libptr = GetLoadcoreInternalData()->let_next;
43 while ((libptr != 0))
44 {
45 if (!memcmp(libptr->name, name, len))
46 return libptr;
47 libptr = libptr->prev;
48 }
49 return 0;
50}
51
62void *slib_get_exportlist_by_name(const char *name)
63{
64 iop_library_t *libptr;
65
66 libptr = slib_get_lib_by_name(name);
67 if (libptr != 0)
68 return libptr->exports;
69 return 0;
70}
71
82int slib_get_version_by_name(const char *name)
83{
84 iop_library_t *libptr;
85
86 libptr = slib_get_lib_by_name(name);
87 if (libptr != 0)
88 return (int)libptr->version;
89 return 0;
90}
91
103int slib_release_library(const char *name)
104{
105 struct irx_export_table *libptr;
106
107 libptr = (struct irx_export_table *)slib_get_lib_by_name(name);
108 if (libptr != 0)
109 return ReleaseLibraryEntries(libptr);
110 return -2;
111}
iop_library_t * slib_get_lib_by_name(const char *name)
Definition slib.c:37
int slib_release_library(const char *name)
Definition slib.c:103
int slib_get_version_by_name(const char *name)
Definition slib.c:82
void * slib_get_exportlist_by_name(const char *name)
Definition slib.c:62