NL_INIT(3C)

NAME
nl_init - initialize NLS operation

SYNOPSIS

int nl_init (lang)
char *lang;

DESCRIPTION

nl_init() initializes NLS operation for the language identified by lang, which is a pointer to a string containing settings of language, territory and codeset as defined for the LANG environment variable (see environ (5V)).

Typically, nl_init() is used to bind program operation to the user's specified language requirements, that is

    nl_init (getenv ("LANG"));

A call to nl_init() will fail if the string pointed to by lang does not identify a valid language/territory/codeset combination. If nl_init() has already been called successfully, operation will continue for the language identified on the last successful call. Otherwise, if nl_init() has not already been called successfully, the various NLS library functions will each revert to their own default mode of operation.

RETURN VALUE

If successful, nl_init() returns 0, otherwise, -1 is returned.

SEE ALSO
getenv(3V), environ(5V)

APPLICATION USAGE

An internationalized application program will not provide the correct language operation until nl_init() has been called successfully. Subsequent calls to nl_init() can be used to switch operation from one supported language to another.