Next: Exporting the plugin dictionary, Previous: Plugin directories and files, Up: The ARTE Plugins
The plugins need to import some ARTE Core functions needed to indicate that tests failed, or to print debug messages. This import is done using the following structure, defined in arte.h:
/** Standard plugin actions */ typedef struct { /** Make the test fail */ void (* FAIL) (char *message); /** Make the test fail if str1 != str2 */ void (* FAIL_IF_DIFFERENT) (char *str1, char *str2, char *message); /** Make the test fail if str1 == str2 */ void (* FAIL_IF_EQUAL) (char *str1, char *str2, char *message); /** Dump debug message */ void (* DEBUG) (arte_log_type_t type, const char *format, ...); } arte_core_functions_t; |
The imported functions are the following:
message
parameter allows the plugin
to include a message/description string of why the test failed.
message
parameter allows the plugin
to include a message/description string of why the test failed.
message
parameter allows the plugin
to include a message/description string of why the test failed.
The import process of the functions is done when the library is dynamically loaded by the Arte Core. In order to provide a correct communication between the Plugin and the Core, the Plugin must export in its API the following:
/** Function to retrieve the array of arte_command_t from the module */ arte_command_t * arte_plugin_get_commands (arte_core_functions_t *common); |
The previous function not only allows to import the Core functions in the plugin, but also exports the plugin dictionary into the ARTE Core (as shown in the next section).