locale_settings/ffi/
mod.rs

1/*!
2Bindings to POSIX API for locale data.
3
4All submodules of `ffi` are generated with bindgen using a wrapper script
5`create-bindings.sh` at the root of the Git repo.
6
7**Do not modify these modules directly by hand.**
8*/
9
10// ------------------------------------------------------------------------------------------------
11// Public Modules
12// ------------------------------------------------------------------------------------------------
13
14#[cfg(target_os = "macos")]
15mod macos;
16#[cfg(target_os = "macos")]
17mod _macos {
18    pub use super::macos::langinfo::{nl_item, nl_langinfo};
19    pub use super::macos::langinfo::{
20        ABDAY_1, ABDAY_2, ABDAY_3, ABDAY_4, ABDAY_5, ABDAY_6, ABDAY_7, ABMON_1, ABMON_10, ABMON_11,
21        ABMON_12, ABMON_2, ABMON_3, ABMON_4, ABMON_5, ABMON_6, ABMON_7, ABMON_8, ABMON_9,
22        ALT_DIGITS, AM_STR, CODESET, CRNCYSTR, DAY_1, DAY_2, DAY_3, DAY_4, DAY_5, DAY_6, DAY_7,
23        D_FMT, D_MD_ORDER, D_T_FMT, ERA, ERA_D_FMT, ERA_D_T_FMT, ERA_T_FMT, MON_1, MON_10, MON_11,
24        MON_12, MON_2, MON_3, MON_4, MON_5, MON_6, MON_7, MON_8, MON_9, NOEXPR, NOSTR, PM_STR,
25        RADIXCHAR, THOUSEP, T_FMT, T_FMT_AMPM, YESEXPR, YESSTR,
26    };
27
28    pub use super::macos::locale::{lconv, localeconv, setlocale};
29    pub use super::macos::locale::{
30        LC_ALL, LC_COLLATE, LC_CTYPE, LC_MESSAGES, LC_MONETARY, LC_NUMERIC, LC_TIME,
31    };
32
33    pub use super::macos::xlocale::{
34        ___mb_cur_max, duplocale, freelocale, locale_t, newlocale, uselocale,
35    };
36    pub use super::macos::xlocale::{
37        LC_COLLATE_MASK, LC_CTYPE_MASK, LC_MESSAGES_MASK, LC_MONETARY_MASK, LC_NUMERIC_MASK,
38        LC_TIME_MASK,
39    };
40}
41#[cfg(target_os = "macos")]
42pub(crate) use _macos::*;
43
44#[cfg(target_os = "linux")]
45mod linux;
46#[cfg(target_os = "linux")]
47mod _linux {
48    pub use super::linux::langinfo::{nl_item, nl_langinfo};
49    pub use super::linux::langinfo::{
50        ABDAY_1, ABDAY_2, ABDAY_3, ABDAY_4, ABDAY_5, ABDAY_6, ABDAY_7, ABMON_1, ABMON_10, ABMON_11,
51        ABMON_12, ABMON_2, ABMON_3, ABMON_4, ABMON_5, ABMON_6, ABMON_7, ABMON_8, ABMON_9,
52        ALT_DIGITS, AM_STR, DAY_1, DAY_2, DAY_3, DAY_4, DAY_5, DAY_6, DAY_7, D_FMT, D_T_FMT, ERA,
53        ERA_D_FMT, ERA_D_T_FMT, ERA_T_FMT, MON_1, MON_10, MON_11, MON_12, MON_2, MON_3, MON_4,
54        MON_5, MON_6, MON_7, MON_8, MON_9, PM_STR, RADIXCHAR, THOUSEP, T_FMT, T_FMT_AMPM,
55        _NL_CTYPE_CODESET_NAME as CODESET, _NL_MONETARY_CRNCYSTR as CRNCYSTR, __NOEXPR as NOEXPR,
56        __NOSTR as NOSTR, __YESEXPR as YESEXPR, __YESSTR as YESSTR,
57    };
58    pub use super::linux::locale::{
59        duplocale, freelocale, lconv, locale_t, localeconv, newlocale, setlocale, uselocale,
60    };
61
62    pub use super::linux::locale::{
63        LC_ALL, LC_COLLATE, LC_COLLATE_MASK, LC_CTYPE, LC_CTYPE_MASK, LC_MESSAGES,
64        LC_MESSAGES_MASK, LC_MONETARY, LC_MONETARY_MASK, LC_NUMERIC, LC_NUMERIC_MASK, LC_TIME,
65        LC_TIME_MASK,
66    };
67
68    extern "C" {
69        fn __ctype_get_mb_cur_max() -> usize;
70    }
71    #[allow(non_upper_case_globals)]
72    pub const ___mb_cur_max: unsafe extern "C" fn() -> usize = __ctype_get_mb_cur_max;
73}
74#[cfg(target_os = "linux")]
75pub(crate) use _linux::*;
76
77pub(crate) mod utils;