C-Pluff C API  0.1.4
Typedefs
Callback function types

Typedefs for client supplied callback functions. More...

Typedefs

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...
 

Detailed Description

Typedefs for client supplied callback functions.

Typedef Documentation

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.

The function should return promptly. Library initialization, plug-in context management, plug-in management, listener registration (cp_register_plistener and cp_unregister_plistener) and dynamic symbol functions must not be called from within a plug-in listener invocation. Listener functions are registered using cp_register_plistener.

Parameters
plugin_idthe plug-in identifier
old_statethe old plug-in state
new_statethe new plug-in state
user_datathe user data pointer supplied at listener registration
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.

The messages may be localized. Plug-in framework API functions must not be called from within a logger function invocation. In a multi-threaded environment logger function invocations are serialized by the framework. Logger functions are registered using cp_register_logger.

Parameters
severitythe severity of the message
msgthe message to be logged, possibly localized
apidthe identifier of the activating plug-in or NULL for the main program
user_datathe user data pointer given when the logger was registered
typedef void(* cp_fatal_error_func_t)(const char *msg)

A fatal error handler for handling unrecoverable errors.

If the error handler returns then the framework aborts the program. Plug-in framework API functions must not be called from within a fatal error handler invocation. The fatal error handler function is set using cp_set_fatal_error_handler.

Parameters
msgthe possibly localized error message
typedef int(* cp_run_func_t)(void *plugin_data)

A run function registered by a plug-in to perform work.

The run function should perform a finite chunk of work and it should return a non-zero value if there is more work to be done. Run functions are registered using cp_run_function and the usage is discussed in more detail in the serial execution section.

Parameters
plugin_datathe plug-in instance data pointer
Returns
non-zero if there is more work to be done or zero if finished

Generated on Fri Jan 1 2016 23:17:02 for C-Pluff C API by doxygen 1.8.6