C-Pluff C API  0.2.0
Functions
Framework initialization

These functions are used for framework initialization. More...

Functions

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

Detailed Description

These functions are used for framework initialization.

They are intended to be used by the main program. These functions are not thread safe.

Function Documentation

◆ cp_set_fatal_error_handler()

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.

The default error handler prints the error message out to standard error and aborts the program. If the user specified error handler returns then the framework will abort the program. Setting NULL error handler will restore the default handler. This function is not thread-safe and it should be called before initializing the framework to catch all fatal errors.

Parameters
error_handlerthe fatal error handler

◆ cp_init()

CP_IMPORT cp_status_t cp_init ( void  )

Initializes the plug-in framework.

This function must be called by the main program before calling any other plug-in framework functions except framework information functions and cp_set_fatal_error_handler. This function may be called several times but it is not thread-safe. Library resources should be released by calling cp_destroy when the framework is not needed anymore.

Additionally, to enable localization support, the main program should set the current locale using

setlocale(LC_ALL, "")

before calling this function.

Returns
CP_OK (zero) on success or error code on failure

◆ cp_destroy()

CP_IMPORT void cp_destroy ( void  )

Destroys the plug-in framework and releases the resources used by it.

The plug-in framework is only destroyed after this function has been called as many times as cp_init. This function is not thread-safe. Plug-in framework functions other than cp_init, ::cp_get_framework_info and cp_set_fatal_error_handler must not be called after the plug-in framework has been destroyed. All contexts are destroyed and all data references returned by the framework become invalid.


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