The ifx_gl_init() function

The ifx_gl_init() function initializes the current processing locale for the current program.

Syntax

#include <ifxgls.h>
...
int ifx_gl_init(void)
Valid in client application Valid in DataBlade® UDR
Yes Not needed

Usage

The ifx_gl_init() function initializes a global locale structure that identifies the current processing locale. Because this locale structure is global, the functions do not require the current locale as an argument. Any program that establishes its own connections must call the ifx_gl_init() function before it calls any other functions.

ESQL/C applications establish their own connections to a database server and therefore must call the ifx_gl_init() function before any functions to establish a current processing locale.

DataBlade® client applications establish their own connections to a database server and therefore must call the ifx_gl_init() function before any functions to establish a current processing locale.

However, a DataBlade® UDR executes in the context of an established connection and therefore has an established current processing locale. DataBlade® UDRs are not required to call the ifx_gl_init() function.

For both ESQL/C and DataBlade® client applications, ifx_gl_init() initializes the current processing locale to the client locale.

Return values

0
The function was successful.
-1
The function was not successful, and the error number is set to indicate the cause. See the Errors section.

Errors

If an error occurred, this function returns -1 and sets the ifx_gl_lc_errno() error number to one of the following values.
IFX_GL_PARAMERR
Either specifiers for locale or code-set conversion (such as GLS environment variables) are incorrect, or the code-set name registry file could not be found.
IFX_GL_ENOMEM
Not enough memory is available to allocate a new locale object or a new code-set-conversion object.
IFX_GL_FILEERR
The locale or code-set conversion file could not be found, is not readable, or has the wrong format.
IFX_GL_INVALIDLOC
An attempt to create a locale with incompatible code sets occurred.
IFX_GL_ELOCTOOWIDE
The locale contains characters that are wider than the library allows.
IFX_GL_BADOBJVER
The locale object version is not compatible with the current library.
IFX_GL_BADFILEFORM
Bad format was found in the code-set registry file.