giiExit3
Initialize and uninitialize libgii
Part of giiInit(3).
Usage
#include <ggi/gii.h> int giiInit(void); int giiExit(void);
Overview
giiInit initializes the library. This function must be called before using other LibGII functions; otherwise the results will be undefined.
giiExit uninitializes the library (after being initialized by giiInit) and automatically cleanup if necessary. This should be called after an application is finished with the library. If any GGI functions are called after the library has been uninitialized, the results will be undefined.
giiInit allows multiple invocations. A reference count is maintained, and to completely uninitialize the library, giiExit must be called as many times as giiInit has been called beforehand.
Return value
giiInit returns 0 for OK, otherwise an gii-error(3) code.
giiExit returns:
- 0
-
after successfully cleaning up,
- >0
-
the number of 'open'
giiInitcalls, if there has been more than one call togiiInit. AsgiiInitandgiiExitmust be used in properly nested pairs, e.g. the firstgiiExitafter twogiiInitwill return 1.
- <0
-
gii-error(3), especially if moregiiExitcalls have been done thangiiInitcalls.
Examples
Initialize and uninitialize LibGII:
if (!giiInit()) {
exit(EXIT_FAILURE); /* can't start! */
}
/* Do some libgii stuff */
giiExit();
Releases
5 releases since Debian 3.1 (Sarge); the text changed 2 times.