nl_langinfo3
Language information
Usage
#include <langinfo.h>
char *
nl_langinfo(nl_item item);
#include <langinfo.h>
#include <xlocale.h>
char *
nl_langinfo_l(nl_item item, locale_t loc);
Library
Standard C Library (libc, -lc)
Overview
The nl_langinfo() function returns a pointer to a string containing information relevant to the particular language or cultural area defined in the program's locale. The manifest constant names and values of item are defined in ⟨langinfo.h⟩.
Calls to setlocale() with a category corresponding to the category of item, or to the category LC_ALL, may overwrite the buffer pointed to by the return value.
Return values
In a locale where langinfo data is not defined, nl_langinfo() returns a pointer to the corresponding string in the POSIX locale. In all locales, nl_langinfo() returns a pointer to an empty string if item contains an invalid setting.
Examples
For example:
nl_langinfo(ABDAY_1)
would return a pointer to the string "Dom" if the identified language was Portuguese, and "Sun" if the identified language was English.
While the nl_langinfo() function uses the current locale, the nl_langinfo_l() function may be passed a locale directly. See xlocale(3) for more information.
Releases
163 releases since Mac OS X 10.0; the text changed 5 times.