1nl_langinfo(3C) Standard C Library Functions nl_langinfo(3C)
2
3
4
6 nl_langinfo - language information
7
9 #include <langinfo.h>
10
11 char *nl_langinfo(nl_item item);
12
13
15 The nl_langinfo() function returns a pointer to a null-terminated
16 string containing information relevant to a particular language or cul‐
17 tural area defined in the programs locale. The manifest constant names
18 and values of item are defined by <langinfo.h>. For example:
19
20
21 nl_langinfo (ABDAY_1);
22
23
24 would return a pointer to the string "Dim" if the identified language
25 was French and a French locale was correctly installed; or "Sun" if the
26 identified language was English.
27
29 If setlocale(3C) has not been called successfully, or if data for a
30 supported language is either not available, or if item is not defined
31 therein, then nl_langinfo() returns a pointer to the corresponding
32 string in the C locale. In all locales, nl_langinfo() returns a
33 pointer to an empty string if item contains an invalid setting.
34
36 The nl_langinfo() function can be used safely in multithreaded applica‐
37 tions, as long as setlocale(3C) is not being called to change the
38 locale.
39
41 See attributes(5) for descriptions of the following attributes:
42
43
44
45
46 ┌─────────────────────────────┬─────────────────────────────┐
47 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
48 ├─────────────────────────────┼─────────────────────────────┤
49 │CSI │Enabled │
50 ├─────────────────────────────┼─────────────────────────────┤
51 │Interface Stability │Standard │
52 ├─────────────────────────────┼─────────────────────────────┤
53 │MT-Level │MT-Safe with exceptions │
54 └─────────────────────────────┴─────────────────────────────┘
55
57 setlocale(3C), langinfo.h(3HEAD), nl_types.h(3HEAD), attributes(5),
58 standards(5)
59
61 The array pointed to by the return value should not be modified by the
62 program. Subsequent calls to nl_langinfo() may overwrite the array.
63
64
65
66SunOS 5.11 24 Jul 2002 nl_langinfo(3C)