C-Pluff C API  0.2.0
Data Structures | Macros | Typedefs | Enumerations | Functions
cpluff.h File Reference

C-Pluff C API header file. More...

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...
 
struct  cp_plugin_loader_t
 A plug-in loader instance. More...
 

Macros

#define CP_C_API
 Marks a symbol declaration to be part of the C-Pluff C API. More...
 
#define CP_SP_UPGRADE
 This flag enables upgrades of installed plug-ins by unloading the old version and installing the new version. More...
 
#define CP_SP_STOP_ALL_ON_UPGRADE
 This flag causes all plug-ins to be stopped before any plug-ins are to be upgraded. More...
 
#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). More...
 
#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). More...
 

Typedefs

typedef struct 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. More...
 
typedef struct cp_plugin_info_t cp_plugin_info_t
 A type for cp_plugin_info_t structure. More...
 
typedef struct cp_plugin_import_t cp_plugin_import_t
 A type for cp_plugin_import_t structure. More...
 
typedef struct cp_ext_point_t cp_ext_point_t
 A type for cp_ext_point_t structure. More...
 
typedef struct cp_extension_t cp_extension_t
 A type for cp_extension_t structure. More...
 
typedef struct cp_cfg_element_t cp_cfg_element_t
 A type for cp_cfg_element_t structure. More...
 
typedef struct cp_plugin_runtime_t cp_plugin_runtime_t
 A type for cp_plugin_runtime_t structure. More...
 
typedef struct cp_plugin_loader_t cp_plugin_loader_t
 A type for cp_plugin_loader_t structure. More...
 
typedef enum cp_status_t cp_status_t
 A type for cp_status_t enumeration. More...
 
typedef enum cp_plugin_state_t cp_plugin_state_t
 A type for cp_plugin_state_t enumeration. More...
 
typedef enum cp_log_severity_t cp_log_severity_t
 A type for cp_log_severity_t enumeration. More...
 
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. More...
 
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. More...
 
typedef void(* cp_fatal_error_func_t) (const char *msg)
 A fatal error handler for handling unrecoverable errors. More...
 
typedef int(* cp_run_func_t) (void *plugin_data)
 A run function registered by a plug-in to perform work. More...
 

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

CP_IMPORT const char * cp_get_version (void)
 Returns the release version string of the linked in C-Pluff implementation. More...
 
CP_IMPORT const char * cp_get_host_type (void)
 Returns the canonical host type associated with the linked in C-Pluff implementation. More...
 
CP_IMPORT void cp_set_fatal_error_handler (cp_fatal_error_func_t error_handler)
 Sets the fatal error handler called on non-recoverable errors. More...
 
CP_IMPORT cp_status_t cp_init (void)
 Initializes the plug-in framework. More...
 
CP_IMPORT void cp_destroy (void)
 Destroys the plug-in framework and releases the resources used by it. More...
 
CP_IMPORT cp_context_tcp_create_context (cp_status_t *status)
 Creates a new plug-in context which can be used as a container for plug-ins. More...
 
CP_IMPORT void cp_set_plugin_descriptor_name (cp_context_t *ctx, const char *name)
 Changes the file name in the plug-in the plug-in descriptor is loaded from. More...
 
CP_IMPORT void cp_set_plugin_descriptor_root_element (cp_context_t *ctx, const char *root)
 Changes the XML root element's name in plug-in descriptor. More...
 
CP_IMPORT void cp_destroy_context (cp_context_t *ctx)
 Destroys the specified plug-in context and releases the associated resources. More...
 
CP_IMPORT cp_status_t cp_register_pcollection (cp_context_t *ctx, const char *dir)
 Registers a local plug-in collection with a plug-in context. More...
 
CP_IMPORT void cp_unregister_pcollection (cp_context_t *ctx, const char *dir)
 Unregisters a previously registered plug-in collection from a plug-in context. More...
 
CP_IMPORT void cp_unregister_pcollections (cp_context_t *ctx)
 Unregisters all plug-in collections from a plug-in context. More...
 
CP_IMPORT cp_status_t cp_register_ploader (cp_context_t *ctx, cp_plugin_loader_t *loader)
 Registers a plug-in loader that will be used to load plug-ins into this context when cp_scan_plugins is called. More...
 
CP_IMPORT void cp_unregister_ploader (cp_context_t *ctx, cp_plugin_loader_t *loader)
 Unregisters a previously registered plug-in loader from a plug-in context. More...
 
CP_IMPORT void cp_unregister_ploaders (cp_context_t *ctx)
 Unregisters all registered plug-in loaders from a plug-in context. More...
 
CP_IMPORT 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. More...
 
