.TH "gicInit" 3 "2006-12-30" "libgiigic-1.1.x" GGI .SH NAME \fBgicInit\fR, \fBgicExit\fR : Initialize and uninitialize LibGIIGIC .SH SYNOPSIS .nb .nf #include int gicInit(void); int gicExit(void); .fi .SH DESCRIPTION \fBgicInit\fR initializes the library. This function must be called before using other LibGIIGIC functions; otherwise the results will be undefined. \fBgicExit\fR uninitializes the library (after being initialized by \fBgicInit\fR) 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. \fBgicInit\fR allows multiple invocations. A reference count is maintained, and to completely uninitialize the library, \fBgicExit\fR must be called as many times as \fBgicInit\fR has been called beforehand. .SH RETURN VALUE \fBgicInit\fR returns \fB0\fR for OK, otherwise an \f(CWgii-error(3)\fR code. \fBgicExit\fR returns: .TP \fB0\fR after successfully cleaning up, .TP \fB>0\fR the number of 'open' \fBgicInit\fR calls, if there has been more than one call to \fBgicInit\fR. As \fBgicInit\fR and \fBgicExit\fR must be used in properly nested pairs, e.g. the first \fBgicExit\fR after two \fBgicInit\fR's will return \fB1\fR. .TP \fB<0\fR \f(CWgii-error(3)\fR, especially if more \fBgicExit\fR calls have been done than \fBgicInit\fR calls. .PP .SH EXAMPLES Initialize and uninitialize LibGIIGIC: .nb .nf if (gicInit() < 0) { fprintf(stderr, "Cannot initialize LibGIIGIC!\en"); exit(1); } /* Do some LibGIIGIC stuff */ gicExit(); .fi .SH SEE ALSO \f(CWgicOpen(3)\fR