ggiOvlInit

Name

ggiOvlInit, ggiOvlExit -- Initialize and uninitialize LibOvl

Synopsis

#include <ggi/ovl.h>

int ggiOvlInit(void);

int ggiOvlExit(void);

Description

ggiOvlInit initalizes the library. This function must be called before using other LibOvl functions; otherwise the results will be undefined.

ggiOvlExit uninitializes the library (after being initalized by ggiOvlInit) and automatically cleanup if necessary. This should be called after an application is finished with the library. If any LibOvl functions are called after the library has been uninitialized, the results will be undefined.

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

Return value

ggiOvlInit returns 0 for OK, otherwise an error code.

ggiOvlExit returns:

0

after successfully cleaning up,

> 0

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

< 0

error, especially if more ggiOvlExit calls have been done than ggiOvlInit calls.

Examples

Example 1. Initialize and uninitialize LibOvl

if (!ggiOvlInit())
{
        exit(EXIT_FAILURE);  /* can't start! */
}

/* Do some libovl stuff */

ggiOvlExit();