newlocale()

Creates a new locale 

Function


SYNOPSIS

#include <locale.h>

locale_t newlocale(int mask, const char * locale, locale_t base);


DESCRIPTION

Creates a new locale, inheriting some properties from an existing base locale. The mask defines the components that the new locale will have set to the locale with the name specified in the locale parameter. Any other components will be inherited from base. The mask is either LC_ALL_MASK, indicating all possible locale components, or the logical OR of some combination of the following:

LC_COLLATE_MASK  
The locale for string collation routines. This controls alphabetic ordering in strcoll() and strxfrm().
LC_CTYPE_MASK 
The locale for the ctype() and multibyte() functions. This controls recognition of upper and lower case, alphabetic or non-alphabetic characters, and so on.
LC_MESSAGES_MASK  
Set a locale for message catalogs, see catopen() function.
LC_MONETARY_MASK  
Set a locale for formatting monetary values; this affects the localeconv() function.
LC_NUMERIC_MASK  
Set a locale for formatting numbers. This controls the formatting of decimal points in input and output of floating point numbers in functions such as printf() and scanf(), as well as values returned by localeconv().
LC_TIME_MASK  
Set a locale for formatting dates and times using the strftime() function. This function uses the same rules for loading locale components as setlocale().


RETURN VALUE

Returns a new, valid, locale_t or NULL if an error occurs. You must free the returned locale with freelocale().


Standards Conformance

The function conforms to IEEE Std 1003.1-2008 'POSIX.1'


SEE ALSO

Functions:
duplocale(), freelocale(), localeconv(), querylocale(), uselocale(), xlocale()


PTC MKS Toolkit 10.5 Documentation Build 40.