30#ifndef AWE_PLUGIN_LOADER_H
31#define AWE_PLUGIN_LOADER_H
55 void* (*malloc)(
size_t size);
56 void* (*realloc)(
void* ptr,
size_t size);
58 void* (*open)(
const char* file);
60 void* (*sym)(
void* handle,
const char* name);
61 void (*
vlog)(int32_t level, uint32_t type,
const char* fmt, va_list args);
AudioWeaver Plugin Types.
struct _awe_PluginLoaderMethods awe_PluginLoaderMethods
Method table to provide overrides to awe_PluginLoader_initWithMethods.
enum awe_PluginLoader_Status awe_PluginLoader_load(const AWEPlugin **plugin, const char *file)
Load a plugin library.
Definition: PluginLoader.c:563
size_t awe_PluginLoader_count()
Get the number of currently loaded plugins.
Definition: PluginLoader.c:617
awe_PluginLoader_Status
Possible statuses which may be returned by plugin loader API functions.
Definition: AWEPluginLoader.h:68
enum awe_PluginLoader_Status awe_PluginLoader_get(const AWEPlugin **plugin, size_t index)
Retrieve a loaded plugin by index.
Definition: PluginLoader.c:627
enum awe_PluginLoader_Status awe_PluginLoader_find(const AWEPlugin **plugin, const char *file)
Retrieve a loaded plugin by file name.
Definition: PluginLoader.c:657
enum awe_PluginLoader_Status awe_PluginLoader_loadWithEntrypoint(const AWEPlugin **plugin, const char *file, const char *entrypoint)
Load a plugin library with a custom entrypoint name.
Definition: PluginLoader.c:573
enum awe_PluginLoader_Status awe_PluginLoader_init(size_t reserved_count)
Initialize the plugin loader.
Definition: PluginLoader.c:512
enum awe_PluginLoader_Status awe_PluginLoader_initWithMethods(size_t reserved_count, const awe_PluginLoaderMethods *const overrides)
Initialize the plugin loader with a set of override callbacks.
Definition: PluginLoader.c:473
enum awe_PluginLoader_Status awe_PluginLoader_loadWithNamespacePrefix(const AWEPlugin **plugin, const char *file, const char *prefix)
Load a plugin library with a namespaced entrypoint name.
Definition: PluginLoader.c:568
enum awe_PluginLoader_Status awe_PluginLoader_unload(const char *file)
Unload a plugin library.
Definition: PluginLoader.c:578
void awe_PluginLoader_free()
Clean up the plugin loader.
Definition: PluginLoader.c:691
const char * awe_PluginLoader_statusToString(const enum awe_PluginLoader_Status status)
Get a description of the given status.
Definition: PluginLoader.c:706
@ AWE_PLUGIN_LOADER_DL_OPEN_FAILED
Failed to open the dynamic library.
Definition: AWEPluginLoader.h:75
@ AWE_PLUGIN_LOADER_UNINITIALIZED
Plugin loader is uninitialized.
Definition: AWEPluginLoader.h:70
@ AWE_PLUGIN_LOADER_INVALID_INDEX
Plugin index is out of range.
Definition: AWEPluginLoader.h:74
@ AWE_PLUGIN_LOADER_MISSING_METHOD
A required method is missing after applying overrides (this can happen when the library was not compi...
Definition: AWEPluginLoader.h:72
@ AWE_PLUGIN_LOADER_ALREADY_INITIALIZED
Attempting to initialize the plugin loader after it has already been initialized.
Definition: AWEPluginLoader.h:71
@ AWE_PLUGIN_LOADER_DL_INTERNAL_FAILURE
The plugin library's initialization function returned null.
Definition: AWEPluginLoader.h:77
@ AWE_PLUGIN_LOADER_SUCCESS
Operation succeeded.
Definition: AWEPluginLoader.h:69
@ AWE_PLUGIN_LOADER_DL_SYMBOL_NOT_FOUND
Initialization function was not found in the plugin library.
Definition: AWEPluginLoader.h:76
@ AWE_PLUGIN_LOADER_ALLOCATION_FAILED
Memory allocation failed.
Definition: AWEPluginLoader.h:73
Method table to provide overrides to awe_PluginLoader_initWithMethods.
Definition: AWEPluginLoader.h:54
void(* vlog)(int32_t level, uint32_t type, const char *fmt, va_list args)
Handle a log message.
Definition: AWEPluginLoader.h:61
void(* close)(void *handle)
Close a shared library.
Definition: AWEPluginLoader.h:59
void(* free)(void *ptr)
Free memory.
Definition: AWEPluginLoader.h:57
A struct encapsulating the functionality which can be provided by a plugin library.
Definition: AWEPluginTypes.h:81