gicExit(3) Initialize and uninitialize LibGIIGIC

Other Alias



#include <ggi/gic.h>
int gicInit(void);
int gicExit(void);


gicInit initializes the library. This function must be called before using other LibGIIGIC functions; otherwise the results will be undefined.

gicExit uninitializes the library (after being initialized by gicInit) and automatically cleans up if necessary. This should be called after an application finished using the library. If any GIC functions are called after the library has been uninitialized, the results will be undefined.

gicInit allows multiple invocations. A reference count is maintained, and to completely uninitialize the library, gicExit must be called as many times as gicInit has been called beforehand.


gicInit returns 0 for OK, otherwise an gii-error(3) code.

gicExit returns:

after successfully cleaning up,

the number of 'open' gicInit calls, if there has been more than one call to gicInit. As gicInit and gicExit must be used in properly nested pairs, e.g. the first gicExit after two gicInit's will return 1.

gii-error(3), especially if more gicExit calls have been done than gicInit calls.


Initialize and uninitialize LibGIIGIC:

if (gicInit() < 0) {
    fprintf(stderr, "Cannot initialize LibGIIGIC!\n");
/* Do some LibGIIGIC stuff */