Framework initialization
[Functions]


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.


Functions

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.


Function Documentation

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_handler the fatal error handler

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

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 Apr 6 15:40:55 2007 for C-Pluff C API by doxygen 1.5.1