]>
Commit | Line | Data |
---|---|---|
392f76cf GB |
1 | #ifndef UTIL_LINUX_NLS_H |
2 | #define UTIL_LINUX_NLS_H | |
3 | ||
66ee8158 | 4 | int main(int argc, char *argv[]); |
7eda085c | 5 | |
7eda085c KZ |
6 | #ifndef LOCALEDIR |
7 | #define LOCALEDIR "/usr/share/locale" | |
8 | #endif | |
9 | ||
8b7f16fc MF |
10 | #ifdef HAVE_LOCALE_H |
11 | # include <locale.h> | |
12 | #else | |
13 | # undef setlocale | |
14 | # define setlocale(Category, Locale) /* empty */ | |
ab65d635 | 15 | struct lconv |
16 | { | |
17 | char *decimal_point; | |
18 | }; | |
19 | # undef localeconv | |
20 | # define localeconv() NULL | |
8b7f16fc MF |
21 | #endif |
22 | ||
7095232d | 23 | |
48d7b13a | 24 | #ifdef ENABLE_NLS |
7eda085c | 25 | # include <libintl.h> |
7095232d KZ |
26 | /* |
27 | * For NLS support in the public shared libraries we have to specify text | |
73afd3f8 | 28 | * domain name to be independent on the main program. For this purpose define |
7095232d KZ |
29 | * UL_TEXTDOMAIN_EXPLICIT before you include nls.h to your shared library code. |
30 | */ | |
31 | # ifdef UL_TEXTDOMAIN_EXPLICIT | |
32 | # define _(Text) dgettext (UL_TEXTDOMAIN_EXPLICIT, Text) | |
33 | # else | |
34 | # define _(Text) gettext (Text) | |
35 | # endif | |
7eda085c KZ |
36 | # ifdef gettext_noop |
37 | # define N_(String) gettext_noop (String) | |
38 | # else | |
39 | # define N_(String) (String) | |
40 | # endif | |
27cc2547 | 41 | # define P_(Singular, Plural, n) ngettext (Singular, Plural, n) |
7eda085c KZ |
42 | #else |
43 | # undef bindtextdomain | |
44 | # define bindtextdomain(Domain, Directory) /* empty */ | |
45 | # undef textdomain | |
46 | # define textdomain(Domain) /* empty */ | |
47 | # define _(Text) (Text) | |
48 | # define N_(Text) (Text) | |
27cc2547 | 49 | # define P_(Singular, Plural, n) ((n) == 1 ? (Singular) : (Plural)) |
7095232d | 50 | #endif /* ENABLE_NLS */ |
7eda085c | 51 | |
dc61d398 KZ |
52 | #ifdef HAVE_LANGINFO_H |
53 | # include <langinfo.h> | |
54 | #else | |
55 | ||
56 | typedef int nl_item; | |
57 | extern char *langinfo_fallback(nl_item item); | |
58 | ||
59 | # define nl_langinfo langinfo_fallback | |
60 | ||
61 | enum { | |
62 | CODESET = 1, | |
63 | RADIXCHAR, | |
64 | THOUSEP, | |
65 | D_T_FMT, | |
66 | D_FMT, | |
67 | T_FMT, | |
68 | T_FMT_AMPM, | |
69 | AM_STR, | |
70 | PM_STR, | |
71 | ||
72 | DAY_1, | |
73 | DAY_2, | |
74 | DAY_3, | |
75 | DAY_4, | |
76 | DAY_5, | |
77 | DAY_6, | |
78 | DAY_7, | |
79 | ||
80 | ABDAY_1, | |
81 | ABDAY_2, | |
82 | ABDAY_3, | |
83 | ABDAY_4, | |
84 | ABDAY_5, | |
85 | ABDAY_6, | |
86 | ABDAY_7, | |
87 | ||
88 | MON_1, | |
89 | MON_2, | |
90 | MON_3, | |
91 | MON_4, | |
92 | MON_5, | |
93 | MON_6, | |
94 | MON_7, | |
95 | MON_8, | |
96 | MON_9, | |
97 | MON_10, | |
98 | MON_11, | |
99 | MON_12, | |
100 | ||
101 | ABMON_1, | |
102 | ABMON_2, | |
103 | ABMON_3, | |
104 | ABMON_4, | |
105 | ABMON_5, | |
106 | ABMON_6, | |
107 | ABMON_7, | |
108 | ABMON_8, | |
109 | ABMON_9, | |
110 | ABMON_10, | |
111 | ABMON_11, | |
112 | ABMON_12, | |
113 | ||
114 | ERA_D_FMT, | |
115 | ERA_D_T_FMT, | |
116 | ERA_T_FMT, | |
117 | ALT_DIGITS, | |
118 | CRNCYSTR, | |
119 | YESEXPR, | |
120 | NOEXPR | |
121 | }; | |
122 | ||
123 | #endif /* !HAVE_LANGINFO_H */ | |
124 | ||
4e12a62e RL |
125 | #ifndef HAVE_LANGINFO_ALTMON |
126 | # define ALTMON_1 MON_1 | |
127 | # define ALTMON_2 MON_2 | |
128 | # define ALTMON_3 MON_3 | |
129 | # define ALTMON_4 MON_4 | |
130 | # define ALTMON_5 MON_5 | |
131 | # define ALTMON_6 MON_6 | |
132 | # define ALTMON_7 MON_7 | |
133 | # define ALTMON_8 MON_8 | |
134 | # define ALTMON_9 MON_9 | |
135 | # define ALTMON_10 MON_10 | |
136 | # define ALTMON_11 MON_11 | |
137 | # define ALTMON_12 MON_12 | |
138 | #endif /* !HAVE_LANGINFO_ALTMON */ | |
139 | ||
140 | #ifndef HAVE_LANGINFO_NL_ABALTMON | |
141 | # define _NL_ABALTMON_1 ABMON_1 | |
142 | # define _NL_ABALTMON_2 ABMON_2 | |
143 | # define _NL_ABALTMON_3 ABMON_3 | |
144 | # define _NL_ABALTMON_4 ABMON_4 | |
145 | # define _NL_ABALTMON_5 ABMON_5 | |
146 | # define _NL_ABALTMON_6 ABMON_6 | |
147 | # define _NL_ABALTMON_7 ABMON_7 | |
148 | # define _NL_ABALTMON_8 ABMON_8 | |
149 | # define _NL_ABALTMON_9 ABMON_9 | |
150 | # define _NL_ABALTMON_10 ABMON_10 | |
151 | # define _NL_ABALTMON_11 ABMON_11 | |
152 | # define _NL_ABALTMON_12 ABMON_12 | |
153 | #endif /* !HAVE_LANGINFO_NL_ABALTMON */ | |
154 | ||
392f76cf | 155 | #endif /* UTIL_LINUX_NLS_H */ |