Compounds | |
| struct | _cpl_plugin_ |
| The type representation of the generic plugin interface. More... | |
Defines | |
| #define | CPL_PLUGIN_API |
| Plugin API version. More... | |
Typedefs | |
| typedef enum _cpl_plugin_type_ | cpl_plugin_type |
| Data type used to store the plugin type code. More... | |
| typedef _cpl_plugin_ | cpl_plugin |
| The plugin data type. More... | |
Enumerations | |
| enum | _cpl_plugin_type_ { CPL_PLUGIN_TYPE_NONE = 0, CPL_PLUGIN_TYPE_RECIPE = 1 } |
| Definition of plugin types. More... | |
Functions | |
| cpl_plugin * | cpl_plugin_new (void) |
| Create a new, empty plugin interface. More... | |
| void | cpl_plugin_copy (cpl_plugin *self, const cpl_plugin *plugin) |
| Copy a plugin. More... | |
| void | cpl_plugin_delete (cpl_plugin *plugin) |
| Destroy a plugin. More... | |
| void | cpl_plugin_initfill (cpl_plugin *self) |
| Initialise a plugin to be empty. More... | |
| cpl_plugin * | cpl_plugin_duplicate (const cpl_plugin *plugin) |
| Create a duplicate of a plugin. More... | |
| int | cpl_plugin_set_api (cpl_plugin *self, unsigned int api) |
| Set the plugin interface version number. More... | |
| unsigned int | cpl_plugin_get_api (cpl_plugin *self) |
| Get the version number of the plugin interface implementation. More... | |
| int | cpl_plugin_set_version (cpl_plugin *self, unsigned long version) |
| Set the version number of a plugin. More... | |
| unsigned long | cpl_plugin_get_version (cpl_plugin *self) |
| Get the version number of a plugin. More... | |
| const char * | cpl_plugin_get_version_as_string (cpl_plugin *self) |
| Get the version number of a plugin as a string. More... | |
| int | cpl_plugin_set_type (cpl_plugin *self, unsigned long type) |
| Set the type of a plugin. More... | |
| unsigned long | cpl_plugin_get_type (cpl_plugin *self) |
| Get the type of a plugin. More... | |
| const char * | cpl_plugin_get_type_as_string (cpl_plugin *self) |
| Get the type of a plugin as string. More... | |
| int | cpl_plugin_set_name (cpl_plugin *self, const char *name) |
| Set the name of a plugin. More... | |
| const char * | cpl_plugin_get_name (cpl_plugin *self) |
| Get the name of a plugin. More... | |
| int | cpl_plugin_set_synopsis (cpl_plugin *self, const char *synopsis) |
| Set the short description of a plugin. More... | |
| const char * | cpl_plugin_get_synopsis (cpl_plugin *self) |
| Get the short description of a plugin. More... | |
| int | cpl_plugin_set_description (cpl_plugin *self, const char *description) |
| Set the detailed description of a plugin. More... | |
| const char * | cpl_plugin_get_description (cpl_plugin *self) |
| Get the detailed description of a plugin. More... | |
| int | cpl_plugin_set_author (cpl_plugin *self, const char *author) |
| Set the name of the plugin author. More... | |
| const char * | cpl_plugin_get_author (cpl_plugin *self) |
| Get the name of the plugin author. More... | |
| int | cpl_plugin_set_email (cpl_plugin *self, const char *email) |
| Set the contact information of a plugin. More... | |
| const char * | cpl_plugin_get_email (cpl_plugin *self) |
| Get the contact information of a plugin. More... | |
| int | cpl_plugin_set_copyright (cpl_plugin *self, const char *copyright) |
| Set the license and copyright information of a plugin. More... | |
| const char * | cpl_plugin_get_copyright (cpl_plugin *self) |
| Get the license and copyright information of a plugin. More... | |
| int | cpl_plugin_set_initialize (cpl_plugin *self, cpl_plugin_func func) |
| Set the initialisation handler of a plugin. More... | |
| cpl_plugin_func | cpl_plugin_get_initialize (cpl_plugin *self) |
| Get the initialisation handler of a plugin. More... | |
| int | cpl_plugin_set_execute (cpl_plugin *self, cpl_plugin_func func) |
| Set the execution handler of a plugin. More... | |
| cpl_plugin_func | cpl_plugin_get_execute (cpl_plugin *self) |
| Get the execution handler of a plugin. More... | |
| int | cpl_plugin_set_deinitialize (cpl_plugin *self, cpl_plugin_func func) |
| Set the cleanup handler of a plugin. More... | |
| cpl_plugin_func | cpl_plugin_get_deinitialize (cpl_plugin *self) |
| Get the cleanup handler of a plugin. More... | |
| void | cpl_plugin_init (cpl_plugin *self, unsigned int api, unsigned long version, unsigned long type, const char *name, const char *synopsis, const char *description, const char *author, const char *email, const char *copyright, cpl_plugin_func create, cpl_plugin_func execute, cpl_plugin_func destroy) |
| Initialise a plugin. More... | |
| void | cpl_plugin_print (cpl_plugin *self) |
| Print the contents of a plugin. More... | |
| int | cpl_plugin_get_info (cpl_pluginlist *list) |
| Append the plugin information to the given list. More... | |
This module defines the basic plugin interface. The plugin interface provides the possibility to dynamically load and execute software modules. The basic plugin interface defined here serves as `superclass' for context specific plugins. All context specific plugins inherit this basic plugin interface. A plugin context is represented by a type code, i.e. the different plugin contexts are represented as different plugin types.
Most of the time an application using the plugin interface is dealing only with this basic, plugin type independent part of the interface. It provides the application with the necessary information about a particular plugin implementation and the services to initialise, execute and cleanup a dynamically loaded module.
In this way plugin type specific details may remain hidden from the application until the plugin type and its implementation details are known through querying the basic plugin interface part.
To obtain a filled plugin interface structure the application will call the function cpl_plugin_get_info(), which has the following prototype:
#include <cpl_pluginlist.h> cpl_plugin_get_info(cpl_pluginlist *list);
For each plugin library (a shared object library containing one or more plugins) this function must be implemented by the plugin developer. Its purpose is to fill a plugin interface structure for each plugin the plugin library contains and add it to a list provided by the application. This list of plugin interfaces provides the application with all the details on how to communicate with a particular plugin.
As an example on how to create a context specific plugin, i.e. how to create a new plugin type, you may have a look at Recipes.
#include <cpl_plugin.h>
|
|
Plugin API version.
|
|
|
The plugin data type.
This defines the (public) plugin data type. |
|
|
Data type used to store the plugin type code.
|
|
|
Definition of plugin types.
Predefined plugin types supported by the Common Pipeline Library itself. |
|
||||||||||||
|
Copy a plugin.
Note that the plugins self and plugin do not need to be of the same kind (see below).
The suggested usage of this function is: If you do not have already created your target plugin self, allocate a memory block with the appropriate size to hold your derived plugin. Pass both, the target plugin (as self) and the source plugin (as plugin) to this function. The function will fill the
|
|
|
Destroy a plugin.
cpl_plugin type is released and then the plugin itself is destroyed.
|
|
|
Create a duplicate of a plugin.
|
|
|
Get the version number of the plugin interface implementation.
|
|
|
Get the name of the plugin author.
|
|
|
Get the license and copyright information of a plugin.
|
|
|
Get the cleanup handler of a plugin.
|
|
|
Get the detailed description of a plugin.
|
|
|
Get the contact information of a plugin.
|
|
|
Get the execution handler of a plugin.
|
|
|
Append the plugin information to the given list.
This prototype is only provided in order to allow the compiler to do some basic checks when compiling a plugin library. To have the prototype available when you are compiling your plugin library, you must add the line #include <cpl_plugininfo.h> to your plugin source file.
The purpose of this function is to create a plugin object for each plugin implementation provided by the plugin library, fill the basic plugin interface (the The list will be provided by the application which is going to use the plugin and it may be expected that list points to a valid plugin list when this function is called. |
|
|
Get the initialisation handler of a plugin.
|
|
|
Get the name of a plugin.
|
|
|
Get the short description of a plugin.
|
|
|
Get the type of a plugin.
|
|
|
Get the type of a plugin as string.
|
|
|
Get the version number of a plugin.
|
|
|
Get the version number of a plugin as a string.
The resulting string is placed in a newly allocated buffer. This buffer must be deallocated using cpl_free() by the caller if it is no longer needed. |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Initialise a plugin.
cpl_plugin part of a plugin structure. For information on which information is required and which is optional please refer to the documentation of the plugin structure _cpl_plugin_.
If self is not a valid pointer, the function returns immediately. |
|
|
Initialise a plugin to be empty.
cpl_plugin structure self so that it is a valid empty plugin. If self does not point to a valid plugin the function returns immediately. |
|
|
Create a new, empty plugin interface.
cpl_plugin and initialises it. The function returns a handle for the newly created plugin interface object. The created plugin interface must be destroyed using the plugin interface destructor cpl_plugin_delete(). |
|
|
Print the contents of a plugin.
|
|
||||||||||||
|
Set the plugin interface version number.
|
|
||||||||||||
|
Set the name of the plugin author.
|
|
||||||||||||
|
Set the license and copyright information of a plugin.
|
|
||||||||||||
|
Set the cleanup handler of a plugin.
|
|
||||||||||||
|
Set the detailed description of a plugin.
\\n' and '\\t' may be embedded in the string description. |
|
||||||||||||
|
Set the contact information of a plugin.
|
|
||||||||||||
|
Set the execution handler of a plugin.
|
|
||||||||||||
|
Set the initialisation handler of a plugin.
|
|
||||||||||||
|
Set the name of a plugin.
|
|
||||||||||||
|
Set the short description of a plugin.
|
|
||||||||||||
|
Set the type of a plugin.
|
|
||||||||||||
|
Set the version number of a plugin.
|
1.2.14 written by Dimitri van Heesch,
© 1997-2002