|NEWLOCALE(3C)||Standard C Library Functions||NEWLOCALE(3C)|
#include <locale.h> locale_t newlocale(int category_mask, const char *locale, locale_t base);
locale_t duplocale(locale_t loc);
void freelocale(locale_t loc);
The function newlocale() can be used to create a new locale object. It can also be used to modify an existing locale object, the new locale object will be a replacement for the modified locale object. To create a new locale, the argument base should be passed the special argument (locale_t)0. This will use a copy of the current global locale as a starting point. To modify an existing locale object, it should be passed in as the argument base. The new locale object is constructed by taking the categories specified in category_mask from the locale specified by the string locale, and filling in the remaining categories from the locale base. When newlocale() returns, callers must no longer use base and assume that freelocale(3C) has been called on it. In addition to locales defined on the system, the following three locales may always be passed in as the string locale:
The function duplocale() duplicates the locale object specified by loc. If the locale object passed is LC_GLOBAL_LOCALE, duplocale() creates a copy of the current global locale as defined through calls to setlocale(3C).
The function freelocale() removes and releases all resources associated with the locale object loc. Programs must not call freelocale() on LC_GLOBAL_LOCALE.
The newlocale() function will fail if:
|ATTRIBUTE TYPE||ATTRIBUTE VALUE|
|November 26, 2017||OmniOS|