KallistiOS git master
Independent SDK for the Sega Dreamcast
|
Loaded library structure. More...
#include <kos/library.h>
Public Member Functions | |
LIST_ENTRY (klibrary) list | |
Library list handle. | |
Data Fields | |
libid_t | libid |
Library ID (assigned at runtime). | |
uint32 | flags |
Library flags. | |
elf_prog_t | image |
ELF image for this library. | |
int | refcnt |
Library reference count. | |
const char *(* | lib_get_name )(void) |
Retrieve the library's symbolic name. | |
uint32(* | lib_get_version )(void) |
Retrieve the library's version. | |
int(* | lib_open )(struct klibrary *lib) |
Open a library. | |
int(* | lib_close )(struct klibrary *lib) |
Close an opened library. | |
Loaded library structure.
This structure represents a single loaded library. Each library is essentially a loaded binary of code and a set of exported entry points that are standardized.
Each loaded library should export at least the functions described in this structure:
You should not modify any members of this structure yourself (except if you are implementing a library).
klibrary_t::LIST_ENTRY | ( | klibrary | ) |
Library list handle.
Contrary to what doxygen might think, this is not a function.
uint32 klibrary_t::flags |
Library flags.
elf_prog_t klibrary_t::image |
ELF image for this library.
This can be used to look up additional entry points in the library.
int(* klibrary_t::lib_close) (struct klibrary *lib) |
Close an opened library.
This function must be implemented by all loadable libraries to close and deinitialize a library. If the library's reference count is > 1 when this function is called, this may involve simply decrementing the reference count.
lib | The library structure |
const char *(* klibrary_t::lib_get_name) (void) |
Retrieve the library's symbolic name.
This function must be implemented by all loadable libraries to fetch the library's symbolic name. This function must work before calling lib_open() on the library.
uint32(* klibrary_t::lib_get_version) (void) |
Retrieve the library's version.
This function must be implemented by all loadble libraries to fetch the library's version number. This function must work before calling lib_open() on the library.
int(* klibrary_t::lib_open) (struct klibrary *lib) |
Open a library.
This function must be implemented by all loadable libraries to initialize the library on load. If the library is already opened, this may only involve increasing the reference count.
lib | The library structure |
libid_t klibrary_t::libid |
Library ID (assigned at runtime).
int klibrary_t::refcnt |
Library reference count.
This value is incremented every time the library is opened, and decremented each time it is closed. Once the library's reference count hits 0, a close will actually destroy the library.