Initialize LibGGIBuf extension

Name

ggiBufInit, ggiBufExit : Initialize LibGGIBuf extension

Synopsis

#include <ggi/buf.h>

int ggiBufInit(void);

int ggiBufExit(void);

Description

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

ggiBufExit uninitializes the library (after being initialized by ggiBufInit) and automatically cleans up if necessary. This should be called after an application is finished with the library. If any LibBuf functions are called after the library has been uninitialized, the results will be undefined.

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

Return Value

ggiBufInit returns 0 for OK, otherwise an error code.

ggiBufExit returns:

0

after successfully cleaning up,

>0

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

<0

error, especially if more ggiBufExit calls have been done than ggiBufInit calls.

See Also