#include <vector>
#include <string>
Go to the source code of this file.
|
typedef void(* | plugin_callback_t) (std::string &&result, const bool success, const char *plugin_name, void *data) |
|
◆ plugin_callback_t
typedef void(* plugin_callback_t) (std::string &&result, const bool success, const char *plugin_name, void *data) |
When a plugin cycle is finished, this function is called. In any case, plugin_stop() has to be called to free all memory.
- Parameters
-
result | the plugin's output (stdout) on success; summary of all error messages on failure as determined by success |
success | result of the plugin cycle; true if result is meaningful output, false if result contains error messages |
plugin_name | the name of the plugin which succeeded; becomes invalid when plugin_stop is called (i.e. strdup it if you need it afterwards). |
data | the caller defined pointer passed to plugin_run() |
◆ plugin_list_load_directory()
bool plugin_list_load_directory |
( |
PluginList * |
list, |
|
|
const char * |
path |
|
) |
| |
Load all plugins (executables) in a directory.
◆ plugin_run()
Run plugins in this list, until one returns success (or until the plugin list is exhausted).
- Parameters
-
list | the plugin list |
args | nullptr terminated command line arguments passed to the plugin programs; they must remain valid while the plugin runs |
callback | the callback function which will be called when a result is available |
callback_data | caller defined pointer which is passed to the callback function |
◆ plugin_stop()
void plugin_stop |
( |
PluginCycle * |
invocation | ) |
|
Stops the plugin cycle and frees resources. This can be called to abort the current cycle, or after the plugin_callback_t has been invoked.