CP_IMPORT void cp_unregister_logger (cp_context_t *ctx, cp_logger_func_t logger)
 Removes a logger registration. More...
 
CP_IMPORT void cp_log (cp_context_t *ctx, cp_log_severity_t severity, const char *msg)
 Emits a new log message. More...
 
CP_IMPORT int cp_is_logged (cp_context_t *ctx, cp_log_severity_t severity)
 Returns whether a message of the specified severity would get logged. More...
 
CP_IMPORT cp_plugin_info_tcp_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. More...
 
CP_IMPORT cp_plugin_info_tcp_load_plugin_descriptor_from_memory (cp_context_t *ctx, const char *buffer, unsigned int buffer_len, cp_status_t *status)
 Loads a plug-in descriptor from the specified block of memory and returns information about the plug-in. More...
 
CP_IMPORT 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. More...
 
CP_IMPORT 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. More...
 
CP_IMPORT cp_status_t cp_start_plugin (cp_context_t *ctx, const char *id)
 Starts a plug-in. More...
 
CP_IMPORT cp_status_t cp_stop_plugin (cp_context_t *ctx, const char *id)
 Stops a plug-in. More...
 
CP_IMPORT void cp_stop_plugins (cp_context_t *ctx)
 Stops all active plug-ins. More...
 
CP_IMPORT cp_status_t cp_uninstall_plugin (cp_context_t *ctx, const char *id)
 Uninstalls the specified plug-in. More...
 
CP_IMPORT void cp_uninstall_plugins (cp_context_t *ctx)
 Uninstalls all plug-ins. More...
 
CP_IMPORT cp_plugin_info_tcp_get_plugin_info (cp_context_t *ctx, const char *id, cp_status_t *status)
 Returns static information about the specified plug-in. More...
 
CP_IMPORT 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. More...
 
CP_IMPORT 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. More...
 
CP_IMPORT 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. More...
 
CP_IMPORT void cp_release_info (cp_context_t *ctx, void *info)
 Releases a previously obtained reference counted information object. More...
 
CP_IMPORT cp_plugin_state_t cp_get_plugin_state (cp_context_t *ctx, const char *id)
 Returns the current state of the specified plug-in. More...
 
CP_IMPORT 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. More...
 
CP_IMPORT void cp_unregister_plistener (cp_context_t *ctx, cp_plugin_listener_func_t listener)
 Removes a plug-in listener from a plug-in context. More...
 
CP_IMPORT cp_cfg_element_tcp_lookup_cfg_element (cp_cfg_element_t *base, const char *path)
 Traverses a configuration element tree and returns the specified element. More...
 
CP_IMPORT 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. More...
 
CP_IMPORT cp_status_t cp_run_function (cp_context_t *ctx, cp_run_func_t runfunc)
 Registers a new run function. More...
 
CP_IMPORT void cp_run_plugins (cp_context_t *ctx)
 Runs the started plug-ins as long as there is something to run. More...
 
CP_IMPORT int cp_run_plugins_step (cp_context_t *ctx)
 Runs one registered run function. More...
 
CP_IMPORT void cp_set_context_args (cp_context_t *ctx, char **argv)
 Sets startup arguments for the specified plug-in context. More...
 
CP_IMPORT char ** cp_get_context_args (cp_context_t *ctx, int *argc)
 Returns the startup arguments associated with the specified plug-in context. More...
 
CP_IMPORT cp_status_t cp_define_symbol (cp_context_t *ctx, const char *name, void *ptr)
 Defines a context specific symbol. More...
 
CP_IMPORT 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. More...
 
CP_IMPORT void cp_release_symbol (cp_context_t *ctx, const void *ptr)
 Releases a previously obtained symbol. More...
 
CP_IMPORT cp_plugin_loader_tcp_create_local_ploader (cp_status_t *status)
 Creates and returns a new instance of a local plug-in loader. More...
 
CP_IMPORT void cp_destroy_local_ploader (cp_plugin_loader_t *loader)
 Releases the resources allocated by a previously created local plug-in loader. More...
 
CP_IMPORT cp_status_t cp_lpl_register_dir (cp_plugin_loader_t *loader, const char *dir)
 Registers a new directory to be scanned by the specified local plug-in loader. More...
 
CP_IMPORT void cp_lpl_unregister_dir (cp_plugin_loader_t *loader, const char *dir)
 Unregisters a directory from the specified local plug-in loader. More...
 
CP_IMPORT void cp_lpl_unregister_dirs (cp_plugin_loader_t *loader)
 Unregisters all registered directories from the specified local plug-in loader. More...
 

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.


Generated on Fri May 1 2020 01:06:58 for C-Pluff C API by doxygen 1.8.13