NL_LANGINFO(3C) Standard C Library Functions NL_LANGINFO(3C)

nl_langinfo, nl_langinfo_l - language information

#include <langinfo.h>
char *nl_langinfo(nl_item item);

char *nl_langinfo_l(nl_item item, locale_t loc);

The nl_langinfo() function returns a pointer to a null-terminated string containing information relevant to a particular language or cultural area defined in the programs locale. The manifest constant names and values of item are defined by <langinfo.h>. For example:

nl_langinfo(ABDAY_1);

would return a pointer to the string "Dim" if the identified language was French and a French locale was correctly installed; or "Sun" if the identified language was English.

The function nl_langinfo_l() behaves identically to nl_langinfo(), except instead of acting in the current locale, it instead acts in the locale specified by loc.

If the locale has not been set or is invalid, or if data for a supported language is either not available, or if item is not defined therein, then these functions return a pointer to the corresponding string in the C locale. In all locales, they return a pointer to an empty string if item contains an invalid setting.

See attributes(7) for descriptions of the following attributes:

ATTRIBUTE TYPE ATTRIBUTE VALUE
CSI Enabled
Interface Stability Standard
MT-Level MT-Safe

newlocale(3C), setlocale(3C), uselocale(3C), langinfo.h(3HEAD), nl_types.h(3HEAD), attributes(7), standards(7)

The array pointed to by the return value should not be modified by the program. Subsequent calls to these functions may overwrite the array.

June 24, 2014 OmniOS