|
Pin
|
#include <ipind_plugin.h>
Public Attributes | |
| bool | verbose_ |
| const char * | logName_ |
| void(* | plugin_log )(IPindPlugin *self, const char *message, size_t length) |
| E_plugin_type(* | get_plugin_type )(IPindPlugin *self) |
| bool(* | init )(IPindPlugin *self, int argc, const char *const argv[]) |
| void(* | uninit )(IPindPlugin *self) |
This structure should not be allocated directly. It should be filled and returned as part of IRPCPlugin.
This is also the first member of IRPCPlugin. So casting an IRPCPlugin to IPindPlugin should work, providing a C style "object oriented" way of implementing plugins.
| E_plugin_type(* IPindPlugin::get_plugin_type) (IPindPlugin *self) |
Return plugin type.
| [in] | self | A pointer to the plugin |
This method must be set and may not be NULL.
| bool(* IPindPlugin::init) (IPindPlugin *self, int argc, const char *const argv[]) |
Called to initialize a plugin.
If this method is set, it will be called after the plugin is loaded. This method may be NULL.
| [in] | self | A pointer to the plugin |
| [in] | argc | Number of arguments (see below) |
| [in] | argv | Array of arguments as set in the plugin JSON configuration file trough the arguments field ("ExtraRPCPlugins/i/arguments" or "/RSCServer/RPCPlugins/i/arguments"). |
| const char* IPindPlugin::logName_ |
Plugin log filename based (but not the same) on this plugin JSON configuration file field "ExtraRPCPlugins/i/logfilename" or "/RSCServer/RPCPlugins/i/logfilename" (which can be relative or absolute). (if doesn't exist, a default name will be given from the plugin "/name" field in the configuration file (name +.log + .<PID>)
| void(* IPindPlugin::plugin_log) (IPindPlugin *self, const char *message, size_t length) |
Plugin print callback. It can be used to emit plugin logs into a dedicated plugin log file. The plugin file name will be the <name from plugin JSON configuration file> + .log + .<PID> Plugin log file is created based on plugin JSON configuration file (.../logfilename field).
| [in] | self | A pointer to the plugin |
| [in] | message | A C style string to be emitted into the plugin log file |
| [in] | length | Length of message string |
| void(* IPindPlugin::uninit) (IPindPlugin *self) |
Perform any cleanup of resources allocated by init() or during the lifetime of the plugin.
If this method is set, it will be called before the plugin is destroyed. This method may be NULL.
| [in] | self | A pointer to the plugin |
| bool IPindPlugin::verbose_ |
When true, plugin_log_verbose() will emit logs into the plugin log file This member is set (internally) to true when the plugin JSON configuration file "ExtraRPCPlugins/i/log" or "/RSCServer/RPCPlugins/i/log" is true. When false or not specified at all this member will be set to true.