C-Pluff C API  0.2.0
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

◆ cp_plugin_listener_func_t

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

◆ cp_logger_func_t

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

◆ cp_fatal_error_func_t

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

◆ cp_run_func_t

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 May 1 2020 01:06:58 for C-Pluff C API by doxygen 1.8.13