KallistiOS git master
Independent SDK for the Sega Dreamcast
|
Dynamically loadable library support. More...
Go to the source code of this file.
Data Structures | |
struct | klibrary_t |
Loaded library structure. More... | |
Macros | |
#define | LIBRARY_DEFAULTS 0 |
Defaults: no flags. | |
Typedefs | |
typedef tid_t | libid_t |
Library ID type. | |
Functions | |
klibrary_t * | library_by_libid (libid_t libid) |
Look up a library by ID. | |
klibrary_t * | library_create (int flags) |
Create a new library shell. | |
int | library_destroy (klibrary_t *lib) |
Destroy a library. | |
klibrary_t * | library_open (const char *name, const char *fn) |
Try to open a library by name. | |
klibrary_t * | library_lookup (const char *name) |
Look up a library by name. | |
klibrary_t * | library_lookup_fn (const char *fn) |
Look up a library by filename. | |
int | library_close (klibrary_t *lib) |
Close a previously opened library. | |
libid_t | library_get_libid (klibrary_t *lib) |
Retrieve the specified library's runtime-assigned ID. | |
int | library_get_refcnt (klibrary_t *lib) |
Retrieve the specified library's reference count. | |
const char * | library_get_name (klibrary_t *lib) |
Retrieve the specified library's name. | |
uint32_t | library_get_version (klibrary_t *lib) |
Retrieve the specified library's version. | |
Dynamically loadable library support.
This file contains definitions for accessing loadable libraries at runtime. Each library has a name and a version number that it can be referenced by. One must be careful with these dynamic libraries as there is no private storage per instance, and all memory space is shared.
Libraries can both export and import symbols. Imported symbols may require other libraries to be loaded earlier. Libraries are reference counted so that they can be opened multiple times without actually loading them multiple times, and so that a close will act as expected in situations like this.