mirror of
https://github.com/aljazceru/lightning.git
synced 2026-01-07 08:04:23 +01:00
plugin: Basic scaffolding for the plugin subsystem
This commit is contained in:
38
lightningd/plugin.h
Normal file
38
lightningd/plugin.h
Normal file
@@ -0,0 +1,38 @@
|
||||
#ifndef LIGHTNING_LIGHTNINGD_PLUGIN_H
|
||||
#define LIGHTNING_LIGHTNINGD_PLUGIN_H
|
||||
#include "config.h"
|
||||
#include <ccan/take/take.h>
|
||||
#include <ccan/tal/tal.h>
|
||||
|
||||
/**
|
||||
* A collection of plugins, and some associated information.
|
||||
*
|
||||
* Mainly used as root context for calls in the plugin subsystem.
|
||||
*/
|
||||
struct plugins;
|
||||
|
||||
/**
|
||||
* Create a new plugins context.
|
||||
*/
|
||||
struct plugins *plugins_new(const tal_t *ctx);
|
||||
|
||||
/**
|
||||
* Initialize the registered plugins.
|
||||
*
|
||||
* Initialization includes spinning up the plugins, reading their
|
||||
* manifest, and registering the JSON-RPC passthrough and command line
|
||||
* arguments. In order to read the getmanifest reply from the plugins
|
||||
* we spin up our own io_loop that exits once all plugins have
|
||||
* responded.
|
||||
*/
|
||||
void plugins_init(struct plugins *plugins);
|
||||
|
||||
/**
|
||||
* Register a plugin for initialization and execution.
|
||||
*
|
||||
* @param plugins: Plugin context
|
||||
* @param path: The path of the executable for this plugin
|
||||
*/
|
||||
void plugin_register(struct plugins *plugins, const char* path TAKES);
|
||||
|
||||
#endif /* LIGHTNING_LIGHTNINGD_PLUGIN_H */
|
||||
Reference in New Issue
Block a user