Mstdlib-1.24.0
Dynamic Module Loading Subsystem

Macros

#define M_MODULE_INVALID_HANDLE   NULL
 

Typedefs

typedef void * M_module_handle_t
 

Functions

M_module_handle_t M_module_load (const char *module_name, char *error, size_t error_size)
 
void * M_module_symbol (M_module_handle_t handle, const char *symbol_name)
 
void M_module_unload (M_module_handle_t handle)
 

Detailed Description

Dynamic Module Loading Subsystem

Macro Definition Documentation

◆ M_MODULE_INVALID_HANDLE

#define M_MODULE_INVALID_HANDLE   NULL

Value for an invalid module handle

Typedef Documentation

◆ M_module_handle_t

typedef void* M_module_handle_t

Type for returned handle for M_module_load()

Function Documentation

◆ M_module_load()

M_module_handle_t M_module_load ( const char *  module_name,
char *  error,
size_t  error_size 
)

Load a module

The module should be a dynamic loadable module for the operating system. The subsystem will attempt to search for the module in multiple paths and multiple file name extensions.

There is no need to supply a suffix like .so, .dll, or .dylib.

Parameters
[in]module_namemodule name to load, no suffix necessary.
[out]erroruser-supplied error message buffer
[in]error_sizesize of user-supplied error message buffer
Returns
M_MODULE_INVALID_HANDLE on failure, otherwise a valid handle.

◆ M_module_symbol()

void * M_module_symbol ( M_module_handle_t  handle,
const char *  symbol_name 
)

Retrieve a pointer to a symbol in the module

Parameters
[in]handleLoaded module handle from M_module_load(), or M_MODULE_INVALID_HANDLE to attempt to load a symbol from the current process.
[in]symbol_nameName of symbol to retrieve.
Returns
Pointer to symbol on success, NULL on failure.

◆ M_module_unload()

void M_module_unload ( M_module_handle_t  handle)

Unload a module loaded by M_module_load().

Parameters
[in]handleLoaded module handle from M_module_load()