bigbiff bigbiff | e60683a | 2013-02-22 20:55:50 -0500 | [diff] [blame] | 1 | #ifndef UTIL_LINUX_NLS_H |
| 2 | #define UTIL_LINUX_NLS_H |
| 3 | |
| 4 | int main(int argc, char *argv[]); |
| 5 | |
| 6 | #ifndef LOCALEDIR |
| 7 | #define LOCALEDIR "/usr/share/locale" |
| 8 | #endif |
| 9 | |
| 10 | #ifdef HAVE_LOCALE_H |
| 11 | # include <locale.h> |
| 12 | #else |
| 13 | # undef setlocale |
| 14 | # define setlocale(Category, Locale) /* empty */ |
| 15 | struct lconv |
| 16 | { |
| 17 | char *decimal_point; |
| 18 | }; |
| 19 | # undef localeconv |
| 20 | # define localeconv() NULL |
| 21 | #endif |
| 22 | |
| 23 | #ifdef ENABLE_NLS |
| 24 | # include <libintl.h> |
| 25 | # define _(Text) gettext (Text) |
| 26 | # ifdef gettext_noop |
| 27 | # define N_(String) gettext_noop (String) |
| 28 | # else |
| 29 | # define N_(String) (String) |
| 30 | # endif |
| 31 | # define P_(Singular, Plural, n) ngettext (Singular, Plural, n) |
| 32 | #else |
| 33 | # undef bindtextdomain |
| 34 | # define bindtextdomain(Domain, Directory) /* empty */ |
| 35 | # undef textdomain |
| 36 | # define textdomain(Domain) /* empty */ |
| 37 | # define _(Text) (Text) |
| 38 | # define N_(Text) (Text) |
| 39 | # define P_(Singular, Plural, n) ((n) == 1 ? (Singular) : (Plural)) |
| 40 | #endif |
| 41 | |
| 42 | #ifdef HAVE_LANGINFO_H |
| 43 | # include <langinfo.h> |
| 44 | #else |
| 45 | |
| 46 | typedef int nl_item; |
| 47 | extern char *langinfo_fallback(nl_item item); |
| 48 | |
| 49 | # define nl_langinfo langinfo_fallback |
| 50 | |
| 51 | enum { |
| 52 | CODESET = 1, |
| 53 | RADIXCHAR, |
| 54 | THOUSEP, |
| 55 | D_T_FMT, |
| 56 | D_FMT, |
| 57 | T_FMT, |
| 58 | T_FMT_AMPM, |
| 59 | AM_STR, |
| 60 | PM_STR, |
| 61 | |
| 62 | DAY_1, |
| 63 | DAY_2, |
| 64 | DAY_3, |
| 65 | DAY_4, |
| 66 | DAY_5, |
| 67 | DAY_6, |
| 68 | DAY_7, |
| 69 | |
| 70 | ABDAY_1, |
| 71 | ABDAY_2, |
| 72 | ABDAY_3, |
| 73 | ABDAY_4, |
| 74 | ABDAY_5, |
| 75 | ABDAY_6, |
| 76 | ABDAY_7, |
| 77 | |
| 78 | MON_1, |
| 79 | MON_2, |
| 80 | MON_3, |
| 81 | MON_4, |
| 82 | MON_5, |
| 83 | MON_6, |
| 84 | MON_7, |
| 85 | MON_8, |
| 86 | MON_9, |
| 87 | MON_10, |
| 88 | MON_11, |
| 89 | MON_12, |
| 90 | |
| 91 | ABMON_1, |
| 92 | ABMON_2, |
| 93 | ABMON_3, |
| 94 | ABMON_4, |
| 95 | ABMON_5, |
| 96 | ABMON_6, |
| 97 | ABMON_7, |
| 98 | ABMON_8, |
| 99 | ABMON_9, |
| 100 | ABMON_10, |
| 101 | ABMON_11, |
| 102 | ABMON_12, |
| 103 | |
| 104 | ERA_D_FMT, |
| 105 | ERA_D_T_FMT, |
| 106 | ERA_T_FMT, |
| 107 | ALT_DIGITS, |
| 108 | CRNCYSTR, |
| 109 | YESEXPR, |
| 110 | NOEXPR |
| 111 | }; |
| 112 | |
| 113 | #endif /* !HAVE_LANGINFO_H */ |
| 114 | |
| 115 | #endif /* UTIL_LINUX_NLS_H */ |