Plugin management.
More...
Plugin management.
The plugin is a feature provided to extend the functionality of sdk. The plugin must have a shared library type that contains the 'nugu_plugin_define_desc' symbol. And there should be no 'lib' prefix in file name.
◆ NUGU_PLUGIN_DEFINE
#define NUGU_PLUGIN_DEFINE |
( |
|
p_name, |
|
|
|
p_prio, |
|
|
|
p_ver, |
|
|
|
p_load, |
|
|
|
p_unload, |
|
|
|
p_init |
|
) |
| |
Value:
.priority = p_prio, \
.version = p_ver, \
.load = p_load, \
.unload = p_unload, \
.init = p_init \
}
Plugin description.
Definition: nugu_plugin.h:93
const char * name
Name of plugin.
Definition: nugu_plugin.h:97
Macros to easily define plugins.
◆ nugu_plugin_new()
◆ nugu_plugin_new_from_file()
NUGU_API NuguPlugin* nugu_plugin_new_from_file |
( |
const char * |
filepath | ) |
|
◆ nugu_plugin_free()
Destroy the plugin.
- Parameters
-
◆ nugu_plugin_add()
Add the plugin to managed list.
- Parameters
-
- Returns
- result
- Return values
-
0 | success |
1 | success (plugin is already registered) |
-1 | failure (another plugin using the same file is already registered) |
- See also
- nugu_plugin_find()
-
nugu_plugin_remove()
◆ nugu_plugin_remove()
◆ nugu_plugin_find()
NUGU_API NuguPlugin* nugu_plugin_find |
( |
const char * |
name | ) |
|
◆ nugu_plugin_set_data()
NUGU_API int nugu_plugin_set_data |
( |
NuguPlugin * |
p, |
|
|
void * |
data |
|
) |
| |
Set private data to plugin.
- Parameters
-
[in] | p | plugin object |
[in] | data | plugin specific data |
- Returns
- result
- Return values
-
- See also
- nugu_plugin_get_data()
◆ nugu_plugin_get_data()
NUGU_API void* nugu_plugin_get_data |
( |
NuguPlugin * |
p | ) |
|
◆ nugu_plugin_get_symbol()
NUGU_API void* nugu_plugin_get_symbol |
( |
NuguPlugin * |
p, |
|
|
const char * |
symbol_name |
|
) |
| |
Get dlsym result from plugin.
- Parameters
-
[in] | p | plugin object |
[in] | symbol_name | symbol name to find |
- Returns
- symbol address
◆ nugu_plugin_get_description()
Get the plugin description.
- Parameters
-
- Returns
- plugin description
◆ nugu_plugin_load_directory()
NUGU_API int nugu_plugin_load_directory |
( |
const char * |
dirpath | ) |
|
Load all plugin files from directory.
- Parameters
-
[in] | dirpath | directory path |
- Returns
- Number of plugins loaded
- Return values
-
◆ nugu_plugin_load_builtin()
NUGU_API int nugu_plugin_load_builtin |
( |
void |
| ) |
|
Load all built-in plugins.
- Returns
- Number of plugins loaded
- Return values
-
◆ nugu_plugin_initialize()
NUGU_API int nugu_plugin_initialize |
( |
void |
| ) |
|
Initialize plugin.
- Returns
- Number of plugins initialized