nl_init(S)
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)
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),
locale(M),
setlocale(S)
Standards conformance
nl_init is obsolete and may not be supported
on future releases. Use
setlocale(S)
instead.
© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003