Guardian C Library Calls Reference Manual

setlocale
3-160 128833Guardian TNS C Library Calls Reference Manual
Reference to Library Calls
setlocale
The setlocale function sets the specified category to the named locale. The setlocale
function can be used to change or query the program’s entire current locale or only
portions of the current locale.
category
specifies the behavior to be changed. The various categories that can be changed are
defined in the locale category macro in the header localeh and described here in the
Usage Guidelines.
locale
names the locale whose conventions are to be used for the behavior designated by
category. The locale can be NULL, the empty string “”, or a case insensitive quoted
string. For this release, any quoted strings are accepted.
Return Value
For this release, the return value is always “C”, if the category and locale arguments
are valid. The return value of “C” specifies the standard C locale.
Usage Guidelines
If locale is NULL, the function does not change the locale but instead returns a
pointer to a string that is the name of the current locale for the indicated category.
This name is such that if the setlocale function is later called using the same value
for category and the returned string as the value for locale, then the effect is to
change the behavior to the one that was in effect when setlocale was called with the
NULL locale.
If locale is not NULL, setlocale changes the current locale and returns a string that
names the new locale.
For this release of the C compiler, the standard C locale is the only locale. The
setlocale function returns “C” if the arguments category and locale are valid.
#include <localeh>
char *setlocale(int category, const char *locale);