Simple Virtual Machine
A simple but flexible virtual machine
|
This module contains API functions used to configure a SVM plugin. More...
Functions | |
SVM_FUNCTION const char * | svm_api_get_signature () |
This function helps the SVM to check the compatibility of a given plugin to its own API. More... | |
SVM_FUNCTION void | svm_plugin_configure (void *plugin_handler, const char *plugin_configuration, const char api_signature[], const char svm_version[]) |
This function configures a plugin to the virtual machine. More... | |
This module contains API functions used to configure a SVM plugin.
The configuration of a plugin is done through a dedicated C callback function:
This function can perform some initialisations, but has to call the API function:
to register all defined objects into the virtual machine.
SVM_FUNCTION const char * svm_api_get_signature | ( | ) |
This function helps the SVM to check the compatibility of a given plugin to its own API.
Any detected incompatibility aborts the boot of the SVM to prevent issues at run time.
SVM_FUNCTION void svm_plugin_configure | ( | void * | plugin_handler, |
const char * | plugin_configuration, | ||
const char | api_signature[], | ||
const char | svm_version[] | ||
) |
This function configures a plugin to the virtual machine.
[in] | plugin_handler | An opaque pointer representing a plugin. This pointer is given by the SVM as the first parameter of the plugin_configure function. |
[in] | plugin_configuration | A string representing the dependencies and the definitions of the plugin. Please refer to the SVM man page to have more details about this string syntax. |
[in] | api_signature | A string representing the SVM API hash used at plugin compilation time. The macro SVM_API_SIGNATURE defined in the <svm/svm_compatibility.h> header should be used here. |
[in] | svm_version | A string representing the SVM version used at plugin compilation time. The macro SVM_VERSION defined in the <svm/svm_compatibility.h> header should be used here. |
A typical example of a plugin configuration function: