Typedefs | |
typedef _cpl_pluginlist_ | cpl_pluginlist |
The opaque plugin list data type. | |
Functions | |
cpl_error_code | cpl_pluginlist_append (cpl_pluginlist *self, const cpl_plugin *plugin) |
Append a plugin to a plugin list. | |
void | cpl_pluginlist_delete (cpl_pluginlist *self) |
Delete a plugin list. | |
void | cpl_pluginlist_dump (const cpl_pluginlist *self, FILE *stream) |
Dump the contents of a plugin list to the given stream. | |
cpl_plugin * | cpl_pluginlist_find (cpl_pluginlist *self, const char *name) |
Find a plugin with a given name in a plugin list. | |
cpl_plugin * | cpl_pluginlist_get_first (cpl_pluginlist *self) |
Get the first plugin of a plugin list. | |
cpl_plugin * | cpl_pluginlist_get_last (cpl_pluginlist *self) |
Get the last plugin of a plugin list. | |
cpl_plugin * | cpl_pluginlist_get_next (cpl_pluginlist *self) |
Get the next plugin from a plugin list. | |
int | cpl_pluginlist_get_size (cpl_pluginlist *self) |
Get the current size of a plugin list. | |
cpl_pluginlist * | cpl_pluginlist_new (void) |
Creates an empty plugin list. | |
cpl_error_code | cpl_pluginlist_prepend (cpl_pluginlist *self, const cpl_plugin *plugin) |
Prepend a plugin to a plugin list. |
Since the plugin list just stores pointers to cpl_plugin
, a plugin list may contain plugins of different kind at the same time, because all context specific plugins inherit the cpl_plugin
type (see Plugin Interface).
#include <cpl_pluginlist.h>
typedef struct _cpl_pluginlist_ cpl_pluginlist |
The opaque plugin list data type.
cpl_error_code cpl_pluginlist_append | ( | cpl_pluginlist * | self, | |
const cpl_plugin * | plugin | |||
) |
Append a plugin to a plugin list.
self | A plugin list. | |
plugin | The plugin to append. |
CPL_ERROR_NONE
on success or a CPL error code otherwise.CPL_ERROR_NULL_INPUT | The parameter self or plugin is a NULL pointer. |
The plugin plugin is inserted into the plugin list self after the last element.
If self does not point to a valid plugin list, or if plugin is not a valid pointer the function returns immediately.
void cpl_pluginlist_delete | ( | cpl_pluginlist * | self | ) |
Delete a plugin list.
self | The plugin list to delete. |
NULL
, nothing is done and no error is set.
void cpl_pluginlist_dump | ( | const cpl_pluginlist * | self, | |
FILE * | stream | |||
) |
Dump the contents of a plugin list to the given stream.
self | The plugin list. | |
stream | The output stream to use. |
NULL
the function does nothing.
cpl_plugin* cpl_pluginlist_find | ( | cpl_pluginlist * | self, | |
const char * | name | |||
) |
Find a plugin with a given name in a plugin list.
self | The plugin list to query. | |
name | The plugin's unique name to look for. |
NULL
if it no plugin with this name could be found. The function returns NULL
if an error occurs and sets an appropriate error code.CPL_ERROR_NULL_INPUT | The parameter self or name is a NULL pointer. |
This function searches the plugin list self for a plugin with the unique name name and returns a pointer to the first one found. If no plugin with the given name is found the function returns NULL
.
cpl_plugin* cpl_pluginlist_get_first | ( | cpl_pluginlist * | self | ) |
Get the first plugin of a plugin list.
self | A plugin list. |
NULL
if the list is empty. The function returns NULL
if an error occurs and sets an appropriate error code.CPL_ERROR_NULL_INPUT | The parameter self is a NULL pointer. |
The function returns a handle to the first plugin stored in the self.
cpl_plugin* cpl_pluginlist_get_last | ( | cpl_pluginlist * | self | ) |
Get the last plugin of a plugin list.
self | A plugin list. |
NULL
if the list is empty. The function returns NULL
if an error occurs and sets an appropriate error code.CPL_ERROR_NULL_INPUT | The parameter self is a NULL pointer. |
The function returns a pointer to the last plugin stored in the plugin list self.
cpl_plugin* cpl_pluginlist_get_next | ( | cpl_pluginlist * | self | ) |
Get the next plugin from a plugin list.
self | A plugin list. |
NULL
if the end of the list has been reached. The function returns NULL
if an error occurs and sets an appropriate error code.CPL_ERROR_NULL_INPUT | The parameter self is a NULL pointer. |
CPL_ERROR_ILLEGAL_INPUT | The function was called without initialising the plugin list self by calling cpl_pluginlist_first(). |
The function returns the next plugin in self. To find the next plugin, the plugin list caches the position of the most recently obtained plugin. This requires a call to cpl_pluginlist_get_first() prior to calling this function in order to properly initialise the internal cache.
If the end of self has been reached the internal cache is reset to the first plugin in the list.
int cpl_pluginlist_get_size | ( | cpl_pluginlist * | self | ) |
Get the current size of a plugin list.
self | A plugin list. |
CPL_ERROR_NULL_INPUT | The parameter self is a NULL pointer. |
The function reports the current number of plugins stored in the plugin list self. If self does not point to a valid plugin list the function returns 0.
cpl_pluginlist* cpl_pluginlist_new | ( | void | ) |
Creates an empty plugin list.
NULL
if it could not be created.cpl_error_code cpl_pluginlist_prepend | ( | cpl_pluginlist * | self, | |
const cpl_plugin * | plugin | |||
) |
Prepend a plugin to a plugin list.
self | A plugin list. | |
plugin | The plugin to prepend. |
CPL_ERROR_NONE
on success or a CPL error code otherwise.CPL_ERROR_NULL_INPUT | The parameter self or plugin is a NULL pointer. |
The plugin plugin is inserted into the plugin list self before the first element.
If self does not point to a valid plugin list, or if plugin is not a valid pointer the function returns immediately.