DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

nl_init(S-osr5)


nl_init -- initializes native language support operation

Syntax

cc -a ods30 . . . -lc

int nl_init (lang)
char * lang;

Description

The nl_init routine is provided as an alternative interface to the setlocale(S-osr5) routine, for programs written to the X/OPEN Portability Guide, Issue 2, standard. However, nl_init has been withdrawn from XPG3.

The nl_init routine initializes native language support 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(M)).

Typically, nl_init is used to bind program operation to the user's specified language requirements, for example:

   nl_init(getenv("LANG"));
A call to nl_init fails if the string pointed to by lang does not identify a valid language/territory/codeset combination. In this case, operation continues for the language identified on the last successful call.

Return value

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

Notes

Calls to nl_init can be used to switch operation from one supported language to another. It is not necessary to call nl_init to set the initial language for an application; this is done by the automatic setlocale call at program startup.

The nl_init routine is not as flexible an interface as that provided by setlocale.

See also

environ(M), getenv(S-osr5), locale(M), setlocale(S-osr5)

Standards conformance

nl_init is obsolete and may not be supported on future releases. Use setlocale(S-osr5) instead.
© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 02 June 2005