C-Pluff C API: cpluff.h File Reference

- Main Page
- Modules
- Data Structures
- Files
- Related Pages

- File List
- Globals

# cpluff.h File Reference

## Detailed Description

C-Pluff C API header file.

The elements declared here constitute the C-Pluff C API. To use the API include this file and link the main program and plug-in runtime libraries with the C-Pluff C library. In addition to local declarations, this file also includes cpluffdef.h header file for defines common to C and C++ API.

Include dependency graph for cpluff.h:

Go to the source code of this file.

## Data Structures
struct | cp_plugin_info_t
| Plug-in information structure captures information about a plug-in. More...
struct | cp_plugin_import_t
| Information about plug-in import. More...
struct | cp_ext_point_t
| Extension point structure captures information about an extension point. More...
struct | cp_extension_t
| Extension structure captures information about an extension. More...
struct | cp_cfg_element_t
| A configuration element contains configuration information for an extension. More...
struct | cp_plugin_runtime_t
| Container for plug-in runtime information. More...
## Defines
#define | CP_C_API
| Marks a symbol declaration to be part of the C-Pluff C API.
#define | CP_SP_UPGRADE
| This flag enables upgrades of installed plug-ins by unloading the old version and installing the new version.
#define | CP_SP_STOP_ALL_ON_UPGRADE
| This flag causes all plug-ins to be stopped before any plug-ins are to be upgraded.
#define | CP_SP_STOP_ALL_ON_INSTALL
| This flag causes all plug-ins to be stopped before any plugins are to be installed (also if new version is to be installed as part of an upgrade).
#define | CP_SP_RESTART_ACTIVE
| Setting this flag causes the currently active plug-ins to be restarted after all changes to the plug-ins have been made (if they were stopped).
## Typedefs
typedef cp_context_t | cp_context_t
| A plug-in context represents the co-operation environment of a set of plug-ins from the perspective of a particular participating plug-in or the perspective of the main program.
typedef cp_plugin_info_t | cp_plugin_info_t
| A type for cp_plugin_info_t structure.
typedef cp_plugin_import_t | cp_plugin_import_t
| A type for cp_plugin_import_t structure.
typedef cp_ext_point_t | cp_ext_point_t
| A type for cp_ext_point_t structure.
typedef cp_extension_t | cp_extension_t
| A type for cp_extension_t structure.
typedef cp_cfg_element_t | cp_cfg_element_t
| A type for cp_cfg_element_t structure.
typedef cp_plugin_runtime_t | cp_plugin_runtime_t
| A type for cp_plugin_runtime_t structure.
typedef enum cp_status_t | cp_status_t
| A type for cp_status_t enumeration.
typedef enum cp_plugin_state_t | cp_plugin_state_t
| A type for cp_plugin_state_t enumeration.
typedef enum cp_log_severity_t | cp_log_severity_t
| A type for cp_log_severity_t enumeration.
typedef void(*) | cp_plugin_listener_func_t (const char *plugin_id, cp_plugin_state_t old_state, cp_plugin_state_t new_state, void *user_data)
| A listener function called synchronously after a plugin state change.
typedef void(*) | cp_logger_func_t (cp_log_severity_t severity, const char *msg, const char *apid, void *user_data)
| A logger function called to log selected plug-in framework messages.
typedef void(*) | cp_fatal_error_func_t (const char *msg)
| A fatal error handler for handling unrecoverable errors.
typedef int(*) | cp_run_func_t (void *plugin_data)
| A run function registered by a plug-in to perform work.
## Enumerations
enum | cp_status_t { CP_OK = 0, CP_ERR_RESOURCE, CP_ERR_UNKNOWN, CP_ERR_IO, CP_ERR_MALFORMED, CP_ERR_CONFLICT, CP_ERR_DEPENDENCY, CP_ERR_RUNTIME }
| An enumeration of status codes returned by API functions. More...
enum | cp_plugin_state_t { CP_PLUGIN_UNINSTALLED, CP_PLUGIN_INSTALLED, CP_PLUGIN_RESOLVED, CP_PLUGIN_STARTING, CP_PLUGIN_STOPPING, CP_PLUGIN_ACTIVE }
| An enumeration of possible plug-in states. More...
enum | cp_log_severity_t { CP_LOG_DEBUG, CP_LOG_INFO, CP_LOG_WARNING, CP_LOG_ERROR }
| An enumeration of possible message severities for framework logging. More...
## Functions
const char * | cp_get_version (void)
| Returns the release version string of the linked in C-Pluff implementation.
const char * | cp_get_host_type (void)
| Returns the canonical host type associated with the linked in C-Pluff implementation.
void | cp_set_fatal_error_handler (cp_fatal_error_func_t error_handler)
| Sets the fatal error handler called on non-recoverable errors.
cp_status_t | cp_init (void)
| Initializes the plug-in framework.
void | cp_destroy (void)
| Destroys the plug-in framework and releases the resources used by it.
cp_context_t * | cp_create_context (cp_status_t *status)
| Creates a new plug-in context which can be used as a container for plug-ins.
void | cp_destroy_context (cp_context_t *ctx)
| Destroys the specified plug-in context and releases the associated resources.
cp_status_t | cp_register_pcollection (cp_context_t *ctx, const char *dir)
| Registers a plug-in collection with a plug-in context.
void | cp_unregister_pcollection (cp_context_t *ctx, const char *dir)
| Unregisters a previously registered plug-in collection from a plug-in context.
void | cp_unregister_pcollections (cp_context_t *ctx)
| Unregisters all plug-in collections from a plug-in context.
cp_status_t | cp_register_logger (cp_context_t *ctx, cp_logger_func_t logger, void *user_data, cp_log_severity_t min_severity)
| Registers a logger with a plug-in context or updates the settings of a registered logger.
void | cp_unregister_logger (cp_context_t *ctx, cp_logger_func_t logger)
| Removes a logger registration.
void | cp_log (cp_context_t *ctx, cp_log_severity_t severity, const char *msg)
| Emits a new log message.
int | cp_is_logged (cp_context_t *ctx, cp_log_severity_t severity)
| Returns whether a message of the specified severity would get logged.
cp_plugin_info_t * | cp_load_plugin_descriptor (cp_context_t *ctx, const char *path, cp_status_t *status)
| Loads a plug-in descriptor from the specified plug-in installation path and returns information about the plug-in.
cp_status_t | cp_install_plugin (cp_context_t *ctx, cp_plugin_info_t *pi)
| Installs the plug-in described by the specified plug-in information structure to the specified plug-in context.
cp_status_t | cp_scan_plugins (cp_context_t *ctx, int flags)
| Scans for plug-ins in the registered plug-in directories, installing new plug-ins and upgrading installed plug-ins.
cp_status_t | cp_start_plugin (cp_context_t *ctx, const char *id)
| Starts a plug-in.
cp_status_t | cp_stop_plugin (cp_context_t *ctx, const char *id)
| Stops a plug-in.
void | cp_stop_plugins (cp_context_t *ctx)
| Stops all active plug-ins.
cp_status_t | cp_uninstall_plugin (cp_context_t *ctx, const char *id)
| Uninstalls the specified plug-in.
void | cp_uninstall_plugins (cp_context_t *ctx)
| Uninstalls all plug-ins.
cp_plugin_info_t * | cp_get_plugin_info (cp_context_t *ctx, const char *id, cp_status_t *status)
| Returns static information about the specified plug-in.
cp_plugin_info_t ** | cp_get_plugins_info (cp_context_t *ctx, cp_status_t *status, int *num)
| Returns static information about the installed plug-ins.
cp_ext_point_t ** | cp_get_ext_points_info (cp_context_t *ctx, cp_status_t *status, int *num)
| Returns static information about the currently installed extension points.
cp_extension_t ** | cp_get_extensions_info (cp_context_t *ctx, const char *extpt_id, cp_status_t *status, int *num)
| Returns static information about the currently installed extension points.
void | cp_release_info (cp_context_t *ctx, void *info)
| Releases a previously obtained reference counted information object.
cp_plugin_state_t | cp_get_plugin_state (cp_context_t *ctx, const char *id)
| Returns the current state of the specified plug-in.
cp_status_t | cp_register_plistener (cp_context_t *ctx, cp_plugin_listener_func_t listener, void *user_data)
| Registers a plug-in listener with a plug-in context.
void | cp_unregister_plistener (cp_context_t *ctx, cp_plugin_listener_func_t listener)
| Removes a plug-in listener from a plug-in context.
cp_cfg_element_t * | cp_lookup_cfg_element (cp_cfg_element_t *base, const char *path)
| Traverses a configuration element tree and returns the specified element.
char * | cp_lookup_cfg_value (cp_cfg_element_t *base, const char *path)
| Traverses a configuration element tree and returns the value of the specified element or attribute.
cp_status_t | cp_run_function (cp_context_t *ctx, cp_run_func_t runfunc)
| Registers a new run function.
void | cp_run_plugins (cp_context_t *ctx)
| Runs the started plug-ins as long as there is something to run.
int | cp_run_plugins_step (cp_context_t *ctx)
| Runs one registered run function.
void | cp_set_context_args (cp_context_t *ctx, char **argv)
| Sets startup arguments for the specified plug-in context.
char ** | cp_get_context_args (cp_context_t *ctx, int *argc)
| Returns the startup arguments associated with the specified plug-in context.
cp_status_t | cp_define_symbol (cp_context_t *ctx, const char *name, void *ptr)
| Defines a context specific symbol.
void * | cp_resolve_symbol (cp_context_t *ctx, const char *id, const char *name, cp_status_t *status)
| Resolves a symbol provided by the specified plug-in.
void | cp_release_symbol (cp_context_t *ctx, const void *ptr)
| Releases a previously obtained symbol.

Generated on Fri Apr 6 15:40:55 2007 for C-Pluff C API by 1.5.1