Module manager implementation.
More...
#include "modmgr.h"
#include "gettext.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#include <ltdl.h>
#include "debug/assert.h"
#include "debug/memory.h"
Go to the source code of this file.
Module manager implementation.
- Date
- 25/11/2017
- Author
- François Cerbelle (Fanfan), franc.nosp@m.ois@.nosp@m.cerbe.nosp@m.lle..nosp@m.net
- Copyright
- Copyright (c) 2017, François Cerbelle
Definition in file modmgr.c.
#define _ |
( |
|
String | ) |
gettext (String) |
◆ PATH_MAX
◆ modules_t
Module list item structure.
◆ modmgr_addpath()
int modmgr_addpath |
( |
const char * |
path | ) |
|
Add a path at the end (lowest prio) of the search path.
Add a path to the end of the module search path.
Definition at line 141 of file modmgr.c.
◆ modmgr_getpath()
const char * modmgr_getpath |
( |
| ) |
|
Get a read-only pointer on the current search path.
Get the current search path list.
Definition at line 181 of file modmgr.c.
◆ modmgr_getsymbol()
void * modmgr_getsymbol |
( |
const modmgr_module_t |
module, |
|
|
const char * |
szSymbol |
|
) |
| |
Resolve a module symbol pointer.
Resolve a module symbol, can be a function or a variable.
Definition at line 419 of file modmgr.c.
◆ modmgr_insertpath()
int modmgr_insertpath |
( |
const char * |
before, |
|
|
const char * |
path |
|
) |
| |
Insert (with higher prio) a path before the specified one (from the current search path)
Insert an higher priority search path before another one.
Definition at line 161 of file modmgr.c.
◆ modmgr_list()
Output the list of modules.
Print the currently loaded modules list for debug and tracing.
Definition at line 379 of file modmgr.c.
◆ modmgr_load()
Load a module, initialize it, add it to the list and return an opaque handle.
Load a module and call the initialization with a parameter if first usage.
- Todo:
- critical section
Definition at line 191 of file modmgr.c.
◆ modmgr_setpath()
int modmgr_setpath |
( |
const char * |
path | ) |
|
Reset and initialize the modules search path.
Initialize or reset module search path.
Definition at line 125 of file modmgr.c.
◆ modmgr_unload()
Decrement the usage counter, if last usage, remove from the module list and call onUnload.
Call the unload function if last usage and tries to unload the module.
Definition at line 306 of file modmgr.c.