diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c29c274f..e2bd656e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,4 @@ -name: rust_icu default feature set +name: Test on: push: branches: [ master ] @@ -19,11 +19,28 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - # This test matrix should be backfilled with more version/feature combos. - # I think any other combinations will fail today. We should fix those - # combinations, then expand this matrix. icu_version: [63, 64, 65, 67] - feature_set: ["renaming icu_version_in_env"] + feature_set: ["renaming,icu_version_in_env"] + steps: + - uses: actions/checkout@v2 + - name: Test ICU version ${{ matrix.icu_version }} + run: make DOCKER_TEST_ENV=rust_icu_testenv-${{ matrix.icu_version }} RUST_ICU_MAJOR_VERSION_NUMBER=${{ matrix.icu_version }} DOCKER_TEST_CARGO_TEST_ARGS="--no-default-features --features ${{ matrix.feature_set }}" docker-test + test-64-plus-features: + runs-on: ubuntu-latest + strategy: + matrix: + icu_version: [64, 65] + feature_set: ["renaming,icu_version_in_env,icu_version_64_plus"] + steps: + - uses: actions/checkout@v2 + - name: Test ICU version ${{ matrix.icu_version }} + run: make DOCKER_TEST_ENV=rust_icu_testenv-${{ matrix.icu_version }} RUST_ICU_MAJOR_VERSION_NUMBER=${{ matrix.icu_version }} DOCKER_TEST_CARGO_TEST_ARGS="--no-default-features --features ${{ matrix.feature_set }}" docker-test + test-67-plus-features: + runs-on: ubuntu-latest + strategy: + matrix: + icu_version: [67] + feature_set: ["renaming,icu_version_in_env,icu_version_64_plus,icu_version_67_plus"] steps: - uses: actions/checkout@v2 - name: Test ICU version ${{ matrix.icu_version }} diff --git a/Cargo.toml b/Cargo.toml index fda4f636..ff6a9777 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,9 +9,9 @@ members = [ "rust_icu_udat", "rust_icu_udata", "rust_icu_uenum", + "rust_icu_ulistformatter", "rust_icu_uloc", "rust_icu_umsg", "rust_icu_ustring", "rust_icu_utext", ] - diff --git a/Makefile b/Makefile index 3ea88e49..e7e35933 100644 --- a/Makefile +++ b/Makefile @@ -126,6 +126,7 @@ publish: $(call publish,rust_icu_udata) $(call publish,rust_icu_ucol) $(call publish,rust_icu_umsg) + $(call publish,rust_icu_ulistformatter) $(call publish,rust_icu) # A helper to up-rev the cargo crate versions. @@ -154,6 +155,7 @@ uprev: $(call uprev,rust_icu_umsg) $(call uprev,rust_icu_intl) $(call uprev,rust_icu_ucol) + $(call uprev,rust_icu_ulistformatter) $(call uprev,rust_icu) cov: diff --git a/README.md b/README.md index c0b01256..27d40cc6 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ | Item | Description | | ---- | ----------- | -| ICU 64..67 | [![Build Status `master`](https://travis-ci.org/google/rust_icu.svg?branch=master)](https://travis-ci.org/google/rust_icu) | +| ICU 64..67 | [![Test status](https://github.com/google/rust_icu/workflows/Test/badge.svg)](https://github.com/google/rust_icu/workflows/Test/badge.svg) | | Source | https://github.com/google/rust_icu | | README | https://github.com/google/rust_icu/blob/master/README.md | | Coverage | [View report](/coverage/report.md) @@ -48,6 +48,7 @@ coverage in the headers. | [rust_icu](https://crates.io/crates/rust_icu)| Top-level crate. Include this if you just want to have all the functionality available for use. | | [rust_icu_common](https://crates.io/crates/rust_icu_common)| Commonly used low-level wrappings of the bindings. | | [rust_icu_intl](https://crates.io/crates/rust_icu_intl)| Implements ECMA 402 recommendation APIs. | +| [rust_icu_ulistformatter](https://crates.io/crates/rust_icu_ulistformatter)| Locale-sensitive list formatting support. Implements [`ulistformatter.h`](https://unicode-org.github.io/icu-docs/apidoc/released/icu4c/ulistformatter_8h.html) C API header from the ICU library. | | [rust_icu_sys](https://crates.io/crates/rust_icu_sys)| Low-level bindings code | | [rust_icu_ucal](https://crates.io/crates/rust_icu_ucal)| ICU Calendar. Implements [`ucal.h`](https://unicode-org.github.io/icu-docs/apidoc/released/icu4c/ucal_8h.html) C API header from the ICU library. | | [rust_icu_ucol](https://crates.io/crates/rust_icu_ucol)| Collation support. Implements [`ucol.h`](https://unicode-org.github.io/icu-docs/apidoc/released/icu4c/ucol_8h.html) C API header from the ICU library. | diff --git a/rust_icu/Cargo.toml b/rust_icu/Cargo.toml index 09541079..12f14b3c 100644 --- a/rust_icu/Cargo.toml +++ b/rust_icu/Cargo.toml @@ -21,11 +21,12 @@ paste = "0.1.5" rust_icu_common = { path = "../rust_icu_common", version = "0.2.3", default-features = false } rust_icu_sys = { path = "../rust_icu_sys", version = "0.2.3", default-features = false } rust_icu_ucal = { path = "../rust_icu_ucal", version = "0.2.3", default-features = false } +rust_icu_ucol = { path = "../rust_icu_ucol", version = "0.2.3", default-features = false } rust_icu_udat = { path = "../rust_icu_udat", version = "0.2.3", default-features = false } rust_icu_udata = { path = "../rust_icu_udata", version = "0.2.3", default-features = false } rust_icu_uenum = { path = "../rust_icu_uenum", version = "0.2.3", default-features = false } +rust_icu_ulistformatter = { path = "../rust_icu_ulistformatter", version = "0.2.3", default-features = false } rust_icu_uloc = { path = "../rust_icu_uloc", version = "0.2.3", default-features = false } -rust_icu_ucol = { path = "../rust_icu_ucol", version = "0.2.3", default-features = false } rust_icu_umsg = { path = "../rust_icu_umsg", version = "0.2.3", default-features = false } rust_icu_ustring = { path = "../rust_icu_ustring", version = "0.2.3", default-features = false } rust_icu_utext = { path = "../rust_icu_utext", version = "0.2.3", default-features = false } @@ -43,6 +44,7 @@ use-bindgen = [ "rust_icu_udat/use-bindgen", "rust_icu_udata/use-bindgen", "rust_icu_uenum/use-bindgen", + "rust_icu_ulistformatter/use-bindgen", "rust_icu_uloc/use-bindgen", "rust_icu_umsg/use-bindgen", "rust_icu_ustring/use-bindgen", @@ -56,6 +58,7 @@ renaming = [ "rust_icu_udat/renaming", "rust_icu_udata/renaming", "rust_icu_uenum/renaming", + "rust_icu_ulistformatter/renaming", "rust_icu_uloc/renaming", "rust_icu_umsg/renaming", "rust_icu_ustring/renaming", @@ -69,6 +72,7 @@ icu_config = [ "rust_icu_udat/icu_config", "rust_icu_udata/icu_config", "rust_icu_uenum/icu_config", + "rust_icu_ulistformatter/icu_config", "rust_icu_uloc/icu_config", "rust_icu_umsg/icu_config", "rust_icu_ustring/icu_config", @@ -82,11 +86,40 @@ icu_version_in_env = [ "rust_icu_udat/icu_version_in_env", "rust_icu_udata/icu_version_in_env", "rust_icu_uenum/icu_version_in_env", + "rust_icu_ulistformatter/icu_version_in_env", "rust_icu_uloc/icu_version_in_env", "rust_icu_umsg/icu_version_in_env", "rust_icu_ustring/icu_version_in_env", "rust_icu_utext/icu_version_in_env", ] +icu_version_64_plus = [ + "rust_icu_common/icu_version_64_plus", + "rust_icu_sys/icu_version_64_plus", + "rust_icu_ucal/icu_version_64_plus", + "rust_icu_ucol/icu_version_64_plus", + "rust_icu_udat/icu_version_64_plus", + "rust_icu_udata/icu_version_64_plus", + "rust_icu_uenum/icu_version_64_plus", + "rust_icu_ulistformatter/icu_version_64_plus", + "rust_icu_uloc/icu_version_64_plus", + "rust_icu_umsg/icu_version_64_plus", + "rust_icu_ustring/icu_version_64_plus", + "rust_icu_utext/icu_version_64_plus", +] +icu_version_67_plus = [ + "rust_icu_common/icu_version_67_plus", + "rust_icu_sys/icu_version_67_plus", + "rust_icu_ucal/icu_version_67_plus", + "rust_icu_ucol/icu_version_67_plus", + "rust_icu_udat/icu_version_67_plus", + "rust_icu_udata/icu_version_67_plus", + "rust_icu_uenum/icu_version_67_plus", + "rust_icu_ulistformatter/icu_version_67_plus", + "rust_icu_uloc/icu_version_67_plus", + "rust_icu_umsg/icu_version_67_plus", + "rust_icu_ustring/icu_version_67_plus", + "rust_icu_utext/icu_version_67_plus", +] [badges] maintenance = { status = "actively-developed" } diff --git a/rust_icu/src/lib.rs b/rust_icu/src/lib.rs index b849daac..cf2c661d 100644 --- a/rust_icu/src/lib.rs +++ b/rust_icu/src/lib.rs @@ -34,6 +34,7 @@ //! | rust_icu_udat | icu::dat | //! | rust_icu_udata | icu::data | //! | rust_icu_uenum | icu::enums | +//! | rust_icu_ulistformatter | icu::listformatter | //! | rust_icu_uloc | icu::loc | //! | rust_icu_umsg | icu::msg | //! | rust_icu_ustring | icu::string | @@ -46,6 +47,7 @@ pub use rust_icu_ucol as col; pub use rust_icu_udat as dat; pub use rust_icu_udata as data; pub use rust_icu_uenum as enums; +pub use rust_icu_ulistformatter as listformatter; pub use rust_icu_uloc as loc; pub use rust_icu_umsg as msg; pub use rust_icu_ustring as string; diff --git a/rust_icu_common/Cargo.toml b/rust_icu_common/Cargo.toml index 60a8f493..34e920d4 100644 --- a/rust_icu_common/Cargo.toml +++ b/rust_icu_common/Cargo.toml @@ -29,6 +29,12 @@ use-bindgen = ["rust_icu_sys/use-bindgen"] renaming = ["rust_icu_sys/renaming"] icu_config = ["rust_icu_sys/icu_config"] icu_version_in_env = ["rust_icu_sys/icu_version_in_env"] +icu_version_64_plus = [ + "rust_icu_sys/icu_version_64_plus", +] +icu_version_67_plus = [ + "rust_icu_sys/icu_version_67_plus", +] [badges] maintenance = { status = "actively-developed" } diff --git a/rust_icu_intl/Cargo.toml b/rust_icu_intl/Cargo.toml index be0b2221..e1d11c6e 100644 --- a/rust_icu_intl/Cargo.toml +++ b/rust_icu_intl/Cargo.toml @@ -20,16 +20,54 @@ paste = "0.1.5" rust_icu_common = { path = "../rust_icu_common", version = "0.2.3", default-features = false } rust_icu_sys = { path = "../rust_icu_sys", version = "0.2.3", default-features = false } rust_icu_uloc = { path = "../rust_icu_uloc", version = "0.2.3", default-features = false } -rust_icu_ustring = { path = "../rust_icu_ustring", version = "0.2.3", default-features = false } rust_icu_umsg = { path = "../rust_icu_umsg", version = "0.2.3", default-features = false } +rust_icu_ustring = { path = "../rust_icu_ustring", version = "0.2.3", default-features = false } thiserror = "1.0.9" # See the feature description in ../rust_icu_sys/Cargo.toml for details. [features] default = ["use-bindgen", "renaming", "icu_config"] -use-bindgen = ["rust_icu_sys/use-bindgen", "rust_icu_common/use-bindgen"] -renaming = ["rust_icu_sys/renaming", "rust_icu_common/renaming"] -icu_config = ["rust_icu_sys/icu_config", "rust_icu_common/icu_config"] -icu_version_in_env = ["rust_icu_sys/icu_version_in_env", "rust_icu_common/icu_version_in_env"] +use-bindgen = [ + "rust_icu_common/use-bindgen", + "rust_icu_sys/use-bindgen", + "rust_icu_uloc/use-bindgen", + "rust_icu_umsg/use-bindgen", + "rust_icu_ustring/use-bindgen", +] +renaming = [ + "rust_icu_common/renaming", + "rust_icu_sys/renaming", + "rust_icu_uloc/renaming", + "rust_icu_umsg/renaming", + "rust_icu_ustring/renaming", +] +icu_config = [ + "rust_icu_common/icu_config", + "rust_icu_sys/icu_config", + "rust_icu_uloc/icu_config", + "rust_icu_umsg/icu_config", + "rust_icu_ustring/icu_config", +] +icu_version_in_env = [ + "rust_icu_common/icu_version_in_env", + "rust_icu_sys/icu_version_in_env", + "rust_icu_uloc/icu_version_in_env", + "rust_icu_umsg/icu_version_in_env", + "rust_icu_ustring/icu_version_in_env", +] +icu_version_64_plus = [ + "rust_icu_common/icu_version_64_plus", + "rust_icu_sys/icu_version_64_plus", + "rust_icu_uloc/icu_version_64_plus", + "rust_icu_umsg/icu_version_64_plus", + "rust_icu_ustring/icu_version_64_plus", +] +icu_version_67_plus = [ + "rust_icu_common/icu_version_67_plus", + "rust_icu_sys/icu_version_67_plus", + "rust_icu_uloc/icu_version_67_plus", + "rust_icu_umsg/icu_version_67_plus", + "rust_icu_ustring/icu_version_67_plus", +] diff --git a/rust_icu_sys/Cargo.toml b/rust_icu_sys/Cargo.toml index f8e55f13..d1b844af 100644 --- a/rust_icu_sys/Cargo.toml +++ b/rust_icu_sys/Cargo.toml @@ -38,6 +38,9 @@ use-bindgen = ["bindgen"] renaming = [] icu_config = [] icu_version_in_env = [] +icu_version_64_plus = [] +icu_version_67_plus = [] + [badges] maintenance = { status = "actively-developed" } diff --git a/rust_icu_sys/bindgen/lib_63.rs b/rust_icu_sys/bindgen/lib_63.rs index c32140f8..79e03138 100644 --- a/rust_icu_sys/bindgen/lib_63.rs +++ b/rust_icu_sys/bindgen/lib_63.rs @@ -961,3070 +961,3101 @@ extern "C" { status: *mut UErrorCode, ) -> i32; } +extern "C" { + pub fn u_init_63(status: *mut UErrorCode); +} +extern "C" { + pub fn u_cleanup_63(); +} +pub type UMemAllocFn = ::std::option::Option< + unsafe extern "C" fn( + context: *const ::std::os::raw::c_void, + size: size_t, + ) -> *mut ::std::os::raw::c_void, +>; +pub type UMemReallocFn = ::std::option::Option< + unsafe extern "C" fn( + context: *const ::std::os::raw::c_void, + mem: *mut ::std::os::raw::c_void, + size: size_t, + ) -> *mut ::std::os::raw::c_void, +>; +pub type UMemFreeFn = ::std::option::Option< + unsafe extern "C" fn(context: *const ::std::os::raw::c_void, mem: *mut ::std::os::raw::c_void), +>; +extern "C" { + pub fn u_setMemoryFunctions_63( + context: *const ::std::os::raw::c_void, + a: UMemAllocFn, + r: UMemReallocFn, + f: UMemFreeFn, + status: *mut UErrorCode, + ); +} +pub type UMTX = *mut ::std::os::raw::c_void; +pub type UMtxInitFn = ::std::option::Option< + unsafe extern "C" fn( + context: *const ::std::os::raw::c_void, + mutex: *mut UMTX, + status: *mut UErrorCode, + ), +>; +pub type UMtxFn = ::std::option::Option< + unsafe extern "C" fn(context: *const ::std::os::raw::c_void, mutex: *mut UMTX), +>; +extern "C" { + pub fn u_setMutexFunctions_63( + context: *const ::std::os::raw::c_void, + init: UMtxInitFn, + destroy: UMtxFn, + lock: UMtxFn, + unlock: UMtxFn, + status: *mut UErrorCode, + ); +} +pub type UMtxAtomicFn = ::std::option::Option< + unsafe extern "C" fn(context: *const ::std::os::raw::c_void, p: *mut i32) -> i32, +>; +extern "C" { + pub fn u_setAtomicIncDecFunctions_63( + context: *const ::std::os::raw::c_void, + inc: UMtxAtomicFn, + dec: UMtxAtomicFn, + status: *mut UErrorCode, + ); +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] +pub enum UCharIteratorOrigin { + UITER_START = 0, + UITER_CURRENT = 1, + UITER_LIMIT = 2, + UITER_ZERO = 3, + UITER_LENGTH = 4, +} +pub type UCharIteratorGetIndex = ::std::option::Option< + unsafe extern "C" fn(iter: *mut UCharIterator, origin: UCharIteratorOrigin) -> i32, +>; +pub type UCharIteratorMove = ::std::option::Option< + unsafe extern "C" fn(iter: *mut UCharIterator, delta: i32, origin: UCharIteratorOrigin) -> i32, +>; +pub type UCharIteratorHasNext = + ::std::option::Option UBool>; +pub type UCharIteratorHasPrevious = + ::std::option::Option UBool>; +pub type UCharIteratorCurrent = + ::std::option::Option UChar32>; +pub type UCharIteratorNext = + ::std::option::Option UChar32>; +pub type UCharIteratorPrevious = + ::std::option::Option UChar32>; +pub type UCharIteratorReserved = + ::std::option::Option i32>; +pub type UCharIteratorGetState = + ::std::option::Option u32>; +pub type UCharIteratorSetState = ::std::option::Option< + unsafe extern "C" fn(iter: *mut UCharIterator, state: u32, pErrorCode: *mut UErrorCode), +>; #[repr(C)] -#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, PartialEq)] -pub struct UFieldPosition { - pub field: i32, - pub beginIndex: i32, - pub endIndex: i32, +#[derive(Debug, Copy, Clone, Hash, PartialOrd, PartialEq)] +pub struct UCharIterator { + pub context: *const ::std::os::raw::c_void, + pub length: i32, + pub start: i32, + pub index: i32, + pub limit: i32, + pub reservedField: i32, + pub getIndex: UCharIteratorGetIndex, + pub move_: UCharIteratorMove, + pub hasNext: UCharIteratorHasNext, + pub hasPrevious: UCharIteratorHasPrevious, + pub current: UCharIteratorCurrent, + pub next: UCharIteratorNext, + pub previous: UCharIteratorPrevious, + pub reservedFn: UCharIteratorReserved, + pub getState: UCharIteratorGetState, + pub setState: UCharIteratorSetState, } #[test] -fn bindgen_test_layout_UFieldPosition() { +fn bindgen_test_layout_UCharIterator() { assert_eq!( - ::std::mem::size_of::(), - 12usize, - concat!("Size of: ", stringify!(UFieldPosition)) + ::std::mem::size_of::(), + 112usize, + concat!("Size of: ", stringify!(UCharIterator)) ); assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(UFieldPosition)) + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(UCharIterator)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).field as *const _ as usize }, + unsafe { &(*(::std::ptr::null::())).context as *const _ as usize }, 0usize, concat!( "Offset of field: ", - stringify!(UFieldPosition), + stringify!(UCharIterator), "::", - stringify!(field) + stringify!(context) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).beginIndex as *const _ as usize }, - 4usize, + unsafe { &(*(::std::ptr::null::())).length as *const _ as usize }, + 8usize, concat!( "Offset of field: ", - stringify!(UFieldPosition), + stringify!(UCharIterator), "::", - stringify!(beginIndex) + stringify!(length) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).endIndex as *const _ as usize }, - 8usize, + unsafe { &(*(::std::ptr::null::())).start as *const _ as usize }, + 12usize, concat!( "Offset of field: ", - stringify!(UFieldPosition), + stringify!(UCharIterator), "::", - stringify!(endIndex) + stringify!(start) ) ); -} -#[repr(C)] -#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, PartialEq)] -pub struct UParseError { - pub line: i32, - pub offset: i32, - pub preContext: [UChar; 16usize], - pub postContext: [UChar; 16usize], -} -#[test] -fn bindgen_test_layout_UParseError() { assert_eq!( - ::std::mem::size_of::(), - 72usize, - concat!("Size of: ", stringify!(UParseError)) + unsafe { &(*(::std::ptr::null::())).index as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(UCharIterator), + "::", + stringify!(index) + ) ); assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(UParseError)) + unsafe { &(*(::std::ptr::null::())).limit as *const _ as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(UCharIterator), + "::", + stringify!(limit) + ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).line as *const _ as usize }, - 0usize, + unsafe { &(*(::std::ptr::null::())).reservedField as *const _ as usize }, + 24usize, concat!( "Offset of field: ", - stringify!(UParseError), + stringify!(UCharIterator), "::", - stringify!(line) + stringify!(reservedField) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).offset as *const _ as usize }, - 4usize, + unsafe { &(*(::std::ptr::null::())).getIndex as *const _ as usize }, + 32usize, concat!( "Offset of field: ", - stringify!(UParseError), + stringify!(UCharIterator), "::", - stringify!(offset) + stringify!(getIndex) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).preContext as *const _ as usize }, - 8usize, + unsafe { &(*(::std::ptr::null::())).move_ as *const _ as usize }, + 40usize, concat!( "Offset of field: ", - stringify!(UParseError), + stringify!(UCharIterator), "::", - stringify!(preContext) + stringify!(move_) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).postContext as *const _ as usize }, - 40usize, + unsafe { &(*(::std::ptr::null::())).hasNext as *const _ as usize }, + 48usize, concat!( "Offset of field: ", - stringify!(UParseError), + stringify!(UCharIterator), "::", - stringify!(postContext) + stringify!(hasNext) ) ); -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UDisplayContextType { - UDISPCTX_TYPE_DIALECT_HANDLING = 0, - UDISPCTX_TYPE_CAPITALIZATION = 1, - UDISPCTX_TYPE_DISPLAY_LENGTH = 2, - UDISPCTX_TYPE_SUBSTITUTE_HANDLING = 3, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UDisplayContext { - UDISPCTX_STANDARD_NAMES = 0, - UDISPCTX_DIALECT_NAMES = 1, - UDISPCTX_CAPITALIZATION_NONE = 256, - UDISPCTX_CAPITALIZATION_FOR_MIDDLE_OF_SENTENCE = 257, - UDISPCTX_CAPITALIZATION_FOR_BEGINNING_OF_SENTENCE = 258, - UDISPCTX_CAPITALIZATION_FOR_UI_LIST_OR_MENU = 259, - UDISPCTX_CAPITALIZATION_FOR_STANDALONE = 260, - UDISPCTX_LENGTH_FULL = 512, - UDISPCTX_LENGTH_SHORT = 513, - UDISPCTX_SUBSTITUTE = 768, - UDISPCTX_NO_SUBSTITUTE = 769, -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct UFieldPositionIterator { - _unused: [u8; 0], -} -pub type UNumberFormat = *mut ::std::os::raw::c_void; -pub type UDateFormat = *mut ::std::os::raw::c_void; -impl UDateFormatStyle { - pub const UDAT_DEFAULT: UDateFormatStyle = UDateFormatStyle::UDAT_MEDIUM; -} -impl UDateFormatStyle { - pub const UDAT_FULL_RELATIVE: UDateFormatStyle = UDateFormatStyle::UDAT_RELATIVE; -} -impl UDateFormatStyle { - pub const UDAT_IGNORE: UDateFormatStyle = UDateFormatStyle::UDAT_PATTERN; -} -#[repr(i32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UDateFormatStyle { - UDAT_FULL = 0, - UDAT_LONG = 1, - UDAT_MEDIUM = 2, - UDAT_SHORT = 3, - UDAT_RELATIVE = 128, - UDAT_LONG_RELATIVE = 129, - UDAT_MEDIUM_RELATIVE = 130, - UDAT_SHORT_RELATIVE = 131, - UDAT_NONE = -1, - UDAT_PATTERN = -2, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UDateFormatField { - UDAT_ERA_FIELD = 0, - UDAT_YEAR_FIELD = 1, - UDAT_MONTH_FIELD = 2, - UDAT_DATE_FIELD = 3, - UDAT_HOUR_OF_DAY1_FIELD = 4, - UDAT_HOUR_OF_DAY0_FIELD = 5, - UDAT_MINUTE_FIELD = 6, - UDAT_SECOND_FIELD = 7, - UDAT_FRACTIONAL_SECOND_FIELD = 8, - UDAT_DAY_OF_WEEK_FIELD = 9, - UDAT_DAY_OF_YEAR_FIELD = 10, - UDAT_DAY_OF_WEEK_IN_MONTH_FIELD = 11, - UDAT_WEEK_OF_YEAR_FIELD = 12, - UDAT_WEEK_OF_MONTH_FIELD = 13, - UDAT_AM_PM_FIELD = 14, - UDAT_HOUR1_FIELD = 15, - UDAT_HOUR0_FIELD = 16, - UDAT_TIMEZONE_FIELD = 17, - UDAT_YEAR_WOY_FIELD = 18, - UDAT_DOW_LOCAL_FIELD = 19, - UDAT_EXTENDED_YEAR_FIELD = 20, - UDAT_JULIAN_DAY_FIELD = 21, - UDAT_MILLISECONDS_IN_DAY_FIELD = 22, - UDAT_TIMEZONE_RFC_FIELD = 23, - UDAT_TIMEZONE_GENERIC_FIELD = 24, - UDAT_STANDALONE_DAY_FIELD = 25, - UDAT_STANDALONE_MONTH_FIELD = 26, - UDAT_QUARTER_FIELD = 27, - UDAT_STANDALONE_QUARTER_FIELD = 28, - UDAT_TIMEZONE_SPECIAL_FIELD = 29, - UDAT_YEAR_NAME_FIELD = 30, - UDAT_TIMEZONE_LOCALIZED_GMT_OFFSET_FIELD = 31, - UDAT_TIMEZONE_ISO_FIELD = 32, - UDAT_TIMEZONE_ISO_LOCAL_FIELD = 33, - UDAT_RELATED_YEAR_FIELD = 34, - UDAT_AM_PM_MIDNIGHT_NOON_FIELD = 35, - UDAT_FLEXIBLE_DAY_PERIOD_FIELD = 36, - UDAT_TIME_SEPARATOR_FIELD = 37, - UDAT_FIELD_COUNT = 38, -} -extern "C" { - pub fn udat_toCalendarDateField_63(field: UDateFormatField) -> UCalendarDateFields; -} -extern "C" { - pub fn udat_open_63( - timeStyle: UDateFormatStyle, - dateStyle: UDateFormatStyle, - locale: *const ::std::os::raw::c_char, - tzID: *const UChar, - tzIDLength: i32, - pattern: *const UChar, - patternLength: i32, - status: *mut UErrorCode, - ) -> *mut UDateFormat; -} -extern "C" { - pub fn udat_close_63(format: *mut UDateFormat); -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UDateFormatBooleanAttribute { - UDAT_PARSE_ALLOW_WHITESPACE = 0, - UDAT_PARSE_ALLOW_NUMERIC = 1, - UDAT_PARSE_PARTIAL_LITERAL_MATCH = 2, - UDAT_PARSE_MULTIPLE_PATTERNS_FOR_MATCH = 3, - UDAT_BOOLEAN_ATTRIBUTE_COUNT = 4, -} -extern "C" { - pub fn udat_getBooleanAttribute_63( - fmt: *const UDateFormat, - attr: UDateFormatBooleanAttribute, - status: *mut UErrorCode, - ) -> UBool; -} -extern "C" { - pub fn udat_setBooleanAttribute_63( - fmt: *mut UDateFormat, - attr: UDateFormatBooleanAttribute, - newValue: UBool, - status: *mut UErrorCode, + assert_eq!( + unsafe { &(*(::std::ptr::null::())).hasPrevious as *const _ as usize }, + 56usize, + concat!( + "Offset of field: ", + stringify!(UCharIterator), + "::", + stringify!(hasPrevious) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).current as *const _ as usize }, + 64usize, + concat!( + "Offset of field: ", + stringify!(UCharIterator), + "::", + stringify!(current) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).next as *const _ as usize }, + 72usize, + concat!( + "Offset of field: ", + stringify!(UCharIterator), + "::", + stringify!(next) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).previous as *const _ as usize }, + 80usize, + concat!( + "Offset of field: ", + stringify!(UCharIterator), + "::", + stringify!(previous) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).reservedFn as *const _ as usize }, + 88usize, + concat!( + "Offset of field: ", + stringify!(UCharIterator), + "::", + stringify!(reservedFn) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).getState as *const _ as usize }, + 96usize, + concat!( + "Offset of field: ", + stringify!(UCharIterator), + "::", + stringify!(getState) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).setState as *const _ as usize }, + 104usize, + concat!( + "Offset of field: ", + stringify!(UCharIterator), + "::", + stringify!(setState) + ) ); } -extern "C" { - pub fn udat_clone_63(fmt: *const UDateFormat, status: *mut UErrorCode) -> *mut UDateFormat; -} -extern "C" { - pub fn udat_format_63( - format: *const UDateFormat, - dateToFormat: UDate, - result: *mut UChar, - resultLength: i32, - position: *mut UFieldPosition, - status: *mut UErrorCode, - ) -> i32; +impl Default for UCharIterator { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } } -extern "C" { - pub fn udat_formatCalendar_63( - format: *const UDateFormat, - calendar: *mut UCalendar, - result: *mut UChar, - capacity: i32, - position: *mut UFieldPosition, - status: *mut UErrorCode, - ) -> i32; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct UCPMap { + _unused: [u8; 0], } -extern "C" { - pub fn udat_formatForFields_63( - format: *const UDateFormat, - dateToFormat: UDate, - result: *mut UChar, - resultLength: i32, - fpositer: *mut UFieldPositionIterator, - status: *mut UErrorCode, - ) -> i32; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct USet { + _unused: [u8; 0], } -extern "C" { - pub fn udat_formatCalendarForFields_63( - format: *const UDateFormat, - calendar: *mut UCalendar, - result: *mut UChar, - capacity: i32, - fpositer: *mut UFieldPositionIterator, - status: *mut UErrorCode, - ) -> i32; +impl UProperty { + pub const UCHAR_BINARY_START: UProperty = UProperty::UCHAR_ALPHABETIC; } -extern "C" { - pub fn udat_parse_63( - format: *const UDateFormat, - text: *const UChar, - textLength: i32, - parsePos: *mut i32, - status: *mut UErrorCode, - ) -> UDate; +impl UProperty { + pub const UCHAR_INT_START: UProperty = UProperty::UCHAR_BIDI_CLASS; } -extern "C" { - pub fn udat_parseCalendar_63( - format: *const UDateFormat, - calendar: *mut UCalendar, - text: *const UChar, - textLength: i32, - parsePos: *mut i32, - status: *mut UErrorCode, - ); +impl UProperty { + pub const UCHAR_MASK_START: UProperty = UProperty::UCHAR_GENERAL_CATEGORY_MASK; } -extern "C" { - pub fn udat_isLenient_63(fmt: *const UDateFormat) -> UBool; +impl UProperty { + pub const UCHAR_DOUBLE_START: UProperty = UProperty::UCHAR_NUMERIC_VALUE; } -extern "C" { - pub fn udat_setLenient_63(fmt: *mut UDateFormat, isLenient: UBool); +impl UProperty { + pub const UCHAR_STRING_START: UProperty = UProperty::UCHAR_AGE; } -extern "C" { - pub fn udat_getCalendar_63(fmt: *const UDateFormat) -> *const UCalendar; +impl UProperty { + pub const UCHAR_OTHER_PROPERTY_START: UProperty = UProperty::UCHAR_SCRIPT_EXTENSIONS; } -extern "C" { - pub fn udat_setCalendar_63(fmt: *mut UDateFormat, calendarToSet: *const UCalendar); +#[repr(i32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] +pub enum UProperty { + UCHAR_ALPHABETIC = 0, + UCHAR_ASCII_HEX_DIGIT = 1, + UCHAR_BIDI_CONTROL = 2, + UCHAR_BIDI_MIRRORED = 3, + UCHAR_DASH = 4, + UCHAR_DEFAULT_IGNORABLE_CODE_POINT = 5, + UCHAR_DEPRECATED = 6, + UCHAR_DIACRITIC = 7, + UCHAR_EXTENDER = 8, + UCHAR_FULL_COMPOSITION_EXCLUSION = 9, + UCHAR_GRAPHEME_BASE = 10, + UCHAR_GRAPHEME_EXTEND = 11, + UCHAR_GRAPHEME_LINK = 12, + UCHAR_HEX_DIGIT = 13, + UCHAR_HYPHEN = 14, + UCHAR_ID_CONTINUE = 15, + UCHAR_ID_START = 16, + UCHAR_IDEOGRAPHIC = 17, + UCHAR_IDS_BINARY_OPERATOR = 18, + UCHAR_IDS_TRINARY_OPERATOR = 19, + UCHAR_JOIN_CONTROL = 20, + UCHAR_LOGICAL_ORDER_EXCEPTION = 21, + UCHAR_LOWERCASE = 22, + UCHAR_MATH = 23, + UCHAR_NONCHARACTER_CODE_POINT = 24, + UCHAR_QUOTATION_MARK = 25, + UCHAR_RADICAL = 26, + UCHAR_SOFT_DOTTED = 27, + UCHAR_TERMINAL_PUNCTUATION = 28, + UCHAR_UNIFIED_IDEOGRAPH = 29, + UCHAR_UPPERCASE = 30, + UCHAR_WHITE_SPACE = 31, + UCHAR_XID_CONTINUE = 32, + UCHAR_XID_START = 33, + UCHAR_CASE_SENSITIVE = 34, + UCHAR_S_TERM = 35, + UCHAR_VARIATION_SELECTOR = 36, + UCHAR_NFD_INERT = 37, + UCHAR_NFKD_INERT = 38, + UCHAR_NFC_INERT = 39, + UCHAR_NFKC_INERT = 40, + UCHAR_SEGMENT_STARTER = 41, + UCHAR_PATTERN_SYNTAX = 42, + UCHAR_PATTERN_WHITE_SPACE = 43, + UCHAR_POSIX_ALNUM = 44, + UCHAR_POSIX_BLANK = 45, + UCHAR_POSIX_GRAPH = 46, + UCHAR_POSIX_PRINT = 47, + UCHAR_POSIX_XDIGIT = 48, + UCHAR_CASED = 49, + UCHAR_CASE_IGNORABLE = 50, + UCHAR_CHANGES_WHEN_LOWERCASED = 51, + UCHAR_CHANGES_WHEN_UPPERCASED = 52, + UCHAR_CHANGES_WHEN_TITLECASED = 53, + UCHAR_CHANGES_WHEN_CASEFOLDED = 54, + UCHAR_CHANGES_WHEN_CASEMAPPED = 55, + UCHAR_CHANGES_WHEN_NFKC_CASEFOLDED = 56, + UCHAR_EMOJI = 57, + UCHAR_EMOJI_PRESENTATION = 58, + UCHAR_EMOJI_MODIFIER = 59, + UCHAR_EMOJI_MODIFIER_BASE = 60, + UCHAR_EMOJI_COMPONENT = 61, + UCHAR_REGIONAL_INDICATOR = 62, + UCHAR_PREPENDED_CONCATENATION_MARK = 63, + UCHAR_EXTENDED_PICTOGRAPHIC = 64, + UCHAR_BINARY_LIMIT = 65, + UCHAR_BIDI_CLASS = 4096, + UCHAR_BLOCK = 4097, + UCHAR_CANONICAL_COMBINING_CLASS = 4098, + UCHAR_DECOMPOSITION_TYPE = 4099, + UCHAR_EAST_ASIAN_WIDTH = 4100, + UCHAR_GENERAL_CATEGORY = 4101, + UCHAR_JOINING_GROUP = 4102, + UCHAR_JOINING_TYPE = 4103, + UCHAR_LINE_BREAK = 4104, + UCHAR_NUMERIC_TYPE = 4105, + UCHAR_SCRIPT = 4106, + UCHAR_HANGUL_SYLLABLE_TYPE = 4107, + UCHAR_NFD_QUICK_CHECK = 4108, + UCHAR_NFKD_QUICK_CHECK = 4109, + UCHAR_NFC_QUICK_CHECK = 4110, + UCHAR_NFKC_QUICK_CHECK = 4111, + UCHAR_LEAD_CANONICAL_COMBINING_CLASS = 4112, + UCHAR_TRAIL_CANONICAL_COMBINING_CLASS = 4113, + UCHAR_GRAPHEME_CLUSTER_BREAK = 4114, + UCHAR_SENTENCE_BREAK = 4115, + UCHAR_WORD_BREAK = 4116, + UCHAR_BIDI_PAIRED_BRACKET_TYPE = 4117, + UCHAR_INDIC_POSITIONAL_CATEGORY = 4118, + UCHAR_INDIC_SYLLABIC_CATEGORY = 4119, + UCHAR_VERTICAL_ORIENTATION = 4120, + UCHAR_INT_LIMIT = 4121, + UCHAR_GENERAL_CATEGORY_MASK = 8192, + UCHAR_MASK_LIMIT = 8193, + UCHAR_NUMERIC_VALUE = 12288, + UCHAR_DOUBLE_LIMIT = 12289, + UCHAR_AGE = 16384, + UCHAR_BIDI_MIRRORING_GLYPH = 16385, + UCHAR_CASE_FOLDING = 16386, + UCHAR_ISO_COMMENT = 16387, + UCHAR_LOWERCASE_MAPPING = 16388, + UCHAR_NAME = 16389, + UCHAR_SIMPLE_CASE_FOLDING = 16390, + UCHAR_SIMPLE_LOWERCASE_MAPPING = 16391, + UCHAR_SIMPLE_TITLECASE_MAPPING = 16392, + UCHAR_SIMPLE_UPPERCASE_MAPPING = 16393, + UCHAR_TITLECASE_MAPPING = 16394, + UCHAR_UNICODE_1_NAME = 16395, + UCHAR_UPPERCASE_MAPPING = 16396, + UCHAR_BIDI_PAIRED_BRACKET = 16397, + UCHAR_STRING_LIMIT = 16398, + UCHAR_SCRIPT_EXTENSIONS = 28672, + UCHAR_OTHER_PROPERTY_LIMIT = 28673, + UCHAR_INVALID_CODE = -1, +} +impl UCharCategory { + pub const U_GENERAL_OTHER_TYPES: UCharCategory = UCharCategory::U_UNASSIGNED; +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] +pub enum UCharCategory { + U_UNASSIGNED = 0, + U_UPPERCASE_LETTER = 1, + U_LOWERCASE_LETTER = 2, + U_TITLECASE_LETTER = 3, + U_MODIFIER_LETTER = 4, + U_OTHER_LETTER = 5, + U_NON_SPACING_MARK = 6, + U_ENCLOSING_MARK = 7, + U_COMBINING_SPACING_MARK = 8, + U_DECIMAL_DIGIT_NUMBER = 9, + U_LETTER_NUMBER = 10, + U_OTHER_NUMBER = 11, + U_SPACE_SEPARATOR = 12, + U_LINE_SEPARATOR = 13, + U_PARAGRAPH_SEPARATOR = 14, + U_CONTROL_CHAR = 15, + U_FORMAT_CHAR = 16, + U_PRIVATE_USE_CHAR = 17, + U_SURROGATE = 18, + U_DASH_PUNCTUATION = 19, + U_START_PUNCTUATION = 20, + U_END_PUNCTUATION = 21, + U_CONNECTOR_PUNCTUATION = 22, + U_OTHER_PUNCTUATION = 23, + U_MATH_SYMBOL = 24, + U_CURRENCY_SYMBOL = 25, + U_MODIFIER_SYMBOL = 26, + U_OTHER_SYMBOL = 27, + U_INITIAL_PUNCTUATION = 28, + U_FINAL_PUNCTUATION = 29, + U_CHAR_CATEGORY_COUNT = 30, +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] +pub enum UCharDirection { + U_LEFT_TO_RIGHT = 0, + U_RIGHT_TO_LEFT = 1, + U_EUROPEAN_NUMBER = 2, + U_EUROPEAN_NUMBER_SEPARATOR = 3, + U_EUROPEAN_NUMBER_TERMINATOR = 4, + U_ARABIC_NUMBER = 5, + U_COMMON_NUMBER_SEPARATOR = 6, + U_BLOCK_SEPARATOR = 7, + U_SEGMENT_SEPARATOR = 8, + U_WHITE_SPACE_NEUTRAL = 9, + U_OTHER_NEUTRAL = 10, + U_LEFT_TO_RIGHT_EMBEDDING = 11, + U_LEFT_TO_RIGHT_OVERRIDE = 12, + U_RIGHT_TO_LEFT_ARABIC = 13, + U_RIGHT_TO_LEFT_EMBEDDING = 14, + U_RIGHT_TO_LEFT_OVERRIDE = 15, + U_POP_DIRECTIONAL_FORMAT = 16, + U_DIR_NON_SPACING_MARK = 17, + U_BOUNDARY_NEUTRAL = 18, + U_FIRST_STRONG_ISOLATE = 19, + U_LEFT_TO_RIGHT_ISOLATE = 20, + U_RIGHT_TO_LEFT_ISOLATE = 21, + U_POP_DIRECTIONAL_ISOLATE = 22, + U_CHAR_DIRECTION_COUNT = 23, +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] +pub enum UCharNameChoice { + U_UNICODE_CHAR_NAME = 0, + U_UNICODE_10_CHAR_NAME = 1, + U_EXTENDED_CHAR_NAME = 2, + U_CHAR_NAME_ALIAS = 3, + U_CHAR_NAME_CHOICE_COUNT = 4, +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] +pub enum UPropertyNameChoice { + U_SHORT_PROPERTY_NAME = 0, + U_LONG_PROPERTY_NAME = 1, + U_PROPERTY_NAME_CHOICE_COUNT = 2, } extern "C" { - pub fn udat_getNumberFormat_63(fmt: *const UDateFormat) -> *const UNumberFormat; + pub fn u_hasBinaryProperty_63(c: UChar32, which: UProperty) -> UBool; } extern "C" { - pub fn udat_getNumberFormatForField_63( - fmt: *const UDateFormat, - field: UChar, - ) -> *const UNumberFormat; + pub fn u_getBinaryPropertySet_63( + property: UProperty, + pErrorCode: *mut UErrorCode, + ) -> *const USet; } extern "C" { - pub fn udat_adoptNumberFormatForFields_63( - fmt: *mut UDateFormat, - fields: *const UChar, - numberFormatToSet: *mut UNumberFormat, - status: *mut UErrorCode, - ); + pub fn u_isUAlphabetic_63(c: UChar32) -> UBool; } extern "C" { - pub fn udat_setNumberFormat_63(fmt: *mut UDateFormat, numberFormatToSet: *const UNumberFormat); + pub fn u_isULowercase_63(c: UChar32) -> UBool; } extern "C" { - pub fn udat_adoptNumberFormat_63( - fmt: *mut UDateFormat, - numberFormatToAdopt: *mut UNumberFormat, - ); + pub fn u_isUUppercase_63(c: UChar32) -> UBool; } extern "C" { - pub fn udat_getAvailable_63(localeIndex: i32) -> *const ::std::os::raw::c_char; + pub fn u_isUWhiteSpace_63(c: UChar32) -> UBool; } extern "C" { - pub fn udat_countAvailable_63() -> i32; + pub fn u_getIntPropertyValue_63(c: UChar32, which: UProperty) -> i32; } extern "C" { - pub fn udat_get2DigitYearStart_63(fmt: *const UDateFormat, status: *mut UErrorCode) -> UDate; + pub fn u_getIntPropertyMinValue_63(which: UProperty) -> i32; } extern "C" { - pub fn udat_set2DigitYearStart_63(fmt: *mut UDateFormat, d: UDate, status: *mut UErrorCode); + pub fn u_getIntPropertyMaxValue_63(which: UProperty) -> i32; } extern "C" { - pub fn udat_toPattern_63( - fmt: *const UDateFormat, - localized: UBool, - result: *mut UChar, - resultLength: i32, - status: *mut UErrorCode, - ) -> i32; + pub fn u_getIntPropertyMap_63( + property: UProperty, + pErrorCode: *mut UErrorCode, + ) -> *const UCPMap; } extern "C" { - pub fn udat_applyPattern_63( - format: *mut UDateFormat, - localized: UBool, - pattern: *const UChar, - patternLength: i32, - ); + pub fn u_getNumericValue_63(c: UChar32) -> f64; } -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UDateFormatSymbolType { - UDAT_ERAS = 0, - UDAT_MONTHS = 1, - UDAT_SHORT_MONTHS = 2, - UDAT_WEEKDAYS = 3, - UDAT_SHORT_WEEKDAYS = 4, - UDAT_AM_PMS = 5, - UDAT_LOCALIZED_CHARS = 6, - UDAT_ERA_NAMES = 7, - UDAT_NARROW_MONTHS = 8, - UDAT_NARROW_WEEKDAYS = 9, - UDAT_STANDALONE_MONTHS = 10, - UDAT_STANDALONE_SHORT_MONTHS = 11, - UDAT_STANDALONE_NARROW_MONTHS = 12, - UDAT_STANDALONE_WEEKDAYS = 13, - UDAT_STANDALONE_SHORT_WEEKDAYS = 14, - UDAT_STANDALONE_NARROW_WEEKDAYS = 15, - UDAT_QUARTERS = 16, - UDAT_SHORT_QUARTERS = 17, - UDAT_STANDALONE_QUARTERS = 18, - UDAT_STANDALONE_SHORT_QUARTERS = 19, - UDAT_SHORTER_WEEKDAYS = 20, - UDAT_STANDALONE_SHORTER_WEEKDAYS = 21, - UDAT_CYCLIC_YEARS_WIDE = 22, - UDAT_CYCLIC_YEARS_ABBREVIATED = 23, - UDAT_CYCLIC_YEARS_NARROW = 24, - UDAT_ZODIAC_NAMES_WIDE = 25, - UDAT_ZODIAC_NAMES_ABBREVIATED = 26, - UDAT_ZODIAC_NAMES_NARROW = 27, +extern "C" { + pub fn u_islower_63(c: UChar32) -> UBool; } -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct UDateFormatSymbols { - _unused: [u8; 0], +extern "C" { + pub fn u_isupper_63(c: UChar32) -> UBool; } extern "C" { - pub fn udat_getSymbols_63( - fmt: *const UDateFormat, - type_: UDateFormatSymbolType, - symbolIndex: i32, - result: *mut UChar, - resultLength: i32, - status: *mut UErrorCode, - ) -> i32; + pub fn u_istitle_63(c: UChar32) -> UBool; } extern "C" { - pub fn udat_countSymbols_63(fmt: *const UDateFormat, type_: UDateFormatSymbolType) -> i32; + pub fn u_isdigit_63(c: UChar32) -> UBool; } extern "C" { - pub fn udat_setSymbols_63( - format: *mut UDateFormat, - type_: UDateFormatSymbolType, - symbolIndex: i32, - value: *mut UChar, - valueLength: i32, - status: *mut UErrorCode, - ); + pub fn u_isalpha_63(c: UChar32) -> UBool; } extern "C" { - pub fn udat_getLocaleByType_63( - fmt: *const UDateFormat, - type_: ULocDataLocaleType, - status: *mut UErrorCode, - ) -> *const ::std::os::raw::c_char; + pub fn u_isalnum_63(c: UChar32) -> UBool; } extern "C" { - pub fn udat_setContext_63( - fmt: *mut UDateFormat, - value: UDisplayContext, - status: *mut UErrorCode, - ); + pub fn u_isxdigit_63(c: UChar32) -> UBool; } extern "C" { - pub fn udat_getContext_63( - fmt: *const UDateFormat, - type_: UDisplayContextType, - status: *mut UErrorCode, - ) -> UDisplayContext; + pub fn u_ispunct_63(c: UChar32) -> UBool; } extern "C" { - pub fn udat_toPatternRelativeDate_63( - fmt: *const UDateFormat, - result: *mut UChar, - resultLength: i32, - status: *mut UErrorCode, - ) -> i32; + pub fn u_isgraph_63(c: UChar32) -> UBool; } extern "C" { - pub fn udat_toPatternRelativeTime_63( - fmt: *const UDateFormat, - result: *mut UChar, - resultLength: i32, - status: *mut UErrorCode, - ) -> i32; + pub fn u_isblank_63(c: UChar32) -> UBool; } extern "C" { - pub fn udat_applyPatternRelative_63( - format: *mut UDateFormat, - datePattern: *const UChar, - datePatternLength: i32, - timePattern: *const UChar, - timePatternLength: i32, - status: *mut UErrorCode, - ); + pub fn u_isdefined_63(c: UChar32) -> UBool; } -pub type UDateFormatOpener = ::std::option::Option< - unsafe extern "C" fn( - timeStyle: UDateFormatStyle, - dateStyle: UDateFormatStyle, - locale: *const ::std::os::raw::c_char, - tzID: *const UChar, - tzIDLength: i32, - pattern: *const UChar, - patternLength: i32, - status: *mut UErrorCode, - ) -> *mut UDateFormat, ->; extern "C" { - pub fn udat_registerOpener_63(opener: UDateFormatOpener, status: *mut UErrorCode); + pub fn u_isspace_63(c: UChar32) -> UBool; } extern "C" { - pub fn udat_unregisterOpener_63( - opener: UDateFormatOpener, - status: *mut UErrorCode, - ) -> UDateFormatOpener; + pub fn u_isJavaSpaceChar_63(c: UChar32) -> UBool; } -#[repr(C)] -#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, PartialEq)] -pub struct UDataInfo { - pub size: u16, - pub reservedWord: u16, - pub isBigEndian: u8, - pub charsetFamily: u8, - pub sizeofUChar: u8, - pub reservedByte: u8, - pub dataFormat: [u8; 4usize], - pub formatVersion: [u8; 4usize], - pub dataVersion: [u8; 4usize], +extern "C" { + pub fn u_isWhitespace_63(c: UChar32) -> UBool; } -#[test] -fn bindgen_test_layout_UDataInfo() { - assert_eq!( - ::std::mem::size_of::(), - 20usize, - concat!("Size of: ", stringify!(UDataInfo)) - ); - assert_eq!( - ::std::mem::align_of::(), - 2usize, - concat!("Alignment of ", stringify!(UDataInfo)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).size as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(UDataInfo), - "::", - stringify!(size) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).reservedWord as *const _ as usize }, - 2usize, - concat!( - "Offset of field: ", - stringify!(UDataInfo), - "::", - stringify!(reservedWord) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).isBigEndian as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(UDataInfo), - "::", - stringify!(isBigEndian) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).charsetFamily as *const _ as usize }, - 5usize, - concat!( - "Offset of field: ", - stringify!(UDataInfo), - "::", - stringify!(charsetFamily) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).sizeofUChar as *const _ as usize }, - 6usize, - concat!( - "Offset of field: ", - stringify!(UDataInfo), - "::", - stringify!(sizeofUChar) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).reservedByte as *const _ as usize }, - 7usize, - concat!( - "Offset of field: ", - stringify!(UDataInfo), - "::", - stringify!(reservedByte) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).dataFormat as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(UDataInfo), - "::", - stringify!(dataFormat) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).formatVersion as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(UDataInfo), - "::", - stringify!(formatVersion) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).dataVersion as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(UDataInfo), - "::", - stringify!(dataVersion) - ) - ); +extern "C" { + pub fn u_iscntrl_63(c: UChar32) -> UBool; } -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct UDataMemory { - _unused: [u8; 0], +extern "C" { + pub fn u_isISOControl_63(c: UChar32) -> UBool; } -pub type UDataMemoryIsAcceptable = ::std::option::Option< - unsafe extern "C" fn( - context: *mut ::std::os::raw::c_void, - type_: *const ::std::os::raw::c_char, - name: *const ::std::os::raw::c_char, - pInfo: *const UDataInfo, - ) -> UBool, ->; extern "C" { - pub fn udata_open_63( - path: *const ::std::os::raw::c_char, - type_: *const ::std::os::raw::c_char, - name: *const ::std::os::raw::c_char, - pErrorCode: *mut UErrorCode, - ) -> *mut UDataMemory; + pub fn u_isprint_63(c: UChar32) -> UBool; } extern "C" { - pub fn udata_openChoice_63( - path: *const ::std::os::raw::c_char, - type_: *const ::std::os::raw::c_char, - name: *const ::std::os::raw::c_char, - isAcceptable: UDataMemoryIsAcceptable, + pub fn u_isbase_63(c: UChar32) -> UBool; +} +extern "C" { + pub fn u_charDirection_63(c: UChar32) -> UCharDirection; +} +extern "C" { + pub fn u_isMirrored_63(c: UChar32) -> UBool; +} +extern "C" { + pub fn u_charMirror_63(c: UChar32) -> UChar32; +} +extern "C" { + pub fn u_getBidiPairedBracket_63(c: UChar32) -> UChar32; +} +extern "C" { + pub fn u_charType_63(c: UChar32) -> i8; +} +pub type UCharEnumTypeRange = ::std::option::Option< + unsafe extern "C" fn( + context: *const ::std::os::raw::c_void, + start: UChar32, + limit: UChar32, + type_: UCharCategory, + ) -> UBool, +>; +extern "C" { + pub fn u_enumCharTypes_63( + enumRange: UCharEnumTypeRange, + context: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn u_getCombiningClass_63(c: UChar32) -> u8; +} +extern "C" { + pub fn u_charDigitValue_63(c: UChar32) -> i32; +} +extern "C" { + pub fn u_charName_63( + code: UChar32, + nameChoice: UCharNameChoice, + buffer: *mut ::std::os::raw::c_char, + bufferLength: i32, + pErrorCode: *mut UErrorCode, + ) -> i32; +} +extern "C" { + pub fn u_getISOComment_63( + c: UChar32, + dest: *mut ::std::os::raw::c_char, + destCapacity: i32, + pErrorCode: *mut UErrorCode, + ) -> i32; +} +extern "C" { + pub fn u_charFromName_63( + nameChoice: UCharNameChoice, + name: *const ::std::os::raw::c_char, + pErrorCode: *mut UErrorCode, + ) -> UChar32; +} +pub type UEnumCharNamesFn = ::std::option::Option< + unsafe extern "C" fn( context: *mut ::std::os::raw::c_void, + code: UChar32, + nameChoice: UCharNameChoice, + name: *const ::std::os::raw::c_char, + length: i32, + ) -> UBool, +>; +extern "C" { + pub fn u_enumCharNames_63( + start: UChar32, + limit: UChar32, + fn_: UEnumCharNamesFn, + context: *mut ::std::os::raw::c_void, + nameChoice: UCharNameChoice, pErrorCode: *mut UErrorCode, - ) -> *mut UDataMemory; + ); } extern "C" { - pub fn udata_close_63(pData: *mut UDataMemory); + pub fn u_getPropertyName_63( + property: UProperty, + nameChoice: UPropertyNameChoice, + ) -> *const ::std::os::raw::c_char; } extern "C" { - pub fn udata_getMemory_63(pData: *mut UDataMemory) -> *const ::std::os::raw::c_void; + pub fn u_getPropertyEnum_63(alias: *const ::std::os::raw::c_char) -> UProperty; } extern "C" { - pub fn udata_getInfo_63(pData: *mut UDataMemory, pInfo: *mut UDataInfo); + pub fn u_getPropertyValueName_63( + property: UProperty, + value: i32, + nameChoice: UPropertyNameChoice, + ) -> *const ::std::os::raw::c_char; } extern "C" { - pub fn udata_setCommonData_63(data: *const ::std::os::raw::c_void, err: *mut UErrorCode); + pub fn u_getPropertyValueEnum_63( + property: UProperty, + alias: *const ::std::os::raw::c_char, + ) -> i32; } extern "C" { - pub fn udata_setAppData_63( - packageName: *const ::std::os::raw::c_char, - data: *const ::std::os::raw::c_void, - err: *mut UErrorCode, - ); + pub fn u_isIDStart_63(c: UChar32) -> UBool; } -impl UDataFileAccess { - pub const UDATA_DEFAULT_ACCESS: UDataFileAccess = UDataFileAccess::UDATA_FILES_FIRST; +extern "C" { + pub fn u_isIDPart_63(c: UChar32) -> UBool; } -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UDataFileAccess { - UDATA_FILES_FIRST = 0, - UDATA_ONLY_PACKAGES = 1, - UDATA_PACKAGES_FIRST = 2, - UDATA_NO_FILES = 3, - UDATA_FILE_ACCESS_COUNT = 4, +extern "C" { + pub fn u_isIDIgnorable_63(c: UChar32) -> UBool; } extern "C" { - pub fn udata_setFileAccess_63(access: UDataFileAccess, status: *mut UErrorCode); + pub fn u_isJavaIDStart_63(c: UChar32) -> UBool; } extern "C" { - pub fn u_getDataDirectory_63() -> *const ::std::os::raw::c_char; + pub fn u_isJavaIDPart_63(c: UChar32) -> UBool; } extern "C" { - pub fn u_setDataDirectory_63(directory: *const ::std::os::raw::c_char); + pub fn u_tolower_63(c: UChar32) -> UChar32; } extern "C" { - pub fn u_getTimeZoneFilesDirectory_63(status: *mut UErrorCode) - -> *const ::std::os::raw::c_char; + pub fn u_toupper_63(c: UChar32) -> UChar32; } extern "C" { - pub fn u_setTimeZoneFilesDirectory_63( - path: *const ::std::os::raw::c_char, - status: *mut UErrorCode, - ); + pub fn u_totitle_63(c: UChar32) -> UChar32; } extern "C" { - pub fn u_charsToUChars_63(cs: *const ::std::os::raw::c_char, us: *mut UChar, length: i32); + pub fn u_foldCase_63(c: UChar32, options: u32) -> UChar32; } extern "C" { - pub fn u_UCharsToChars_63(us: *const UChar, cs: *mut ::std::os::raw::c_char, length: i32); + pub fn u_digit_63(ch: UChar32, radix: i8) -> i32; +} +extern "C" { + pub fn u_forDigit_63(digit: i32, radix: i8) -> UChar32; +} +extern "C" { + pub fn u_charAge_63(c: UChar32, versionArray: *mut u8); +} +extern "C" { + pub fn u_getUnicodeVersion_63(versionArray: *mut u8); +} +extern "C" { + pub fn u_getFC_NFKC_Closure_63( + c: UChar32, + dest: *mut UChar, + destCapacity: i32, + pErrorCode: *mut UErrorCode, + ) -> i32; } #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UCharIteratorOrigin { - UITER_START = 0, - UITER_CURRENT = 1, - UITER_LIMIT = 2, - UITER_ZERO = 3, - UITER_LENGTH = 4, +pub enum USetSpanCondition { + USET_SPAN_NOT_CONTAINED = 0, + USET_SPAN_CONTAINED = 1, + USET_SPAN_SIMPLE = 2, + USET_SPAN_CONDITION_COUNT = 3, } -pub type UCharIteratorGetIndex = ::std::option::Option< - unsafe extern "C" fn(iter: *mut UCharIterator, origin: UCharIteratorOrigin) -> i32, ->; -pub type UCharIteratorMove = ::std::option::Option< - unsafe extern "C" fn(iter: *mut UCharIterator, delta: i32, origin: UCharIteratorOrigin) -> i32, ->; -pub type UCharIteratorHasNext = - ::std::option::Option UBool>; -pub type UCharIteratorHasPrevious = - ::std::option::Option UBool>; -pub type UCharIteratorCurrent = - ::std::option::Option UChar32>; -pub type UCharIteratorNext = - ::std::option::Option UChar32>; -pub type UCharIteratorPrevious = - ::std::option::Option UChar32>; -pub type UCharIteratorReserved = - ::std::option::Option i32>; -pub type UCharIteratorGetState = - ::std::option::Option u32>; -pub type UCharIteratorSetState = ::std::option::Option< - unsafe extern "C" fn(iter: *mut UCharIterator, state: u32, pErrorCode: *mut UErrorCode), ->; #[repr(C)] -#[derive(Debug, Copy, Clone, Hash, PartialOrd, PartialEq)] -pub struct UCharIterator { - pub context: *const ::std::os::raw::c_void, - pub length: i32, - pub start: i32, - pub index: i32, - pub limit: i32, - pub reservedField: i32, - pub getIndex: UCharIteratorGetIndex, - pub move_: UCharIteratorMove, - pub hasNext: UCharIteratorHasNext, - pub hasPrevious: UCharIteratorHasPrevious, - pub current: UCharIteratorCurrent, - pub next: UCharIteratorNext, - pub previous: UCharIteratorPrevious, - pub reservedFn: UCharIteratorReserved, - pub getState: UCharIteratorGetState, - pub setState: UCharIteratorSetState, +#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, PartialEq)] +pub struct UParseError { + pub line: i32, + pub offset: i32, + pub preContext: [UChar; 16usize], + pub postContext: [UChar; 16usize], } #[test] -fn bindgen_test_layout_UCharIterator() { +fn bindgen_test_layout_UParseError() { assert_eq!( - ::std::mem::size_of::(), - 112usize, - concat!("Size of: ", stringify!(UCharIterator)) + ::std::mem::size_of::(), + 72usize, + concat!("Size of: ", stringify!(UParseError)) ); assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(UCharIterator)) + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(UParseError)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).context as *const _ as usize }, + unsafe { &(*(::std::ptr::null::())).line as *const _ as usize }, 0usize, concat!( "Offset of field: ", - stringify!(UCharIterator), + stringify!(UParseError), "::", - stringify!(context) + stringify!(line) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).length as *const _ as usize }, - 8usize, + unsafe { &(*(::std::ptr::null::())).offset as *const _ as usize }, + 4usize, concat!( "Offset of field: ", - stringify!(UCharIterator), + stringify!(UParseError), "::", - stringify!(length) + stringify!(offset) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).start as *const _ as usize }, - 12usize, + unsafe { &(*(::std::ptr::null::())).preContext as *const _ as usize }, + 8usize, concat!( "Offset of field: ", - stringify!(UCharIterator), + stringify!(UParseError), "::", - stringify!(start) + stringify!(preContext) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).index as *const _ as usize }, - 16usize, + unsafe { &(*(::std::ptr::null::())).postContext as *const _ as usize }, + 40usize, concat!( "Offset of field: ", - stringify!(UCharIterator), + stringify!(UParseError), "::", - stringify!(index) + stringify!(postContext) ) ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).limit as *const _ as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(UCharIterator), - "::", - stringify!(limit) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).reservedField as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(UCharIterator), - "::", - stringify!(reservedField) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).getIndex as *const _ as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(UCharIterator), - "::", - stringify!(getIndex) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).move_ as *const _ as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(UCharIterator), - "::", - stringify!(move_) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).hasNext as *const _ as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(UCharIterator), - "::", - stringify!(hasNext) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).hasPrevious as *const _ as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(UCharIterator), - "::", - stringify!(hasPrevious) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).current as *const _ as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(UCharIterator), - "::", - stringify!(current) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).next as *const _ as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(UCharIterator), - "::", - stringify!(next) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).previous as *const _ as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(UCharIterator), - "::", - stringify!(previous) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).reservedFn as *const _ as usize }, - 88usize, - concat!( - "Offset of field: ", - stringify!(UCharIterator), - "::", - stringify!(reservedFn) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).getState as *const _ as usize }, - 96usize, - concat!( - "Offset of field: ", - stringify!(UCharIterator), - "::", - stringify!(getState) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).setState as *const _ as usize }, - 104usize, - concat!( - "Offset of field: ", - stringify!(UCharIterator), - "::", - stringify!(setState) - ) - ); -} -impl Default for UCharIterator { - fn default() -> Self { - unsafe { ::std::mem::zeroed() } - } } #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct UBreakIterator { +pub struct UCollator { _unused: [u8; 0], } -extern "C" { - pub fn u_strlen_63(s: *const UChar) -> i32; +#[repr(i32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] +pub enum UCollationResult { + UCOL_EQUAL = 0, + UCOL_GREATER = 1, + UCOL_LESS = -1, } -extern "C" { - pub fn u_countChar32_63(s: *const UChar, length: i32) -> i32; +impl UColAttributeValue { + pub const UCOL_DEFAULT_STRENGTH: UColAttributeValue = UColAttributeValue::UCOL_TERTIARY; } -extern "C" { - pub fn u_strHasMoreChar32Than_63(s: *const UChar, length: i32, number: i32) -> UBool; +impl UColAttributeValue { + pub const UCOL_QUATERNARY: UColAttributeValue = UColAttributeValue::UCOL_CE_STRENGTH_LIMIT; } -extern "C" { - pub fn u_strcat_63(dst: *mut UChar, src: *const UChar) -> *mut UChar; +impl UColAttributeValue { + pub const UCOL_OFF: UColAttributeValue = UColAttributeValue::UCOL_STRENGTH_LIMIT; } -extern "C" { - pub fn u_strncat_63(dst: *mut UChar, src: *const UChar, n: i32) -> *mut UChar; +#[repr(i32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] +pub enum UColAttributeValue { + UCOL_DEFAULT = -1, + UCOL_PRIMARY = 0, + UCOL_SECONDARY = 1, + UCOL_TERTIARY = 2, + UCOL_CE_STRENGTH_LIMIT = 3, + UCOL_IDENTICAL = 15, + UCOL_STRENGTH_LIMIT = 16, + UCOL_ON = 17, + UCOL_SHIFTED = 20, + UCOL_NON_IGNORABLE = 21, + UCOL_LOWER_FIRST = 24, + UCOL_UPPER_FIRST = 25, + UCOL_ATTRIBUTE_VALUE_COUNT = 26, } -extern "C" { - pub fn u_strstr_63(s: *const UChar, substring: *const UChar) -> *mut UChar; +impl UColReorderCode { + pub const UCOL_REORDER_CODE_OTHERS: UColReorderCode = UColReorderCode::UCOL_REORDER_CODE_NONE; } -extern "C" { - pub fn u_strFindFirst_63( - s: *const UChar, - length: i32, - substring: *const UChar, - subLength: i32, - ) -> *mut UChar; +impl UColReorderCode { + pub const UCOL_REORDER_CODE_FIRST: UColReorderCode = UColReorderCode::UCOL_REORDER_CODE_SPACE; } -extern "C" { - pub fn u_strchr_63(s: *const UChar, c: UChar) -> *mut UChar; +#[repr(i32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] +pub enum UColReorderCode { + UCOL_REORDER_CODE_DEFAULT = -1, + UCOL_REORDER_CODE_NONE = 103, + UCOL_REORDER_CODE_SPACE = 4096, + UCOL_REORDER_CODE_PUNCTUATION = 4097, + UCOL_REORDER_CODE_SYMBOL = 4098, + UCOL_REORDER_CODE_CURRENCY = 4099, + UCOL_REORDER_CODE_DIGIT = 4100, + UCOL_REORDER_CODE_LIMIT = 4101, } -extern "C" { - pub fn u_strchr32_63(s: *const UChar, c: UChar32) -> *mut UChar; +pub use self::UColAttributeValue as UCollationStrength; +impl UColAttribute { + pub const UCOL_DECOMPOSITION_MODE: UColAttribute = UColAttribute::UCOL_NORMALIZATION_MODE; } -extern "C" { - pub fn u_strrstr_63(s: *const UChar, substring: *const UChar) -> *mut UChar; +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] +pub enum UColAttribute { + UCOL_FRENCH_COLLATION = 0, + UCOL_ALTERNATE_HANDLING = 1, + UCOL_CASE_FIRST = 2, + UCOL_CASE_LEVEL = 3, + UCOL_NORMALIZATION_MODE = 4, + UCOL_STRENGTH = 5, + UCOL_HIRAGANA_QUATERNARY_MODE = 6, + UCOL_NUMERIC_COLLATION = 7, + UCOL_ATTRIBUTE_COUNT = 8, +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] +pub enum UColRuleOption { + UCOL_TAILORING_ONLY = 0, + UCOL_FULL_RULES = 1, } extern "C" { - pub fn u_strFindLast_63( - s: *const UChar, - length: i32, - substring: *const UChar, - subLength: i32, - ) -> *mut UChar; + pub fn ucol_open_63( + loc: *const ::std::os::raw::c_char, + status: *mut UErrorCode, + ) -> *mut UCollator; } extern "C" { - pub fn u_strrchr_63(s: *const UChar, c: UChar) -> *mut UChar; + pub fn ucol_openRules_63( + rules: *const UChar, + rulesLength: i32, + normalizationMode: UColAttributeValue, + strength: UCollationStrength, + parseError: *mut UParseError, + status: *mut UErrorCode, + ) -> *mut UCollator; } extern "C" { - pub fn u_strrchr32_63(s: *const UChar, c: UChar32) -> *mut UChar; + pub fn ucol_openFromShortString_63( + definition: *const ::std::os::raw::c_char, + forceDefaults: UBool, + parseError: *mut UParseError, + status: *mut UErrorCode, + ) -> *mut UCollator; } extern "C" { - pub fn u_strpbrk_63(string: *const UChar, matchSet: *const UChar) -> *mut UChar; + pub fn ucol_getContractions_63( + coll: *const UCollator, + conts: *mut USet, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_strcspn_63(string: *const UChar, matchSet: *const UChar) -> i32; + pub fn ucol_getContractionsAndExpansions_63( + coll: *const UCollator, + contractions: *mut USet, + expansions: *mut USet, + addPrefixes: UBool, + status: *mut UErrorCode, + ); } extern "C" { - pub fn u_strspn_63(string: *const UChar, matchSet: *const UChar) -> i32; + pub fn ucol_close_63(coll: *mut UCollator); } extern "C" { - pub fn u_strtok_r_63( - src: *mut UChar, - delim: *const UChar, - saveState: *mut *mut UChar, - ) -> *mut UChar; + pub fn ucol_strcoll_63( + coll: *const UCollator, + source: *const UChar, + sourceLength: i32, + target: *const UChar, + targetLength: i32, + ) -> UCollationResult; } extern "C" { - pub fn u_strcmp_63(s1: *const UChar, s2: *const UChar) -> i32; + pub fn ucol_strcollUTF8_63( + coll: *const UCollator, + source: *const ::std::os::raw::c_char, + sourceLength: i32, + target: *const ::std::os::raw::c_char, + targetLength: i32, + status: *mut UErrorCode, + ) -> UCollationResult; } extern "C" { - pub fn u_strcmpCodePointOrder_63(s1: *const UChar, s2: *const UChar) -> i32; + pub fn ucol_greater_63( + coll: *const UCollator, + source: *const UChar, + sourceLength: i32, + target: *const UChar, + targetLength: i32, + ) -> UBool; } extern "C" { - pub fn u_strCompare_63( - s1: *const UChar, - length1: i32, - s2: *const UChar, - length2: i32, - codePointOrder: UBool, - ) -> i32; + pub fn ucol_greaterOrEqual_63( + coll: *const UCollator, + source: *const UChar, + sourceLength: i32, + target: *const UChar, + targetLength: i32, + ) -> UBool; } extern "C" { - pub fn u_strCompareIter_63( - iter1: *mut UCharIterator, - iter2: *mut UCharIterator, - codePointOrder: UBool, - ) -> i32; + pub fn ucol_equal_63( + coll: *const UCollator, + source: *const UChar, + sourceLength: i32, + target: *const UChar, + targetLength: i32, + ) -> UBool; } extern "C" { - pub fn u_strCaseCompare_63( - s1: *const UChar, - length1: i32, - s2: *const UChar, - length2: i32, - options: u32, - pErrorCode: *mut UErrorCode, - ) -> i32; + pub fn ucol_strcollIter_63( + coll: *const UCollator, + sIter: *mut UCharIterator, + tIter: *mut UCharIterator, + status: *mut UErrorCode, + ) -> UCollationResult; } extern "C" { - pub fn u_strncmp_63(ucs1: *const UChar, ucs2: *const UChar, n: i32) -> i32; + pub fn ucol_getStrength_63(coll: *const UCollator) -> UCollationStrength; } extern "C" { - pub fn u_strncmpCodePointOrder_63(s1: *const UChar, s2: *const UChar, n: i32) -> i32; + pub fn ucol_setStrength_63(coll: *mut UCollator, strength: UCollationStrength); } extern "C" { - pub fn u_strcasecmp_63(s1: *const UChar, s2: *const UChar, options: u32) -> i32; + pub fn ucol_getReorderCodes_63( + coll: *const UCollator, + dest: *mut i32, + destCapacity: i32, + pErrorCode: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_strncasecmp_63(s1: *const UChar, s2: *const UChar, n: i32, options: u32) -> i32; + pub fn ucol_setReorderCodes_63( + coll: *mut UCollator, + reorderCodes: *const i32, + reorderCodesLength: i32, + pErrorCode: *mut UErrorCode, + ); } extern "C" { - pub fn u_memcasecmp_63(s1: *const UChar, s2: *const UChar, length: i32, options: u32) -> i32; + pub fn ucol_getEquivalentReorderCodes_63( + reorderCode: i32, + dest: *mut i32, + destCapacity: i32, + pErrorCode: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_strcpy_63(dst: *mut UChar, src: *const UChar) -> *mut UChar; + pub fn ucol_getDisplayName_63( + objLoc: *const ::std::os::raw::c_char, + dispLoc: *const ::std::os::raw::c_char, + result: *mut UChar, + resultLength: i32, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_strncpy_63(dst: *mut UChar, src: *const UChar, n: i32) -> *mut UChar; + pub fn ucol_getAvailable_63(localeIndex: i32) -> *const ::std::os::raw::c_char; } extern "C" { - pub fn u_uastrcpy_63(dst: *mut UChar, src: *const ::std::os::raw::c_char) -> *mut UChar; + pub fn ucol_countAvailable_63() -> i32; } extern "C" { - pub fn u_uastrncpy_63( - dst: *mut UChar, - src: *const ::std::os::raw::c_char, - n: i32, - ) -> *mut UChar; + pub fn ucol_openAvailableLocales_63(status: *mut UErrorCode) -> *mut UEnumeration; } extern "C" { - pub fn u_austrcpy_63( - dst: *mut ::std::os::raw::c_char, - src: *const UChar, - ) -> *mut ::std::os::raw::c_char; + pub fn ucol_getKeywords_63(status: *mut UErrorCode) -> *mut UEnumeration; } extern "C" { - pub fn u_austrncpy_63( - dst: *mut ::std::os::raw::c_char, - src: *const UChar, - n: i32, - ) -> *mut ::std::os::raw::c_char; + pub fn ucol_getKeywordValues_63( + keyword: *const ::std::os::raw::c_char, + status: *mut UErrorCode, + ) -> *mut UEnumeration; } extern "C" { - pub fn u_memcpy_63(dest: *mut UChar, src: *const UChar, count: i32) -> *mut UChar; + pub fn ucol_getKeywordValuesForLocale_63( + key: *const ::std::os::raw::c_char, + locale: *const ::std::os::raw::c_char, + commonlyUsed: UBool, + status: *mut UErrorCode, + ) -> *mut UEnumeration; } extern "C" { - pub fn u_memmove_63(dest: *mut UChar, src: *const UChar, count: i32) -> *mut UChar; + pub fn ucol_getFunctionalEquivalent_63( + result: *mut ::std::os::raw::c_char, + resultCapacity: i32, + keyword: *const ::std::os::raw::c_char, + locale: *const ::std::os::raw::c_char, + isAvailable: *mut UBool, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_memset_63(dest: *mut UChar, c: UChar, count: i32) -> *mut UChar; + pub fn ucol_getRules_63(coll: *const UCollator, length: *mut i32) -> *const UChar; } extern "C" { - pub fn u_memcmp_63(buf1: *const UChar, buf2: *const UChar, count: i32) -> i32; + pub fn ucol_getShortDefinitionString_63( + coll: *const UCollator, + locale: *const ::std::os::raw::c_char, + buffer: *mut ::std::os::raw::c_char, + capacity: i32, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_memcmpCodePointOrder_63(s1: *const UChar, s2: *const UChar, count: i32) -> i32; + pub fn ucol_normalizeShortDefinitionString_63( + source: *const ::std::os::raw::c_char, + destination: *mut ::std::os::raw::c_char, + capacity: i32, + parseError: *mut UParseError, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_memchr_63(s: *const UChar, c: UChar, count: i32) -> *mut UChar; + pub fn ucol_getSortKey_63( + coll: *const UCollator, + source: *const UChar, + sourceLength: i32, + result: *mut u8, + resultLength: i32, + ) -> i32; } extern "C" { - pub fn u_memchr32_63(s: *const UChar, c: UChar32, count: i32) -> *mut UChar; + pub fn ucol_nextSortKeyPart_63( + coll: *const UCollator, + iter: *mut UCharIterator, + state: *mut u32, + dest: *mut u8, + count: i32, + status: *mut UErrorCode, + ) -> i32; } -extern "C" { - pub fn u_memrchr_63(s: *const UChar, c: UChar, count: i32) -> *mut UChar; +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] +pub enum UColBoundMode { + UCOL_BOUND_LOWER = 0, + UCOL_BOUND_UPPER = 1, + UCOL_BOUND_UPPER_LONG = 2, + UCOL_BOUND_VALUE_COUNT = 3, } extern "C" { - pub fn u_memrchr32_63(s: *const UChar, c: UChar32, count: i32) -> *mut UChar; + pub fn ucol_getBound_63( + source: *const u8, + sourceLength: i32, + boundType: UColBoundMode, + noOfLevels: u32, + result: *mut u8, + resultLength: i32, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_unescape_63( - src: *const ::std::os::raw::c_char, - dest: *mut UChar, - destCapacity: i32, - ) -> i32; + pub fn ucol_getVersion_63(coll: *const UCollator, info: *mut u8); } -pub type UNESCAPE_CHAR_AT = ::std::option::Option< - unsafe extern "C" fn(offset: i32, context: *mut ::std::os::raw::c_void) -> UChar, ->; extern "C" { - pub fn u_unescapeAt_63( - charAt: UNESCAPE_CHAR_AT, - offset: *mut i32, - length: i32, - context: *mut ::std::os::raw::c_void, - ) -> UChar32; + pub fn ucol_getUCAVersion_63(coll: *const UCollator, info: *mut u8); } extern "C" { - pub fn u_strToUpper_63( - dest: *mut UChar, + pub fn ucol_mergeSortkeys_63( + src1: *const u8, + src1Length: i32, + src2: *const u8, + src2Length: i32, + dest: *mut u8, destCapacity: i32, - src: *const UChar, - srcLength: i32, - locale: *const ::std::os::raw::c_char, - pErrorCode: *mut UErrorCode, ) -> i32; } extern "C" { - pub fn u_strToLower_63( - dest: *mut UChar, - destCapacity: i32, - src: *const UChar, - srcLength: i32, - locale: *const ::std::os::raw::c_char, - pErrorCode: *mut UErrorCode, - ) -> i32; + pub fn ucol_setAttribute_63( + coll: *mut UCollator, + attr: UColAttribute, + value: UColAttributeValue, + status: *mut UErrorCode, + ); } extern "C" { - pub fn u_strToTitle_63( - dest: *mut UChar, - destCapacity: i32, - src: *const UChar, - srcLength: i32, - titleIter: *mut UBreakIterator, - locale: *const ::std::os::raw::c_char, - pErrorCode: *mut UErrorCode, - ) -> i32; + pub fn ucol_getAttribute_63( + coll: *const UCollator, + attr: UColAttribute, + status: *mut UErrorCode, + ) -> UColAttributeValue; } extern "C" { - pub fn u_strFoldCase_63( - dest: *mut UChar, - destCapacity: i32, - src: *const UChar, - srcLength: i32, - options: u32, + pub fn ucol_setMaxVariable_63( + coll: *mut UCollator, + group: UColReorderCode, pErrorCode: *mut UErrorCode, - ) -> i32; + ); } extern "C" { - pub fn u_strToWCS_63( - dest: *mut wchar_t, - destCapacity: i32, - pDestLength: *mut i32, - src: *const UChar, - srcLength: i32, - pErrorCode: *mut UErrorCode, - ) -> *mut wchar_t; + pub fn ucol_getMaxVariable_63(coll: *const UCollator) -> UColReorderCode; } extern "C" { - pub fn u_strFromWCS_63( - dest: *mut UChar, - destCapacity: i32, - pDestLength: *mut i32, - src: *const wchar_t, - srcLength: i32, - pErrorCode: *mut UErrorCode, - ) -> *mut UChar; + pub fn ucol_setVariableTop_63( + coll: *mut UCollator, + varTop: *const UChar, + len: i32, + status: *mut UErrorCode, + ) -> u32; } extern "C" { - pub fn u_strToUTF8_63( - dest: *mut ::std::os::raw::c_char, - destCapacity: i32, - pDestLength: *mut i32, - src: *const UChar, - srcLength: i32, - pErrorCode: *mut UErrorCode, - ) -> *mut ::std::os::raw::c_char; + pub fn ucol_getVariableTop_63(coll: *const UCollator, status: *mut UErrorCode) -> u32; } extern "C" { - pub fn u_strFromUTF8_63( - dest: *mut UChar, - destCapacity: i32, - pDestLength: *mut i32, - src: *const ::std::os::raw::c_char, - srcLength: i32, - pErrorCode: *mut UErrorCode, - ) -> *mut UChar; + pub fn ucol_restoreVariableTop_63(coll: *mut UCollator, varTop: u32, status: *mut UErrorCode); } extern "C" { - pub fn u_strToUTF8WithSub_63( - dest: *mut ::std::os::raw::c_char, - destCapacity: i32, - pDestLength: *mut i32, - src: *const UChar, - srcLength: i32, - subchar: UChar32, - pNumSubstitutions: *mut i32, - pErrorCode: *mut UErrorCode, - ) -> *mut ::std::os::raw::c_char; + pub fn ucol_safeClone_63( + coll: *const UCollator, + stackBuffer: *mut ::std::os::raw::c_void, + pBufferSize: *mut i32, + status: *mut UErrorCode, + ) -> *mut UCollator; } extern "C" { - pub fn u_strFromUTF8WithSub_63( - dest: *mut UChar, - destCapacity: i32, - pDestLength: *mut i32, - src: *const ::std::os::raw::c_char, - srcLength: i32, - subchar: UChar32, - pNumSubstitutions: *mut i32, - pErrorCode: *mut UErrorCode, - ) -> *mut UChar; + pub fn ucol_getRulesEx_63( + coll: *const UCollator, + delta: UColRuleOption, + buffer: *mut UChar, + bufferLen: i32, + ) -> i32; } extern "C" { - pub fn u_strFromUTF8Lenient_63( - dest: *mut UChar, - destCapacity: i32, - pDestLength: *mut i32, - src: *const ::std::os::raw::c_char, - srcLength: i32, - pErrorCode: *mut UErrorCode, - ) -> *mut UChar; + pub fn ucol_getLocale_63( + coll: *const UCollator, + type_: ULocDataLocaleType, + status: *mut UErrorCode, + ) -> *const ::std::os::raw::c_char; } extern "C" { - pub fn u_strToUTF32_63( - dest: *mut UChar32, - destCapacity: i32, - pDestLength: *mut i32, - src: *const UChar, - srcLength: i32, - pErrorCode: *mut UErrorCode, - ) -> *mut UChar32; + pub fn ucol_getLocaleByType_63( + coll: *const UCollator, + type_: ULocDataLocaleType, + status: *mut UErrorCode, + ) -> *const ::std::os::raw::c_char; } extern "C" { - pub fn u_strFromUTF32_63( - dest: *mut UChar, - destCapacity: i32, - pDestLength: *mut i32, - src: *const UChar32, - srcLength: i32, - pErrorCode: *mut UErrorCode, - ) -> *mut UChar; + pub fn ucol_getTailoredSet_63(coll: *const UCollator, status: *mut UErrorCode) -> *mut USet; } extern "C" { - pub fn u_strToUTF32WithSub_63( - dest: *mut UChar32, - destCapacity: i32, - pDestLength: *mut i32, - src: *const UChar, - srcLength: i32, - subchar: UChar32, - pNumSubstitutions: *mut i32, - pErrorCode: *mut UErrorCode, - ) -> *mut UChar32; + pub fn ucol_getUnsafeSet_63( + coll: *const UCollator, + unsafe_: *mut USet, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_strFromUTF32WithSub_63( - dest: *mut UChar, - destCapacity: i32, - pDestLength: *mut i32, - src: *const UChar32, - srcLength: i32, - subchar: UChar32, - pNumSubstitutions: *mut i32, - pErrorCode: *mut UErrorCode, - ) -> *mut UChar; + pub fn ucol_prepareShortStringOpen_63( + definition: *const ::std::os::raw::c_char, + forceDefaults: UBool, + parseError: *mut UParseError, + status: *mut UErrorCode, + ); } extern "C" { - pub fn u_strToJavaModifiedUTF8_63( - dest: *mut ::std::os::raw::c_char, - destCapacity: i32, - pDestLength: *mut i32, - src: *const UChar, - srcLength: i32, - pErrorCode: *mut UErrorCode, - ) -> *mut ::std::os::raw::c_char; + pub fn ucol_cloneBinary_63( + coll: *const UCollator, + buffer: *mut u8, + capacity: i32, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_strFromJavaModifiedUTF8WithSub_63( - dest: *mut UChar, - destCapacity: i32, - pDestLength: *mut i32, - src: *const ::std::os::raw::c_char, - srcLength: i32, - subchar: UChar32, - pNumSubstitutions: *mut i32, - pErrorCode: *mut UErrorCode, - ) -> *mut UChar; + pub fn ucol_openBinary_63( + bin: *const u8, + length: i32, + base: *const UCollator, + status: *mut UErrorCode, + ) -> *mut UCollator; } #[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct UCPMap { - _unused: [u8; 0], +#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, PartialEq)] +pub struct UFieldPosition { + pub field: i32, + pub beginIndex: i32, + pub endIndex: i32, +} +#[test] +fn bindgen_test_layout_UFieldPosition() { + assert_eq!( + ::std::mem::size_of::(), + 12usize, + concat!("Size of: ", stringify!(UFieldPosition)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(UFieldPosition)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).field as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(UFieldPosition), + "::", + stringify!(field) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).beginIndex as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(UFieldPosition), + "::", + stringify!(beginIndex) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).endIndex as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(UFieldPosition), + "::", + stringify!(endIndex) + ) + ); +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] +pub enum UDisplayContextType { + UDISPCTX_TYPE_DIALECT_HANDLING = 0, + UDISPCTX_TYPE_CAPITALIZATION = 1, + UDISPCTX_TYPE_DISPLAY_LENGTH = 2, + UDISPCTX_TYPE_SUBSTITUTE_HANDLING = 3, +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] +pub enum UDisplayContext { + UDISPCTX_STANDARD_NAMES = 0, + UDISPCTX_DIALECT_NAMES = 1, + UDISPCTX_CAPITALIZATION_NONE = 256, + UDISPCTX_CAPITALIZATION_FOR_MIDDLE_OF_SENTENCE = 257, + UDISPCTX_CAPITALIZATION_FOR_BEGINNING_OF_SENTENCE = 258, + UDISPCTX_CAPITALIZATION_FOR_UI_LIST_OR_MENU = 259, + UDISPCTX_CAPITALIZATION_FOR_STANDALONE = 260, + UDISPCTX_LENGTH_FULL = 512, + UDISPCTX_LENGTH_SHORT = 513, + UDISPCTX_SUBSTITUTE = 768, + UDISPCTX_NO_SUBSTITUTE = 769, } #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct USet { +pub struct UFieldPositionIterator { _unused: [u8; 0], } -impl UProperty { - pub const UCHAR_BINARY_START: UProperty = UProperty::UCHAR_ALPHABETIC; -} -impl UProperty { - pub const UCHAR_INT_START: UProperty = UProperty::UCHAR_BIDI_CLASS; -} -impl UProperty { - pub const UCHAR_MASK_START: UProperty = UProperty::UCHAR_GENERAL_CATEGORY_MASK; -} -impl UProperty { - pub const UCHAR_DOUBLE_START: UProperty = UProperty::UCHAR_NUMERIC_VALUE; +pub type UNumberFormat = *mut ::std::os::raw::c_void; +pub type UDateFormat = *mut ::std::os::raw::c_void; +impl UDateFormatStyle { + pub const UDAT_DEFAULT: UDateFormatStyle = UDateFormatStyle::UDAT_MEDIUM; } -impl UProperty { - pub const UCHAR_STRING_START: UProperty = UProperty::UCHAR_AGE; +impl UDateFormatStyle { + pub const UDAT_FULL_RELATIVE: UDateFormatStyle = UDateFormatStyle::UDAT_RELATIVE; } -impl UProperty { - pub const UCHAR_OTHER_PROPERTY_START: UProperty = UProperty::UCHAR_SCRIPT_EXTENSIONS; +impl UDateFormatStyle { + pub const UDAT_IGNORE: UDateFormatStyle = UDateFormatStyle::UDAT_PATTERN; } #[repr(i32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UProperty { - UCHAR_ALPHABETIC = 0, - UCHAR_ASCII_HEX_DIGIT = 1, - UCHAR_BIDI_CONTROL = 2, - UCHAR_BIDI_MIRRORED = 3, - UCHAR_DASH = 4, - UCHAR_DEFAULT_IGNORABLE_CODE_POINT = 5, - UCHAR_DEPRECATED = 6, - UCHAR_DIACRITIC = 7, - UCHAR_EXTENDER = 8, - UCHAR_FULL_COMPOSITION_EXCLUSION = 9, - UCHAR_GRAPHEME_BASE = 10, - UCHAR_GRAPHEME_EXTEND = 11, - UCHAR_GRAPHEME_LINK = 12, - UCHAR_HEX_DIGIT = 13, - UCHAR_HYPHEN = 14, - UCHAR_ID_CONTINUE = 15, - UCHAR_ID_START = 16, - UCHAR_IDEOGRAPHIC = 17, - UCHAR_IDS_BINARY_OPERATOR = 18, - UCHAR_IDS_TRINARY_OPERATOR = 19, - UCHAR_JOIN_CONTROL = 20, - UCHAR_LOGICAL_ORDER_EXCEPTION = 21, - UCHAR_LOWERCASE = 22, - UCHAR_MATH = 23, - UCHAR_NONCHARACTER_CODE_POINT = 24, - UCHAR_QUOTATION_MARK = 25, - UCHAR_RADICAL = 26, - UCHAR_SOFT_DOTTED = 27, - UCHAR_TERMINAL_PUNCTUATION = 28, - UCHAR_UNIFIED_IDEOGRAPH = 29, - UCHAR_UPPERCASE = 30, - UCHAR_WHITE_SPACE = 31, - UCHAR_XID_CONTINUE = 32, - UCHAR_XID_START = 33, - UCHAR_CASE_SENSITIVE = 34, - UCHAR_S_TERM = 35, - UCHAR_VARIATION_SELECTOR = 36, - UCHAR_NFD_INERT = 37, - UCHAR_NFKD_INERT = 38, - UCHAR_NFC_INERT = 39, - UCHAR_NFKC_INERT = 40, - UCHAR_SEGMENT_STARTER = 41, - UCHAR_PATTERN_SYNTAX = 42, - UCHAR_PATTERN_WHITE_SPACE = 43, - UCHAR_POSIX_ALNUM = 44, - UCHAR_POSIX_BLANK = 45, - UCHAR_POSIX_GRAPH = 46, - UCHAR_POSIX_PRINT = 47, - UCHAR_POSIX_XDIGIT = 48, - UCHAR_CASED = 49, - UCHAR_CASE_IGNORABLE = 50, - UCHAR_CHANGES_WHEN_LOWERCASED = 51, - UCHAR_CHANGES_WHEN_UPPERCASED = 52, - UCHAR_CHANGES_WHEN_TITLECASED = 53, - UCHAR_CHANGES_WHEN_CASEFOLDED = 54, - UCHAR_CHANGES_WHEN_CASEMAPPED = 55, - UCHAR_CHANGES_WHEN_NFKC_CASEFOLDED = 56, - UCHAR_EMOJI = 57, - UCHAR_EMOJI_PRESENTATION = 58, - UCHAR_EMOJI_MODIFIER = 59, - UCHAR_EMOJI_MODIFIER_BASE = 60, - UCHAR_EMOJI_COMPONENT = 61, - UCHAR_REGIONAL_INDICATOR = 62, - UCHAR_PREPENDED_CONCATENATION_MARK = 63, - UCHAR_EXTENDED_PICTOGRAPHIC = 64, - UCHAR_BINARY_LIMIT = 65, - UCHAR_BIDI_CLASS = 4096, - UCHAR_BLOCK = 4097, - UCHAR_CANONICAL_COMBINING_CLASS = 4098, - UCHAR_DECOMPOSITION_TYPE = 4099, - UCHAR_EAST_ASIAN_WIDTH = 4100, - UCHAR_GENERAL_CATEGORY = 4101, - UCHAR_JOINING_GROUP = 4102, - UCHAR_JOINING_TYPE = 4103, - UCHAR_LINE_BREAK = 4104, - UCHAR_NUMERIC_TYPE = 4105, - UCHAR_SCRIPT = 4106, - UCHAR_HANGUL_SYLLABLE_TYPE = 4107, - UCHAR_NFD_QUICK_CHECK = 4108, - UCHAR_NFKD_QUICK_CHECK = 4109, - UCHAR_NFC_QUICK_CHECK = 4110, - UCHAR_NFKC_QUICK_CHECK = 4111, - UCHAR_LEAD_CANONICAL_COMBINING_CLASS = 4112, - UCHAR_TRAIL_CANONICAL_COMBINING_CLASS = 4113, - UCHAR_GRAPHEME_CLUSTER_BREAK = 4114, - UCHAR_SENTENCE_BREAK = 4115, - UCHAR_WORD_BREAK = 4116, - UCHAR_BIDI_PAIRED_BRACKET_TYPE = 4117, - UCHAR_INDIC_POSITIONAL_CATEGORY = 4118, - UCHAR_INDIC_SYLLABIC_CATEGORY = 4119, - UCHAR_VERTICAL_ORIENTATION = 4120, - UCHAR_INT_LIMIT = 4121, - UCHAR_GENERAL_CATEGORY_MASK = 8192, - UCHAR_MASK_LIMIT = 8193, - UCHAR_NUMERIC_VALUE = 12288, - UCHAR_DOUBLE_LIMIT = 12289, - UCHAR_AGE = 16384, - UCHAR_BIDI_MIRRORING_GLYPH = 16385, - UCHAR_CASE_FOLDING = 16386, - UCHAR_ISO_COMMENT = 16387, - UCHAR_LOWERCASE_MAPPING = 16388, - UCHAR_NAME = 16389, - UCHAR_SIMPLE_CASE_FOLDING = 16390, - UCHAR_SIMPLE_LOWERCASE_MAPPING = 16391, - UCHAR_SIMPLE_TITLECASE_MAPPING = 16392, - UCHAR_SIMPLE_UPPERCASE_MAPPING = 16393, - UCHAR_TITLECASE_MAPPING = 16394, - UCHAR_UNICODE_1_NAME = 16395, - UCHAR_UPPERCASE_MAPPING = 16396, - UCHAR_BIDI_PAIRED_BRACKET = 16397, - UCHAR_STRING_LIMIT = 16398, - UCHAR_SCRIPT_EXTENSIONS = 28672, - UCHAR_OTHER_PROPERTY_LIMIT = 28673, - UCHAR_INVALID_CODE = -1, -} -impl UCharCategory { - pub const U_GENERAL_OTHER_TYPES: UCharCategory = UCharCategory::U_UNASSIGNED; +pub enum UDateFormatStyle { + UDAT_FULL = 0, + UDAT_LONG = 1, + UDAT_MEDIUM = 2, + UDAT_SHORT = 3, + UDAT_RELATIVE = 128, + UDAT_LONG_RELATIVE = 129, + UDAT_MEDIUM_RELATIVE = 130, + UDAT_SHORT_RELATIVE = 131, + UDAT_NONE = -1, + UDAT_PATTERN = -2, } #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UCharCategory { - U_UNASSIGNED = 0, - U_UPPERCASE_LETTER = 1, - U_LOWERCASE_LETTER = 2, - U_TITLECASE_LETTER = 3, - U_MODIFIER_LETTER = 4, - U_OTHER_LETTER = 5, - U_NON_SPACING_MARK = 6, - U_ENCLOSING_MARK = 7, - U_COMBINING_SPACING_MARK = 8, - U_DECIMAL_DIGIT_NUMBER = 9, - U_LETTER_NUMBER = 10, - U_OTHER_NUMBER = 11, - U_SPACE_SEPARATOR = 12, - U_LINE_SEPARATOR = 13, - U_PARAGRAPH_SEPARATOR = 14, - U_CONTROL_CHAR = 15, - U_FORMAT_CHAR = 16, - U_PRIVATE_USE_CHAR = 17, - U_SURROGATE = 18, - U_DASH_PUNCTUATION = 19, - U_START_PUNCTUATION = 20, - U_END_PUNCTUATION = 21, - U_CONNECTOR_PUNCTUATION = 22, - U_OTHER_PUNCTUATION = 23, - U_MATH_SYMBOL = 24, - U_CURRENCY_SYMBOL = 25, - U_MODIFIER_SYMBOL = 26, - U_OTHER_SYMBOL = 27, - U_INITIAL_PUNCTUATION = 28, - U_FINAL_PUNCTUATION = 29, - U_CHAR_CATEGORY_COUNT = 30, +pub enum UDateFormatField { + UDAT_ERA_FIELD = 0, + UDAT_YEAR_FIELD = 1, + UDAT_MONTH_FIELD = 2, + UDAT_DATE_FIELD = 3, + UDAT_HOUR_OF_DAY1_FIELD = 4, + UDAT_HOUR_OF_DAY0_FIELD = 5, + UDAT_MINUTE_FIELD = 6, + UDAT_SECOND_FIELD = 7, + UDAT_FRACTIONAL_SECOND_FIELD = 8, + UDAT_DAY_OF_WEEK_FIELD = 9, + UDAT_DAY_OF_YEAR_FIELD = 10, + UDAT_DAY_OF_WEEK_IN_MONTH_FIELD = 11, + UDAT_WEEK_OF_YEAR_FIELD = 12, + UDAT_WEEK_OF_MONTH_FIELD = 13, + UDAT_AM_PM_FIELD = 14, + UDAT_HOUR1_FIELD = 15, + UDAT_HOUR0_FIELD = 16, + UDAT_TIMEZONE_FIELD = 17, + UDAT_YEAR_WOY_FIELD = 18, + UDAT_DOW_LOCAL_FIELD = 19, + UDAT_EXTENDED_YEAR_FIELD = 20, + UDAT_JULIAN_DAY_FIELD = 21, + UDAT_MILLISECONDS_IN_DAY_FIELD = 22, + UDAT_TIMEZONE_RFC_FIELD = 23, + UDAT_TIMEZONE_GENERIC_FIELD = 24, + UDAT_STANDALONE_DAY_FIELD = 25, + UDAT_STANDALONE_MONTH_FIELD = 26, + UDAT_QUARTER_FIELD = 27, + UDAT_STANDALONE_QUARTER_FIELD = 28, + UDAT_TIMEZONE_SPECIAL_FIELD = 29, + UDAT_YEAR_NAME_FIELD = 30, + UDAT_TIMEZONE_LOCALIZED_GMT_OFFSET_FIELD = 31, + UDAT_TIMEZONE_ISO_FIELD = 32, + UDAT_TIMEZONE_ISO_LOCAL_FIELD = 33, + UDAT_RELATED_YEAR_FIELD = 34, + UDAT_AM_PM_MIDNIGHT_NOON_FIELD = 35, + UDAT_FLEXIBLE_DAY_PERIOD_FIELD = 36, + UDAT_TIME_SEPARATOR_FIELD = 37, + UDAT_FIELD_COUNT = 38, +} +extern "C" { + pub fn udat_toCalendarDateField_63(field: UDateFormatField) -> UCalendarDateFields; +} +extern "C" { + pub fn udat_open_63( + timeStyle: UDateFormatStyle, + dateStyle: UDateFormatStyle, + locale: *const ::std::os::raw::c_char, + tzID: *const UChar, + tzIDLength: i32, + pattern: *const UChar, + patternLength: i32, + status: *mut UErrorCode, + ) -> *mut UDateFormat; +} +extern "C" { + pub fn udat_close_63(format: *mut UDateFormat); } #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UCharDirection { - U_LEFT_TO_RIGHT = 0, - U_RIGHT_TO_LEFT = 1, - U_EUROPEAN_NUMBER = 2, - U_EUROPEAN_NUMBER_SEPARATOR = 3, - U_EUROPEAN_NUMBER_TERMINATOR = 4, - U_ARABIC_NUMBER = 5, - U_COMMON_NUMBER_SEPARATOR = 6, - U_BLOCK_SEPARATOR = 7, - U_SEGMENT_SEPARATOR = 8, - U_WHITE_SPACE_NEUTRAL = 9, - U_OTHER_NEUTRAL = 10, - U_LEFT_TO_RIGHT_EMBEDDING = 11, - U_LEFT_TO_RIGHT_OVERRIDE = 12, - U_RIGHT_TO_LEFT_ARABIC = 13, - U_RIGHT_TO_LEFT_EMBEDDING = 14, - U_RIGHT_TO_LEFT_OVERRIDE = 15, - U_POP_DIRECTIONAL_FORMAT = 16, - U_DIR_NON_SPACING_MARK = 17, - U_BOUNDARY_NEUTRAL = 18, - U_FIRST_STRONG_ISOLATE = 19, - U_LEFT_TO_RIGHT_ISOLATE = 20, - U_RIGHT_TO_LEFT_ISOLATE = 21, - U_POP_DIRECTIONAL_ISOLATE = 22, - U_CHAR_DIRECTION_COUNT = 23, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UCharNameChoice { - U_UNICODE_CHAR_NAME = 0, - U_UNICODE_10_CHAR_NAME = 1, - U_EXTENDED_CHAR_NAME = 2, - U_CHAR_NAME_ALIAS = 3, - U_CHAR_NAME_CHOICE_COUNT = 4, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UPropertyNameChoice { - U_SHORT_PROPERTY_NAME = 0, - U_LONG_PROPERTY_NAME = 1, - U_PROPERTY_NAME_CHOICE_COUNT = 2, +pub enum UDateFormatBooleanAttribute { + UDAT_PARSE_ALLOW_WHITESPACE = 0, + UDAT_PARSE_ALLOW_NUMERIC = 1, + UDAT_PARSE_PARTIAL_LITERAL_MATCH = 2, + UDAT_PARSE_MULTIPLE_PATTERNS_FOR_MATCH = 3, + UDAT_BOOLEAN_ATTRIBUTE_COUNT = 4, } extern "C" { - pub fn u_hasBinaryProperty_63(c: UChar32, which: UProperty) -> UBool; + pub fn udat_getBooleanAttribute_63( + fmt: *const UDateFormat, + attr: UDateFormatBooleanAttribute, + status: *mut UErrorCode, + ) -> UBool; } extern "C" { - pub fn u_getBinaryPropertySet_63( - property: UProperty, - pErrorCode: *mut UErrorCode, - ) -> *const USet; + pub fn udat_setBooleanAttribute_63( + fmt: *mut UDateFormat, + attr: UDateFormatBooleanAttribute, + newValue: UBool, + status: *mut UErrorCode, + ); } extern "C" { - pub fn u_isUAlphabetic_63(c: UChar32) -> UBool; + pub fn udat_clone_63(fmt: *const UDateFormat, status: *mut UErrorCode) -> *mut UDateFormat; } extern "C" { - pub fn u_isULowercase_63(c: UChar32) -> UBool; + pub fn udat_format_63( + format: *const UDateFormat, + dateToFormat: UDate, + result: *mut UChar, + resultLength: i32, + position: *mut UFieldPosition, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_isUUppercase_63(c: UChar32) -> UBool; + pub fn udat_formatCalendar_63( + format: *const UDateFormat, + calendar: *mut UCalendar, + result: *mut UChar, + capacity: i32, + position: *mut UFieldPosition, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_isUWhiteSpace_63(c: UChar32) -> UBool; + pub fn udat_formatForFields_63( + format: *const UDateFormat, + dateToFormat: UDate, + result: *mut UChar, + resultLength: i32, + fpositer: *mut UFieldPositionIterator, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_getIntPropertyValue_63(c: UChar32, which: UProperty) -> i32; + pub fn udat_formatCalendarForFields_63( + format: *const UDateFormat, + calendar: *mut UCalendar, + result: *mut UChar, + capacity: i32, + fpositer: *mut UFieldPositionIterator, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_getIntPropertyMinValue_63(which: UProperty) -> i32; + pub fn udat_parse_63( + format: *const UDateFormat, + text: *const UChar, + textLength: i32, + parsePos: *mut i32, + status: *mut UErrorCode, + ) -> UDate; } extern "C" { - pub fn u_getIntPropertyMaxValue_63(which: UProperty) -> i32; + pub fn udat_parseCalendar_63( + format: *const UDateFormat, + calendar: *mut UCalendar, + text: *const UChar, + textLength: i32, + parsePos: *mut i32, + status: *mut UErrorCode, + ); } extern "C" { - pub fn u_getIntPropertyMap_63( - property: UProperty, - pErrorCode: *mut UErrorCode, - ) -> *const UCPMap; + pub fn udat_isLenient_63(fmt: *const UDateFormat) -> UBool; } extern "C" { - pub fn u_getNumericValue_63(c: UChar32) -> f64; + pub fn udat_setLenient_63(fmt: *mut UDateFormat, isLenient: UBool); } extern "C" { - pub fn u_islower_63(c: UChar32) -> UBool; + pub fn udat_getCalendar_63(fmt: *const UDateFormat) -> *const UCalendar; } extern "C" { - pub fn u_isupper_63(c: UChar32) -> UBool; + pub fn udat_setCalendar_63(fmt: *mut UDateFormat, calendarToSet: *const UCalendar); } extern "C" { - pub fn u_istitle_63(c: UChar32) -> UBool; + pub fn udat_getNumberFormat_63(fmt: *const UDateFormat) -> *const UNumberFormat; } extern "C" { - pub fn u_isdigit_63(c: UChar32) -> UBool; + pub fn udat_getNumberFormatForField_63( + fmt: *const UDateFormat, + field: UChar, + ) -> *const UNumberFormat; } extern "C" { - pub fn u_isalpha_63(c: UChar32) -> UBool; + pub fn udat_adoptNumberFormatForFields_63( + fmt: *mut UDateFormat, + fields: *const UChar, + numberFormatToSet: *mut UNumberFormat, + status: *mut UErrorCode, + ); } extern "C" { - pub fn u_isalnum_63(c: UChar32) -> UBool; + pub fn udat_setNumberFormat_63(fmt: *mut UDateFormat, numberFormatToSet: *const UNumberFormat); } extern "C" { - pub fn u_isxdigit_63(c: UChar32) -> UBool; + pub fn udat_adoptNumberFormat_63( + fmt: *mut UDateFormat, + numberFormatToAdopt: *mut UNumberFormat, + ); } extern "C" { - pub fn u_ispunct_63(c: UChar32) -> UBool; + pub fn udat_getAvailable_63(localeIndex: i32) -> *const ::std::os::raw::c_char; } extern "C" { - pub fn u_isgraph_63(c: UChar32) -> UBool; + pub fn udat_countAvailable_63() -> i32; } extern "C" { - pub fn u_isblank_63(c: UChar32) -> UBool; + pub fn udat_get2DigitYearStart_63(fmt: *const UDateFormat, status: *mut UErrorCode) -> UDate; } extern "C" { - pub fn u_isdefined_63(c: UChar32) -> UBool; + pub fn udat_set2DigitYearStart_63(fmt: *mut UDateFormat, d: UDate, status: *mut UErrorCode); } extern "C" { - pub fn u_isspace_63(c: UChar32) -> UBool; + pub fn udat_toPattern_63( + fmt: *const UDateFormat, + localized: UBool, + result: *mut UChar, + resultLength: i32, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_isJavaSpaceChar_63(c: UChar32) -> UBool; + pub fn udat_applyPattern_63( + format: *mut UDateFormat, + localized: UBool, + pattern: *const UChar, + patternLength: i32, + ); } -extern "C" { - pub fn u_isWhitespace_63(c: UChar32) -> UBool; +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] +pub enum UDateFormatSymbolType { + UDAT_ERAS = 0, + UDAT_MONTHS = 1, + UDAT_SHORT_MONTHS = 2, + UDAT_WEEKDAYS = 3, + UDAT_SHORT_WEEKDAYS = 4, + UDAT_AM_PMS = 5, + UDAT_LOCALIZED_CHARS = 6, + UDAT_ERA_NAMES = 7, + UDAT_NARROW_MONTHS = 8, + UDAT_NARROW_WEEKDAYS = 9, + UDAT_STANDALONE_MONTHS = 10, + UDAT_STANDALONE_SHORT_MONTHS = 11, + UDAT_STANDALONE_NARROW_MONTHS = 12, + UDAT_STANDALONE_WEEKDAYS = 13, + UDAT_STANDALONE_SHORT_WEEKDAYS = 14, + UDAT_STANDALONE_NARROW_WEEKDAYS = 15, + UDAT_QUARTERS = 16, + UDAT_SHORT_QUARTERS = 17, + UDAT_STANDALONE_QUARTERS = 18, + UDAT_STANDALONE_SHORT_QUARTERS = 19, + UDAT_SHORTER_WEEKDAYS = 20, + UDAT_STANDALONE_SHORTER_WEEKDAYS = 21, + UDAT_CYCLIC_YEARS_WIDE = 22, + UDAT_CYCLIC_YEARS_ABBREVIATED = 23, + UDAT_CYCLIC_YEARS_NARROW = 24, + UDAT_ZODIAC_NAMES_WIDE = 25, + UDAT_ZODIAC_NAMES_ABBREVIATED = 26, + UDAT_ZODIAC_NAMES_NARROW = 27, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct UDateFormatSymbols { + _unused: [u8; 0], } extern "C" { - pub fn u_iscntrl_63(c: UChar32) -> UBool; + pub fn udat_getSymbols_63( + fmt: *const UDateFormat, + type_: UDateFormatSymbolType, + symbolIndex: i32, + result: *mut UChar, + resultLength: i32, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_isISOControl_63(c: UChar32) -> UBool; + pub fn udat_countSymbols_63(fmt: *const UDateFormat, type_: UDateFormatSymbolType) -> i32; } extern "C" { - pub fn u_isprint_63(c: UChar32) -> UBool; + pub fn udat_setSymbols_63( + format: *mut UDateFormat, + type_: UDateFormatSymbolType, + symbolIndex: i32, + value: *mut UChar, + valueLength: i32, + status: *mut UErrorCode, + ); } extern "C" { - pub fn u_isbase_63(c: UChar32) -> UBool; + pub fn udat_getLocaleByType_63( + fmt: *const UDateFormat, + type_: ULocDataLocaleType, + status: *mut UErrorCode, + ) -> *const ::std::os::raw::c_char; } extern "C" { - pub fn u_charDirection_63(c: UChar32) -> UCharDirection; + pub fn udat_setContext_63( + fmt: *mut UDateFormat, + value: UDisplayContext, + status: *mut UErrorCode, + ); } extern "C" { - pub fn u_isMirrored_63(c: UChar32) -> UBool; + pub fn udat_getContext_63( + fmt: *const UDateFormat, + type_: UDisplayContextType, + status: *mut UErrorCode, + ) -> UDisplayContext; } extern "C" { - pub fn u_charMirror_63(c: UChar32) -> UChar32; + pub fn udat_toPatternRelativeDate_63( + fmt: *const UDateFormat, + result: *mut UChar, + resultLength: i32, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_getBidiPairedBracket_63(c: UChar32) -> UChar32; + pub fn udat_toPatternRelativeTime_63( + fmt: *const UDateFormat, + result: *mut UChar, + resultLength: i32, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_charType_63(c: UChar32) -> i8; + pub fn udat_applyPatternRelative_63( + format: *mut UDateFormat, + datePattern: *const UChar, + datePatternLength: i32, + timePattern: *const UChar, + timePatternLength: i32, + status: *mut UErrorCode, + ); } -pub type UCharEnumTypeRange = ::std::option::Option< +pub type UDateFormatOpener = ::std::option::Option< unsafe extern "C" fn( - context: *const ::std::os::raw::c_void, - start: UChar32, - limit: UChar32, - type_: UCharCategory, - ) -> UBool, + timeStyle: UDateFormatStyle, + dateStyle: UDateFormatStyle, + locale: *const ::std::os::raw::c_char, + tzID: *const UChar, + tzIDLength: i32, + pattern: *const UChar, + patternLength: i32, + status: *mut UErrorCode, + ) -> *mut UDateFormat, >; extern "C" { - pub fn u_enumCharTypes_63( - enumRange: UCharEnumTypeRange, - context: *const ::std::os::raw::c_void, - ); -} -extern "C" { - pub fn u_getCombiningClass_63(c: UChar32) -> u8; + pub fn udat_registerOpener_63(opener: UDateFormatOpener, status: *mut UErrorCode); } extern "C" { - pub fn u_charDigitValue_63(c: UChar32) -> i32; + pub fn udat_unregisterOpener_63( + opener: UDateFormatOpener, + status: *mut UErrorCode, + ) -> UDateFormatOpener; } -extern "C" { - pub fn u_charName_63( - code: UChar32, - nameChoice: UCharNameChoice, - buffer: *mut ::std::os::raw::c_char, - bufferLength: i32, - pErrorCode: *mut UErrorCode, - ) -> i32; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, PartialEq)] +pub struct UDataInfo { + pub size: u16, + pub reservedWord: u16, + pub isBigEndian: u8, + pub charsetFamily: u8, + pub sizeofUChar: u8, + pub reservedByte: u8, + pub dataFormat: [u8; 4usize], + pub formatVersion: [u8; 4usize], + pub dataVersion: [u8; 4usize], } -extern "C" { - pub fn u_getISOComment_63( - c: UChar32, - dest: *mut ::std::os::raw::c_char, - destCapacity: i32, - pErrorCode: *mut UErrorCode, - ) -> i32; +#[test] +fn bindgen_test_layout_UDataInfo() { + assert_eq!( + ::std::mem::size_of::(), + 20usize, + concat!("Size of: ", stringify!(UDataInfo)) + ); + assert_eq!( + ::std::mem::align_of::(), + 2usize, + concat!("Alignment of ", stringify!(UDataInfo)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).size as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(UDataInfo), + "::", + stringify!(size) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).reservedWord as *const _ as usize }, + 2usize, + concat!( + "Offset of field: ", + stringify!(UDataInfo), + "::", + stringify!(reservedWord) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).isBigEndian as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(UDataInfo), + "::", + stringify!(isBigEndian) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).charsetFamily as *const _ as usize }, + 5usize, + concat!( + "Offset of field: ", + stringify!(UDataInfo), + "::", + stringify!(charsetFamily) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).sizeofUChar as *const _ as usize }, + 6usize, + concat!( + "Offset of field: ", + stringify!(UDataInfo), + "::", + stringify!(sizeofUChar) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).reservedByte as *const _ as usize }, + 7usize, + concat!( + "Offset of field: ", + stringify!(UDataInfo), + "::", + stringify!(reservedByte) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).dataFormat as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(UDataInfo), + "::", + stringify!(dataFormat) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).formatVersion as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(UDataInfo), + "::", + stringify!(formatVersion) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).dataVersion as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(UDataInfo), + "::", + stringify!(dataVersion) + ) + ); } -extern "C" { - pub fn u_charFromName_63( - nameChoice: UCharNameChoice, - name: *const ::std::os::raw::c_char, - pErrorCode: *mut UErrorCode, - ) -> UChar32; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct UDataMemory { + _unused: [u8; 0], } -pub type UEnumCharNamesFn = ::std::option::Option< +pub type UDataMemoryIsAcceptable = ::std::option::Option< unsafe extern "C" fn( context: *mut ::std::os::raw::c_void, - code: UChar32, - nameChoice: UCharNameChoice, + type_: *const ::std::os::raw::c_char, name: *const ::std::os::raw::c_char, - length: i32, + pInfo: *const UDataInfo, ) -> UBool, >; extern "C" { - pub fn u_enumCharNames_63( - start: UChar32, - limit: UChar32, - fn_: UEnumCharNamesFn, - context: *mut ::std::os::raw::c_void, - nameChoice: UCharNameChoice, + pub fn udata_open_63( + path: *const ::std::os::raw::c_char, + type_: *const ::std::os::raw::c_char, + name: *const ::std::os::raw::c_char, pErrorCode: *mut UErrorCode, - ); + ) -> *mut UDataMemory; } extern "C" { - pub fn u_getPropertyName_63( - property: UProperty, - nameChoice: UPropertyNameChoice, - ) -> *const ::std::os::raw::c_char; + pub fn udata_openChoice_63( + path: *const ::std::os::raw::c_char, + type_: *const ::std::os::raw::c_char, + name: *const ::std::os::raw::c_char, + isAcceptable: UDataMemoryIsAcceptable, + context: *mut ::std::os::raw::c_void, + pErrorCode: *mut UErrorCode, + ) -> *mut UDataMemory; } extern "C" { - pub fn u_getPropertyEnum_63(alias: *const ::std::os::raw::c_char) -> UProperty; + pub fn udata_close_63(pData: *mut UDataMemory); } extern "C" { - pub fn u_getPropertyValueName_63( - property: UProperty, - value: i32, - nameChoice: UPropertyNameChoice, - ) -> *const ::std::os::raw::c_char; + pub fn udata_getMemory_63(pData: *mut UDataMemory) -> *const ::std::os::raw::c_void; } extern "C" { - pub fn u_getPropertyValueEnum_63( - property: UProperty, - alias: *const ::std::os::raw::c_char, - ) -> i32; + pub fn udata_getInfo_63(pData: *mut UDataMemory, pInfo: *mut UDataInfo); } extern "C" { - pub fn u_isIDStart_63(c: UChar32) -> UBool; + pub fn udata_setCommonData_63(data: *const ::std::os::raw::c_void, err: *mut UErrorCode); } extern "C" { - pub fn u_isIDPart_63(c: UChar32) -> UBool; + pub fn udata_setAppData_63( + packageName: *const ::std::os::raw::c_char, + data: *const ::std::os::raw::c_void, + err: *mut UErrorCode, + ); } -extern "C" { - pub fn u_isIDIgnorable_63(c: UChar32) -> UBool; +impl UDataFileAccess { + pub const UDATA_DEFAULT_ACCESS: UDataFileAccess = UDataFileAccess::UDATA_FILES_FIRST; } -extern "C" { - pub fn u_isJavaIDStart_63(c: UChar32) -> UBool; +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] +pub enum UDataFileAccess { + UDATA_FILES_FIRST = 0, + UDATA_ONLY_PACKAGES = 1, + UDATA_PACKAGES_FIRST = 2, + UDATA_NO_FILES = 3, + UDATA_FILE_ACCESS_COUNT = 4, } extern "C" { - pub fn u_isJavaIDPart_63(c: UChar32) -> UBool; + pub fn udata_setFileAccess_63(access: UDataFileAccess, status: *mut UErrorCode); } -extern "C" { - pub fn u_tolower_63(c: UChar32) -> UChar32; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct UListFormatter { + _unused: [u8; 0], } -extern "C" { - pub fn u_toupper_63(c: UChar32) -> UChar32; +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] +pub enum UListFormatterField { + ULISTFMT_LITERAL_FIELD = 0, + ULISTFMT_ELEMENT_FIELD = 1, } extern "C" { - pub fn u_totitle_63(c: UChar32) -> UChar32; + pub fn ulistfmt_open_63( + locale: *const ::std::os::raw::c_char, + status: *mut UErrorCode, + ) -> *mut UListFormatter; } extern "C" { - pub fn u_foldCase_63(c: UChar32, options: u32) -> UChar32; + pub fn ulistfmt_close_63(listfmt: *mut UListFormatter); } extern "C" { - pub fn u_digit_63(ch: UChar32, radix: i8) -> i32; + pub fn ulistfmt_format_63( + listfmt: *const UListFormatter, + strings: *const *const UChar, + stringLengths: *const i32, + stringCount: i32, + result: *mut UChar, + resultCapacity: i32, + status: *mut UErrorCode, + ) -> i32; } +pub type va_list = __builtin_va_list; extern "C" { - pub fn u_forDigit_63(digit: i32, radix: i8) -> UChar32; -} -extern "C" { - pub fn u_charAge_63(c: UChar32, versionArray: *mut u8); -} -extern "C" { - pub fn u_getUnicodeVersion_63(versionArray: *mut u8); + pub fn u_formatMessage_63( + locale: *const ::std::os::raw::c_char, + pattern: *const UChar, + patternLength: i32, + result: *mut UChar, + resultLength: i32, + status: *mut UErrorCode, + ... + ) -> i32; } extern "C" { - pub fn u_getFC_NFKC_Closure_63( - c: UChar32, - dest: *mut UChar, - destCapacity: i32, - pErrorCode: *mut UErrorCode, + pub fn u_vformatMessage_63( + locale: *const ::std::os::raw::c_char, + pattern: *const UChar, + patternLength: i32, + result: *mut UChar, + resultLength: i32, + ap: *mut __va_list_tag, + status: *mut UErrorCode, ) -> i32; } extern "C" { - pub fn utext_close_63(ut: *mut UText) -> *mut UText; + pub fn u_parseMessage_63( + locale: *const ::std::os::raw::c_char, + pattern: *const UChar, + patternLength: i32, + source: *const UChar, + sourceLength: i32, + status: *mut UErrorCode, + ... + ); } extern "C" { - pub fn utext_openUTF8_63( - ut: *mut UText, - s: *const ::std::os::raw::c_char, - length: i64, + pub fn u_vparseMessage_63( + locale: *const ::std::os::raw::c_char, + pattern: *const UChar, + patternLength: i32, + source: *const UChar, + sourceLength: i32, + ap: *mut __va_list_tag, status: *mut UErrorCode, - ) -> *mut UText; + ); } extern "C" { - pub fn utext_openUChars_63( - ut: *mut UText, - s: *const UChar, - length: i64, + pub fn u_formatMessageWithError_63( + locale: *const ::std::os::raw::c_char, + pattern: *const UChar, + patternLength: i32, + result: *mut UChar, + resultLength: i32, + parseError: *mut UParseError, status: *mut UErrorCode, - ) -> *mut UText; + ... + ) -> i32; } extern "C" { - pub fn utext_clone_63( - dest: *mut UText, - src: *const UText, - deep: UBool, - readOnly: UBool, + pub fn u_vformatMessageWithError_63( + locale: *const ::std::os::raw::c_char, + pattern: *const UChar, + patternLength: i32, + result: *mut UChar, + resultLength: i32, + parseError: *mut UParseError, + ap: *mut __va_list_tag, status: *mut UErrorCode, - ) -> *mut UText; + ) -> i32; } extern "C" { - pub fn utext_equals_63(a: *const UText, b: *const UText) -> UBool; + pub fn u_parseMessageWithError_63( + locale: *const ::std::os::raw::c_char, + pattern: *const UChar, + patternLength: i32, + source: *const UChar, + sourceLength: i32, + parseError: *mut UParseError, + status: *mut UErrorCode, + ... + ); } extern "C" { - pub fn utext_nativeLength_63(ut: *mut UText) -> i64; + pub fn u_vparseMessageWithError_63( + locale: *const ::std::os::raw::c_char, + pattern: *const UChar, + patternLength: i32, + source: *const UChar, + sourceLength: i32, + ap: *mut __va_list_tag, + parseError: *mut UParseError, + status: *mut UErrorCode, + ); } +pub type UMessageFormat = *mut ::std::os::raw::c_void; extern "C" { - pub fn utext_isLengthExpensive_63(ut: *const UText) -> UBool; + pub fn umsg_open_63( + pattern: *const UChar, + patternLength: i32, + locale: *const ::std::os::raw::c_char, + parseError: *mut UParseError, + status: *mut UErrorCode, + ) -> *mut UMessageFormat; } extern "C" { - pub fn utext_char32At_63(ut: *mut UText, nativeIndex: i64) -> UChar32; + pub fn umsg_close_63(format: *mut UMessageFormat); } extern "C" { - pub fn utext_current32_63(ut: *mut UText) -> UChar32; + pub fn umsg_clone_63(fmt: *const UMessageFormat, status: *mut UErrorCode) -> UMessageFormat; } extern "C" { - pub fn utext_next32_63(ut: *mut UText) -> UChar32; + pub fn umsg_setLocale_63(fmt: *mut UMessageFormat, locale: *const ::std::os::raw::c_char); } extern "C" { - pub fn utext_previous32_63(ut: *mut UText) -> UChar32; + pub fn umsg_getLocale_63(fmt: *const UMessageFormat) -> *const ::std::os::raw::c_char; } extern "C" { - pub fn utext_next32From_63(ut: *mut UText, nativeIndex: i64) -> UChar32; + pub fn umsg_applyPattern_63( + fmt: *mut UMessageFormat, + pattern: *const UChar, + patternLength: i32, + parseError: *mut UParseError, + status: *mut UErrorCode, + ); } extern "C" { - pub fn utext_previous32From_63(ut: *mut UText, nativeIndex: i64) -> UChar32; + pub fn umsg_toPattern_63( + fmt: *const UMessageFormat, + result: *mut UChar, + resultLength: i32, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn utext_getNativeIndex_63(ut: *const UText) -> i64; + pub fn umsg_format_63( + fmt: *const UMessageFormat, + result: *mut UChar, + resultLength: i32, + status: *mut UErrorCode, + ... + ) -> i32; } extern "C" { - pub fn utext_setNativeIndex_63(ut: *mut UText, nativeIndex: i64); + pub fn umsg_vformat_63( + fmt: *const UMessageFormat, + result: *mut UChar, + resultLength: i32, + ap: *mut __va_list_tag, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn utext_moveIndex32_63(ut: *mut UText, delta: i32) -> UBool; + pub fn umsg_parse_63( + fmt: *const UMessageFormat, + source: *const UChar, + sourceLength: i32, + count: *mut i32, + status: *mut UErrorCode, + ... + ); } extern "C" { - pub fn utext_getPreviousNativeIndex_63(ut: *mut UText) -> i64; + pub fn umsg_vparse_63( + fmt: *const UMessageFormat, + source: *const UChar, + sourceLength: i32, + count: *mut i32, + ap: *mut __va_list_tag, + status: *mut UErrorCode, + ); } extern "C" { - pub fn utext_extract_63( - ut: *mut UText, - nativeStart: i64, - nativeLimit: i64, + pub fn umsg_autoQuoteApostrophe_63( + pattern: *const UChar, + patternLength: i32, dest: *mut UChar, destCapacity: i32, - status: *mut UErrorCode, + ec: *mut UErrorCode, ) -> i32; } extern "C" { - pub fn utext_isWritable_63(ut: *const UText) -> UBool; + pub fn u_getDataDirectory_63() -> *const ::std::os::raw::c_char; } extern "C" { - pub fn utext_hasMetaData_63(ut: *const UText) -> UBool; + pub fn u_setDataDirectory_63(directory: *const ::std::os::raw::c_char); } extern "C" { - pub fn utext_replace_63( - ut: *mut UText, - nativeStart: i64, - nativeLimit: i64, - replacementText: *const UChar, - replacementLength: i32, - status: *mut UErrorCode, - ) -> i32; + pub fn u_getTimeZoneFilesDirectory_63(status: *mut UErrorCode) + -> *const ::std::os::raw::c_char; } extern "C" { - pub fn utext_copy_63( - ut: *mut UText, - nativeStart: i64, - nativeLimit: i64, - destIndex: i64, - move_: UBool, + pub fn u_setTimeZoneFilesDirectory_63( + path: *const ::std::os::raw::c_char, status: *mut UErrorCode, ); } extern "C" { - pub fn utext_freeze_63(ut: *mut UText); + pub fn u_charsToUChars_63(cs: *const ::std::os::raw::c_char, us: *mut UChar, length: i32); +} +extern "C" { + pub fn u_UCharsToChars_63(us: *const UChar, cs: *mut ::std::os::raw::c_char, length: i32); } -pub type UTextClone = ::std::option::Option< - unsafe extern "C" fn( - dest: *mut UText, - src: *const UText, - deep: UBool, - status: *mut UErrorCode, - ) -> *mut UText, ->; -pub type UTextNativeLength = ::std::option::Option i64>; -pub type UTextAccess = ::std::option::Option< - unsafe extern "C" fn(ut: *mut UText, nativeIndex: i64, forward: UBool) -> UBool, ->; -pub type UTextExtract = ::std::option::Option< - unsafe extern "C" fn( - ut: *mut UText, - nativeStart: i64, - nativeLimit: i64, - dest: *mut UChar, - destCapacity: i32, - status: *mut UErrorCode, - ) -> i32, ->; -pub type UTextReplace = ::std::option::Option< - unsafe extern "C" fn( - ut: *mut UText, - nativeStart: i64, - nativeLimit: i64, - replacementText: *const UChar, - replacmentLength: i32, - status: *mut UErrorCode, - ) -> i32, ->; -pub type UTextCopy = ::std::option::Option< - unsafe extern "C" fn( - ut: *mut UText, - nativeStart: i64, - nativeLimit: i64, - nativeDest: i64, - move_: UBool, - status: *mut UErrorCode, - ), ->; -pub type UTextMapOffsetToNative = - ::std::option::Option i64>; -pub type UTextMapNativeIndexToUTF16 = - ::std::option::Option i32>; -pub type UTextClose = ::std::option::Option; #[repr(C)] -#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, PartialEq)] -pub struct UTextFuncs { - pub tableSize: i32, - pub reserved1: i32, - pub reserved2: i32, - pub reserved3: i32, - pub clone: UTextClone, - pub nativeLength: UTextNativeLength, - pub access: UTextAccess, - pub extract: UTextExtract, - pub replace: UTextReplace, - pub copy: UTextCopy, - pub mapOffsetToNative: UTextMapOffsetToNative, - pub mapNativeIndexToUTF16: UTextMapNativeIndexToUTF16, - pub close: UTextClose, - pub spare1: UTextClose, - pub spare2: UTextClose, - pub spare3: UTextClose, -} -#[test] -fn bindgen_test_layout_UTextFuncs() { - assert_eq!( - ::std::mem::size_of::(), - 112usize, - concat!("Size of: ", stringify!(UTextFuncs)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(UTextFuncs)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).tableSize as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(UTextFuncs), - "::", - stringify!(tableSize) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).reserved1 as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(UTextFuncs), - "::", - stringify!(reserved1) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).reserved2 as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(UTextFuncs), - "::", - stringify!(reserved2) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).reserved3 as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(UTextFuncs), - "::", - stringify!(reserved3) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).clone as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(UTextFuncs), - "::", - stringify!(clone) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).nativeLength as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(UTextFuncs), - "::", - stringify!(nativeLength) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).access as *const _ as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(UTextFuncs), - "::", - stringify!(access) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).extract as *const _ as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(UTextFuncs), - "::", - stringify!(extract) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).replace as *const _ as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(UTextFuncs), - "::", - stringify!(replace) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).copy as *const _ as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(UTextFuncs), - "::", - stringify!(copy) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).mapOffsetToNative as *const _ as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(UTextFuncs), - "::", - stringify!(mapOffsetToNative) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).mapNativeIndexToUTF16 as *const _ as usize - }, - 72usize, - concat!( - "Offset of field: ", - stringify!(UTextFuncs), - "::", - stringify!(mapNativeIndexToUTF16) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).close as *const _ as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(UTextFuncs), - "::", - stringify!(close) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).spare1 as *const _ as usize }, - 88usize, - concat!( - "Offset of field: ", - stringify!(UTextFuncs), - "::", - stringify!(spare1) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).spare2 as *const _ as usize }, - 96usize, - concat!( - "Offset of field: ", - stringify!(UTextFuncs), - "::", - stringify!(spare2) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).spare3 as *const _ as usize }, - 104usize, - concat!( - "Offset of field: ", - stringify!(UTextFuncs), - "::", - stringify!(spare3) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone, Hash, PartialOrd, PartialEq)] -pub struct UText { - pub magic: u32, - pub flags: i32, - pub providerProperties: i32, - pub sizeOfStruct: i32, - pub chunkNativeLimit: i64, - pub extraSize: i32, - pub nativeIndexingLimit: i32, - pub chunkNativeStart: i64, - pub chunkOffset: i32, - pub chunkLength: i32, - pub chunkContents: *const UChar, - pub pFuncs: *const UTextFuncs, - pub pExtra: *mut ::std::os::raw::c_void, - pub context: *const ::std::os::raw::c_void, - pub p: *const ::std::os::raw::c_void, - pub q: *const ::std::os::raw::c_void, - pub r: *const ::std::os::raw::c_void, - pub privP: *mut ::std::os::raw::c_void, - pub a: i64, - pub b: i32, - pub c: i32, - pub privA: i64, - pub privB: i32, - pub privC: i32, -} -#[test] -fn bindgen_test_layout_UText() { - assert_eq!( - ::std::mem::size_of::(), - 144usize, - concat!("Size of: ", stringify!(UText)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(UText)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).magic as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(magic) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).flags as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(flags) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).providerProperties as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(providerProperties) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).sizeOfStruct as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(sizeOfStruct) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).chunkNativeLimit as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(chunkNativeLimit) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).extraSize as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(extraSize) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).nativeIndexingLimit as *const _ as usize }, - 28usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(nativeIndexingLimit) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).chunkNativeStart as *const _ as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(chunkNativeStart) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).chunkOffset as *const _ as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(chunkOffset) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).chunkLength as *const _ as usize }, - 44usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(chunkLength) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).chunkContents as *const _ as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(chunkContents) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).pFuncs as *const _ as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(pFuncs) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).pExtra as *const _ as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(pExtra) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).context as *const _ as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(context) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).p as *const _ as usize }, - 80usize, - concat!("Offset of field: ", stringify!(UText), "::", stringify!(p)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).q as *const _ as usize }, - 88usize, - concat!("Offset of field: ", stringify!(UText), "::", stringify!(q)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).r as *const _ as usize }, - 96usize, - concat!("Offset of field: ", stringify!(UText), "::", stringify!(r)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).privP as *const _ as usize }, - 104usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(privP) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).a as *const _ as usize }, - 112usize, - concat!("Offset of field: ", stringify!(UText), "::", stringify!(a)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).b as *const _ as usize }, - 120usize, - concat!("Offset of field: ", stringify!(UText), "::", stringify!(b)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).c as *const _ as usize }, - 124usize, - concat!("Offset of field: ", stringify!(UText), "::", stringify!(c)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).privA as *const _ as usize }, - 128usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(privA) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).privB as *const _ as usize }, - 136usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(privB) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).privC as *const _ as usize }, - 140usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(privC) - ) - ); +#[derive(Debug, Copy, Clone)] +pub struct UBreakIterator { + _unused: [u8; 0], } -impl Default for UText { - fn default() -> Self { - unsafe { ::std::mem::zeroed() } - } +extern "C" { + pub fn u_strlen_63(s: *const UChar) -> i32; } extern "C" { - pub fn utext_setup_63(ut: *mut UText, extraSpace: i32, status: *mut UErrorCode) -> *mut UText; + pub fn u_countChar32_63(s: *const UChar, length: i32) -> i32; } extern "C" { - pub fn u_init_63(status: *mut UErrorCode); + pub fn u_strHasMoreChar32Than_63(s: *const UChar, length: i32, number: i32) -> UBool; } extern "C" { - pub fn u_cleanup_63(); + pub fn u_strcat_63(dst: *mut UChar, src: *const UChar) -> *mut UChar; +} +extern "C" { + pub fn u_strncat_63(dst: *mut UChar, src: *const UChar, n: i32) -> *mut UChar; +} +extern "C" { + pub fn u_strstr_63(s: *const UChar, substring: *const UChar) -> *mut UChar; +} +extern "C" { + pub fn u_strFindFirst_63( + s: *const UChar, + length: i32, + substring: *const UChar, + subLength: i32, + ) -> *mut UChar; +} +extern "C" { + pub fn u_strchr_63(s: *const UChar, c: UChar) -> *mut UChar; +} +extern "C" { + pub fn u_strchr32_63(s: *const UChar, c: UChar32) -> *mut UChar; +} +extern "C" { + pub fn u_strrstr_63(s: *const UChar, substring: *const UChar) -> *mut UChar; +} +extern "C" { + pub fn u_strFindLast_63( + s: *const UChar, + length: i32, + substring: *const UChar, + subLength: i32, + ) -> *mut UChar; +} +extern "C" { + pub fn u_strrchr_63(s: *const UChar, c: UChar) -> *mut UChar; +} +extern "C" { + pub fn u_strrchr32_63(s: *const UChar, c: UChar32) -> *mut UChar; +} +extern "C" { + pub fn u_strpbrk_63(string: *const UChar, matchSet: *const UChar) -> *mut UChar; +} +extern "C" { + pub fn u_strcspn_63(string: *const UChar, matchSet: *const UChar) -> i32; +} +extern "C" { + pub fn u_strspn_63(string: *const UChar, matchSet: *const UChar) -> i32; +} +extern "C" { + pub fn u_strtok_r_63( + src: *mut UChar, + delim: *const UChar, + saveState: *mut *mut UChar, + ) -> *mut UChar; +} +extern "C" { + pub fn u_strcmp_63(s1: *const UChar, s2: *const UChar) -> i32; +} +extern "C" { + pub fn u_strcmpCodePointOrder_63(s1: *const UChar, s2: *const UChar) -> i32; +} +extern "C" { + pub fn u_strCompare_63( + s1: *const UChar, + length1: i32, + s2: *const UChar, + length2: i32, + codePointOrder: UBool, + ) -> i32; +} +extern "C" { + pub fn u_strCompareIter_63( + iter1: *mut UCharIterator, + iter2: *mut UCharIterator, + codePointOrder: UBool, + ) -> i32; +} +extern "C" { + pub fn u_strCaseCompare_63( + s1: *const UChar, + length1: i32, + s2: *const UChar, + length2: i32, + options: u32, + pErrorCode: *mut UErrorCode, + ) -> i32; +} +extern "C" { + pub fn u_strncmp_63(ucs1: *const UChar, ucs2: *const UChar, n: i32) -> i32; +} +extern "C" { + pub fn u_strncmpCodePointOrder_63(s1: *const UChar, s2: *const UChar, n: i32) -> i32; +} +extern "C" { + pub fn u_strcasecmp_63(s1: *const UChar, s2: *const UChar, options: u32) -> i32; +} +extern "C" { + pub fn u_strncasecmp_63(s1: *const UChar, s2: *const UChar, n: i32, options: u32) -> i32; +} +extern "C" { + pub fn u_memcasecmp_63(s1: *const UChar, s2: *const UChar, length: i32, options: u32) -> i32; +} +extern "C" { + pub fn u_strcpy_63(dst: *mut UChar, src: *const UChar) -> *mut UChar; +} +extern "C" { + pub fn u_strncpy_63(dst: *mut UChar, src: *const UChar, n: i32) -> *mut UChar; +} +extern "C" { + pub fn u_uastrcpy_63(dst: *mut UChar, src: *const ::std::os::raw::c_char) -> *mut UChar; +} +extern "C" { + pub fn u_uastrncpy_63( + dst: *mut UChar, + src: *const ::std::os::raw::c_char, + n: i32, + ) -> *mut UChar; +} +extern "C" { + pub fn u_austrcpy_63( + dst: *mut ::std::os::raw::c_char, + src: *const UChar, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn u_austrncpy_63( + dst: *mut ::std::os::raw::c_char, + src: *const UChar, + n: i32, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn u_memcpy_63(dest: *mut UChar, src: *const UChar, count: i32) -> *mut UChar; +} +extern "C" { + pub fn u_memmove_63(dest: *mut UChar, src: *const UChar, count: i32) -> *mut UChar; +} +extern "C" { + pub fn u_memset_63(dest: *mut UChar, c: UChar, count: i32) -> *mut UChar; +} +extern "C" { + pub fn u_memcmp_63(buf1: *const UChar, buf2: *const UChar, count: i32) -> i32; +} +extern "C" { + pub fn u_memcmpCodePointOrder_63(s1: *const UChar, s2: *const UChar, count: i32) -> i32; } -pub type UMemAllocFn = ::std::option::Option< - unsafe extern "C" fn( - context: *const ::std::os::raw::c_void, - size: size_t, - ) -> *mut ::std::os::raw::c_void, ->; -pub type UMemReallocFn = ::std::option::Option< - unsafe extern "C" fn( - context: *const ::std::os::raw::c_void, - mem: *mut ::std::os::raw::c_void, - size: size_t, - ) -> *mut ::std::os::raw::c_void, ->; -pub type UMemFreeFn = ::std::option::Option< - unsafe extern "C" fn(context: *const ::std::os::raw::c_void, mem: *mut ::std::os::raw::c_void), ->; extern "C" { - pub fn u_setMemoryFunctions_63( - context: *const ::std::os::raw::c_void, - a: UMemAllocFn, - r: UMemReallocFn, - f: UMemFreeFn, - status: *mut UErrorCode, - ); + pub fn u_memchr_63(s: *const UChar, c: UChar, count: i32) -> *mut UChar; } -pub type UMTX = *mut ::std::os::raw::c_void; -pub type UMtxInitFn = ::std::option::Option< - unsafe extern "C" fn( - context: *const ::std::os::raw::c_void, - mutex: *mut UMTX, - status: *mut UErrorCode, - ), ->; -pub type UMtxFn = ::std::option::Option< - unsafe extern "C" fn(context: *const ::std::os::raw::c_void, mutex: *mut UMTX), ->; extern "C" { - pub fn u_setMutexFunctions_63( - context: *const ::std::os::raw::c_void, - init: UMtxInitFn, - destroy: UMtxFn, - lock: UMtxFn, - unlock: UMtxFn, - status: *mut UErrorCode, - ); + pub fn u_memchr32_63(s: *const UChar, c: UChar32, count: i32) -> *mut UChar; } -pub type UMtxAtomicFn = ::std::option::Option< - unsafe extern "C" fn(context: *const ::std::os::raw::c_void, p: *mut i32) -> i32, ->; extern "C" { - pub fn u_setAtomicIncDecFunctions_63( - context: *const ::std::os::raw::c_void, - inc: UMtxAtomicFn, - dec: UMtxAtomicFn, - status: *mut UErrorCode, - ); + pub fn u_memrchr_63(s: *const UChar, c: UChar, count: i32) -> *mut UChar; } -pub type va_list = __builtin_va_list; extern "C" { - pub fn u_formatMessage_63( - locale: *const ::std::os::raw::c_char, - pattern: *const UChar, - patternLength: i32, - result: *mut UChar, - resultLength: i32, - status: *mut UErrorCode, - ... - ) -> i32; + pub fn u_memrchr32_63(s: *const UChar, c: UChar32, count: i32) -> *mut UChar; } extern "C" { - pub fn u_vformatMessage_63( - locale: *const ::std::os::raw::c_char, - pattern: *const UChar, - patternLength: i32, - result: *mut UChar, - resultLength: i32, - ap: *mut __va_list_tag, - status: *mut UErrorCode, + pub fn u_unescape_63( + src: *const ::std::os::raw::c_char, + dest: *mut UChar, + destCapacity: i32, ) -> i32; } +pub type UNESCAPE_CHAR_AT = ::std::option::Option< + unsafe extern "C" fn(offset: i32, context: *mut ::std::os::raw::c_void) -> UChar, +>; extern "C" { - pub fn u_parseMessage_63( - locale: *const ::std::os::raw::c_char, - pattern: *const UChar, - patternLength: i32, - source: *const UChar, - sourceLength: i32, - status: *mut UErrorCode, - ... - ); + pub fn u_unescapeAt_63( + charAt: UNESCAPE_CHAR_AT, + offset: *mut i32, + length: i32, + context: *mut ::std::os::raw::c_void, + ) -> UChar32; } extern "C" { - pub fn u_vparseMessage_63( + pub fn u_strToUpper_63( + dest: *mut UChar, + destCapacity: i32, + src: *const UChar, + srcLength: i32, locale: *const ::std::os::raw::c_char, - pattern: *const UChar, - patternLength: i32, - source: *const UChar, - sourceLength: i32, - ap: *mut __va_list_tag, - status: *mut UErrorCode, - ); + pErrorCode: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_formatMessageWithError_63( + pub fn u_strToLower_63( + dest: *mut UChar, + destCapacity: i32, + src: *const UChar, + srcLength: i32, locale: *const ::std::os::raw::c_char, - pattern: *const UChar, - patternLength: i32, - result: *mut UChar, - resultLength: i32, - parseError: *mut UParseError, - status: *mut UErrorCode, - ... + pErrorCode: *mut UErrorCode, ) -> i32; } extern "C" { - pub fn u_vformatMessageWithError_63( + pub fn u_strToTitle_63( + dest: *mut UChar, + destCapacity: i32, + src: *const UChar, + srcLength: i32, + titleIter: *mut UBreakIterator, locale: *const ::std::os::raw::c_char, - pattern: *const UChar, - patternLength: i32, - result: *mut UChar, - resultLength: i32, - parseError: *mut UParseError, - ap: *mut __va_list_tag, - status: *mut UErrorCode, + pErrorCode: *mut UErrorCode, ) -> i32; } extern "C" { - pub fn u_parseMessageWithError_63( - locale: *const ::std::os::raw::c_char, - pattern: *const UChar, - patternLength: i32, - source: *const UChar, - sourceLength: i32, - parseError: *mut UParseError, - status: *mut UErrorCode, - ... - ); + pub fn u_strFoldCase_63( + dest: *mut UChar, + destCapacity: i32, + src: *const UChar, + srcLength: i32, + options: u32, + pErrorCode: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_vparseMessageWithError_63( - locale: *const ::std::os::raw::c_char, - pattern: *const UChar, - patternLength: i32, - source: *const UChar, - sourceLength: i32, - ap: *mut __va_list_tag, - parseError: *mut UParseError, - status: *mut UErrorCode, - ); + pub fn u_strToWCS_63( + dest: *mut wchar_t, + destCapacity: i32, + pDestLength: *mut i32, + src: *const UChar, + srcLength: i32, + pErrorCode: *mut UErrorCode, + ) -> *mut wchar_t; } -pub type UMessageFormat = *mut ::std::os::raw::c_void; extern "C" { - pub fn umsg_open_63( - pattern: *const UChar, - patternLength: i32, - locale: *const ::std::os::raw::c_char, - parseError: *mut UParseError, - status: *mut UErrorCode, - ) -> *mut UMessageFormat; + pub fn u_strFromWCS_63( + dest: *mut UChar, + destCapacity: i32, + pDestLength: *mut i32, + src: *const wchar_t, + srcLength: i32, + pErrorCode: *mut UErrorCode, + ) -> *mut UChar; } extern "C" { - pub fn umsg_close_63(format: *mut UMessageFormat); + pub fn u_strToUTF8_63( + dest: *mut ::std::os::raw::c_char, + destCapacity: i32, + pDestLength: *mut i32, + src: *const UChar, + srcLength: i32, + pErrorCode: *mut UErrorCode, + ) -> *mut ::std::os::raw::c_char; } extern "C" { - pub fn umsg_clone_63(fmt: *const UMessageFormat, status: *mut UErrorCode) -> UMessageFormat; + pub fn u_strFromUTF8_63( + dest: *mut UChar, + destCapacity: i32, + pDestLength: *mut i32, + src: *const ::std::os::raw::c_char, + srcLength: i32, + pErrorCode: *mut UErrorCode, + ) -> *mut UChar; +} +extern "C" { + pub fn u_strToUTF8WithSub_63( + dest: *mut ::std::os::raw::c_char, + destCapacity: i32, + pDestLength: *mut i32, + src: *const UChar, + srcLength: i32, + subchar: UChar32, + pNumSubstitutions: *mut i32, + pErrorCode: *mut UErrorCode, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn u_strFromUTF8WithSub_63( + dest: *mut UChar, + destCapacity: i32, + pDestLength: *mut i32, + src: *const ::std::os::raw::c_char, + srcLength: i32, + subchar: UChar32, + pNumSubstitutions: *mut i32, + pErrorCode: *mut UErrorCode, + ) -> *mut UChar; +} +extern "C" { + pub fn u_strFromUTF8Lenient_63( + dest: *mut UChar, + destCapacity: i32, + pDestLength: *mut i32, + src: *const ::std::os::raw::c_char, + srcLength: i32, + pErrorCode: *mut UErrorCode, + ) -> *mut UChar; +} +extern "C" { + pub fn u_strToUTF32_63( + dest: *mut UChar32, + destCapacity: i32, + pDestLength: *mut i32, + src: *const UChar, + srcLength: i32, + pErrorCode: *mut UErrorCode, + ) -> *mut UChar32; +} +extern "C" { + pub fn u_strFromUTF32_63( + dest: *mut UChar, + destCapacity: i32, + pDestLength: *mut i32, + src: *const UChar32, + srcLength: i32, + pErrorCode: *mut UErrorCode, + ) -> *mut UChar; +} +extern "C" { + pub fn u_strToUTF32WithSub_63( + dest: *mut UChar32, + destCapacity: i32, + pDestLength: *mut i32, + src: *const UChar, + srcLength: i32, + subchar: UChar32, + pNumSubstitutions: *mut i32, + pErrorCode: *mut UErrorCode, + ) -> *mut UChar32; } extern "C" { - pub fn umsg_setLocale_63(fmt: *mut UMessageFormat, locale: *const ::std::os::raw::c_char); + pub fn u_strFromUTF32WithSub_63( + dest: *mut UChar, + destCapacity: i32, + pDestLength: *mut i32, + src: *const UChar32, + srcLength: i32, + subchar: UChar32, + pNumSubstitutions: *mut i32, + pErrorCode: *mut UErrorCode, + ) -> *mut UChar; } extern "C" { - pub fn umsg_getLocale_63(fmt: *const UMessageFormat) -> *const ::std::os::raw::c_char; + pub fn u_strToJavaModifiedUTF8_63( + dest: *mut ::std::os::raw::c_char, + destCapacity: i32, + pDestLength: *mut i32, + src: *const UChar, + srcLength: i32, + pErrorCode: *mut UErrorCode, + ) -> *mut ::std::os::raw::c_char; } extern "C" { - pub fn umsg_applyPattern_63( - fmt: *mut UMessageFormat, - pattern: *const UChar, - patternLength: i32, - parseError: *mut UParseError, - status: *mut UErrorCode, - ); + pub fn u_strFromJavaModifiedUTF8WithSub_63( + dest: *mut UChar, + destCapacity: i32, + pDestLength: *mut i32, + src: *const ::std::os::raw::c_char, + srcLength: i32, + subchar: UChar32, + pNumSubstitutions: *mut i32, + pErrorCode: *mut UErrorCode, + ) -> *mut UChar; } extern "C" { - pub fn umsg_toPattern_63( - fmt: *const UMessageFormat, - result: *mut UChar, - resultLength: i32, - status: *mut UErrorCode, - ) -> i32; + pub fn utext_close_63(ut: *mut UText) -> *mut UText; } extern "C" { - pub fn umsg_format_63( - fmt: *const UMessageFormat, - result: *mut UChar, - resultLength: i32, + pub fn utext_openUTF8_63( + ut: *mut UText, + s: *const ::std::os::raw::c_char, + length: i64, status: *mut UErrorCode, - ... - ) -> i32; + ) -> *mut UText; } extern "C" { - pub fn umsg_vformat_63( - fmt: *const UMessageFormat, - result: *mut UChar, - resultLength: i32, - ap: *mut __va_list_tag, + pub fn utext_openUChars_63( + ut: *mut UText, + s: *const UChar, + length: i64, status: *mut UErrorCode, - ) -> i32; + ) -> *mut UText; } extern "C" { - pub fn umsg_parse_63( - fmt: *const UMessageFormat, - source: *const UChar, - sourceLength: i32, - count: *mut i32, + pub fn utext_clone_63( + dest: *mut UText, + src: *const UText, + deep: UBool, + readOnly: UBool, status: *mut UErrorCode, - ... - ); + ) -> *mut UText; } extern "C" { - pub fn umsg_vparse_63( - fmt: *const UMessageFormat, - source: *const UChar, - sourceLength: i32, - count: *mut i32, - ap: *mut __va_list_tag, - status: *mut UErrorCode, - ); + pub fn utext_equals_63(a: *const UText, b: *const UText) -> UBool; } extern "C" { - pub fn umsg_autoQuoteApostrophe_63( - pattern: *const UChar, - patternLength: i32, - dest: *mut UChar, - destCapacity: i32, - ec: *mut UErrorCode, - ) -> i32; -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum USetSpanCondition { - USET_SPAN_NOT_CONTAINED = 0, - USET_SPAN_CONTAINED = 1, - USET_SPAN_SIMPLE = 2, - USET_SPAN_CONDITION_COUNT = 3, -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct UCollator { - _unused: [u8; 0], -} -#[repr(i32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UCollationResult { - UCOL_EQUAL = 0, - UCOL_GREATER = 1, - UCOL_LESS = -1, -} -impl UColAttributeValue { - pub const UCOL_DEFAULT_STRENGTH: UColAttributeValue = UColAttributeValue::UCOL_TERTIARY; -} -impl UColAttributeValue { - pub const UCOL_QUATERNARY: UColAttributeValue = UColAttributeValue::UCOL_CE_STRENGTH_LIMIT; -} -impl UColAttributeValue { - pub const UCOL_OFF: UColAttributeValue = UColAttributeValue::UCOL_STRENGTH_LIMIT; -} -#[repr(i32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UColAttributeValue { - UCOL_DEFAULT = -1, - UCOL_PRIMARY = 0, - UCOL_SECONDARY = 1, - UCOL_TERTIARY = 2, - UCOL_CE_STRENGTH_LIMIT = 3, - UCOL_IDENTICAL = 15, - UCOL_STRENGTH_LIMIT = 16, - UCOL_ON = 17, - UCOL_SHIFTED = 20, - UCOL_NON_IGNORABLE = 21, - UCOL_LOWER_FIRST = 24, - UCOL_UPPER_FIRST = 25, - UCOL_ATTRIBUTE_VALUE_COUNT = 26, -} -impl UColReorderCode { - pub const UCOL_REORDER_CODE_OTHERS: UColReorderCode = UColReorderCode::UCOL_REORDER_CODE_NONE; -} -impl UColReorderCode { - pub const UCOL_REORDER_CODE_FIRST: UColReorderCode = UColReorderCode::UCOL_REORDER_CODE_SPACE; -} -#[repr(i32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UColReorderCode { - UCOL_REORDER_CODE_DEFAULT = -1, - UCOL_REORDER_CODE_NONE = 103, - UCOL_REORDER_CODE_SPACE = 4096, - UCOL_REORDER_CODE_PUNCTUATION = 4097, - UCOL_REORDER_CODE_SYMBOL = 4098, - UCOL_REORDER_CODE_CURRENCY = 4099, - UCOL_REORDER_CODE_DIGIT = 4100, - UCOL_REORDER_CODE_LIMIT = 4101, -} -pub use self::UColAttributeValue as UCollationStrength; -impl UColAttribute { - pub const UCOL_DECOMPOSITION_MODE: UColAttribute = UColAttribute::UCOL_NORMALIZATION_MODE; -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UColAttribute { - UCOL_FRENCH_COLLATION = 0, - UCOL_ALTERNATE_HANDLING = 1, - UCOL_CASE_FIRST = 2, - UCOL_CASE_LEVEL = 3, - UCOL_NORMALIZATION_MODE = 4, - UCOL_STRENGTH = 5, - UCOL_HIRAGANA_QUATERNARY_MODE = 6, - UCOL_NUMERIC_COLLATION = 7, - UCOL_ATTRIBUTE_COUNT = 8, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UColRuleOption { - UCOL_TAILORING_ONLY = 0, - UCOL_FULL_RULES = 1, + pub fn utext_nativeLength_63(ut: *mut UText) -> i64; } extern "C" { - pub fn ucol_open_63( - loc: *const ::std::os::raw::c_char, - status: *mut UErrorCode, - ) -> *mut UCollator; + pub fn utext_isLengthExpensive_63(ut: *const UText) -> UBool; } extern "C" { - pub fn ucol_openRules_63( - rules: *const UChar, - rulesLength: i32, - normalizationMode: UColAttributeValue, - strength: UCollationStrength, - parseError: *mut UParseError, - status: *mut UErrorCode, - ) -> *mut UCollator; + pub fn utext_char32At_63(ut: *mut UText, nativeIndex: i64) -> UChar32; } extern "C" { - pub fn ucol_openFromShortString_63( - definition: *const ::std::os::raw::c_char, - forceDefaults: UBool, - parseError: *mut UParseError, - status: *mut UErrorCode, - ) -> *mut UCollator; + pub fn utext_current32_63(ut: *mut UText) -> UChar32; } extern "C" { - pub fn ucol_getContractions_63( - coll: *const UCollator, - conts: *mut USet, - status: *mut UErrorCode, - ) -> i32; + pub fn utext_next32_63(ut: *mut UText) -> UChar32; } extern "C" { - pub fn ucol_getContractionsAndExpansions_63( - coll: *const UCollator, - contractions: *mut USet, - expansions: *mut USet, - addPrefixes: UBool, - status: *mut UErrorCode, - ); + pub fn utext_previous32_63(ut: *mut UText) -> UChar32; } extern "C" { - pub fn ucol_close_63(coll: *mut UCollator); + pub fn utext_next32From_63(ut: *mut UText, nativeIndex: i64) -> UChar32; } extern "C" { - pub fn ucol_strcoll_63( - coll: *const UCollator, - source: *const UChar, - sourceLength: i32, - target: *const UChar, - targetLength: i32, - ) -> UCollationResult; + pub fn utext_previous32From_63(ut: *mut UText, nativeIndex: i64) -> UChar32; } extern "C" { - pub fn ucol_strcollUTF8_63( - coll: *const UCollator, - source: *const ::std::os::raw::c_char, - sourceLength: i32, - target: *const ::std::os::raw::c_char, - targetLength: i32, - status: *mut UErrorCode, - ) -> UCollationResult; + pub fn utext_getNativeIndex_63(ut: *const UText) -> i64; } extern "C" { - pub fn ucol_greater_63( - coll: *const UCollator, - source: *const UChar, - sourceLength: i32, - target: *const UChar, - targetLength: i32, - ) -> UBool; + pub fn utext_setNativeIndex_63(ut: *mut UText, nativeIndex: i64); } extern "C" { - pub fn ucol_greaterOrEqual_63( - coll: *const UCollator, - source: *const UChar, - sourceLength: i32, - target: *const UChar, - targetLength: i32, - ) -> UBool; + pub fn utext_moveIndex32_63(ut: *mut UText, delta: i32) -> UBool; } extern "C" { - pub fn ucol_equal_63( - coll: *const UCollator, - source: *const UChar, - sourceLength: i32, - target: *const UChar, - targetLength: i32, - ) -> UBool; + pub fn utext_getPreviousNativeIndex_63(ut: *mut UText) -> i64; } extern "C" { - pub fn ucol_strcollIter_63( - coll: *const UCollator, - sIter: *mut UCharIterator, - tIter: *mut UCharIterator, + pub fn utext_extract_63( + ut: *mut UText, + nativeStart: i64, + nativeLimit: i64, + dest: *mut UChar, + destCapacity: i32, status: *mut UErrorCode, - ) -> UCollationResult; + ) -> i32; } extern "C" { - pub fn ucol_getStrength_63(coll: *const UCollator) -> UCollationStrength; + pub fn utext_isWritable_63(ut: *const UText) -> UBool; } extern "C" { - pub fn ucol_setStrength_63(coll: *mut UCollator, strength: UCollationStrength); + pub fn utext_hasMetaData_63(ut: *const UText) -> UBool; } extern "C" { - pub fn ucol_getReorderCodes_63( - coll: *const UCollator, - dest: *mut i32, - destCapacity: i32, - pErrorCode: *mut UErrorCode, + pub fn utext_replace_63( + ut: *mut UText, + nativeStart: i64, + nativeLimit: i64, + replacementText: *const UChar, + replacementLength: i32, + status: *mut UErrorCode, ) -> i32; } extern "C" { - pub fn ucol_setReorderCodes_63( - coll: *mut UCollator, - reorderCodes: *const i32, - reorderCodesLength: i32, - pErrorCode: *mut UErrorCode, + pub fn utext_copy_63( + ut: *mut UText, + nativeStart: i64, + nativeLimit: i64, + destIndex: i64, + move_: UBool, + status: *mut UErrorCode, + ); +} +extern "C" { + pub fn utext_freeze_63(ut: *mut UText); +} +pub type UTextClone = ::std::option::Option< + unsafe extern "C" fn( + dest: *mut UText, + src: *const UText, + deep: UBool, + status: *mut UErrorCode, + ) -> *mut UText, +>; +pub type UTextNativeLength = ::std::option::Option i64>; +pub type UTextAccess = ::std::option::Option< + unsafe extern "C" fn(ut: *mut UText, nativeIndex: i64, forward: UBool) -> UBool, +>; +pub type UTextExtract = ::std::option::Option< + unsafe extern "C" fn( + ut: *mut UText, + nativeStart: i64, + nativeLimit: i64, + dest: *mut UChar, + destCapacity: i32, + status: *mut UErrorCode, + ) -> i32, +>; +pub type UTextReplace = ::std::option::Option< + unsafe extern "C" fn( + ut: *mut UText, + nativeStart: i64, + nativeLimit: i64, + replacementText: *const UChar, + replacmentLength: i32, + status: *mut UErrorCode, + ) -> i32, +>; +pub type UTextCopy = ::std::option::Option< + unsafe extern "C" fn( + ut: *mut UText, + nativeStart: i64, + nativeLimit: i64, + nativeDest: i64, + move_: UBool, + status: *mut UErrorCode, + ), +>; +pub type UTextMapOffsetToNative = + ::std::option::Option i64>; +pub type UTextMapNativeIndexToUTF16 = + ::std::option::Option i32>; +pub type UTextClose = ::std::option::Option; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, PartialEq)] +pub struct UTextFuncs { + pub tableSize: i32, + pub reserved1: i32, + pub reserved2: i32, + pub reserved3: i32, + pub clone: UTextClone, + pub nativeLength: UTextNativeLength, + pub access: UTextAccess, + pub extract: UTextExtract, + pub replace: UTextReplace, + pub copy: UTextCopy, + pub mapOffsetToNative: UTextMapOffsetToNative, + pub mapNativeIndexToUTF16: UTextMapNativeIndexToUTF16, + pub close: UTextClose, + pub spare1: UTextClose, + pub spare2: UTextClose, + pub spare3: UTextClose, +} +#[test] +fn bindgen_test_layout_UTextFuncs() { + assert_eq!( + ::std::mem::size_of::(), + 112usize, + concat!("Size of: ", stringify!(UTextFuncs)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(UTextFuncs)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tableSize as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(UTextFuncs), + "::", + stringify!(tableSize) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).reserved1 as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(UTextFuncs), + "::", + stringify!(reserved1) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).reserved2 as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(UTextFuncs), + "::", + stringify!(reserved2) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).reserved3 as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(UTextFuncs), + "::", + stringify!(reserved3) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).clone as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(UTextFuncs), + "::", + stringify!(clone) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).nativeLength as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(UTextFuncs), + "::", + stringify!(nativeLength) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).access as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(UTextFuncs), + "::", + stringify!(access) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).extract as *const _ as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(UTextFuncs), + "::", + stringify!(extract) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).replace as *const _ as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(UTextFuncs), + "::", + stringify!(replace) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).copy as *const _ as usize }, + 56usize, + concat!( + "Offset of field: ", + stringify!(UTextFuncs), + "::", + stringify!(copy) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).mapOffsetToNative as *const _ as usize }, + 64usize, + concat!( + "Offset of field: ", + stringify!(UTextFuncs), + "::", + stringify!(mapOffsetToNative) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).mapNativeIndexToUTF16 as *const _ as usize + }, + 72usize, + concat!( + "Offset of field: ", + stringify!(UTextFuncs), + "::", + stringify!(mapNativeIndexToUTF16) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).close as *const _ as usize }, + 80usize, + concat!( + "Offset of field: ", + stringify!(UTextFuncs), + "::", + stringify!(close) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).spare1 as *const _ as usize }, + 88usize, + concat!( + "Offset of field: ", + stringify!(UTextFuncs), + "::", + stringify!(spare1) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).spare2 as *const _ as usize }, + 96usize, + concat!( + "Offset of field: ", + stringify!(UTextFuncs), + "::", + stringify!(spare2) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).spare3 as *const _ as usize }, + 104usize, + concat!( + "Offset of field: ", + stringify!(UTextFuncs), + "::", + stringify!(spare3) + ) ); } -extern "C" { - pub fn ucol_getEquivalentReorderCodes_63( - reorderCode: i32, - dest: *mut i32, - destCapacity: i32, - pErrorCode: *mut UErrorCode, - ) -> i32; -} -extern "C" { - pub fn ucol_getDisplayName_63( - objLoc: *const ::std::os::raw::c_char, - dispLoc: *const ::std::os::raw::c_char, - result: *mut UChar, - resultLength: i32, - status: *mut UErrorCode, - ) -> i32; -} -extern "C" { - pub fn ucol_getAvailable_63(localeIndex: i32) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn ucol_countAvailable_63() -> i32; -} -extern "C" { - pub fn ucol_openAvailableLocales_63(status: *mut UErrorCode) -> *mut UEnumeration; -} -extern "C" { - pub fn ucol_getKeywords_63(status: *mut UErrorCode) -> *mut UEnumeration; -} -extern "C" { - pub fn ucol_getKeywordValues_63( - keyword: *const ::std::os::raw::c_char, - status: *mut UErrorCode, - ) -> *mut UEnumeration; -} -extern "C" { - pub fn ucol_getKeywordValuesForLocale_63( - key: *const ::std::os::raw::c_char, - locale: *const ::std::os::raw::c_char, - commonlyUsed: UBool, - status: *mut UErrorCode, - ) -> *mut UEnumeration; -} -extern "C" { - pub fn ucol_getFunctionalEquivalent_63( - result: *mut ::std::os::raw::c_char, - resultCapacity: i32, - keyword: *const ::std::os::raw::c_char, - locale: *const ::std::os::raw::c_char, - isAvailable: *mut UBool, - status: *mut UErrorCode, - ) -> i32; -} -extern "C" { - pub fn ucol_getRules_63(coll: *const UCollator, length: *mut i32) -> *const UChar; -} -extern "C" { - pub fn ucol_getShortDefinitionString_63( - coll: *const UCollator, - locale: *const ::std::os::raw::c_char, - buffer: *mut ::std::os::raw::c_char, - capacity: i32, - status: *mut UErrorCode, - ) -> i32; -} -extern "C" { - pub fn ucol_normalizeShortDefinitionString_63( - source: *const ::std::os::raw::c_char, - destination: *mut ::std::os::raw::c_char, - capacity: i32, - parseError: *mut UParseError, - status: *mut UErrorCode, - ) -> i32; -} -extern "C" { - pub fn ucol_getSortKey_63( - coll: *const UCollator, - source: *const UChar, - sourceLength: i32, - result: *mut u8, - resultLength: i32, - ) -> i32; -} -extern "C" { - pub fn ucol_nextSortKeyPart_63( - coll: *const UCollator, - iter: *mut UCharIterator, - state: *mut u32, - dest: *mut u8, - count: i32, - status: *mut UErrorCode, - ) -> i32; -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UColBoundMode { - UCOL_BOUND_LOWER = 0, - UCOL_BOUND_UPPER = 1, - UCOL_BOUND_UPPER_LONG = 2, - UCOL_BOUND_VALUE_COUNT = 3, -} -extern "C" { - pub fn ucol_getBound_63( - source: *const u8, - sourceLength: i32, - boundType: UColBoundMode, - noOfLevels: u32, - result: *mut u8, - resultLength: i32, - status: *mut UErrorCode, - ) -> i32; -} -extern "C" { - pub fn ucol_getVersion_63(coll: *const UCollator, info: *mut u8); -} -extern "C" { - pub fn ucol_getUCAVersion_63(coll: *const UCollator, info: *mut u8); -} -extern "C" { - pub fn ucol_mergeSortkeys_63( - src1: *const u8, - src1Length: i32, - src2: *const u8, - src2Length: i32, - dest: *mut u8, - destCapacity: i32, - ) -> i32; +#[repr(C)] +#[derive(Debug, Copy, Clone, Hash, PartialOrd, PartialEq)] +pub struct UText { + pub magic: u32, + pub flags: i32, + pub providerProperties: i32, + pub sizeOfStruct: i32, + pub chunkNativeLimit: i64, + pub extraSize: i32, + pub nativeIndexingLimit: i32, + pub chunkNativeStart: i64, + pub chunkOffset: i32, + pub chunkLength: i32, + pub chunkContents: *const UChar, + pub pFuncs: *const UTextFuncs, + pub pExtra: *mut ::std::os::raw::c_void, + pub context: *const ::std::os::raw::c_void, + pub p: *const ::std::os::raw::c_void, + pub q: *const ::std::os::raw::c_void, + pub r: *const ::std::os::raw::c_void, + pub privP: *mut ::std::os::raw::c_void, + pub a: i64, + pub b: i32, + pub c: i32, + pub privA: i64, + pub privB: i32, + pub privC: i32, } -extern "C" { - pub fn ucol_setAttribute_63( - coll: *mut UCollator, - attr: UColAttribute, - value: UColAttributeValue, - status: *mut UErrorCode, +#[test] +fn bindgen_test_layout_UText() { + assert_eq!( + ::std::mem::size_of::(), + 144usize, + concat!("Size of: ", stringify!(UText)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(UText)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).magic as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(magic) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).flags as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(flags) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).providerProperties as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(providerProperties) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).sizeOfStruct as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(sizeOfStruct) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).chunkNativeLimit as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(chunkNativeLimit) + ) ); -} -extern "C" { - pub fn ucol_getAttribute_63( - coll: *const UCollator, - attr: UColAttribute, - status: *mut UErrorCode, - ) -> UColAttributeValue; -} -extern "C" { - pub fn ucol_setMaxVariable_63( - coll: *mut UCollator, - group: UColReorderCode, - pErrorCode: *mut UErrorCode, + assert_eq!( + unsafe { &(*(::std::ptr::null::())).extraSize as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(extraSize) + ) ); -} -extern "C" { - pub fn ucol_getMaxVariable_63(coll: *const UCollator) -> UColReorderCode; -} -extern "C" { - pub fn ucol_setVariableTop_63( - coll: *mut UCollator, - varTop: *const UChar, - len: i32, - status: *mut UErrorCode, - ) -> u32; -} -extern "C" { - pub fn ucol_getVariableTop_63(coll: *const UCollator, status: *mut UErrorCode) -> u32; -} -extern "C" { - pub fn ucol_restoreVariableTop_63(coll: *mut UCollator, varTop: u32, status: *mut UErrorCode); -} -extern "C" { - pub fn ucol_safeClone_63( - coll: *const UCollator, - stackBuffer: *mut ::std::os::raw::c_void, - pBufferSize: *mut i32, - status: *mut UErrorCode, - ) -> *mut UCollator; -} -extern "C" { - pub fn ucol_getRulesEx_63( - coll: *const UCollator, - delta: UColRuleOption, - buffer: *mut UChar, - bufferLen: i32, - ) -> i32; -} -extern "C" { - pub fn ucol_getLocale_63( - coll: *const UCollator, - type_: ULocDataLocaleType, - status: *mut UErrorCode, - ) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn ucol_getLocaleByType_63( - coll: *const UCollator, - type_: ULocDataLocaleType, - status: *mut UErrorCode, - ) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn ucol_getTailoredSet_63(coll: *const UCollator, status: *mut UErrorCode) -> *mut USet; -} -extern "C" { - pub fn ucol_getUnsafeSet_63( - coll: *const UCollator, - unsafe_: *mut USet, - status: *mut UErrorCode, - ) -> i32; -} -extern "C" { - pub fn ucol_prepareShortStringOpen_63( - definition: *const ::std::os::raw::c_char, - forceDefaults: UBool, - parseError: *mut UParseError, - status: *mut UErrorCode, + assert_eq!( + unsafe { &(*(::std::ptr::null::())).nativeIndexingLimit as *const _ as usize }, + 28usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(nativeIndexingLimit) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).chunkNativeStart as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(chunkNativeStart) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).chunkOffset as *const _ as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(chunkOffset) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).chunkLength as *const _ as usize }, + 44usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(chunkLength) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).chunkContents as *const _ as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(chunkContents) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).pFuncs as *const _ as usize }, + 56usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(pFuncs) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).pExtra as *const _ as usize }, + 64usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(pExtra) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).context as *const _ as usize }, + 72usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(context) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).p as *const _ as usize }, + 80usize, + concat!("Offset of field: ", stringify!(UText), "::", stringify!(p)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).q as *const _ as usize }, + 88usize, + concat!("Offset of field: ", stringify!(UText), "::", stringify!(q)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).r as *const _ as usize }, + 96usize, + concat!("Offset of field: ", stringify!(UText), "::", stringify!(r)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).privP as *const _ as usize }, + 104usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(privP) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).a as *const _ as usize }, + 112usize, + concat!("Offset of field: ", stringify!(UText), "::", stringify!(a)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).b as *const _ as usize }, + 120usize, + concat!("Offset of field: ", stringify!(UText), "::", stringify!(b)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).c as *const _ as usize }, + 124usize, + concat!("Offset of field: ", stringify!(UText), "::", stringify!(c)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).privA as *const _ as usize }, + 128usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(privA) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).privB as *const _ as usize }, + 136usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(privB) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).privC as *const _ as usize }, + 140usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(privC) + ) ); } -extern "C" { - pub fn ucol_cloneBinary_63( - coll: *const UCollator, - buffer: *mut u8, - capacity: i32, - status: *mut UErrorCode, - ) -> i32; +impl Default for UText { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } } extern "C" { - pub fn ucol_openBinary_63( - bin: *const u8, - length: i32, - base: *const UCollator, - status: *mut UErrorCode, - ) -> *mut UCollator; + pub fn utext_setup_63(ut: *mut UText, extraSpace: i32, status: *mut UErrorCode) -> *mut UText; } pub type __builtin_va_list = [__va_list_tag; 1usize]; #[repr(C)] diff --git a/rust_icu_sys/bindgen/lib_64.rs b/rust_icu_sys/bindgen/lib_64.rs index 37fde29a..10e625f8 100644 --- a/rust_icu_sys/bindgen/lib_64.rs +++ b/rust_icu_sys/bindgen/lib_64.rs @@ -961,3070 +961,3133 @@ extern "C" { status: *mut UErrorCode, ) -> i32; } +extern "C" { + pub fn u_init_64(status: *mut UErrorCode); +} +extern "C" { + pub fn u_cleanup_64(); +} +pub type UMemAllocFn = ::std::option::Option< + unsafe extern "C" fn( + context: *const ::std::os::raw::c_void, + size: size_t, + ) -> *mut ::std::os::raw::c_void, +>; +pub type UMemReallocFn = ::std::option::Option< + unsafe extern "C" fn( + context: *const ::std::os::raw::c_void, + mem: *mut ::std::os::raw::c_void, + size: size_t, + ) -> *mut ::std::os::raw::c_void, +>; +pub type UMemFreeFn = ::std::option::Option< + unsafe extern "C" fn(context: *const ::std::os::raw::c_void, mem: *mut ::std::os::raw::c_void), +>; +extern "C" { + pub fn u_setMemoryFunctions_64( + context: *const ::std::os::raw::c_void, + a: UMemAllocFn, + r: UMemReallocFn, + f: UMemFreeFn, + status: *mut UErrorCode, + ); +} +pub type UMTX = *mut ::std::os::raw::c_void; +pub type UMtxInitFn = ::std::option::Option< + unsafe extern "C" fn( + context: *const ::std::os::raw::c_void, + mutex: *mut UMTX, + status: *mut UErrorCode, + ), +>; +pub type UMtxFn = ::std::option::Option< + unsafe extern "C" fn(context: *const ::std::os::raw::c_void, mutex: *mut UMTX), +>; +extern "C" { + pub fn u_setMutexFunctions_64( + context: *const ::std::os::raw::c_void, + init: UMtxInitFn, + destroy: UMtxFn, + lock: UMtxFn, + unlock: UMtxFn, + status: *mut UErrorCode, + ); +} +pub type UMtxAtomicFn = ::std::option::Option< + unsafe extern "C" fn(context: *const ::std::os::raw::c_void, p: *mut i32) -> i32, +>; +extern "C" { + pub fn u_setAtomicIncDecFunctions_64( + context: *const ::std::os::raw::c_void, + inc: UMtxAtomicFn, + dec: UMtxAtomicFn, + status: *mut UErrorCode, + ); +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] +pub enum UCharIteratorOrigin { + UITER_START = 0, + UITER_CURRENT = 1, + UITER_LIMIT = 2, + UITER_ZERO = 3, + UITER_LENGTH = 4, +} +pub type UCharIteratorGetIndex = ::std::option::Option< + unsafe extern "C" fn(iter: *mut UCharIterator, origin: UCharIteratorOrigin) -> i32, +>; +pub type UCharIteratorMove = ::std::option::Option< + unsafe extern "C" fn(iter: *mut UCharIterator, delta: i32, origin: UCharIteratorOrigin) -> i32, +>; +pub type UCharIteratorHasNext = + ::std::option::Option UBool>; +pub type UCharIteratorHasPrevious = + ::std::option::Option UBool>; +pub type UCharIteratorCurrent = + ::std::option::Option UChar32>; +pub type UCharIteratorNext = + ::std::option::Option UChar32>; +pub type UCharIteratorPrevious = + ::std::option::Option UChar32>; +pub type UCharIteratorReserved = + ::std::option::Option i32>; +pub type UCharIteratorGetState = + ::std::option::Option u32>; +pub type UCharIteratorSetState = ::std::option::Option< + unsafe extern "C" fn(iter: *mut UCharIterator, state: u32, pErrorCode: *mut UErrorCode), +>; #[repr(C)] -#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, PartialEq)] -pub struct UFieldPosition { - pub field: i32, - pub beginIndex: i32, - pub endIndex: i32, +#[derive(Debug, Copy, Clone, Hash, PartialOrd, PartialEq)] +pub struct UCharIterator { + pub context: *const ::std::os::raw::c_void, + pub length: i32, + pub start: i32, + pub index: i32, + pub limit: i32, + pub reservedField: i32, + pub getIndex: UCharIteratorGetIndex, + pub move_: UCharIteratorMove, + pub hasNext: UCharIteratorHasNext, + pub hasPrevious: UCharIteratorHasPrevious, + pub current: UCharIteratorCurrent, + pub next: UCharIteratorNext, + pub previous: UCharIteratorPrevious, + pub reservedFn: UCharIteratorReserved, + pub getState: UCharIteratorGetState, + pub setState: UCharIteratorSetState, } #[test] -fn bindgen_test_layout_UFieldPosition() { +fn bindgen_test_layout_UCharIterator() { assert_eq!( - ::std::mem::size_of::(), - 12usize, - concat!("Size of: ", stringify!(UFieldPosition)) + ::std::mem::size_of::(), + 112usize, + concat!("Size of: ", stringify!(UCharIterator)) ); assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(UFieldPosition)) + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(UCharIterator)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).field as *const _ as usize }, + unsafe { &(*(::std::ptr::null::())).context as *const _ as usize }, 0usize, concat!( "Offset of field: ", - stringify!(UFieldPosition), + stringify!(UCharIterator), "::", - stringify!(field) + stringify!(context) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).beginIndex as *const _ as usize }, - 4usize, + unsafe { &(*(::std::ptr::null::())).length as *const _ as usize }, + 8usize, concat!( "Offset of field: ", - stringify!(UFieldPosition), + stringify!(UCharIterator), "::", - stringify!(beginIndex) + stringify!(length) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).endIndex as *const _ as usize }, - 8usize, + unsafe { &(*(::std::ptr::null::())).start as *const _ as usize }, + 12usize, concat!( "Offset of field: ", - stringify!(UFieldPosition), + stringify!(UCharIterator), "::", - stringify!(endIndex) + stringify!(start) ) ); -} -#[repr(C)] -#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, PartialEq)] -pub struct UParseError { - pub line: i32, - pub offset: i32, - pub preContext: [UChar; 16usize], - pub postContext: [UChar; 16usize], -} -#[test] -fn bindgen_test_layout_UParseError() { assert_eq!( - ::std::mem::size_of::(), - 72usize, - concat!("Size of: ", stringify!(UParseError)) + unsafe { &(*(::std::ptr::null::())).index as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(UCharIterator), + "::", + stringify!(index) + ) ); assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(UParseError)) + unsafe { &(*(::std::ptr::null::())).limit as *const _ as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(UCharIterator), + "::", + stringify!(limit) + ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).line as *const _ as usize }, - 0usize, + unsafe { &(*(::std::ptr::null::())).reservedField as *const _ as usize }, + 24usize, concat!( "Offset of field: ", - stringify!(UParseError), + stringify!(UCharIterator), "::", - stringify!(line) + stringify!(reservedField) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).offset as *const _ as usize }, - 4usize, + unsafe { &(*(::std::ptr::null::())).getIndex as *const _ as usize }, + 32usize, concat!( "Offset of field: ", - stringify!(UParseError), + stringify!(UCharIterator), "::", - stringify!(offset) + stringify!(getIndex) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).preContext as *const _ as usize }, - 8usize, + unsafe { &(*(::std::ptr::null::())).move_ as *const _ as usize }, + 40usize, concat!( "Offset of field: ", - stringify!(UParseError), + stringify!(UCharIterator), "::", - stringify!(preContext) + stringify!(move_) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).postContext as *const _ as usize }, - 40usize, + unsafe { &(*(::std::ptr::null::())).hasNext as *const _ as usize }, + 48usize, concat!( "Offset of field: ", - stringify!(UParseError), + stringify!(UCharIterator), "::", - stringify!(postContext) + stringify!(hasNext) ) ); -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UDisplayContextType { - UDISPCTX_TYPE_DIALECT_HANDLING = 0, - UDISPCTX_TYPE_CAPITALIZATION = 1, - UDISPCTX_TYPE_DISPLAY_LENGTH = 2, - UDISPCTX_TYPE_SUBSTITUTE_HANDLING = 3, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UDisplayContext { - UDISPCTX_STANDARD_NAMES = 0, - UDISPCTX_DIALECT_NAMES = 1, - UDISPCTX_CAPITALIZATION_NONE = 256, - UDISPCTX_CAPITALIZATION_FOR_MIDDLE_OF_SENTENCE = 257, - UDISPCTX_CAPITALIZATION_FOR_BEGINNING_OF_SENTENCE = 258, - UDISPCTX_CAPITALIZATION_FOR_UI_LIST_OR_MENU = 259, - UDISPCTX_CAPITALIZATION_FOR_STANDALONE = 260, - UDISPCTX_LENGTH_FULL = 512, - UDISPCTX_LENGTH_SHORT = 513, - UDISPCTX_SUBSTITUTE = 768, - UDISPCTX_NO_SUBSTITUTE = 769, -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct UFieldPositionIterator { - _unused: [u8; 0], -} -pub type UNumberFormat = *mut ::std::os::raw::c_void; -pub type UDateFormat = *mut ::std::os::raw::c_void; -impl UDateFormatStyle { - pub const UDAT_DEFAULT: UDateFormatStyle = UDateFormatStyle::UDAT_MEDIUM; -} -impl UDateFormatStyle { - pub const UDAT_FULL_RELATIVE: UDateFormatStyle = UDateFormatStyle::UDAT_RELATIVE; -} -impl UDateFormatStyle { - pub const UDAT_IGNORE: UDateFormatStyle = UDateFormatStyle::UDAT_PATTERN; -} -#[repr(i32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UDateFormatStyle { - UDAT_FULL = 0, - UDAT_LONG = 1, - UDAT_MEDIUM = 2, - UDAT_SHORT = 3, - UDAT_RELATIVE = 128, - UDAT_LONG_RELATIVE = 129, - UDAT_MEDIUM_RELATIVE = 130, - UDAT_SHORT_RELATIVE = 131, - UDAT_NONE = -1, - UDAT_PATTERN = -2, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UDateFormatField { - UDAT_ERA_FIELD = 0, - UDAT_YEAR_FIELD = 1, - UDAT_MONTH_FIELD = 2, - UDAT_DATE_FIELD = 3, - UDAT_HOUR_OF_DAY1_FIELD = 4, - UDAT_HOUR_OF_DAY0_FIELD = 5, - UDAT_MINUTE_FIELD = 6, - UDAT_SECOND_FIELD = 7, - UDAT_FRACTIONAL_SECOND_FIELD = 8, - UDAT_DAY_OF_WEEK_FIELD = 9, - UDAT_DAY_OF_YEAR_FIELD = 10, - UDAT_DAY_OF_WEEK_IN_MONTH_FIELD = 11, - UDAT_WEEK_OF_YEAR_FIELD = 12, - UDAT_WEEK_OF_MONTH_FIELD = 13, - UDAT_AM_PM_FIELD = 14, - UDAT_HOUR1_FIELD = 15, - UDAT_HOUR0_FIELD = 16, - UDAT_TIMEZONE_FIELD = 17, - UDAT_YEAR_WOY_FIELD = 18, - UDAT_DOW_LOCAL_FIELD = 19, - UDAT_EXTENDED_YEAR_FIELD = 20, - UDAT_JULIAN_DAY_FIELD = 21, - UDAT_MILLISECONDS_IN_DAY_FIELD = 22, - UDAT_TIMEZONE_RFC_FIELD = 23, - UDAT_TIMEZONE_GENERIC_FIELD = 24, - UDAT_STANDALONE_DAY_FIELD = 25, - UDAT_STANDALONE_MONTH_FIELD = 26, - UDAT_QUARTER_FIELD = 27, - UDAT_STANDALONE_QUARTER_FIELD = 28, - UDAT_TIMEZONE_SPECIAL_FIELD = 29, - UDAT_YEAR_NAME_FIELD = 30, - UDAT_TIMEZONE_LOCALIZED_GMT_OFFSET_FIELD = 31, - UDAT_TIMEZONE_ISO_FIELD = 32, - UDAT_TIMEZONE_ISO_LOCAL_FIELD = 33, - UDAT_RELATED_YEAR_FIELD = 34, - UDAT_AM_PM_MIDNIGHT_NOON_FIELD = 35, - UDAT_FLEXIBLE_DAY_PERIOD_FIELD = 36, - UDAT_TIME_SEPARATOR_FIELD = 37, - UDAT_FIELD_COUNT = 38, -} -extern "C" { - pub fn udat_toCalendarDateField_64(field: UDateFormatField) -> UCalendarDateFields; -} -extern "C" { - pub fn udat_open_64( - timeStyle: UDateFormatStyle, - dateStyle: UDateFormatStyle, - locale: *const ::std::os::raw::c_char, - tzID: *const UChar, - tzIDLength: i32, - pattern: *const UChar, - patternLength: i32, - status: *mut UErrorCode, - ) -> *mut UDateFormat; -} -extern "C" { - pub fn udat_close_64(format: *mut UDateFormat); -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UDateFormatBooleanAttribute { - UDAT_PARSE_ALLOW_WHITESPACE = 0, - UDAT_PARSE_ALLOW_NUMERIC = 1, - UDAT_PARSE_PARTIAL_LITERAL_MATCH = 2, - UDAT_PARSE_MULTIPLE_PATTERNS_FOR_MATCH = 3, - UDAT_BOOLEAN_ATTRIBUTE_COUNT = 4, -} -extern "C" { - pub fn udat_getBooleanAttribute_64( - fmt: *const UDateFormat, - attr: UDateFormatBooleanAttribute, - status: *mut UErrorCode, - ) -> UBool; -} -extern "C" { - pub fn udat_setBooleanAttribute_64( - fmt: *mut UDateFormat, - attr: UDateFormatBooleanAttribute, - newValue: UBool, - status: *mut UErrorCode, + assert_eq!( + unsafe { &(*(::std::ptr::null::())).hasPrevious as *const _ as usize }, + 56usize, + concat!( + "Offset of field: ", + stringify!(UCharIterator), + "::", + stringify!(hasPrevious) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).current as *const _ as usize }, + 64usize, + concat!( + "Offset of field: ", + stringify!(UCharIterator), + "::", + stringify!(current) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).next as *const _ as usize }, + 72usize, + concat!( + "Offset of field: ", + stringify!(UCharIterator), + "::", + stringify!(next) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).previous as *const _ as usize }, + 80usize, + concat!( + "Offset of field: ", + stringify!(UCharIterator), + "::", + stringify!(previous) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).reservedFn as *const _ as usize }, + 88usize, + concat!( + "Offset of field: ", + stringify!(UCharIterator), + "::", + stringify!(reservedFn) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).getState as *const _ as usize }, + 96usize, + concat!( + "Offset of field: ", + stringify!(UCharIterator), + "::", + stringify!(getState) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).setState as *const _ as usize }, + 104usize, + concat!( + "Offset of field: ", + stringify!(UCharIterator), + "::", + stringify!(setState) + ) ); } -extern "C" { - pub fn udat_clone_64(fmt: *const UDateFormat, status: *mut UErrorCode) -> *mut UDateFormat; -} -extern "C" { - pub fn udat_format_64( - format: *const UDateFormat, - dateToFormat: UDate, - result: *mut UChar, - resultLength: i32, - position: *mut UFieldPosition, - status: *mut UErrorCode, - ) -> i32; +impl Default for UCharIterator { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } } -extern "C" { - pub fn udat_formatCalendar_64( - format: *const UDateFormat, - calendar: *mut UCalendar, - result: *mut UChar, - capacity: i32, - position: *mut UFieldPosition, - status: *mut UErrorCode, - ) -> i32; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct UCPMap { + _unused: [u8; 0], } -extern "C" { - pub fn udat_formatForFields_64( - format: *const UDateFormat, - dateToFormat: UDate, - result: *mut UChar, - resultLength: i32, - fpositer: *mut UFieldPositionIterator, - status: *mut UErrorCode, - ) -> i32; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct USet { + _unused: [u8; 0], } -extern "C" { - pub fn udat_formatCalendarForFields_64( - format: *const UDateFormat, - calendar: *mut UCalendar, - result: *mut UChar, - capacity: i32, - fpositer: *mut UFieldPositionIterator, - status: *mut UErrorCode, - ) -> i32; +impl UProperty { + pub const UCHAR_BINARY_START: UProperty = UProperty::UCHAR_ALPHABETIC; } -extern "C" { - pub fn udat_parse_64( - format: *const UDateFormat, - text: *const UChar, - textLength: i32, - parsePos: *mut i32, - status: *mut UErrorCode, - ) -> UDate; +impl UProperty { + pub const UCHAR_INT_START: UProperty = UProperty::UCHAR_BIDI_CLASS; } -extern "C" { - pub fn udat_parseCalendar_64( - format: *const UDateFormat, - calendar: *mut UCalendar, - text: *const UChar, - textLength: i32, - parsePos: *mut i32, - status: *mut UErrorCode, - ); +impl UProperty { + pub const UCHAR_MASK_START: UProperty = UProperty::UCHAR_GENERAL_CATEGORY_MASK; } -extern "C" { - pub fn udat_isLenient_64(fmt: *const UDateFormat) -> UBool; +impl UProperty { + pub const UCHAR_DOUBLE_START: UProperty = UProperty::UCHAR_NUMERIC_VALUE; } -extern "C" { - pub fn udat_setLenient_64(fmt: *mut UDateFormat, isLenient: UBool); +impl UProperty { + pub const UCHAR_STRING_START: UProperty = UProperty::UCHAR_AGE; } -extern "C" { - pub fn udat_getCalendar_64(fmt: *const UDateFormat) -> *const UCalendar; +impl UProperty { + pub const UCHAR_OTHER_PROPERTY_START: UProperty = UProperty::UCHAR_SCRIPT_EXTENSIONS; } -extern "C" { - pub fn udat_setCalendar_64(fmt: *mut UDateFormat, calendarToSet: *const UCalendar); +#[repr(i32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] +pub enum UProperty { + UCHAR_ALPHABETIC = 0, + UCHAR_ASCII_HEX_DIGIT = 1, + UCHAR_BIDI_CONTROL = 2, + UCHAR_BIDI_MIRRORED = 3, + UCHAR_DASH = 4, + UCHAR_DEFAULT_IGNORABLE_CODE_POINT = 5, + UCHAR_DEPRECATED = 6, + UCHAR_DIACRITIC = 7, + UCHAR_EXTENDER = 8, + UCHAR_FULL_COMPOSITION_EXCLUSION = 9, + UCHAR_GRAPHEME_BASE = 10, + UCHAR_GRAPHEME_EXTEND = 11, + UCHAR_GRAPHEME_LINK = 12, + UCHAR_HEX_DIGIT = 13, + UCHAR_HYPHEN = 14, + UCHAR_ID_CONTINUE = 15, + UCHAR_ID_START = 16, + UCHAR_IDEOGRAPHIC = 17, + UCHAR_IDS_BINARY_OPERATOR = 18, + UCHAR_IDS_TRINARY_OPERATOR = 19, + UCHAR_JOIN_CONTROL = 20, + UCHAR_LOGICAL_ORDER_EXCEPTION = 21, + UCHAR_LOWERCASE = 22, + UCHAR_MATH = 23, + UCHAR_NONCHARACTER_CODE_POINT = 24, + UCHAR_QUOTATION_MARK = 25, + UCHAR_RADICAL = 26, + UCHAR_SOFT_DOTTED = 27, + UCHAR_TERMINAL_PUNCTUATION = 28, + UCHAR_UNIFIED_IDEOGRAPH = 29, + UCHAR_UPPERCASE = 30, + UCHAR_WHITE_SPACE = 31, + UCHAR_XID_CONTINUE = 32, + UCHAR_XID_START = 33, + UCHAR_CASE_SENSITIVE = 34, + UCHAR_S_TERM = 35, + UCHAR_VARIATION_SELECTOR = 36, + UCHAR_NFD_INERT = 37, + UCHAR_NFKD_INERT = 38, + UCHAR_NFC_INERT = 39, + UCHAR_NFKC_INERT = 40, + UCHAR_SEGMENT_STARTER = 41, + UCHAR_PATTERN_SYNTAX = 42, + UCHAR_PATTERN_WHITE_SPACE = 43, + UCHAR_POSIX_ALNUM = 44, + UCHAR_POSIX_BLANK = 45, + UCHAR_POSIX_GRAPH = 46, + UCHAR_POSIX_PRINT = 47, + UCHAR_POSIX_XDIGIT = 48, + UCHAR_CASED = 49, + UCHAR_CASE_IGNORABLE = 50, + UCHAR_CHANGES_WHEN_LOWERCASED = 51, + UCHAR_CHANGES_WHEN_UPPERCASED = 52, + UCHAR_CHANGES_WHEN_TITLECASED = 53, + UCHAR_CHANGES_WHEN_CASEFOLDED = 54, + UCHAR_CHANGES_WHEN_CASEMAPPED = 55, + UCHAR_CHANGES_WHEN_NFKC_CASEFOLDED = 56, + UCHAR_EMOJI = 57, + UCHAR_EMOJI_PRESENTATION = 58, + UCHAR_EMOJI_MODIFIER = 59, + UCHAR_EMOJI_MODIFIER_BASE = 60, + UCHAR_EMOJI_COMPONENT = 61, + UCHAR_REGIONAL_INDICATOR = 62, + UCHAR_PREPENDED_CONCATENATION_MARK = 63, + UCHAR_EXTENDED_PICTOGRAPHIC = 64, + UCHAR_BINARY_LIMIT = 65, + UCHAR_BIDI_CLASS = 4096, + UCHAR_BLOCK = 4097, + UCHAR_CANONICAL_COMBINING_CLASS = 4098, + UCHAR_DECOMPOSITION_TYPE = 4099, + UCHAR_EAST_ASIAN_WIDTH = 4100, + UCHAR_GENERAL_CATEGORY = 4101, + UCHAR_JOINING_GROUP = 4102, + UCHAR_JOINING_TYPE = 4103, + UCHAR_LINE_BREAK = 4104, + UCHAR_NUMERIC_TYPE = 4105, + UCHAR_SCRIPT = 4106, + UCHAR_HANGUL_SYLLABLE_TYPE = 4107, + UCHAR_NFD_QUICK_CHECK = 4108, + UCHAR_NFKD_QUICK_CHECK = 4109, + UCHAR_NFC_QUICK_CHECK = 4110, + UCHAR_NFKC_QUICK_CHECK = 4111, + UCHAR_LEAD_CANONICAL_COMBINING_CLASS = 4112, + UCHAR_TRAIL_CANONICAL_COMBINING_CLASS = 4113, + UCHAR_GRAPHEME_CLUSTER_BREAK = 4114, + UCHAR_SENTENCE_BREAK = 4115, + UCHAR_WORD_BREAK = 4116, + UCHAR_BIDI_PAIRED_BRACKET_TYPE = 4117, + UCHAR_INDIC_POSITIONAL_CATEGORY = 4118, + UCHAR_INDIC_SYLLABIC_CATEGORY = 4119, + UCHAR_VERTICAL_ORIENTATION = 4120, + UCHAR_INT_LIMIT = 4121, + UCHAR_GENERAL_CATEGORY_MASK = 8192, + UCHAR_MASK_LIMIT = 8193, + UCHAR_NUMERIC_VALUE = 12288, + UCHAR_DOUBLE_LIMIT = 12289, + UCHAR_AGE = 16384, + UCHAR_BIDI_MIRRORING_GLYPH = 16385, + UCHAR_CASE_FOLDING = 16386, + UCHAR_ISO_COMMENT = 16387, + UCHAR_LOWERCASE_MAPPING = 16388, + UCHAR_NAME = 16389, + UCHAR_SIMPLE_CASE_FOLDING = 16390, + UCHAR_SIMPLE_LOWERCASE_MAPPING = 16391, + UCHAR_SIMPLE_TITLECASE_MAPPING = 16392, + UCHAR_SIMPLE_UPPERCASE_MAPPING = 16393, + UCHAR_TITLECASE_MAPPING = 16394, + UCHAR_UNICODE_1_NAME = 16395, + UCHAR_UPPERCASE_MAPPING = 16396, + UCHAR_BIDI_PAIRED_BRACKET = 16397, + UCHAR_STRING_LIMIT = 16398, + UCHAR_SCRIPT_EXTENSIONS = 28672, + UCHAR_OTHER_PROPERTY_LIMIT = 28673, + UCHAR_INVALID_CODE = -1, +} +impl UCharCategory { + pub const U_GENERAL_OTHER_TYPES: UCharCategory = UCharCategory::U_UNASSIGNED; +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] +pub enum UCharCategory { + U_UNASSIGNED = 0, + U_UPPERCASE_LETTER = 1, + U_LOWERCASE_LETTER = 2, + U_TITLECASE_LETTER = 3, + U_MODIFIER_LETTER = 4, + U_OTHER_LETTER = 5, + U_NON_SPACING_MARK = 6, + U_ENCLOSING_MARK = 7, + U_COMBINING_SPACING_MARK = 8, + U_DECIMAL_DIGIT_NUMBER = 9, + U_LETTER_NUMBER = 10, + U_OTHER_NUMBER = 11, + U_SPACE_SEPARATOR = 12, + U_LINE_SEPARATOR = 13, + U_PARAGRAPH_SEPARATOR = 14, + U_CONTROL_CHAR = 15, + U_FORMAT_CHAR = 16, + U_PRIVATE_USE_CHAR = 17, + U_SURROGATE = 18, + U_DASH_PUNCTUATION = 19, + U_START_PUNCTUATION = 20, + U_END_PUNCTUATION = 21, + U_CONNECTOR_PUNCTUATION = 22, + U_OTHER_PUNCTUATION = 23, + U_MATH_SYMBOL = 24, + U_CURRENCY_SYMBOL = 25, + U_MODIFIER_SYMBOL = 26, + U_OTHER_SYMBOL = 27, + U_INITIAL_PUNCTUATION = 28, + U_FINAL_PUNCTUATION = 29, + U_CHAR_CATEGORY_COUNT = 30, +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] +pub enum UCharDirection { + U_LEFT_TO_RIGHT = 0, + U_RIGHT_TO_LEFT = 1, + U_EUROPEAN_NUMBER = 2, + U_EUROPEAN_NUMBER_SEPARATOR = 3, + U_EUROPEAN_NUMBER_TERMINATOR = 4, + U_ARABIC_NUMBER = 5, + U_COMMON_NUMBER_SEPARATOR = 6, + U_BLOCK_SEPARATOR = 7, + U_SEGMENT_SEPARATOR = 8, + U_WHITE_SPACE_NEUTRAL = 9, + U_OTHER_NEUTRAL = 10, + U_LEFT_TO_RIGHT_EMBEDDING = 11, + U_LEFT_TO_RIGHT_OVERRIDE = 12, + U_RIGHT_TO_LEFT_ARABIC = 13, + U_RIGHT_TO_LEFT_EMBEDDING = 14, + U_RIGHT_TO_LEFT_OVERRIDE = 15, + U_POP_DIRECTIONAL_FORMAT = 16, + U_DIR_NON_SPACING_MARK = 17, + U_BOUNDARY_NEUTRAL = 18, + U_FIRST_STRONG_ISOLATE = 19, + U_LEFT_TO_RIGHT_ISOLATE = 20, + U_RIGHT_TO_LEFT_ISOLATE = 21, + U_POP_DIRECTIONAL_ISOLATE = 22, + U_CHAR_DIRECTION_COUNT = 23, +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] +pub enum UCharNameChoice { + U_UNICODE_CHAR_NAME = 0, + U_UNICODE_10_CHAR_NAME = 1, + U_EXTENDED_CHAR_NAME = 2, + U_CHAR_NAME_ALIAS = 3, + U_CHAR_NAME_CHOICE_COUNT = 4, +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] +pub enum UPropertyNameChoice { + U_SHORT_PROPERTY_NAME = 0, + U_LONG_PROPERTY_NAME = 1, + U_PROPERTY_NAME_CHOICE_COUNT = 2, } extern "C" { - pub fn udat_getNumberFormat_64(fmt: *const UDateFormat) -> *const UNumberFormat; + pub fn u_hasBinaryProperty_64(c: UChar32, which: UProperty) -> UBool; } extern "C" { - pub fn udat_getNumberFormatForField_64( - fmt: *const UDateFormat, - field: UChar, - ) -> *const UNumberFormat; + pub fn u_getBinaryPropertySet_64( + property: UProperty, + pErrorCode: *mut UErrorCode, + ) -> *const USet; } extern "C" { - pub fn udat_adoptNumberFormatForFields_64( - fmt: *mut UDateFormat, - fields: *const UChar, - numberFormatToSet: *mut UNumberFormat, - status: *mut UErrorCode, - ); + pub fn u_isUAlphabetic_64(c: UChar32) -> UBool; } extern "C" { - pub fn udat_setNumberFormat_64(fmt: *mut UDateFormat, numberFormatToSet: *const UNumberFormat); + pub fn u_isULowercase_64(c: UChar32) -> UBool; } extern "C" { - pub fn udat_adoptNumberFormat_64( - fmt: *mut UDateFormat, - numberFormatToAdopt: *mut UNumberFormat, - ); + pub fn u_isUUppercase_64(c: UChar32) -> UBool; } extern "C" { - pub fn udat_getAvailable_64(localeIndex: i32) -> *const ::std::os::raw::c_char; + pub fn u_isUWhiteSpace_64(c: UChar32) -> UBool; } extern "C" { - pub fn udat_countAvailable_64() -> i32; + pub fn u_getIntPropertyValue_64(c: UChar32, which: UProperty) -> i32; } extern "C" { - pub fn udat_get2DigitYearStart_64(fmt: *const UDateFormat, status: *mut UErrorCode) -> UDate; + pub fn u_getIntPropertyMinValue_64(which: UProperty) -> i32; } extern "C" { - pub fn udat_set2DigitYearStart_64(fmt: *mut UDateFormat, d: UDate, status: *mut UErrorCode); + pub fn u_getIntPropertyMaxValue_64(which: UProperty) -> i32; } extern "C" { - pub fn udat_toPattern_64( - fmt: *const UDateFormat, - localized: UBool, - result: *mut UChar, - resultLength: i32, - status: *mut UErrorCode, - ) -> i32; + pub fn u_getIntPropertyMap_64( + property: UProperty, + pErrorCode: *mut UErrorCode, + ) -> *const UCPMap; } extern "C" { - pub fn udat_applyPattern_64( - format: *mut UDateFormat, - localized: UBool, - pattern: *const UChar, - patternLength: i32, - ); + pub fn u_getNumericValue_64(c: UChar32) -> f64; } -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UDateFormatSymbolType { - UDAT_ERAS = 0, - UDAT_MONTHS = 1, - UDAT_SHORT_MONTHS = 2, - UDAT_WEEKDAYS = 3, - UDAT_SHORT_WEEKDAYS = 4, - UDAT_AM_PMS = 5, - UDAT_LOCALIZED_CHARS = 6, - UDAT_ERA_NAMES = 7, - UDAT_NARROW_MONTHS = 8, - UDAT_NARROW_WEEKDAYS = 9, - UDAT_STANDALONE_MONTHS = 10, - UDAT_STANDALONE_SHORT_MONTHS = 11, - UDAT_STANDALONE_NARROW_MONTHS = 12, - UDAT_STANDALONE_WEEKDAYS = 13, - UDAT_STANDALONE_SHORT_WEEKDAYS = 14, - UDAT_STANDALONE_NARROW_WEEKDAYS = 15, - UDAT_QUARTERS = 16, - UDAT_SHORT_QUARTERS = 17, - UDAT_STANDALONE_QUARTERS = 18, - UDAT_STANDALONE_SHORT_QUARTERS = 19, - UDAT_SHORTER_WEEKDAYS = 20, - UDAT_STANDALONE_SHORTER_WEEKDAYS = 21, - UDAT_CYCLIC_YEARS_WIDE = 22, - UDAT_CYCLIC_YEARS_ABBREVIATED = 23, - UDAT_CYCLIC_YEARS_NARROW = 24, - UDAT_ZODIAC_NAMES_WIDE = 25, - UDAT_ZODIAC_NAMES_ABBREVIATED = 26, - UDAT_ZODIAC_NAMES_NARROW = 27, +extern "C" { + pub fn u_islower_64(c: UChar32) -> UBool; } -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct UDateFormatSymbols { - _unused: [u8; 0], +extern "C" { + pub fn u_isupper_64(c: UChar32) -> UBool; } extern "C" { - pub fn udat_getSymbols_64( - fmt: *const UDateFormat, - type_: UDateFormatSymbolType, - symbolIndex: i32, - result: *mut UChar, - resultLength: i32, - status: *mut UErrorCode, - ) -> i32; + pub fn u_istitle_64(c: UChar32) -> UBool; } extern "C" { - pub fn udat_countSymbols_64(fmt: *const UDateFormat, type_: UDateFormatSymbolType) -> i32; + pub fn u_isdigit_64(c: UChar32) -> UBool; } extern "C" { - pub fn udat_setSymbols_64( - format: *mut UDateFormat, - type_: UDateFormatSymbolType, - symbolIndex: i32, - value: *mut UChar, - valueLength: i32, - status: *mut UErrorCode, - ); + pub fn u_isalpha_64(c: UChar32) -> UBool; } extern "C" { - pub fn udat_getLocaleByType_64( - fmt: *const UDateFormat, - type_: ULocDataLocaleType, - status: *mut UErrorCode, - ) -> *const ::std::os::raw::c_char; + pub fn u_isalnum_64(c: UChar32) -> UBool; } extern "C" { - pub fn udat_setContext_64( - fmt: *mut UDateFormat, - value: UDisplayContext, - status: *mut UErrorCode, - ); + pub fn u_isxdigit_64(c: UChar32) -> UBool; } extern "C" { - pub fn udat_getContext_64( - fmt: *const UDateFormat, - type_: UDisplayContextType, - status: *mut UErrorCode, - ) -> UDisplayContext; + pub fn u_ispunct_64(c: UChar32) -> UBool; } extern "C" { - pub fn udat_toPatternRelativeDate_64( - fmt: *const UDateFormat, - result: *mut UChar, - resultLength: i32, - status: *mut UErrorCode, - ) -> i32; + pub fn u_isgraph_64(c: UChar32) -> UBool; } extern "C" { - pub fn udat_toPatternRelativeTime_64( - fmt: *const UDateFormat, - result: *mut UChar, - resultLength: i32, - status: *mut UErrorCode, - ) -> i32; + pub fn u_isblank_64(c: UChar32) -> UBool; } extern "C" { - pub fn udat_applyPatternRelative_64( - format: *mut UDateFormat, - datePattern: *const UChar, - datePatternLength: i32, - timePattern: *const UChar, - timePatternLength: i32, - status: *mut UErrorCode, - ); + pub fn u_isdefined_64(c: UChar32) -> UBool; } -pub type UDateFormatOpener = ::std::option::Option< - unsafe extern "C" fn( - timeStyle: UDateFormatStyle, - dateStyle: UDateFormatStyle, - locale: *const ::std::os::raw::c_char, - tzID: *const UChar, - tzIDLength: i32, - pattern: *const UChar, - patternLength: i32, - status: *mut UErrorCode, - ) -> *mut UDateFormat, ->; extern "C" { - pub fn udat_registerOpener_64(opener: UDateFormatOpener, status: *mut UErrorCode); + pub fn u_isspace_64(c: UChar32) -> UBool; } extern "C" { - pub fn udat_unregisterOpener_64( - opener: UDateFormatOpener, - status: *mut UErrorCode, - ) -> UDateFormatOpener; + pub fn u_isJavaSpaceChar_64(c: UChar32) -> UBool; } -#[repr(C)] -#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, PartialEq)] -pub struct UDataInfo { - pub size: u16, - pub reservedWord: u16, - pub isBigEndian: u8, - pub charsetFamily: u8, - pub sizeofUChar: u8, - pub reservedByte: u8, - pub dataFormat: [u8; 4usize], - pub formatVersion: [u8; 4usize], - pub dataVersion: [u8; 4usize], +extern "C" { + pub fn u_isWhitespace_64(c: UChar32) -> UBool; } -#[test] -fn bindgen_test_layout_UDataInfo() { - assert_eq!( - ::std::mem::size_of::(), - 20usize, - concat!("Size of: ", stringify!(UDataInfo)) - ); - assert_eq!( - ::std::mem::align_of::(), - 2usize, - concat!("Alignment of ", stringify!(UDataInfo)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).size as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(UDataInfo), - "::", - stringify!(size) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).reservedWord as *const _ as usize }, - 2usize, - concat!( - "Offset of field: ", - stringify!(UDataInfo), - "::", - stringify!(reservedWord) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).isBigEndian as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(UDataInfo), - "::", - stringify!(isBigEndian) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).charsetFamily as *const _ as usize }, - 5usize, - concat!( - "Offset of field: ", - stringify!(UDataInfo), - "::", - stringify!(charsetFamily) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).sizeofUChar as *const _ as usize }, - 6usize, - concat!( - "Offset of field: ", - stringify!(UDataInfo), - "::", - stringify!(sizeofUChar) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).reservedByte as *const _ as usize }, - 7usize, - concat!( - "Offset of field: ", - stringify!(UDataInfo), - "::", - stringify!(reservedByte) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).dataFormat as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(UDataInfo), - "::", - stringify!(dataFormat) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).formatVersion as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(UDataInfo), - "::", - stringify!(formatVersion) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).dataVersion as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(UDataInfo), - "::", - stringify!(dataVersion) - ) - ); +extern "C" { + pub fn u_iscntrl_64(c: UChar32) -> UBool; } -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct UDataMemory { - _unused: [u8; 0], +extern "C" { + pub fn u_isISOControl_64(c: UChar32) -> UBool; } -pub type UDataMemoryIsAcceptable = ::std::option::Option< - unsafe extern "C" fn( - context: *mut ::std::os::raw::c_void, - type_: *const ::std::os::raw::c_char, - name: *const ::std::os::raw::c_char, - pInfo: *const UDataInfo, - ) -> UBool, ->; extern "C" { - pub fn udata_open_64( - path: *const ::std::os::raw::c_char, - type_: *const ::std::os::raw::c_char, - name: *const ::std::os::raw::c_char, - pErrorCode: *mut UErrorCode, - ) -> *mut UDataMemory; + pub fn u_isprint_64(c: UChar32) -> UBool; } extern "C" { - pub fn udata_openChoice_64( - path: *const ::std::os::raw::c_char, - type_: *const ::std::os::raw::c_char, - name: *const ::std::os::raw::c_char, - isAcceptable: UDataMemoryIsAcceptable, + pub fn u_isbase_64(c: UChar32) -> UBool; +} +extern "C" { + pub fn u_charDirection_64(c: UChar32) -> UCharDirection; +} +extern "C" { + pub fn u_isMirrored_64(c: UChar32) -> UBool; +} +extern "C" { + pub fn u_charMirror_64(c: UChar32) -> UChar32; +} +extern "C" { + pub fn u_getBidiPairedBracket_64(c: UChar32) -> UChar32; +} +extern "C" { + pub fn u_charType_64(c: UChar32) -> i8; +} +pub type UCharEnumTypeRange = ::std::option::Option< + unsafe extern "C" fn( + context: *const ::std::os::raw::c_void, + start: UChar32, + limit: UChar32, + type_: UCharCategory, + ) -> UBool, +>; +extern "C" { + pub fn u_enumCharTypes_64( + enumRange: UCharEnumTypeRange, + context: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn u_getCombiningClass_64(c: UChar32) -> u8; +} +extern "C" { + pub fn u_charDigitValue_64(c: UChar32) -> i32; +} +extern "C" { + pub fn u_charName_64( + code: UChar32, + nameChoice: UCharNameChoice, + buffer: *mut ::std::os::raw::c_char, + bufferLength: i32, + pErrorCode: *mut UErrorCode, + ) -> i32; +} +extern "C" { + pub fn u_getISOComment_64( + c: UChar32, + dest: *mut ::std::os::raw::c_char, + destCapacity: i32, + pErrorCode: *mut UErrorCode, + ) -> i32; +} +extern "C" { + pub fn u_charFromName_64( + nameChoice: UCharNameChoice, + name: *const ::std::os::raw::c_char, + pErrorCode: *mut UErrorCode, + ) -> UChar32; +} +pub type UEnumCharNamesFn = ::std::option::Option< + unsafe extern "C" fn( context: *mut ::std::os::raw::c_void, + code: UChar32, + nameChoice: UCharNameChoice, + name: *const ::std::os::raw::c_char, + length: i32, + ) -> UBool, +>; +extern "C" { + pub fn u_enumCharNames_64( + start: UChar32, + limit: UChar32, + fn_: UEnumCharNamesFn, + context: *mut ::std::os::raw::c_void, + nameChoice: UCharNameChoice, pErrorCode: *mut UErrorCode, - ) -> *mut UDataMemory; + ); } extern "C" { - pub fn udata_close_64(pData: *mut UDataMemory); + pub fn u_getPropertyName_64( + property: UProperty, + nameChoice: UPropertyNameChoice, + ) -> *const ::std::os::raw::c_char; } extern "C" { - pub fn udata_getMemory_64(pData: *mut UDataMemory) -> *const ::std::os::raw::c_void; + pub fn u_getPropertyEnum_64(alias: *const ::std::os::raw::c_char) -> UProperty; } extern "C" { - pub fn udata_getInfo_64(pData: *mut UDataMemory, pInfo: *mut UDataInfo); + pub fn u_getPropertyValueName_64( + property: UProperty, + value: i32, + nameChoice: UPropertyNameChoice, + ) -> *const ::std::os::raw::c_char; } extern "C" { - pub fn udata_setCommonData_64(data: *const ::std::os::raw::c_void, err: *mut UErrorCode); + pub fn u_getPropertyValueEnum_64( + property: UProperty, + alias: *const ::std::os::raw::c_char, + ) -> i32; } extern "C" { - pub fn udata_setAppData_64( - packageName: *const ::std::os::raw::c_char, - data: *const ::std::os::raw::c_void, - err: *mut UErrorCode, - ); + pub fn u_isIDStart_64(c: UChar32) -> UBool; } -impl UDataFileAccess { - pub const UDATA_DEFAULT_ACCESS: UDataFileAccess = UDataFileAccess::UDATA_FILES_FIRST; +extern "C" { + pub fn u_isIDPart_64(c: UChar32) -> UBool; } -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UDataFileAccess { - UDATA_FILES_FIRST = 0, - UDATA_ONLY_PACKAGES = 1, - UDATA_PACKAGES_FIRST = 2, - UDATA_NO_FILES = 3, - UDATA_FILE_ACCESS_COUNT = 4, +extern "C" { + pub fn u_isIDIgnorable_64(c: UChar32) -> UBool; } extern "C" { - pub fn udata_setFileAccess_64(access: UDataFileAccess, status: *mut UErrorCode); + pub fn u_isJavaIDStart_64(c: UChar32) -> UBool; } extern "C" { - pub fn u_getDataDirectory_64() -> *const ::std::os::raw::c_char; + pub fn u_isJavaIDPart_64(c: UChar32) -> UBool; } extern "C" { - pub fn u_setDataDirectory_64(directory: *const ::std::os::raw::c_char); + pub fn u_tolower_64(c: UChar32) -> UChar32; } extern "C" { - pub fn u_getTimeZoneFilesDirectory_64(status: *mut UErrorCode) - -> *const ::std::os::raw::c_char; + pub fn u_toupper_64(c: UChar32) -> UChar32; } extern "C" { - pub fn u_setTimeZoneFilesDirectory_64( - path: *const ::std::os::raw::c_char, - status: *mut UErrorCode, - ); + pub fn u_totitle_64(c: UChar32) -> UChar32; } extern "C" { - pub fn u_charsToUChars_64(cs: *const ::std::os::raw::c_char, us: *mut UChar, length: i32); + pub fn u_foldCase_64(c: UChar32, options: u32) -> UChar32; } extern "C" { - pub fn u_UCharsToChars_64(us: *const UChar, cs: *mut ::std::os::raw::c_char, length: i32); + pub fn u_digit_64(ch: UChar32, radix: i8) -> i32; +} +extern "C" { + pub fn u_forDigit_64(digit: i32, radix: i8) -> UChar32; +} +extern "C" { + pub fn u_charAge_64(c: UChar32, versionArray: *mut u8); +} +extern "C" { + pub fn u_getUnicodeVersion_64(versionArray: *mut u8); +} +extern "C" { + pub fn u_getFC_NFKC_Closure_64( + c: UChar32, + dest: *mut UChar, + destCapacity: i32, + pErrorCode: *mut UErrorCode, + ) -> i32; } #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UCharIteratorOrigin { - UITER_START = 0, - UITER_CURRENT = 1, - UITER_LIMIT = 2, - UITER_ZERO = 3, - UITER_LENGTH = 4, +pub enum USetSpanCondition { + USET_SPAN_NOT_CONTAINED = 0, + USET_SPAN_CONTAINED = 1, + USET_SPAN_SIMPLE = 2, + USET_SPAN_CONDITION_COUNT = 3, } -pub type UCharIteratorGetIndex = ::std::option::Option< - unsafe extern "C" fn(iter: *mut UCharIterator, origin: UCharIteratorOrigin) -> i32, ->; -pub type UCharIteratorMove = ::std::option::Option< - unsafe extern "C" fn(iter: *mut UCharIterator, delta: i32, origin: UCharIteratorOrigin) -> i32, ->; -pub type UCharIteratorHasNext = - ::std::option::Option UBool>; -pub type UCharIteratorHasPrevious = - ::std::option::Option UBool>; -pub type UCharIteratorCurrent = - ::std::option::Option UChar32>; -pub type UCharIteratorNext = - ::std::option::Option UChar32>; -pub type UCharIteratorPrevious = - ::std::option::Option UChar32>; -pub type UCharIteratorReserved = - ::std::option::Option i32>; -pub type UCharIteratorGetState = - ::std::option::Option u32>; -pub type UCharIteratorSetState = ::std::option::Option< - unsafe extern "C" fn(iter: *mut UCharIterator, state: u32, pErrorCode: *mut UErrorCode), ->; #[repr(C)] -#[derive(Debug, Copy, Clone, Hash, PartialOrd, PartialEq)] -pub struct UCharIterator { - pub context: *const ::std::os::raw::c_void, - pub length: i32, - pub start: i32, - pub index: i32, - pub limit: i32, - pub reservedField: i32, - pub getIndex: UCharIteratorGetIndex, - pub move_: UCharIteratorMove, - pub hasNext: UCharIteratorHasNext, - pub hasPrevious: UCharIteratorHasPrevious, - pub current: UCharIteratorCurrent, - pub next: UCharIteratorNext, - pub previous: UCharIteratorPrevious, - pub reservedFn: UCharIteratorReserved, - pub getState: UCharIteratorGetState, - pub setState: UCharIteratorSetState, +#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, PartialEq)] +pub struct UParseError { + pub line: i32, + pub offset: i32, + pub preContext: [UChar; 16usize], + pub postContext: [UChar; 16usize], } #[test] -fn bindgen_test_layout_UCharIterator() { +fn bindgen_test_layout_UParseError() { assert_eq!( - ::std::mem::size_of::(), - 112usize, - concat!("Size of: ", stringify!(UCharIterator)) + ::std::mem::size_of::(), + 72usize, + concat!("Size of: ", stringify!(UParseError)) ); assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(UCharIterator)) + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(UParseError)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).context as *const _ as usize }, + unsafe { &(*(::std::ptr::null::())).line as *const _ as usize }, 0usize, concat!( "Offset of field: ", - stringify!(UCharIterator), + stringify!(UParseError), "::", - stringify!(context) + stringify!(line) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).length as *const _ as usize }, - 8usize, + unsafe { &(*(::std::ptr::null::())).offset as *const _ as usize }, + 4usize, concat!( "Offset of field: ", - stringify!(UCharIterator), + stringify!(UParseError), "::", - stringify!(length) + stringify!(offset) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).start as *const _ as usize }, - 12usize, + unsafe { &(*(::std::ptr::null::())).preContext as *const _ as usize }, + 8usize, concat!( "Offset of field: ", - stringify!(UCharIterator), + stringify!(UParseError), "::", - stringify!(start) + stringify!(preContext) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).index as *const _ as usize }, - 16usize, + unsafe { &(*(::std::ptr::null::())).postContext as *const _ as usize }, + 40usize, concat!( "Offset of field: ", - stringify!(UCharIterator), + stringify!(UParseError), "::", - stringify!(index) + stringify!(postContext) ) ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).limit as *const _ as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(UCharIterator), - "::", - stringify!(limit) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).reservedField as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(UCharIterator), - "::", - stringify!(reservedField) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).getIndex as *const _ as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(UCharIterator), - "::", - stringify!(getIndex) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).move_ as *const _ as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(UCharIterator), - "::", - stringify!(move_) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).hasNext as *const _ as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(UCharIterator), - "::", - stringify!(hasNext) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).hasPrevious as *const _ as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(UCharIterator), - "::", - stringify!(hasPrevious) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).current as *const _ as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(UCharIterator), - "::", - stringify!(current) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).next as *const _ as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(UCharIterator), - "::", - stringify!(next) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).previous as *const _ as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(UCharIterator), - "::", - stringify!(previous) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).reservedFn as *const _ as usize }, - 88usize, - concat!( - "Offset of field: ", - stringify!(UCharIterator), - "::", - stringify!(reservedFn) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).getState as *const _ as usize }, - 96usize, - concat!( - "Offset of field: ", - stringify!(UCharIterator), - "::", - stringify!(getState) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).setState as *const _ as usize }, - 104usize, - concat!( - "Offset of field: ", - stringify!(UCharIterator), - "::", - stringify!(setState) - ) - ); -} -impl Default for UCharIterator { - fn default() -> Self { - unsafe { ::std::mem::zeroed() } - } } #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct UBreakIterator { +pub struct UCollator { _unused: [u8; 0], } -extern "C" { - pub fn u_strlen_64(s: *const UChar) -> i32; +#[repr(i32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] +pub enum UCollationResult { + UCOL_EQUAL = 0, + UCOL_GREATER = 1, + UCOL_LESS = -1, } -extern "C" { - pub fn u_countChar32_64(s: *const UChar, length: i32) -> i32; +impl UColAttributeValue { + pub const UCOL_DEFAULT_STRENGTH: UColAttributeValue = UColAttributeValue::UCOL_TERTIARY; } -extern "C" { - pub fn u_strHasMoreChar32Than_64(s: *const UChar, length: i32, number: i32) -> UBool; +impl UColAttributeValue { + pub const UCOL_QUATERNARY: UColAttributeValue = UColAttributeValue::UCOL_CE_STRENGTH_LIMIT; } -extern "C" { - pub fn u_strcat_64(dst: *mut UChar, src: *const UChar) -> *mut UChar; +impl UColAttributeValue { + pub const UCOL_OFF: UColAttributeValue = UColAttributeValue::UCOL_STRENGTH_LIMIT; } -extern "C" { - pub fn u_strncat_64(dst: *mut UChar, src: *const UChar, n: i32) -> *mut UChar; +#[repr(i32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] +pub enum UColAttributeValue { + UCOL_DEFAULT = -1, + UCOL_PRIMARY = 0, + UCOL_SECONDARY = 1, + UCOL_TERTIARY = 2, + UCOL_CE_STRENGTH_LIMIT = 3, + UCOL_IDENTICAL = 15, + UCOL_STRENGTH_LIMIT = 16, + UCOL_ON = 17, + UCOL_SHIFTED = 20, + UCOL_NON_IGNORABLE = 21, + UCOL_LOWER_FIRST = 24, + UCOL_UPPER_FIRST = 25, + UCOL_ATTRIBUTE_VALUE_COUNT = 26, } -extern "C" { - pub fn u_strstr_64(s: *const UChar, substring: *const UChar) -> *mut UChar; +impl UColReorderCode { + pub const UCOL_REORDER_CODE_OTHERS: UColReorderCode = UColReorderCode::UCOL_REORDER_CODE_NONE; } -extern "C" { - pub fn u_strFindFirst_64( - s: *const UChar, - length: i32, - substring: *const UChar, - subLength: i32, - ) -> *mut UChar; +impl UColReorderCode { + pub const UCOL_REORDER_CODE_FIRST: UColReorderCode = UColReorderCode::UCOL_REORDER_CODE_SPACE; } -extern "C" { - pub fn u_strchr_64(s: *const UChar, c: UChar) -> *mut UChar; +#[repr(i32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] +pub enum UColReorderCode { + UCOL_REORDER_CODE_DEFAULT = -1, + UCOL_REORDER_CODE_NONE = 103, + UCOL_REORDER_CODE_SPACE = 4096, + UCOL_REORDER_CODE_PUNCTUATION = 4097, + UCOL_REORDER_CODE_SYMBOL = 4098, + UCOL_REORDER_CODE_CURRENCY = 4099, + UCOL_REORDER_CODE_DIGIT = 4100, + UCOL_REORDER_CODE_LIMIT = 4101, } -extern "C" { - pub fn u_strchr32_64(s: *const UChar, c: UChar32) -> *mut UChar; +pub use self::UColAttributeValue as UCollationStrength; +impl UColAttribute { + pub const UCOL_DECOMPOSITION_MODE: UColAttribute = UColAttribute::UCOL_NORMALIZATION_MODE; } -extern "C" { - pub fn u_strrstr_64(s: *const UChar, substring: *const UChar) -> *mut UChar; +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] +pub enum UColAttribute { + UCOL_FRENCH_COLLATION = 0, + UCOL_ALTERNATE_HANDLING = 1, + UCOL_CASE_FIRST = 2, + UCOL_CASE_LEVEL = 3, + UCOL_NORMALIZATION_MODE = 4, + UCOL_STRENGTH = 5, + UCOL_HIRAGANA_QUATERNARY_MODE = 6, + UCOL_NUMERIC_COLLATION = 7, + UCOL_ATTRIBUTE_COUNT = 8, +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] +pub enum UColRuleOption { + UCOL_TAILORING_ONLY = 0, + UCOL_FULL_RULES = 1, } extern "C" { - pub fn u_strFindLast_64( - s: *const UChar, - length: i32, - substring: *const UChar, - subLength: i32, - ) -> *mut UChar; + pub fn ucol_open_64( + loc: *const ::std::os::raw::c_char, + status: *mut UErrorCode, + ) -> *mut UCollator; } extern "C" { - pub fn u_strrchr_64(s: *const UChar, c: UChar) -> *mut UChar; + pub fn ucol_openRules_64( + rules: *const UChar, + rulesLength: i32, + normalizationMode: UColAttributeValue, + strength: UCollationStrength, + parseError: *mut UParseError, + status: *mut UErrorCode, + ) -> *mut UCollator; } extern "C" { - pub fn u_strrchr32_64(s: *const UChar, c: UChar32) -> *mut UChar; + pub fn ucol_openFromShortString_64( + definition: *const ::std::os::raw::c_char, + forceDefaults: UBool, + parseError: *mut UParseError, + status: *mut UErrorCode, + ) -> *mut UCollator; } extern "C" { - pub fn u_strpbrk_64(string: *const UChar, matchSet: *const UChar) -> *mut UChar; + pub fn ucol_getContractions_64( + coll: *const UCollator, + conts: *mut USet, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_strcspn_64(string: *const UChar, matchSet: *const UChar) -> i32; + pub fn ucol_getContractionsAndExpansions_64( + coll: *const UCollator, + contractions: *mut USet, + expansions: *mut USet, + addPrefixes: UBool, + status: *mut UErrorCode, + ); } extern "C" { - pub fn u_strspn_64(string: *const UChar, matchSet: *const UChar) -> i32; + pub fn ucol_close_64(coll: *mut UCollator); } extern "C" { - pub fn u_strtok_r_64( - src: *mut UChar, - delim: *const UChar, - saveState: *mut *mut UChar, - ) -> *mut UChar; + pub fn ucol_strcoll_64( + coll: *const UCollator, + source: *const UChar, + sourceLength: i32, + target: *const UChar, + targetLength: i32, + ) -> UCollationResult; } extern "C" { - pub fn u_strcmp_64(s1: *const UChar, s2: *const UChar) -> i32; + pub fn ucol_strcollUTF8_64( + coll: *const UCollator, + source: *const ::std::os::raw::c_char, + sourceLength: i32, + target: *const ::std::os::raw::c_char, + targetLength: i32, + status: *mut UErrorCode, + ) -> UCollationResult; } extern "C" { - pub fn u_strcmpCodePointOrder_64(s1: *const UChar, s2: *const UChar) -> i32; + pub fn ucol_greater_64( + coll: *const UCollator, + source: *const UChar, + sourceLength: i32, + target: *const UChar, + targetLength: i32, + ) -> UBool; } extern "C" { - pub fn u_strCompare_64( - s1: *const UChar, - length1: i32, - s2: *const UChar, - length2: i32, - codePointOrder: UBool, - ) -> i32; + pub fn ucol_greaterOrEqual_64( + coll: *const UCollator, + source: *const UChar, + sourceLength: i32, + target: *const UChar, + targetLength: i32, + ) -> UBool; } extern "C" { - pub fn u_strCompareIter_64( - iter1: *mut UCharIterator, - iter2: *mut UCharIterator, - codePointOrder: UBool, - ) -> i32; + pub fn ucol_equal_64( + coll: *const UCollator, + source: *const UChar, + sourceLength: i32, + target: *const UChar, + targetLength: i32, + ) -> UBool; } extern "C" { - pub fn u_strCaseCompare_64( - s1: *const UChar, - length1: i32, - s2: *const UChar, - length2: i32, - options: u32, - pErrorCode: *mut UErrorCode, - ) -> i32; + pub fn ucol_strcollIter_64( + coll: *const UCollator, + sIter: *mut UCharIterator, + tIter: *mut UCharIterator, + status: *mut UErrorCode, + ) -> UCollationResult; } extern "C" { - pub fn u_strncmp_64(ucs1: *const UChar, ucs2: *const UChar, n: i32) -> i32; + pub fn ucol_getStrength_64(coll: *const UCollator) -> UCollationStrength; } extern "C" { - pub fn u_strncmpCodePointOrder_64(s1: *const UChar, s2: *const UChar, n: i32) -> i32; + pub fn ucol_setStrength_64(coll: *mut UCollator, strength: UCollationStrength); } extern "C" { - pub fn u_strcasecmp_64(s1: *const UChar, s2: *const UChar, options: u32) -> i32; + pub fn ucol_getReorderCodes_64( + coll: *const UCollator, + dest: *mut i32, + destCapacity: i32, + pErrorCode: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_strncasecmp_64(s1: *const UChar, s2: *const UChar, n: i32, options: u32) -> i32; + pub fn ucol_setReorderCodes_64( + coll: *mut UCollator, + reorderCodes: *const i32, + reorderCodesLength: i32, + pErrorCode: *mut UErrorCode, + ); } extern "C" { - pub fn u_memcasecmp_64(s1: *const UChar, s2: *const UChar, length: i32, options: u32) -> i32; + pub fn ucol_getEquivalentReorderCodes_64( + reorderCode: i32, + dest: *mut i32, + destCapacity: i32, + pErrorCode: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_strcpy_64(dst: *mut UChar, src: *const UChar) -> *mut UChar; + pub fn ucol_getDisplayName_64( + objLoc: *const ::std::os::raw::c_char, + dispLoc: *const ::std::os::raw::c_char, + result: *mut UChar, + resultLength: i32, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_strncpy_64(dst: *mut UChar, src: *const UChar, n: i32) -> *mut UChar; + pub fn ucol_getAvailable_64(localeIndex: i32) -> *const ::std::os::raw::c_char; } extern "C" { - pub fn u_uastrcpy_64(dst: *mut UChar, src: *const ::std::os::raw::c_char) -> *mut UChar; + pub fn ucol_countAvailable_64() -> i32; } extern "C" { - pub fn u_uastrncpy_64( - dst: *mut UChar, - src: *const ::std::os::raw::c_char, - n: i32, - ) -> *mut UChar; + pub fn ucol_openAvailableLocales_64(status: *mut UErrorCode) -> *mut UEnumeration; } extern "C" { - pub fn u_austrcpy_64( - dst: *mut ::std::os::raw::c_char, - src: *const UChar, - ) -> *mut ::std::os::raw::c_char; + pub fn ucol_getKeywords_64(status: *mut UErrorCode) -> *mut UEnumeration; } extern "C" { - pub fn u_austrncpy_64( - dst: *mut ::std::os::raw::c_char, - src: *const UChar, - n: i32, - ) -> *mut ::std::os::raw::c_char; + pub fn ucol_getKeywordValues_64( + keyword: *const ::std::os::raw::c_char, + status: *mut UErrorCode, + ) -> *mut UEnumeration; } extern "C" { - pub fn u_memcpy_64(dest: *mut UChar, src: *const UChar, count: i32) -> *mut UChar; + pub fn ucol_getKeywordValuesForLocale_64( + key: *const ::std::os::raw::c_char, + locale: *const ::std::os::raw::c_char, + commonlyUsed: UBool, + status: *mut UErrorCode, + ) -> *mut UEnumeration; } extern "C" { - pub fn u_memmove_64(dest: *mut UChar, src: *const UChar, count: i32) -> *mut UChar; + pub fn ucol_getFunctionalEquivalent_64( + result: *mut ::std::os::raw::c_char, + resultCapacity: i32, + keyword: *const ::std::os::raw::c_char, + locale: *const ::std::os::raw::c_char, + isAvailable: *mut UBool, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_memset_64(dest: *mut UChar, c: UChar, count: i32) -> *mut UChar; + pub fn ucol_getRules_64(coll: *const UCollator, length: *mut i32) -> *const UChar; } extern "C" { - pub fn u_memcmp_64(buf1: *const UChar, buf2: *const UChar, count: i32) -> i32; + pub fn ucol_getShortDefinitionString_64( + coll: *const UCollator, + locale: *const ::std::os::raw::c_char, + buffer: *mut ::std::os::raw::c_char, + capacity: i32, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_memcmpCodePointOrder_64(s1: *const UChar, s2: *const UChar, count: i32) -> i32; + pub fn ucol_normalizeShortDefinitionString_64( + source: *const ::std::os::raw::c_char, + destination: *mut ::std::os::raw::c_char, + capacity: i32, + parseError: *mut UParseError, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_memchr_64(s: *const UChar, c: UChar, count: i32) -> *mut UChar; + pub fn ucol_getSortKey_64( + coll: *const UCollator, + source: *const UChar, + sourceLength: i32, + result: *mut u8, + resultLength: i32, + ) -> i32; } extern "C" { - pub fn u_memchr32_64(s: *const UChar, c: UChar32, count: i32) -> *mut UChar; + pub fn ucol_nextSortKeyPart_64( + coll: *const UCollator, + iter: *mut UCharIterator, + state: *mut u32, + dest: *mut u8, + count: i32, + status: *mut UErrorCode, + ) -> i32; } -extern "C" { - pub fn u_memrchr_64(s: *const UChar, c: UChar, count: i32) -> *mut UChar; +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] +pub enum UColBoundMode { + UCOL_BOUND_LOWER = 0, + UCOL_BOUND_UPPER = 1, + UCOL_BOUND_UPPER_LONG = 2, + UCOL_BOUND_VALUE_COUNT = 3, } extern "C" { - pub fn u_memrchr32_64(s: *const UChar, c: UChar32, count: i32) -> *mut UChar; + pub fn ucol_getBound_64( + source: *const u8, + sourceLength: i32, + boundType: UColBoundMode, + noOfLevels: u32, + result: *mut u8, + resultLength: i32, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_unescape_64( - src: *const ::std::os::raw::c_char, - dest: *mut UChar, - destCapacity: i32, - ) -> i32; + pub fn ucol_getVersion_64(coll: *const UCollator, info: *mut u8); } -pub type UNESCAPE_CHAR_AT = ::std::option::Option< - unsafe extern "C" fn(offset: i32, context: *mut ::std::os::raw::c_void) -> UChar, ->; extern "C" { - pub fn u_unescapeAt_64( - charAt: UNESCAPE_CHAR_AT, - offset: *mut i32, - length: i32, - context: *mut ::std::os::raw::c_void, - ) -> UChar32; + pub fn ucol_getUCAVersion_64(coll: *const UCollator, info: *mut u8); } extern "C" { - pub fn u_strToUpper_64( - dest: *mut UChar, + pub fn ucol_mergeSortkeys_64( + src1: *const u8, + src1Length: i32, + src2: *const u8, + src2Length: i32, + dest: *mut u8, destCapacity: i32, - src: *const UChar, - srcLength: i32, - locale: *const ::std::os::raw::c_char, - pErrorCode: *mut UErrorCode, ) -> i32; } extern "C" { - pub fn u_strToLower_64( - dest: *mut UChar, - destCapacity: i32, - src: *const UChar, - srcLength: i32, - locale: *const ::std::os::raw::c_char, - pErrorCode: *mut UErrorCode, - ) -> i32; + pub fn ucol_setAttribute_64( + coll: *mut UCollator, + attr: UColAttribute, + value: UColAttributeValue, + status: *mut UErrorCode, + ); } extern "C" { - pub fn u_strToTitle_64( - dest: *mut UChar, - destCapacity: i32, - src: *const UChar, - srcLength: i32, - titleIter: *mut UBreakIterator, - locale: *const ::std::os::raw::c_char, - pErrorCode: *mut UErrorCode, - ) -> i32; + pub fn ucol_getAttribute_64( + coll: *const UCollator, + attr: UColAttribute, + status: *mut UErrorCode, + ) -> UColAttributeValue; } extern "C" { - pub fn u_strFoldCase_64( - dest: *mut UChar, - destCapacity: i32, - src: *const UChar, - srcLength: i32, - options: u32, + pub fn ucol_setMaxVariable_64( + coll: *mut UCollator, + group: UColReorderCode, pErrorCode: *mut UErrorCode, - ) -> i32; + ); } extern "C" { - pub fn u_strToWCS_64( - dest: *mut wchar_t, - destCapacity: i32, - pDestLength: *mut i32, - src: *const UChar, - srcLength: i32, - pErrorCode: *mut UErrorCode, - ) -> *mut wchar_t; + pub fn ucol_getMaxVariable_64(coll: *const UCollator) -> UColReorderCode; } extern "C" { - pub fn u_strFromWCS_64( - dest: *mut UChar, - destCapacity: i32, - pDestLength: *mut i32, - src: *const wchar_t, - srcLength: i32, - pErrorCode: *mut UErrorCode, - ) -> *mut UChar; + pub fn ucol_setVariableTop_64( + coll: *mut UCollator, + varTop: *const UChar, + len: i32, + status: *mut UErrorCode, + ) -> u32; } extern "C" { - pub fn u_strToUTF8_64( - dest: *mut ::std::os::raw::c_char, - destCapacity: i32, - pDestLength: *mut i32, - src: *const UChar, - srcLength: i32, - pErrorCode: *mut UErrorCode, - ) -> *mut ::std::os::raw::c_char; + pub fn ucol_getVariableTop_64(coll: *const UCollator, status: *mut UErrorCode) -> u32; } extern "C" { - pub fn u_strFromUTF8_64( - dest: *mut UChar, - destCapacity: i32, - pDestLength: *mut i32, - src: *const ::std::os::raw::c_char, - srcLength: i32, - pErrorCode: *mut UErrorCode, - ) -> *mut UChar; + pub fn ucol_restoreVariableTop_64(coll: *mut UCollator, varTop: u32, status: *mut UErrorCode); } extern "C" { - pub fn u_strToUTF8WithSub_64( - dest: *mut ::std::os::raw::c_char, - destCapacity: i32, - pDestLength: *mut i32, - src: *const UChar, - srcLength: i32, - subchar: UChar32, - pNumSubstitutions: *mut i32, - pErrorCode: *mut UErrorCode, - ) -> *mut ::std::os::raw::c_char; + pub fn ucol_safeClone_64( + coll: *const UCollator, + stackBuffer: *mut ::std::os::raw::c_void, + pBufferSize: *mut i32, + status: *mut UErrorCode, + ) -> *mut UCollator; } extern "C" { - pub fn u_strFromUTF8WithSub_64( - dest: *mut UChar, - destCapacity: i32, - pDestLength: *mut i32, - src: *const ::std::os::raw::c_char, - srcLength: i32, - subchar: UChar32, - pNumSubstitutions: *mut i32, - pErrorCode: *mut UErrorCode, - ) -> *mut UChar; + pub fn ucol_getRulesEx_64( + coll: *const UCollator, + delta: UColRuleOption, + buffer: *mut UChar, + bufferLen: i32, + ) -> i32; } extern "C" { - pub fn u_strFromUTF8Lenient_64( - dest: *mut UChar, - destCapacity: i32, - pDestLength: *mut i32, - src: *const ::std::os::raw::c_char, - srcLength: i32, - pErrorCode: *mut UErrorCode, - ) -> *mut UChar; + pub fn ucol_getLocale_64( + coll: *const UCollator, + type_: ULocDataLocaleType, + status: *mut UErrorCode, + ) -> *const ::std::os::raw::c_char; } extern "C" { - pub fn u_strToUTF32_64( - dest: *mut UChar32, - destCapacity: i32, - pDestLength: *mut i32, - src: *const UChar, - srcLength: i32, - pErrorCode: *mut UErrorCode, - ) -> *mut UChar32; + pub fn ucol_getLocaleByType_64( + coll: *const UCollator, + type_: ULocDataLocaleType, + status: *mut UErrorCode, + ) -> *const ::std::os::raw::c_char; } extern "C" { - pub fn u_strFromUTF32_64( - dest: *mut UChar, - destCapacity: i32, - pDestLength: *mut i32, - src: *const UChar32, - srcLength: i32, - pErrorCode: *mut UErrorCode, - ) -> *mut UChar; + pub fn ucol_getTailoredSet_64(coll: *const UCollator, status: *mut UErrorCode) -> *mut USet; } extern "C" { - pub fn u_strToUTF32WithSub_64( - dest: *mut UChar32, - destCapacity: i32, - pDestLength: *mut i32, - src: *const UChar, - srcLength: i32, - subchar: UChar32, - pNumSubstitutions: *mut i32, - pErrorCode: *mut UErrorCode, - ) -> *mut UChar32; + pub fn ucol_getUnsafeSet_64( + coll: *const UCollator, + unsafe_: *mut USet, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_strFromUTF32WithSub_64( - dest: *mut UChar, - destCapacity: i32, - pDestLength: *mut i32, - src: *const UChar32, - srcLength: i32, - subchar: UChar32, - pNumSubstitutions: *mut i32, - pErrorCode: *mut UErrorCode, - ) -> *mut UChar; + pub fn ucol_prepareShortStringOpen_64( + definition: *const ::std::os::raw::c_char, + forceDefaults: UBool, + parseError: *mut UParseError, + status: *mut UErrorCode, + ); } extern "C" { - pub fn u_strToJavaModifiedUTF8_64( - dest: *mut ::std::os::raw::c_char, - destCapacity: i32, - pDestLength: *mut i32, - src: *const UChar, - srcLength: i32, - pErrorCode: *mut UErrorCode, - ) -> *mut ::std::os::raw::c_char; + pub fn ucol_cloneBinary_64( + coll: *const UCollator, + buffer: *mut u8, + capacity: i32, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_strFromJavaModifiedUTF8WithSub_64( - dest: *mut UChar, - destCapacity: i32, - pDestLength: *mut i32, - src: *const ::std::os::raw::c_char, - srcLength: i32, - subchar: UChar32, - pNumSubstitutions: *mut i32, - pErrorCode: *mut UErrorCode, - ) -> *mut UChar; + pub fn ucol_openBinary_64( + bin: *const u8, + length: i32, + base: *const UCollator, + status: *mut UErrorCode, + ) -> *mut UCollator; } #[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct UCPMap { - _unused: [u8; 0], +#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, PartialEq)] +pub struct UFieldPosition { + pub field: i32, + pub beginIndex: i32, + pub endIndex: i32, +} +#[test] +fn bindgen_test_layout_UFieldPosition() { + assert_eq!( + ::std::mem::size_of::(), + 12usize, + concat!("Size of: ", stringify!(UFieldPosition)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(UFieldPosition)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).field as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(UFieldPosition), + "::", + stringify!(field) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).beginIndex as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(UFieldPosition), + "::", + stringify!(beginIndex) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).endIndex as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(UFieldPosition), + "::", + stringify!(endIndex) + ) + ); +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] +pub enum UDisplayContextType { + UDISPCTX_TYPE_DIALECT_HANDLING = 0, + UDISPCTX_TYPE_CAPITALIZATION = 1, + UDISPCTX_TYPE_DISPLAY_LENGTH = 2, + UDISPCTX_TYPE_SUBSTITUTE_HANDLING = 3, +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] +pub enum UDisplayContext { + UDISPCTX_STANDARD_NAMES = 0, + UDISPCTX_DIALECT_NAMES = 1, + UDISPCTX_CAPITALIZATION_NONE = 256, + UDISPCTX_CAPITALIZATION_FOR_MIDDLE_OF_SENTENCE = 257, + UDISPCTX_CAPITALIZATION_FOR_BEGINNING_OF_SENTENCE = 258, + UDISPCTX_CAPITALIZATION_FOR_UI_LIST_OR_MENU = 259, + UDISPCTX_CAPITALIZATION_FOR_STANDALONE = 260, + UDISPCTX_LENGTH_FULL = 512, + UDISPCTX_LENGTH_SHORT = 513, + UDISPCTX_SUBSTITUTE = 768, + UDISPCTX_NO_SUBSTITUTE = 769, } #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct USet { +pub struct UFieldPositionIterator { _unused: [u8; 0], } -impl UProperty { - pub const UCHAR_BINARY_START: UProperty = UProperty::UCHAR_ALPHABETIC; -} -impl UProperty { - pub const UCHAR_INT_START: UProperty = UProperty::UCHAR_BIDI_CLASS; -} -impl UProperty { - pub const UCHAR_MASK_START: UProperty = UProperty::UCHAR_GENERAL_CATEGORY_MASK; -} -impl UProperty { - pub const UCHAR_DOUBLE_START: UProperty = UProperty::UCHAR_NUMERIC_VALUE; +pub type UNumberFormat = *mut ::std::os::raw::c_void; +pub type UDateFormat = *mut ::std::os::raw::c_void; +impl UDateFormatStyle { + pub const UDAT_DEFAULT: UDateFormatStyle = UDateFormatStyle::UDAT_MEDIUM; } -impl UProperty { - pub const UCHAR_STRING_START: UProperty = UProperty::UCHAR_AGE; +impl UDateFormatStyle { + pub const UDAT_FULL_RELATIVE: UDateFormatStyle = UDateFormatStyle::UDAT_RELATIVE; } -impl UProperty { - pub const UCHAR_OTHER_PROPERTY_START: UProperty = UProperty::UCHAR_SCRIPT_EXTENSIONS; +impl UDateFormatStyle { + pub const UDAT_IGNORE: UDateFormatStyle = UDateFormatStyle::UDAT_PATTERN; } #[repr(i32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UProperty { - UCHAR_ALPHABETIC = 0, - UCHAR_ASCII_HEX_DIGIT = 1, - UCHAR_BIDI_CONTROL = 2, - UCHAR_BIDI_MIRRORED = 3, - UCHAR_DASH = 4, - UCHAR_DEFAULT_IGNORABLE_CODE_POINT = 5, - UCHAR_DEPRECATED = 6, - UCHAR_DIACRITIC = 7, - UCHAR_EXTENDER = 8, - UCHAR_FULL_COMPOSITION_EXCLUSION = 9, - UCHAR_GRAPHEME_BASE = 10, - UCHAR_GRAPHEME_EXTEND = 11, - UCHAR_GRAPHEME_LINK = 12, - UCHAR_HEX_DIGIT = 13, - UCHAR_HYPHEN = 14, - UCHAR_ID_CONTINUE = 15, - UCHAR_ID_START = 16, - UCHAR_IDEOGRAPHIC = 17, - UCHAR_IDS_BINARY_OPERATOR = 18, - UCHAR_IDS_TRINARY_OPERATOR = 19, - UCHAR_JOIN_CONTROL = 20, - UCHAR_LOGICAL_ORDER_EXCEPTION = 21, - UCHAR_LOWERCASE = 22, - UCHAR_MATH = 23, - UCHAR_NONCHARACTER_CODE_POINT = 24, - UCHAR_QUOTATION_MARK = 25, - UCHAR_RADICAL = 26, - UCHAR_SOFT_DOTTED = 27, - UCHAR_TERMINAL_PUNCTUATION = 28, - UCHAR_UNIFIED_IDEOGRAPH = 29, - UCHAR_UPPERCASE = 30, - UCHAR_WHITE_SPACE = 31, - UCHAR_XID_CONTINUE = 32, - UCHAR_XID_START = 33, - UCHAR_CASE_SENSITIVE = 34, - UCHAR_S_TERM = 35, - UCHAR_VARIATION_SELECTOR = 36, - UCHAR_NFD_INERT = 37, - UCHAR_NFKD_INERT = 38, - UCHAR_NFC_INERT = 39, - UCHAR_NFKC_INERT = 40, - UCHAR_SEGMENT_STARTER = 41, - UCHAR_PATTERN_SYNTAX = 42, - UCHAR_PATTERN_WHITE_SPACE = 43, - UCHAR_POSIX_ALNUM = 44, - UCHAR_POSIX_BLANK = 45, - UCHAR_POSIX_GRAPH = 46, - UCHAR_POSIX_PRINT = 47, - UCHAR_POSIX_XDIGIT = 48, - UCHAR_CASED = 49, - UCHAR_CASE_IGNORABLE = 50, - UCHAR_CHANGES_WHEN_LOWERCASED = 51, - UCHAR_CHANGES_WHEN_UPPERCASED = 52, - UCHAR_CHANGES_WHEN_TITLECASED = 53, - UCHAR_CHANGES_WHEN_CASEFOLDED = 54, - UCHAR_CHANGES_WHEN_CASEMAPPED = 55, - UCHAR_CHANGES_WHEN_NFKC_CASEFOLDED = 56, - UCHAR_EMOJI = 57, - UCHAR_EMOJI_PRESENTATION = 58, - UCHAR_EMOJI_MODIFIER = 59, - UCHAR_EMOJI_MODIFIER_BASE = 60, - UCHAR_EMOJI_COMPONENT = 61, - UCHAR_REGIONAL_INDICATOR = 62, - UCHAR_PREPENDED_CONCATENATION_MARK = 63, - UCHAR_EXTENDED_PICTOGRAPHIC = 64, - UCHAR_BINARY_LIMIT = 65, - UCHAR_BIDI_CLASS = 4096, - UCHAR_BLOCK = 4097, - UCHAR_CANONICAL_COMBINING_CLASS = 4098, - UCHAR_DECOMPOSITION_TYPE = 4099, - UCHAR_EAST_ASIAN_WIDTH = 4100, - UCHAR_GENERAL_CATEGORY = 4101, - UCHAR_JOINING_GROUP = 4102, - UCHAR_JOINING_TYPE = 4103, - UCHAR_LINE_BREAK = 4104, - UCHAR_NUMERIC_TYPE = 4105, - UCHAR_SCRIPT = 4106, - UCHAR_HANGUL_SYLLABLE_TYPE = 4107, - UCHAR_NFD_QUICK_CHECK = 4108, - UCHAR_NFKD_QUICK_CHECK = 4109, - UCHAR_NFC_QUICK_CHECK = 4110, - UCHAR_NFKC_QUICK_CHECK = 4111, - UCHAR_LEAD_CANONICAL_COMBINING_CLASS = 4112, - UCHAR_TRAIL_CANONICAL_COMBINING_CLASS = 4113, - UCHAR_GRAPHEME_CLUSTER_BREAK = 4114, - UCHAR_SENTENCE_BREAK = 4115, - UCHAR_WORD_BREAK = 4116, - UCHAR_BIDI_PAIRED_BRACKET_TYPE = 4117, - UCHAR_INDIC_POSITIONAL_CATEGORY = 4118, - UCHAR_INDIC_SYLLABIC_CATEGORY = 4119, - UCHAR_VERTICAL_ORIENTATION = 4120, - UCHAR_INT_LIMIT = 4121, - UCHAR_GENERAL_CATEGORY_MASK = 8192, - UCHAR_MASK_LIMIT = 8193, - UCHAR_NUMERIC_VALUE = 12288, - UCHAR_DOUBLE_LIMIT = 12289, - UCHAR_AGE = 16384, - UCHAR_BIDI_MIRRORING_GLYPH = 16385, - UCHAR_CASE_FOLDING = 16386, - UCHAR_ISO_COMMENT = 16387, - UCHAR_LOWERCASE_MAPPING = 16388, - UCHAR_NAME = 16389, - UCHAR_SIMPLE_CASE_FOLDING = 16390, - UCHAR_SIMPLE_LOWERCASE_MAPPING = 16391, - UCHAR_SIMPLE_TITLECASE_MAPPING = 16392, - UCHAR_SIMPLE_UPPERCASE_MAPPING = 16393, - UCHAR_TITLECASE_MAPPING = 16394, - UCHAR_UNICODE_1_NAME = 16395, - UCHAR_UPPERCASE_MAPPING = 16396, - UCHAR_BIDI_PAIRED_BRACKET = 16397, - UCHAR_STRING_LIMIT = 16398, - UCHAR_SCRIPT_EXTENSIONS = 28672, - UCHAR_OTHER_PROPERTY_LIMIT = 28673, - UCHAR_INVALID_CODE = -1, -} -impl UCharCategory { - pub const U_GENERAL_OTHER_TYPES: UCharCategory = UCharCategory::U_UNASSIGNED; +pub enum UDateFormatStyle { + UDAT_FULL = 0, + UDAT_LONG = 1, + UDAT_MEDIUM = 2, + UDAT_SHORT = 3, + UDAT_RELATIVE = 128, + UDAT_LONG_RELATIVE = 129, + UDAT_MEDIUM_RELATIVE = 130, + UDAT_SHORT_RELATIVE = 131, + UDAT_NONE = -1, + UDAT_PATTERN = -2, } #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UCharCategory { - U_UNASSIGNED = 0, - U_UPPERCASE_LETTER = 1, - U_LOWERCASE_LETTER = 2, - U_TITLECASE_LETTER = 3, - U_MODIFIER_LETTER = 4, - U_OTHER_LETTER = 5, - U_NON_SPACING_MARK = 6, - U_ENCLOSING_MARK = 7, - U_COMBINING_SPACING_MARK = 8, - U_DECIMAL_DIGIT_NUMBER = 9, - U_LETTER_NUMBER = 10, - U_OTHER_NUMBER = 11, - U_SPACE_SEPARATOR = 12, - U_LINE_SEPARATOR = 13, - U_PARAGRAPH_SEPARATOR = 14, - U_CONTROL_CHAR = 15, - U_FORMAT_CHAR = 16, - U_PRIVATE_USE_CHAR = 17, - U_SURROGATE = 18, - U_DASH_PUNCTUATION = 19, - U_START_PUNCTUATION = 20, - U_END_PUNCTUATION = 21, - U_CONNECTOR_PUNCTUATION = 22, - U_OTHER_PUNCTUATION = 23, - U_MATH_SYMBOL = 24, - U_CURRENCY_SYMBOL = 25, - U_MODIFIER_SYMBOL = 26, - U_OTHER_SYMBOL = 27, - U_INITIAL_PUNCTUATION = 28, - U_FINAL_PUNCTUATION = 29, - U_CHAR_CATEGORY_COUNT = 30, +pub enum UDateFormatField { + UDAT_ERA_FIELD = 0, + UDAT_YEAR_FIELD = 1, + UDAT_MONTH_FIELD = 2, + UDAT_DATE_FIELD = 3, + UDAT_HOUR_OF_DAY1_FIELD = 4, + UDAT_HOUR_OF_DAY0_FIELD = 5, + UDAT_MINUTE_FIELD = 6, + UDAT_SECOND_FIELD = 7, + UDAT_FRACTIONAL_SECOND_FIELD = 8, + UDAT_DAY_OF_WEEK_FIELD = 9, + UDAT_DAY_OF_YEAR_FIELD = 10, + UDAT_DAY_OF_WEEK_IN_MONTH_FIELD = 11, + UDAT_WEEK_OF_YEAR_FIELD = 12, + UDAT_WEEK_OF_MONTH_FIELD = 13, + UDAT_AM_PM_FIELD = 14, + UDAT_HOUR1_FIELD = 15, + UDAT_HOUR0_FIELD = 16, + UDAT_TIMEZONE_FIELD = 17, + UDAT_YEAR_WOY_FIELD = 18, + UDAT_DOW_LOCAL_FIELD = 19, + UDAT_EXTENDED_YEAR_FIELD = 20, + UDAT_JULIAN_DAY_FIELD = 21, + UDAT_MILLISECONDS_IN_DAY_FIELD = 22, + UDAT_TIMEZONE_RFC_FIELD = 23, + UDAT_TIMEZONE_GENERIC_FIELD = 24, + UDAT_STANDALONE_DAY_FIELD = 25, + UDAT_STANDALONE_MONTH_FIELD = 26, + UDAT_QUARTER_FIELD = 27, + UDAT_STANDALONE_QUARTER_FIELD = 28, + UDAT_TIMEZONE_SPECIAL_FIELD = 29, + UDAT_YEAR_NAME_FIELD = 30, + UDAT_TIMEZONE_LOCALIZED_GMT_OFFSET_FIELD = 31, + UDAT_TIMEZONE_ISO_FIELD = 32, + UDAT_TIMEZONE_ISO_LOCAL_FIELD = 33, + UDAT_RELATED_YEAR_FIELD = 34, + UDAT_AM_PM_MIDNIGHT_NOON_FIELD = 35, + UDAT_FLEXIBLE_DAY_PERIOD_FIELD = 36, + UDAT_TIME_SEPARATOR_FIELD = 37, + UDAT_FIELD_COUNT = 38, +} +extern "C" { + pub fn udat_toCalendarDateField_64(field: UDateFormatField) -> UCalendarDateFields; +} +extern "C" { + pub fn udat_open_64( + timeStyle: UDateFormatStyle, + dateStyle: UDateFormatStyle, + locale: *const ::std::os::raw::c_char, + tzID: *const UChar, + tzIDLength: i32, + pattern: *const UChar, + patternLength: i32, + status: *mut UErrorCode, + ) -> *mut UDateFormat; +} +extern "C" { + pub fn udat_close_64(format: *mut UDateFormat); } #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UCharDirection { - U_LEFT_TO_RIGHT = 0, - U_RIGHT_TO_LEFT = 1, - U_EUROPEAN_NUMBER = 2, - U_EUROPEAN_NUMBER_SEPARATOR = 3, - U_EUROPEAN_NUMBER_TERMINATOR = 4, - U_ARABIC_NUMBER = 5, - U_COMMON_NUMBER_SEPARATOR = 6, - U_BLOCK_SEPARATOR = 7, - U_SEGMENT_SEPARATOR = 8, - U_WHITE_SPACE_NEUTRAL = 9, - U_OTHER_NEUTRAL = 10, - U_LEFT_TO_RIGHT_EMBEDDING = 11, - U_LEFT_TO_RIGHT_OVERRIDE = 12, - U_RIGHT_TO_LEFT_ARABIC = 13, - U_RIGHT_TO_LEFT_EMBEDDING = 14, - U_RIGHT_TO_LEFT_OVERRIDE = 15, - U_POP_DIRECTIONAL_FORMAT = 16, - U_DIR_NON_SPACING_MARK = 17, - U_BOUNDARY_NEUTRAL = 18, - U_FIRST_STRONG_ISOLATE = 19, - U_LEFT_TO_RIGHT_ISOLATE = 20, - U_RIGHT_TO_LEFT_ISOLATE = 21, - U_POP_DIRECTIONAL_ISOLATE = 22, - U_CHAR_DIRECTION_COUNT = 23, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UCharNameChoice { - U_UNICODE_CHAR_NAME = 0, - U_UNICODE_10_CHAR_NAME = 1, - U_EXTENDED_CHAR_NAME = 2, - U_CHAR_NAME_ALIAS = 3, - U_CHAR_NAME_CHOICE_COUNT = 4, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UPropertyNameChoice { - U_SHORT_PROPERTY_NAME = 0, - U_LONG_PROPERTY_NAME = 1, - U_PROPERTY_NAME_CHOICE_COUNT = 2, +pub enum UDateFormatBooleanAttribute { + UDAT_PARSE_ALLOW_WHITESPACE = 0, + UDAT_PARSE_ALLOW_NUMERIC = 1, + UDAT_PARSE_PARTIAL_LITERAL_MATCH = 2, + UDAT_PARSE_MULTIPLE_PATTERNS_FOR_MATCH = 3, + UDAT_BOOLEAN_ATTRIBUTE_COUNT = 4, } extern "C" { - pub fn u_hasBinaryProperty_64(c: UChar32, which: UProperty) -> UBool; + pub fn udat_getBooleanAttribute_64( + fmt: *const UDateFormat, + attr: UDateFormatBooleanAttribute, + status: *mut UErrorCode, + ) -> UBool; } extern "C" { - pub fn u_getBinaryPropertySet_64( - property: UProperty, - pErrorCode: *mut UErrorCode, - ) -> *const USet; + pub fn udat_setBooleanAttribute_64( + fmt: *mut UDateFormat, + attr: UDateFormatBooleanAttribute, + newValue: UBool, + status: *mut UErrorCode, + ); } extern "C" { - pub fn u_isUAlphabetic_64(c: UChar32) -> UBool; + pub fn udat_clone_64(fmt: *const UDateFormat, status: *mut UErrorCode) -> *mut UDateFormat; } extern "C" { - pub fn u_isULowercase_64(c: UChar32) -> UBool; + pub fn udat_format_64( + format: *const UDateFormat, + dateToFormat: UDate, + result: *mut UChar, + resultLength: i32, + position: *mut UFieldPosition, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_isUUppercase_64(c: UChar32) -> UBool; + pub fn udat_formatCalendar_64( + format: *const UDateFormat, + calendar: *mut UCalendar, + result: *mut UChar, + capacity: i32, + position: *mut UFieldPosition, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_isUWhiteSpace_64(c: UChar32) -> UBool; + pub fn udat_formatForFields_64( + format: *const UDateFormat, + dateToFormat: UDate, + result: *mut UChar, + resultLength: i32, + fpositer: *mut UFieldPositionIterator, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_getIntPropertyValue_64(c: UChar32, which: UProperty) -> i32; + pub fn udat_formatCalendarForFields_64( + format: *const UDateFormat, + calendar: *mut UCalendar, + result: *mut UChar, + capacity: i32, + fpositer: *mut UFieldPositionIterator, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_getIntPropertyMinValue_64(which: UProperty) -> i32; + pub fn udat_parse_64( + format: *const UDateFormat, + text: *const UChar, + textLength: i32, + parsePos: *mut i32, + status: *mut UErrorCode, + ) -> UDate; } extern "C" { - pub fn u_getIntPropertyMaxValue_64(which: UProperty) -> i32; + pub fn udat_parseCalendar_64( + format: *const UDateFormat, + calendar: *mut UCalendar, + text: *const UChar, + textLength: i32, + parsePos: *mut i32, + status: *mut UErrorCode, + ); } extern "C" { - pub fn u_getIntPropertyMap_64( - property: UProperty, - pErrorCode: *mut UErrorCode, - ) -> *const UCPMap; + pub fn udat_isLenient_64(fmt: *const UDateFormat) -> UBool; } extern "C" { - pub fn u_getNumericValue_64(c: UChar32) -> f64; + pub fn udat_setLenient_64(fmt: *mut UDateFormat, isLenient: UBool); } extern "C" { - pub fn u_islower_64(c: UChar32) -> UBool; + pub fn udat_getCalendar_64(fmt: *const UDateFormat) -> *const UCalendar; } extern "C" { - pub fn u_isupper_64(c: UChar32) -> UBool; + pub fn udat_setCalendar_64(fmt: *mut UDateFormat, calendarToSet: *const UCalendar); } extern "C" { - pub fn u_istitle_64(c: UChar32) -> UBool; + pub fn udat_getNumberFormat_64(fmt: *const UDateFormat) -> *const UNumberFormat; } extern "C" { - pub fn u_isdigit_64(c: UChar32) -> UBool; + pub fn udat_getNumberFormatForField_64( + fmt: *const UDateFormat, + field: UChar, + ) -> *const UNumberFormat; } extern "C" { - pub fn u_isalpha_64(c: UChar32) -> UBool; + pub fn udat_adoptNumberFormatForFields_64( + fmt: *mut UDateFormat, + fields: *const UChar, + numberFormatToSet: *mut UNumberFormat, + status: *mut UErrorCode, + ); } extern "C" { - pub fn u_isalnum_64(c: UChar32) -> UBool; + pub fn udat_setNumberFormat_64(fmt: *mut UDateFormat, numberFormatToSet: *const UNumberFormat); } extern "C" { - pub fn u_isxdigit_64(c: UChar32) -> UBool; + pub fn udat_adoptNumberFormat_64( + fmt: *mut UDateFormat, + numberFormatToAdopt: *mut UNumberFormat, + ); } extern "C" { - pub fn u_ispunct_64(c: UChar32) -> UBool; + pub fn udat_getAvailable_64(localeIndex: i32) -> *const ::std::os::raw::c_char; } extern "C" { - pub fn u_isgraph_64(c: UChar32) -> UBool; + pub fn udat_countAvailable_64() -> i32; } extern "C" { - pub fn u_isblank_64(c: UChar32) -> UBool; + pub fn udat_get2DigitYearStart_64(fmt: *const UDateFormat, status: *mut UErrorCode) -> UDate; } extern "C" { - pub fn u_isdefined_64(c: UChar32) -> UBool; + pub fn udat_set2DigitYearStart_64(fmt: *mut UDateFormat, d: UDate, status: *mut UErrorCode); } extern "C" { - pub fn u_isspace_64(c: UChar32) -> UBool; + pub fn udat_toPattern_64( + fmt: *const UDateFormat, + localized: UBool, + result: *mut UChar, + resultLength: i32, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_isJavaSpaceChar_64(c: UChar32) -> UBool; + pub fn udat_applyPattern_64( + format: *mut UDateFormat, + localized: UBool, + pattern: *const UChar, + patternLength: i32, + ); } -extern "C" { - pub fn u_isWhitespace_64(c: UChar32) -> UBool; +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] +pub enum UDateFormatSymbolType { + UDAT_ERAS = 0, + UDAT_MONTHS = 1, + UDAT_SHORT_MONTHS = 2, + UDAT_WEEKDAYS = 3, + UDAT_SHORT_WEEKDAYS = 4, + UDAT_AM_PMS = 5, + UDAT_LOCALIZED_CHARS = 6, + UDAT_ERA_NAMES = 7, + UDAT_NARROW_MONTHS = 8, + UDAT_NARROW_WEEKDAYS = 9, + UDAT_STANDALONE_MONTHS = 10, + UDAT_STANDALONE_SHORT_MONTHS = 11, + UDAT_STANDALONE_NARROW_MONTHS = 12, + UDAT_STANDALONE_WEEKDAYS = 13, + UDAT_STANDALONE_SHORT_WEEKDAYS = 14, + UDAT_STANDALONE_NARROW_WEEKDAYS = 15, + UDAT_QUARTERS = 16, + UDAT_SHORT_QUARTERS = 17, + UDAT_STANDALONE_QUARTERS = 18, + UDAT_STANDALONE_SHORT_QUARTERS = 19, + UDAT_SHORTER_WEEKDAYS = 20, + UDAT_STANDALONE_SHORTER_WEEKDAYS = 21, + UDAT_CYCLIC_YEARS_WIDE = 22, + UDAT_CYCLIC_YEARS_ABBREVIATED = 23, + UDAT_CYCLIC_YEARS_NARROW = 24, + UDAT_ZODIAC_NAMES_WIDE = 25, + UDAT_ZODIAC_NAMES_ABBREVIATED = 26, + UDAT_ZODIAC_NAMES_NARROW = 27, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct UDateFormatSymbols { + _unused: [u8; 0], } extern "C" { - pub fn u_iscntrl_64(c: UChar32) -> UBool; + pub fn udat_getSymbols_64( + fmt: *const UDateFormat, + type_: UDateFormatSymbolType, + symbolIndex: i32, + result: *mut UChar, + resultLength: i32, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_isISOControl_64(c: UChar32) -> UBool; + pub fn udat_countSymbols_64(fmt: *const UDateFormat, type_: UDateFormatSymbolType) -> i32; } extern "C" { - pub fn u_isprint_64(c: UChar32) -> UBool; + pub fn udat_setSymbols_64( + format: *mut UDateFormat, + type_: UDateFormatSymbolType, + symbolIndex: i32, + value: *mut UChar, + valueLength: i32, + status: *mut UErrorCode, + ); } extern "C" { - pub fn u_isbase_64(c: UChar32) -> UBool; + pub fn udat_getLocaleByType_64( + fmt: *const UDateFormat, + type_: ULocDataLocaleType, + status: *mut UErrorCode, + ) -> *const ::std::os::raw::c_char; } extern "C" { - pub fn u_charDirection_64(c: UChar32) -> UCharDirection; + pub fn udat_setContext_64( + fmt: *mut UDateFormat, + value: UDisplayContext, + status: *mut UErrorCode, + ); } extern "C" { - pub fn u_isMirrored_64(c: UChar32) -> UBool; + pub fn udat_getContext_64( + fmt: *const UDateFormat, + type_: UDisplayContextType, + status: *mut UErrorCode, + ) -> UDisplayContext; } extern "C" { - pub fn u_charMirror_64(c: UChar32) -> UChar32; + pub fn udat_toPatternRelativeDate_64( + fmt: *const UDateFormat, + result: *mut UChar, + resultLength: i32, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_getBidiPairedBracket_64(c: UChar32) -> UChar32; + pub fn udat_toPatternRelativeTime_64( + fmt: *const UDateFormat, + result: *mut UChar, + resultLength: i32, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_charType_64(c: UChar32) -> i8; + pub fn udat_applyPatternRelative_64( + format: *mut UDateFormat, + datePattern: *const UChar, + datePatternLength: i32, + timePattern: *const UChar, + timePatternLength: i32, + status: *mut UErrorCode, + ); } -pub type UCharEnumTypeRange = ::std::option::Option< +pub type UDateFormatOpener = ::std::option::Option< unsafe extern "C" fn( - context: *const ::std::os::raw::c_void, - start: UChar32, - limit: UChar32, - type_: UCharCategory, - ) -> UBool, + timeStyle: UDateFormatStyle, + dateStyle: UDateFormatStyle, + locale: *const ::std::os::raw::c_char, + tzID: *const UChar, + tzIDLength: i32, + pattern: *const UChar, + patternLength: i32, + status: *mut UErrorCode, + ) -> *mut UDateFormat, >; extern "C" { - pub fn u_enumCharTypes_64( - enumRange: UCharEnumTypeRange, - context: *const ::std::os::raw::c_void, - ); -} -extern "C" { - pub fn u_getCombiningClass_64(c: UChar32) -> u8; + pub fn udat_registerOpener_64(opener: UDateFormatOpener, status: *mut UErrorCode); } extern "C" { - pub fn u_charDigitValue_64(c: UChar32) -> i32; + pub fn udat_unregisterOpener_64( + opener: UDateFormatOpener, + status: *mut UErrorCode, + ) -> UDateFormatOpener; } -extern "C" { - pub fn u_charName_64( - code: UChar32, - nameChoice: UCharNameChoice, - buffer: *mut ::std::os::raw::c_char, - bufferLength: i32, - pErrorCode: *mut UErrorCode, - ) -> i32; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, PartialEq)] +pub struct UDataInfo { + pub size: u16, + pub reservedWord: u16, + pub isBigEndian: u8, + pub charsetFamily: u8, + pub sizeofUChar: u8, + pub reservedByte: u8, + pub dataFormat: [u8; 4usize], + pub formatVersion: [u8; 4usize], + pub dataVersion: [u8; 4usize], } -extern "C" { - pub fn u_getISOComment_64( - c: UChar32, - dest: *mut ::std::os::raw::c_char, - destCapacity: i32, - pErrorCode: *mut UErrorCode, - ) -> i32; +#[test] +fn bindgen_test_layout_UDataInfo() { + assert_eq!( + ::std::mem::size_of::(), + 20usize, + concat!("Size of: ", stringify!(UDataInfo)) + ); + assert_eq!( + ::std::mem::align_of::(), + 2usize, + concat!("Alignment of ", stringify!(UDataInfo)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).size as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(UDataInfo), + "::", + stringify!(size) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).reservedWord as *const _ as usize }, + 2usize, + concat!( + "Offset of field: ", + stringify!(UDataInfo), + "::", + stringify!(reservedWord) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).isBigEndian as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(UDataInfo), + "::", + stringify!(isBigEndian) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).charsetFamily as *const _ as usize }, + 5usize, + concat!( + "Offset of field: ", + stringify!(UDataInfo), + "::", + stringify!(charsetFamily) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).sizeofUChar as *const _ as usize }, + 6usize, + concat!( + "Offset of field: ", + stringify!(UDataInfo), + "::", + stringify!(sizeofUChar) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).reservedByte as *const _ as usize }, + 7usize, + concat!( + "Offset of field: ", + stringify!(UDataInfo), + "::", + stringify!(reservedByte) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).dataFormat as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(UDataInfo), + "::", + stringify!(dataFormat) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).formatVersion as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(UDataInfo), + "::", + stringify!(formatVersion) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).dataVersion as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(UDataInfo), + "::", + stringify!(dataVersion) + ) + ); } -extern "C" { - pub fn u_charFromName_64( - nameChoice: UCharNameChoice, - name: *const ::std::os::raw::c_char, - pErrorCode: *mut UErrorCode, - ) -> UChar32; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct UDataMemory { + _unused: [u8; 0], } -pub type UEnumCharNamesFn = ::std::option::Option< +pub type UDataMemoryIsAcceptable = ::std::option::Option< unsafe extern "C" fn( context: *mut ::std::os::raw::c_void, - code: UChar32, - nameChoice: UCharNameChoice, + type_: *const ::std::os::raw::c_char, name: *const ::std::os::raw::c_char, - length: i32, + pInfo: *const UDataInfo, ) -> UBool, >; extern "C" { - pub fn u_enumCharNames_64( - start: UChar32, - limit: UChar32, - fn_: UEnumCharNamesFn, - context: *mut ::std::os::raw::c_void, - nameChoice: UCharNameChoice, + pub fn udata_open_64( + path: *const ::std::os::raw::c_char, + type_: *const ::std::os::raw::c_char, + name: *const ::std::os::raw::c_char, pErrorCode: *mut UErrorCode, - ); + ) -> *mut UDataMemory; } extern "C" { - pub fn u_getPropertyName_64( - property: UProperty, - nameChoice: UPropertyNameChoice, - ) -> *const ::std::os::raw::c_char; + pub fn udata_openChoice_64( + path: *const ::std::os::raw::c_char, + type_: *const ::std::os::raw::c_char, + name: *const ::std::os::raw::c_char, + isAcceptable: UDataMemoryIsAcceptable, + context: *mut ::std::os::raw::c_void, + pErrorCode: *mut UErrorCode, + ) -> *mut UDataMemory; } extern "C" { - pub fn u_getPropertyEnum_64(alias: *const ::std::os::raw::c_char) -> UProperty; + pub fn udata_close_64(pData: *mut UDataMemory); } extern "C" { - pub fn u_getPropertyValueName_64( - property: UProperty, - value: i32, - nameChoice: UPropertyNameChoice, - ) -> *const ::std::os::raw::c_char; + pub fn udata_getMemory_64(pData: *mut UDataMemory) -> *const ::std::os::raw::c_void; } extern "C" { - pub fn u_getPropertyValueEnum_64( - property: UProperty, - alias: *const ::std::os::raw::c_char, - ) -> i32; + pub fn udata_getInfo_64(pData: *mut UDataMemory, pInfo: *mut UDataInfo); } extern "C" { - pub fn u_isIDStart_64(c: UChar32) -> UBool; + pub fn udata_setCommonData_64(data: *const ::std::os::raw::c_void, err: *mut UErrorCode); } extern "C" { - pub fn u_isIDPart_64(c: UChar32) -> UBool; + pub fn udata_setAppData_64( + packageName: *const ::std::os::raw::c_char, + data: *const ::std::os::raw::c_void, + err: *mut UErrorCode, + ); } -extern "C" { - pub fn u_isIDIgnorable_64(c: UChar32) -> UBool; +impl UDataFileAccess { + pub const UDATA_DEFAULT_ACCESS: UDataFileAccess = UDataFileAccess::UDATA_FILES_FIRST; +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] +pub enum UDataFileAccess { + UDATA_FILES_FIRST = 0, + UDATA_ONLY_PACKAGES = 1, + UDATA_PACKAGES_FIRST = 2, + UDATA_NO_FILES = 3, + UDATA_FILE_ACCESS_COUNT = 4, } extern "C" { - pub fn u_isJavaIDStart_64(c: UChar32) -> UBool; + pub fn udata_setFileAccess_64(access: UDataFileAccess, status: *mut UErrorCode); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct UFormattedValue { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct UListFormatter { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct UFormattedList { + _unused: [u8; 0], +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] +pub enum UListFormatterField { + ULISTFMT_LITERAL_FIELD = 0, + ULISTFMT_ELEMENT_FIELD = 1, } extern "C" { - pub fn u_isJavaIDPart_64(c: UChar32) -> UBool; + pub fn ulistfmt_open_64( + locale: *const ::std::os::raw::c_char, + status: *mut UErrorCode, + ) -> *mut UListFormatter; } extern "C" { - pub fn u_tolower_64(c: UChar32) -> UChar32; + pub fn ulistfmt_close_64(listfmt: *mut UListFormatter); } extern "C" { - pub fn u_toupper_64(c: UChar32) -> UChar32; + pub fn ulistfmt_openResult_64(ec: *mut UErrorCode) -> *mut UFormattedList; } extern "C" { - pub fn u_totitle_64(c: UChar32) -> UChar32; + pub fn ulistfmt_resultAsValue_64( + uresult: *const UFormattedList, + ec: *mut UErrorCode, + ) -> *const UFormattedValue; } extern "C" { - pub fn u_foldCase_64(c: UChar32, options: u32) -> UChar32; + pub fn ulistfmt_closeResult_64(uresult: *mut UFormattedList); } extern "C" { - pub fn u_digit_64(ch: UChar32, radix: i8) -> i32; -} -extern "C" { - pub fn u_forDigit_64(digit: i32, radix: i8) -> UChar32; + pub fn ulistfmt_format_64( + listfmt: *const UListFormatter, + strings: *const *const UChar, + stringLengths: *const i32, + stringCount: i32, + result: *mut UChar, + resultCapacity: i32, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_charAge_64(c: UChar32, versionArray: *mut u8); + pub fn ulistfmt_formatStringsToResult_64( + listfmt: *const UListFormatter, + strings: *const *const UChar, + stringLengths: *const i32, + stringCount: i32, + uresult: *mut UFormattedList, + status: *mut UErrorCode, + ); } +pub type va_list = __builtin_va_list; extern "C" { - pub fn u_getUnicodeVersion_64(versionArray: *mut u8); + pub fn u_formatMessage_64( + locale: *const ::std::os::raw::c_char, + pattern: *const UChar, + patternLength: i32, + result: *mut UChar, + resultLength: i32, + status: *mut UErrorCode, + ... + ) -> i32; } extern "C" { - pub fn u_getFC_NFKC_Closure_64( - c: UChar32, - dest: *mut UChar, - destCapacity: i32, - pErrorCode: *mut UErrorCode, + pub fn u_vformatMessage_64( + locale: *const ::std::os::raw::c_char, + pattern: *const UChar, + patternLength: i32, + result: *mut UChar, + resultLength: i32, + ap: *mut __va_list_tag, + status: *mut UErrorCode, ) -> i32; } extern "C" { - pub fn utext_close_64(ut: *mut UText) -> *mut UText; + pub fn u_parseMessage_64( + locale: *const ::std::os::raw::c_char, + pattern: *const UChar, + patternLength: i32, + source: *const UChar, + sourceLength: i32, + status: *mut UErrorCode, + ... + ); } extern "C" { - pub fn utext_openUTF8_64( - ut: *mut UText, - s: *const ::std::os::raw::c_char, - length: i64, + pub fn u_vparseMessage_64( + locale: *const ::std::os::raw::c_char, + pattern: *const UChar, + patternLength: i32, + source: *const UChar, + sourceLength: i32, + ap: *mut __va_list_tag, status: *mut UErrorCode, - ) -> *mut UText; + ); } extern "C" { - pub fn utext_openUChars_64( - ut: *mut UText, - s: *const UChar, - length: i64, + pub fn u_formatMessageWithError_64( + locale: *const ::std::os::raw::c_char, + pattern: *const UChar, + patternLength: i32, + result: *mut UChar, + resultLength: i32, + parseError: *mut UParseError, status: *mut UErrorCode, - ) -> *mut UText; + ... + ) -> i32; } extern "C" { - pub fn utext_clone_64( - dest: *mut UText, - src: *const UText, - deep: UBool, - readOnly: UBool, + pub fn u_vformatMessageWithError_64( + locale: *const ::std::os::raw::c_char, + pattern: *const UChar, + patternLength: i32, + result: *mut UChar, + resultLength: i32, + parseError: *mut UParseError, + ap: *mut __va_list_tag, status: *mut UErrorCode, - ) -> *mut UText; + ) -> i32; } extern "C" { - pub fn utext_equals_64(a: *const UText, b: *const UText) -> UBool; + pub fn u_parseMessageWithError_64( + locale: *const ::std::os::raw::c_char, + pattern: *const UChar, + patternLength: i32, + source: *const UChar, + sourceLength: i32, + parseError: *mut UParseError, + status: *mut UErrorCode, + ... + ); } extern "C" { - pub fn utext_nativeLength_64(ut: *mut UText) -> i64; + pub fn u_vparseMessageWithError_64( + locale: *const ::std::os::raw::c_char, + pattern: *const UChar, + patternLength: i32, + source: *const UChar, + sourceLength: i32, + ap: *mut __va_list_tag, + parseError: *mut UParseError, + status: *mut UErrorCode, + ); } +pub type UMessageFormat = *mut ::std::os::raw::c_void; extern "C" { - pub fn utext_isLengthExpensive_64(ut: *const UText) -> UBool; + pub fn umsg_open_64( + pattern: *const UChar, + patternLength: i32, + locale: *const ::std::os::raw::c_char, + parseError: *mut UParseError, + status: *mut UErrorCode, + ) -> *mut UMessageFormat; } extern "C" { - pub fn utext_char32At_64(ut: *mut UText, nativeIndex: i64) -> UChar32; + pub fn umsg_close_64(format: *mut UMessageFormat); } extern "C" { - pub fn utext_current32_64(ut: *mut UText) -> UChar32; + pub fn umsg_clone_64(fmt: *const UMessageFormat, status: *mut UErrorCode) -> UMessageFormat; } extern "C" { - pub fn utext_next32_64(ut: *mut UText) -> UChar32; + pub fn umsg_setLocale_64(fmt: *mut UMessageFormat, locale: *const ::std::os::raw::c_char); } extern "C" { - pub fn utext_previous32_64(ut: *mut UText) -> UChar32; + pub fn umsg_getLocale_64(fmt: *const UMessageFormat) -> *const ::std::os::raw::c_char; } extern "C" { - pub fn utext_next32From_64(ut: *mut UText, nativeIndex: i64) -> UChar32; + pub fn umsg_applyPattern_64( + fmt: *mut UMessageFormat, + pattern: *const UChar, + patternLength: i32, + parseError: *mut UParseError, + status: *mut UErrorCode, + ); } extern "C" { - pub fn utext_previous32From_64(ut: *mut UText, nativeIndex: i64) -> UChar32; + pub fn umsg_toPattern_64( + fmt: *const UMessageFormat, + result: *mut UChar, + resultLength: i32, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn utext_getNativeIndex_64(ut: *const UText) -> i64; + pub fn umsg_format_64( + fmt: *const UMessageFormat, + result: *mut UChar, + resultLength: i32, + status: *mut UErrorCode, + ... + ) -> i32; } extern "C" { - pub fn utext_setNativeIndex_64(ut: *mut UText, nativeIndex: i64); + pub fn umsg_vformat_64( + fmt: *const UMessageFormat, + result: *mut UChar, + resultLength: i32, + ap: *mut __va_list_tag, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn utext_moveIndex32_64(ut: *mut UText, delta: i32) -> UBool; + pub fn umsg_parse_64( + fmt: *const UMessageFormat, + source: *const UChar, + sourceLength: i32, + count: *mut i32, + status: *mut UErrorCode, + ... + ); } extern "C" { - pub fn utext_getPreviousNativeIndex_64(ut: *mut UText) -> i64; + pub fn umsg_vparse_64( + fmt: *const UMessageFormat, + source: *const UChar, + sourceLength: i32, + count: *mut i32, + ap: *mut __va_list_tag, + status: *mut UErrorCode, + ); } extern "C" { - pub fn utext_extract_64( - ut: *mut UText, - nativeStart: i64, - nativeLimit: i64, + pub fn umsg_autoQuoteApostrophe_64( + pattern: *const UChar, + patternLength: i32, dest: *mut UChar, destCapacity: i32, - status: *mut UErrorCode, + ec: *mut UErrorCode, ) -> i32; } extern "C" { - pub fn utext_isWritable_64(ut: *const UText) -> UBool; + pub fn u_getDataDirectory_64() -> *const ::std::os::raw::c_char; } extern "C" { - pub fn utext_hasMetaData_64(ut: *const UText) -> UBool; + pub fn u_setDataDirectory_64(directory: *const ::std::os::raw::c_char); } extern "C" { - pub fn utext_replace_64( - ut: *mut UText, - nativeStart: i64, - nativeLimit: i64, - replacementText: *const UChar, - replacementLength: i32, - status: *mut UErrorCode, - ) -> i32; + pub fn u_getTimeZoneFilesDirectory_64(status: *mut UErrorCode) + -> *const ::std::os::raw::c_char; } extern "C" { - pub fn utext_copy_64( - ut: *mut UText, - nativeStart: i64, - nativeLimit: i64, - destIndex: i64, - move_: UBool, + pub fn u_setTimeZoneFilesDirectory_64( + path: *const ::std::os::raw::c_char, status: *mut UErrorCode, ); } extern "C" { - pub fn utext_freeze_64(ut: *mut UText); + pub fn u_charsToUChars_64(cs: *const ::std::os::raw::c_char, us: *mut UChar, length: i32); +} +extern "C" { + pub fn u_UCharsToChars_64(us: *const UChar, cs: *mut ::std::os::raw::c_char, length: i32); } -pub type UTextClone = ::std::option::Option< - unsafe extern "C" fn( - dest: *mut UText, - src: *const UText, - deep: UBool, - status: *mut UErrorCode, - ) -> *mut UText, ->; -pub type UTextNativeLength = ::std::option::Option i64>; -pub type UTextAccess = ::std::option::Option< - unsafe extern "C" fn(ut: *mut UText, nativeIndex: i64, forward: UBool) -> UBool, ->; -pub type UTextExtract = ::std::option::Option< - unsafe extern "C" fn( - ut: *mut UText, - nativeStart: i64, - nativeLimit: i64, - dest: *mut UChar, - destCapacity: i32, - status: *mut UErrorCode, - ) -> i32, ->; -pub type UTextReplace = ::std::option::Option< - unsafe extern "C" fn( - ut: *mut UText, - nativeStart: i64, - nativeLimit: i64, - replacementText: *const UChar, - replacmentLength: i32, - status: *mut UErrorCode, - ) -> i32, ->; -pub type UTextCopy = ::std::option::Option< - unsafe extern "C" fn( - ut: *mut UText, - nativeStart: i64, - nativeLimit: i64, - nativeDest: i64, - move_: UBool, - status: *mut UErrorCode, - ), ->; -pub type UTextMapOffsetToNative = - ::std::option::Option i64>; -pub type UTextMapNativeIndexToUTF16 = - ::std::option::Option i32>; -pub type UTextClose = ::std::option::Option; #[repr(C)] -#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, PartialEq)] -pub struct UTextFuncs { - pub tableSize: i32, - pub reserved1: i32, - pub reserved2: i32, - pub reserved3: i32, - pub clone: UTextClone, - pub nativeLength: UTextNativeLength, - pub access: UTextAccess, - pub extract: UTextExtract, - pub replace: UTextReplace, - pub copy: UTextCopy, - pub mapOffsetToNative: UTextMapOffsetToNative, - pub mapNativeIndexToUTF16: UTextMapNativeIndexToUTF16, - pub close: UTextClose, - pub spare1: UTextClose, - pub spare2: UTextClose, - pub spare3: UTextClose, +#[derive(Debug, Copy, Clone)] +pub struct UBreakIterator { + _unused: [u8; 0], } -#[test] -fn bindgen_test_layout_UTextFuncs() { - assert_eq!( - ::std::mem::size_of::(), - 112usize, - concat!("Size of: ", stringify!(UTextFuncs)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(UTextFuncs)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).tableSize as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(UTextFuncs), - "::", - stringify!(tableSize) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).reserved1 as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(UTextFuncs), - "::", - stringify!(reserved1) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).reserved2 as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(UTextFuncs), - "::", - stringify!(reserved2) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).reserved3 as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(UTextFuncs), - "::", - stringify!(reserved3) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).clone as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(UTextFuncs), - "::", - stringify!(clone) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).nativeLength as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(UTextFuncs), - "::", - stringify!(nativeLength) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).access as *const _ as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(UTextFuncs), - "::", - stringify!(access) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).extract as *const _ as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(UTextFuncs), - "::", - stringify!(extract) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).replace as *const _ as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(UTextFuncs), - "::", - stringify!(replace) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).copy as *const _ as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(UTextFuncs), - "::", - stringify!(copy) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).mapOffsetToNative as *const _ as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(UTextFuncs), - "::", - stringify!(mapOffsetToNative) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).mapNativeIndexToUTF16 as *const _ as usize - }, - 72usize, - concat!( - "Offset of field: ", - stringify!(UTextFuncs), - "::", - stringify!(mapNativeIndexToUTF16) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).close as *const _ as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(UTextFuncs), - "::", - stringify!(close) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).spare1 as *const _ as usize }, - 88usize, - concat!( - "Offset of field: ", - stringify!(UTextFuncs), - "::", - stringify!(spare1) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).spare2 as *const _ as usize }, - 96usize, - concat!( - "Offset of field: ", - stringify!(UTextFuncs), - "::", - stringify!(spare2) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).spare3 as *const _ as usize }, - 104usize, - concat!( - "Offset of field: ", - stringify!(UTextFuncs), - "::", - stringify!(spare3) - ) - ); +extern "C" { + pub fn u_strlen_64(s: *const UChar) -> i32; } -#[repr(C)] -#[derive(Debug, Copy, Clone, Hash, PartialOrd, PartialEq)] -pub struct UText { - pub magic: u32, - pub flags: i32, - pub providerProperties: i32, - pub sizeOfStruct: i32, - pub chunkNativeLimit: i64, - pub extraSize: i32, - pub nativeIndexingLimit: i32, - pub chunkNativeStart: i64, - pub chunkOffset: i32, - pub chunkLength: i32, - pub chunkContents: *const UChar, - pub pFuncs: *const UTextFuncs, - pub pExtra: *mut ::std::os::raw::c_void, - pub context: *const ::std::os::raw::c_void, - pub p: *const ::std::os::raw::c_void, - pub q: *const ::std::os::raw::c_void, - pub r: *const ::std::os::raw::c_void, - pub privP: *mut ::std::os::raw::c_void, - pub a: i64, - pub b: i32, - pub c: i32, - pub privA: i64, - pub privB: i32, - pub privC: i32, +extern "C" { + pub fn u_countChar32_64(s: *const UChar, length: i32) -> i32; } -#[test] -fn bindgen_test_layout_UText() { - assert_eq!( - ::std::mem::size_of::(), - 144usize, - concat!("Size of: ", stringify!(UText)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(UText)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).magic as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(magic) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).flags as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(flags) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).providerProperties as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(providerProperties) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).sizeOfStruct as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(sizeOfStruct) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).chunkNativeLimit as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(chunkNativeLimit) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).extraSize as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(extraSize) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).nativeIndexingLimit as *const _ as usize }, - 28usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(nativeIndexingLimit) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).chunkNativeStart as *const _ as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(chunkNativeStart) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).chunkOffset as *const _ as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(chunkOffset) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).chunkLength as *const _ as usize }, - 44usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(chunkLength) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).chunkContents as *const _ as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(chunkContents) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).pFuncs as *const _ as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(pFuncs) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).pExtra as *const _ as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(pExtra) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).context as *const _ as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(context) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).p as *const _ as usize }, - 80usize, - concat!("Offset of field: ", stringify!(UText), "::", stringify!(p)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).q as *const _ as usize }, - 88usize, - concat!("Offset of field: ", stringify!(UText), "::", stringify!(q)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).r as *const _ as usize }, - 96usize, - concat!("Offset of field: ", stringify!(UText), "::", stringify!(r)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).privP as *const _ as usize }, - 104usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(privP) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).a as *const _ as usize }, - 112usize, - concat!("Offset of field: ", stringify!(UText), "::", stringify!(a)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).b as *const _ as usize }, - 120usize, - concat!("Offset of field: ", stringify!(UText), "::", stringify!(b)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).c as *const _ as usize }, - 124usize, - concat!("Offset of field: ", stringify!(UText), "::", stringify!(c)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).privA as *const _ as usize }, - 128usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(privA) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).privB as *const _ as usize }, - 136usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(privB) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).privC as *const _ as usize }, - 140usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(privC) - ) - ); +extern "C" { + pub fn u_strHasMoreChar32Than_64(s: *const UChar, length: i32, number: i32) -> UBool; } -impl Default for UText { - fn default() -> Self { - unsafe { ::std::mem::zeroed() } - } +extern "C" { + pub fn u_strcat_64(dst: *mut UChar, src: *const UChar) -> *mut UChar; } extern "C" { - pub fn utext_setup_64(ut: *mut UText, extraSpace: i32, status: *mut UErrorCode) -> *mut UText; + pub fn u_strncat_64(dst: *mut UChar, src: *const UChar, n: i32) -> *mut UChar; } extern "C" { - pub fn u_init_64(status: *mut UErrorCode); + pub fn u_strstr_64(s: *const UChar, substring: *const UChar) -> *mut UChar; } extern "C" { - pub fn u_cleanup_64(); + pub fn u_strFindFirst_64( + s: *const UChar, + length: i32, + substring: *const UChar, + subLength: i32, + ) -> *mut UChar; } -pub type UMemAllocFn = ::std::option::Option< - unsafe extern "C" fn( - context: *const ::std::os::raw::c_void, - size: size_t, - ) -> *mut ::std::os::raw::c_void, ->; -pub type UMemReallocFn = ::std::option::Option< - unsafe extern "C" fn( - context: *const ::std::os::raw::c_void, - mem: *mut ::std::os::raw::c_void, - size: size_t, - ) -> *mut ::std::os::raw::c_void, ->; -pub type UMemFreeFn = ::std::option::Option< - unsafe extern "C" fn(context: *const ::std::os::raw::c_void, mem: *mut ::std::os::raw::c_void), ->; extern "C" { - pub fn u_setMemoryFunctions_64( - context: *const ::std::os::raw::c_void, - a: UMemAllocFn, - r: UMemReallocFn, - f: UMemFreeFn, - status: *mut UErrorCode, - ); + pub fn u_strchr_64(s: *const UChar, c: UChar) -> *mut UChar; } -pub type UMTX = *mut ::std::os::raw::c_void; -pub type UMtxInitFn = ::std::option::Option< - unsafe extern "C" fn( - context: *const ::std::os::raw::c_void, - mutex: *mut UMTX, - status: *mut UErrorCode, - ), ->; -pub type UMtxFn = ::std::option::Option< - unsafe extern "C" fn(context: *const ::std::os::raw::c_void, mutex: *mut UMTX), ->; extern "C" { - pub fn u_setMutexFunctions_64( - context: *const ::std::os::raw::c_void, - init: UMtxInitFn, - destroy: UMtxFn, - lock: UMtxFn, - unlock: UMtxFn, - status: *mut UErrorCode, - ); + pub fn u_strchr32_64(s: *const UChar, c: UChar32) -> *mut UChar; } -pub type UMtxAtomicFn = ::std::option::Option< - unsafe extern "C" fn(context: *const ::std::os::raw::c_void, p: *mut i32) -> i32, ->; extern "C" { - pub fn u_setAtomicIncDecFunctions_64( - context: *const ::std::os::raw::c_void, - inc: UMtxAtomicFn, - dec: UMtxAtomicFn, - status: *mut UErrorCode, - ); + pub fn u_strrstr_64(s: *const UChar, substring: *const UChar) -> *mut UChar; } -pub type va_list = __builtin_va_list; extern "C" { - pub fn u_formatMessage_64( - locale: *const ::std::os::raw::c_char, - pattern: *const UChar, - patternLength: i32, - result: *mut UChar, - resultLength: i32, - status: *mut UErrorCode, - ... - ) -> i32; + pub fn u_strFindLast_64( + s: *const UChar, + length: i32, + substring: *const UChar, + subLength: i32, + ) -> *mut UChar; } extern "C" { - pub fn u_vformatMessage_64( - locale: *const ::std::os::raw::c_char, - pattern: *const UChar, - patternLength: i32, - result: *mut UChar, - resultLength: i32, - ap: *mut __va_list_tag, - status: *mut UErrorCode, - ) -> i32; + pub fn u_strrchr_64(s: *const UChar, c: UChar) -> *mut UChar; } extern "C" { - pub fn u_parseMessage_64( - locale: *const ::std::os::raw::c_char, - pattern: *const UChar, - patternLength: i32, - source: *const UChar, - sourceLength: i32, - status: *mut UErrorCode, - ... - ); + pub fn u_strrchr32_64(s: *const UChar, c: UChar32) -> *mut UChar; } extern "C" { - pub fn u_vparseMessage_64( - locale: *const ::std::os::raw::c_char, - pattern: *const UChar, - patternLength: i32, - source: *const UChar, - sourceLength: i32, - ap: *mut __va_list_tag, - status: *mut UErrorCode, - ); + pub fn u_strpbrk_64(string: *const UChar, matchSet: *const UChar) -> *mut UChar; } extern "C" { - pub fn u_formatMessageWithError_64( - locale: *const ::std::os::raw::c_char, - pattern: *const UChar, - patternLength: i32, - result: *mut UChar, - resultLength: i32, - parseError: *mut UParseError, - status: *mut UErrorCode, - ... + pub fn u_strcspn_64(string: *const UChar, matchSet: *const UChar) -> i32; +} +extern "C" { + pub fn u_strspn_64(string: *const UChar, matchSet: *const UChar) -> i32; +} +extern "C" { + pub fn u_strtok_r_64( + src: *mut UChar, + delim: *const UChar, + saveState: *mut *mut UChar, + ) -> *mut UChar; +} +extern "C" { + pub fn u_strcmp_64(s1: *const UChar, s2: *const UChar) -> i32; +} +extern "C" { + pub fn u_strcmpCodePointOrder_64(s1: *const UChar, s2: *const UChar) -> i32; +} +extern "C" { + pub fn u_strCompare_64( + s1: *const UChar, + length1: i32, + s2: *const UChar, + length2: i32, + codePointOrder: UBool, ) -> i32; } extern "C" { - pub fn u_vformatMessageWithError_64( - locale: *const ::std::os::raw::c_char, - pattern: *const UChar, - patternLength: i32, - result: *mut UChar, - resultLength: i32, - parseError: *mut UParseError, - ap: *mut __va_list_tag, - status: *mut UErrorCode, + pub fn u_strCompareIter_64( + iter1: *mut UCharIterator, + iter2: *mut UCharIterator, + codePointOrder: UBool, ) -> i32; } extern "C" { - pub fn u_parseMessageWithError_64( - locale: *const ::std::os::raw::c_char, - pattern: *const UChar, - patternLength: i32, - source: *const UChar, - sourceLength: i32, - parseError: *mut UParseError, - status: *mut UErrorCode, - ... - ); + pub fn u_strCaseCompare_64( + s1: *const UChar, + length1: i32, + s2: *const UChar, + length2: i32, + options: u32, + pErrorCode: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_vparseMessageWithError_64( - locale: *const ::std::os::raw::c_char, - pattern: *const UChar, - patternLength: i32, - source: *const UChar, - sourceLength: i32, - ap: *mut __va_list_tag, - parseError: *mut UParseError, - status: *mut UErrorCode, - ); + pub fn u_strncmp_64(ucs1: *const UChar, ucs2: *const UChar, n: i32) -> i32; } -pub type UMessageFormat = *mut ::std::os::raw::c_void; extern "C" { - pub fn umsg_open_64( - pattern: *const UChar, - patternLength: i32, - locale: *const ::std::os::raw::c_char, - parseError: *mut UParseError, - status: *mut UErrorCode, - ) -> *mut UMessageFormat; + pub fn u_strncmpCodePointOrder_64(s1: *const UChar, s2: *const UChar, n: i32) -> i32; } extern "C" { - pub fn umsg_close_64(format: *mut UMessageFormat); + pub fn u_strcasecmp_64(s1: *const UChar, s2: *const UChar, options: u32) -> i32; } extern "C" { - pub fn umsg_clone_64(fmt: *const UMessageFormat, status: *mut UErrorCode) -> UMessageFormat; + pub fn u_strncasecmp_64(s1: *const UChar, s2: *const UChar, n: i32, options: u32) -> i32; } extern "C" { - pub fn umsg_setLocale_64(fmt: *mut UMessageFormat, locale: *const ::std::os::raw::c_char); + pub fn u_memcasecmp_64(s1: *const UChar, s2: *const UChar, length: i32, options: u32) -> i32; } extern "C" { - pub fn umsg_getLocale_64(fmt: *const UMessageFormat) -> *const ::std::os::raw::c_char; + pub fn u_strcpy_64(dst: *mut UChar, src: *const UChar) -> *mut UChar; } extern "C" { - pub fn umsg_applyPattern_64( - fmt: *mut UMessageFormat, - pattern: *const UChar, - patternLength: i32, - parseError: *mut UParseError, - status: *mut UErrorCode, - ); + pub fn u_strncpy_64(dst: *mut UChar, src: *const UChar, n: i32) -> *mut UChar; } extern "C" { - pub fn umsg_toPattern_64( - fmt: *const UMessageFormat, - result: *mut UChar, - resultLength: i32, - status: *mut UErrorCode, - ) -> i32; + pub fn u_uastrcpy_64(dst: *mut UChar, src: *const ::std::os::raw::c_char) -> *mut UChar; } extern "C" { - pub fn umsg_format_64( - fmt: *const UMessageFormat, - result: *mut UChar, - resultLength: i32, - status: *mut UErrorCode, - ... - ) -> i32; + pub fn u_uastrncpy_64( + dst: *mut UChar, + src: *const ::std::os::raw::c_char, + n: i32, + ) -> *mut UChar; } extern "C" { - pub fn umsg_vformat_64( - fmt: *const UMessageFormat, - result: *mut UChar, - resultLength: i32, - ap: *mut __va_list_tag, - status: *mut UErrorCode, - ) -> i32; + pub fn u_austrcpy_64( + dst: *mut ::std::os::raw::c_char, + src: *const UChar, + ) -> *mut ::std::os::raw::c_char; } extern "C" { - pub fn umsg_parse_64( - fmt: *const UMessageFormat, - source: *const UChar, - sourceLength: i32, - count: *mut i32, - status: *mut UErrorCode, - ... - ); + pub fn u_austrncpy_64( + dst: *mut ::std::os::raw::c_char, + src: *const UChar, + n: i32, + ) -> *mut ::std::os::raw::c_char; } extern "C" { - pub fn umsg_vparse_64( - fmt: *const UMessageFormat, - source: *const UChar, - sourceLength: i32, - count: *mut i32, - ap: *mut __va_list_tag, - status: *mut UErrorCode, - ); + pub fn u_memcpy_64(dest: *mut UChar, src: *const UChar, count: i32) -> *mut UChar; } extern "C" { - pub fn umsg_autoQuoteApostrophe_64( - pattern: *const UChar, - patternLength: i32, - dest: *mut UChar, - destCapacity: i32, - ec: *mut UErrorCode, - ) -> i32; + pub fn u_memmove_64(dest: *mut UChar, src: *const UChar, count: i32) -> *mut UChar; } -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum USetSpanCondition { - USET_SPAN_NOT_CONTAINED = 0, - USET_SPAN_CONTAINED = 1, - USET_SPAN_SIMPLE = 2, - USET_SPAN_CONDITION_COUNT = 3, +extern "C" { + pub fn u_memset_64(dest: *mut UChar, c: UChar, count: i32) -> *mut UChar; } -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct UCollator { - _unused: [u8; 0], +extern "C" { + pub fn u_memcmp_64(buf1: *const UChar, buf2: *const UChar, count: i32) -> i32; } -#[repr(i32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UCollationResult { - UCOL_EQUAL = 0, - UCOL_GREATER = 1, - UCOL_LESS = -1, +extern "C" { + pub fn u_memcmpCodePointOrder_64(s1: *const UChar, s2: *const UChar, count: i32) -> i32; } -impl UColAttributeValue { - pub const UCOL_DEFAULT_STRENGTH: UColAttributeValue = UColAttributeValue::UCOL_TERTIARY; +extern "C" { + pub fn u_memchr_64(s: *const UChar, c: UChar, count: i32) -> *mut UChar; } -impl UColAttributeValue { - pub const UCOL_QUATERNARY: UColAttributeValue = UColAttributeValue::UCOL_CE_STRENGTH_LIMIT; +extern "C" { + pub fn u_memchr32_64(s: *const UChar, c: UChar32, count: i32) -> *mut UChar; } -impl UColAttributeValue { - pub const UCOL_OFF: UColAttributeValue = UColAttributeValue::UCOL_STRENGTH_LIMIT; -} -#[repr(i32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UColAttributeValue { - UCOL_DEFAULT = -1, - UCOL_PRIMARY = 0, - UCOL_SECONDARY = 1, - UCOL_TERTIARY = 2, - UCOL_CE_STRENGTH_LIMIT = 3, - UCOL_IDENTICAL = 15, - UCOL_STRENGTH_LIMIT = 16, - UCOL_ON = 17, - UCOL_SHIFTED = 20, - UCOL_NON_IGNORABLE = 21, - UCOL_LOWER_FIRST = 24, - UCOL_UPPER_FIRST = 25, - UCOL_ATTRIBUTE_VALUE_COUNT = 26, -} -impl UColReorderCode { - pub const UCOL_REORDER_CODE_OTHERS: UColReorderCode = UColReorderCode::UCOL_REORDER_CODE_NONE; -} -impl UColReorderCode { - pub const UCOL_REORDER_CODE_FIRST: UColReorderCode = UColReorderCode::UCOL_REORDER_CODE_SPACE; -} -#[repr(i32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UColReorderCode { - UCOL_REORDER_CODE_DEFAULT = -1, - UCOL_REORDER_CODE_NONE = 103, - UCOL_REORDER_CODE_SPACE = 4096, - UCOL_REORDER_CODE_PUNCTUATION = 4097, - UCOL_REORDER_CODE_SYMBOL = 4098, - UCOL_REORDER_CODE_CURRENCY = 4099, - UCOL_REORDER_CODE_DIGIT = 4100, - UCOL_REORDER_CODE_LIMIT = 4101, -} -pub use self::UColAttributeValue as UCollationStrength; -impl UColAttribute { - pub const UCOL_DECOMPOSITION_MODE: UColAttribute = UColAttribute::UCOL_NORMALIZATION_MODE; -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UColAttribute { - UCOL_FRENCH_COLLATION = 0, - UCOL_ALTERNATE_HANDLING = 1, - UCOL_CASE_FIRST = 2, - UCOL_CASE_LEVEL = 3, - UCOL_NORMALIZATION_MODE = 4, - UCOL_STRENGTH = 5, - UCOL_HIRAGANA_QUATERNARY_MODE = 6, - UCOL_NUMERIC_COLLATION = 7, - UCOL_ATTRIBUTE_COUNT = 8, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UColRuleOption { - UCOL_TAILORING_ONLY = 0, - UCOL_FULL_RULES = 1, -} -extern "C" { - pub fn ucol_open_64( - loc: *const ::std::os::raw::c_char, - status: *mut UErrorCode, - ) -> *mut UCollator; -} -extern "C" { - pub fn ucol_openRules_64( - rules: *const UChar, - rulesLength: i32, - normalizationMode: UColAttributeValue, - strength: UCollationStrength, - parseError: *mut UParseError, - status: *mut UErrorCode, - ) -> *mut UCollator; +extern "C" { + pub fn u_memrchr_64(s: *const UChar, c: UChar, count: i32) -> *mut UChar; } extern "C" { - pub fn ucol_openFromShortString_64( - definition: *const ::std::os::raw::c_char, - forceDefaults: UBool, - parseError: *mut UParseError, - status: *mut UErrorCode, - ) -> *mut UCollator; + pub fn u_memrchr32_64(s: *const UChar, c: UChar32, count: i32) -> *mut UChar; } extern "C" { - pub fn ucol_getContractions_64( - coll: *const UCollator, - conts: *mut USet, - status: *mut UErrorCode, + pub fn u_unescape_64( + src: *const ::std::os::raw::c_char, + dest: *mut UChar, + destCapacity: i32, ) -> i32; } +pub type UNESCAPE_CHAR_AT = ::std::option::Option< + unsafe extern "C" fn(offset: i32, context: *mut ::std::os::raw::c_void) -> UChar, +>; extern "C" { - pub fn ucol_getContractionsAndExpansions_64( - coll: *const UCollator, - contractions: *mut USet, - expansions: *mut USet, - addPrefixes: UBool, - status: *mut UErrorCode, - ); -} -extern "C" { - pub fn ucol_close_64(coll: *mut UCollator); + pub fn u_unescapeAt_64( + charAt: UNESCAPE_CHAR_AT, + offset: *mut i32, + length: i32, + context: *mut ::std::os::raw::c_void, + ) -> UChar32; } extern "C" { - pub fn ucol_strcoll_64( - coll: *const UCollator, - source: *const UChar, - sourceLength: i32, - target: *const UChar, - targetLength: i32, - ) -> UCollationResult; + pub fn u_strToUpper_64( + dest: *mut UChar, + destCapacity: i32, + src: *const UChar, + srcLength: i32, + locale: *const ::std::os::raw::c_char, + pErrorCode: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn ucol_strcollUTF8_64( - coll: *const UCollator, - source: *const ::std::os::raw::c_char, - sourceLength: i32, - target: *const ::std::os::raw::c_char, - targetLength: i32, - status: *mut UErrorCode, - ) -> UCollationResult; + pub fn u_strToLower_64( + dest: *mut UChar, + destCapacity: i32, + src: *const UChar, + srcLength: i32, + locale: *const ::std::os::raw::c_char, + pErrorCode: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn ucol_greater_64( - coll: *const UCollator, - source: *const UChar, - sourceLength: i32, - target: *const UChar, - targetLength: i32, - ) -> UBool; + pub fn u_strToTitle_64( + dest: *mut UChar, + destCapacity: i32, + src: *const UChar, + srcLength: i32, + titleIter: *mut UBreakIterator, + locale: *const ::std::os::raw::c_char, + pErrorCode: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn ucol_greaterOrEqual_64( - coll: *const UCollator, - source: *const UChar, - sourceLength: i32, - target: *const UChar, - targetLength: i32, - ) -> UBool; + pub fn u_strFoldCase_64( + dest: *mut UChar, + destCapacity: i32, + src: *const UChar, + srcLength: i32, + options: u32, + pErrorCode: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn ucol_equal_64( - coll: *const UCollator, - source: *const UChar, - sourceLength: i32, - target: *const UChar, - targetLength: i32, - ) -> UBool; + pub fn u_strToWCS_64( + dest: *mut wchar_t, + destCapacity: i32, + pDestLength: *mut i32, + src: *const UChar, + srcLength: i32, + pErrorCode: *mut UErrorCode, + ) -> *mut wchar_t; } extern "C" { - pub fn ucol_strcollIter_64( - coll: *const UCollator, - sIter: *mut UCharIterator, - tIter: *mut UCharIterator, - status: *mut UErrorCode, - ) -> UCollationResult; + pub fn u_strFromWCS_64( + dest: *mut UChar, + destCapacity: i32, + pDestLength: *mut i32, + src: *const wchar_t, + srcLength: i32, + pErrorCode: *mut UErrorCode, + ) -> *mut UChar; } extern "C" { - pub fn ucol_getStrength_64(coll: *const UCollator) -> UCollationStrength; + pub fn u_strToUTF8_64( + dest: *mut ::std::os::raw::c_char, + destCapacity: i32, + pDestLength: *mut i32, + src: *const UChar, + srcLength: i32, + pErrorCode: *mut UErrorCode, + ) -> *mut ::std::os::raw::c_char; } extern "C" { - pub fn ucol_setStrength_64(coll: *mut UCollator, strength: UCollationStrength); + pub fn u_strFromUTF8_64( + dest: *mut UChar, + destCapacity: i32, + pDestLength: *mut i32, + src: *const ::std::os::raw::c_char, + srcLength: i32, + pErrorCode: *mut UErrorCode, + ) -> *mut UChar; } extern "C" { - pub fn ucol_getReorderCodes_64( - coll: *const UCollator, - dest: *mut i32, + pub fn u_strToUTF8WithSub_64( + dest: *mut ::std::os::raw::c_char, destCapacity: i32, + pDestLength: *mut i32, + src: *const UChar, + srcLength: i32, + subchar: UChar32, + pNumSubstitutions: *mut i32, pErrorCode: *mut UErrorCode, - ) -> i32; + ) -> *mut ::std::os::raw::c_char; } extern "C" { - pub fn ucol_setReorderCodes_64( - coll: *mut UCollator, - reorderCodes: *const i32, - reorderCodesLength: i32, + pub fn u_strFromUTF8WithSub_64( + dest: *mut UChar, + destCapacity: i32, + pDestLength: *mut i32, + src: *const ::std::os::raw::c_char, + srcLength: i32, + subchar: UChar32, + pNumSubstitutions: *mut i32, pErrorCode: *mut UErrorCode, - ); + ) -> *mut UChar; } extern "C" { - pub fn ucol_getEquivalentReorderCodes_64( - reorderCode: i32, - dest: *mut i32, + pub fn u_strFromUTF8Lenient_64( + dest: *mut UChar, destCapacity: i32, + pDestLength: *mut i32, + src: *const ::std::os::raw::c_char, + srcLength: i32, pErrorCode: *mut UErrorCode, - ) -> i32; + ) -> *mut UChar; } extern "C" { - pub fn ucol_getDisplayName_64( - objLoc: *const ::std::os::raw::c_char, - dispLoc: *const ::std::os::raw::c_char, - result: *mut UChar, - resultLength: i32, - status: *mut UErrorCode, - ) -> i32; + pub fn u_strToUTF32_64( + dest: *mut UChar32, + destCapacity: i32, + pDestLength: *mut i32, + src: *const UChar, + srcLength: i32, + pErrorCode: *mut UErrorCode, + ) -> *mut UChar32; } extern "C" { - pub fn ucol_getAvailable_64(localeIndex: i32) -> *const ::std::os::raw::c_char; + pub fn u_strFromUTF32_64( + dest: *mut UChar, + destCapacity: i32, + pDestLength: *mut i32, + src: *const UChar32, + srcLength: i32, + pErrorCode: *mut UErrorCode, + ) -> *mut UChar; } extern "C" { - pub fn ucol_countAvailable_64() -> i32; + pub fn u_strToUTF32WithSub_64( + dest: *mut UChar32, + destCapacity: i32, + pDestLength: *mut i32, + src: *const UChar, + srcLength: i32, + subchar: UChar32, + pNumSubstitutions: *mut i32, + pErrorCode: *mut UErrorCode, + ) -> *mut UChar32; } extern "C" { - pub fn ucol_openAvailableLocales_64(status: *mut UErrorCode) -> *mut UEnumeration; + pub fn u_strFromUTF32WithSub_64( + dest: *mut UChar, + destCapacity: i32, + pDestLength: *mut i32, + src: *const UChar32, + srcLength: i32, + subchar: UChar32, + pNumSubstitutions: *mut i32, + pErrorCode: *mut UErrorCode, + ) -> *mut UChar; } extern "C" { - pub fn ucol_getKeywords_64(status: *mut UErrorCode) -> *mut UEnumeration; + pub fn u_strToJavaModifiedUTF8_64( + dest: *mut ::std::os::raw::c_char, + destCapacity: i32, + pDestLength: *mut i32, + src: *const UChar, + srcLength: i32, + pErrorCode: *mut UErrorCode, + ) -> *mut ::std::os::raw::c_char; } extern "C" { - pub fn ucol_getKeywordValues_64( - keyword: *const ::std::os::raw::c_char, + pub fn u_strFromJavaModifiedUTF8WithSub_64( + dest: *mut UChar, + destCapacity: i32, + pDestLength: *mut i32, + src: *const ::std::os::raw::c_char, + srcLength: i32, + subchar: UChar32, + pNumSubstitutions: *mut i32, + pErrorCode: *mut UErrorCode, + ) -> *mut UChar; +} +extern "C" { + pub fn utext_close_64(ut: *mut UText) -> *mut UText; +} +extern "C" { + pub fn utext_openUTF8_64( + ut: *mut UText, + s: *const ::std::os::raw::c_char, + length: i64, status: *mut UErrorCode, - ) -> *mut UEnumeration; + ) -> *mut UText; } extern "C" { - pub fn ucol_getKeywordValuesForLocale_64( - key: *const ::std::os::raw::c_char, - locale: *const ::std::os::raw::c_char, - commonlyUsed: UBool, + pub fn utext_openUChars_64( + ut: *mut UText, + s: *const UChar, + length: i64, status: *mut UErrorCode, - ) -> *mut UEnumeration; + ) -> *mut UText; } extern "C" { - pub fn ucol_getFunctionalEquivalent_64( - result: *mut ::std::os::raw::c_char, - resultCapacity: i32, - keyword: *const ::std::os::raw::c_char, - locale: *const ::std::os::raw::c_char, - isAvailable: *mut UBool, + pub fn utext_clone_64( + dest: *mut UText, + src: *const UText, + deep: UBool, + readOnly: UBool, status: *mut UErrorCode, - ) -> i32; + ) -> *mut UText; } extern "C" { - pub fn ucol_getRules_64(coll: *const UCollator, length: *mut i32) -> *const UChar; + pub fn utext_equals_64(a: *const UText, b: *const UText) -> UBool; } extern "C" { - pub fn ucol_getShortDefinitionString_64( - coll: *const UCollator, - locale: *const ::std::os::raw::c_char, - buffer: *mut ::std::os::raw::c_char, - capacity: i32, - status: *mut UErrorCode, - ) -> i32; + pub fn utext_nativeLength_64(ut: *mut UText) -> i64; } extern "C" { - pub fn ucol_normalizeShortDefinitionString_64( - source: *const ::std::os::raw::c_char, - destination: *mut ::std::os::raw::c_char, - capacity: i32, - parseError: *mut UParseError, - status: *mut UErrorCode, - ) -> i32; + pub fn utext_isLengthExpensive_64(ut: *const UText) -> UBool; } extern "C" { - pub fn ucol_getSortKey_64( - coll: *const UCollator, - source: *const UChar, - sourceLength: i32, - result: *mut u8, - resultLength: i32, - ) -> i32; + pub fn utext_char32At_64(ut: *mut UText, nativeIndex: i64) -> UChar32; } extern "C" { - pub fn ucol_nextSortKeyPart_64( - coll: *const UCollator, - iter: *mut UCharIterator, - state: *mut u32, - dest: *mut u8, - count: i32, - status: *mut UErrorCode, - ) -> i32; + pub fn utext_current32_64(ut: *mut UText) -> UChar32; } -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UColBoundMode { - UCOL_BOUND_LOWER = 0, - UCOL_BOUND_UPPER = 1, - UCOL_BOUND_UPPER_LONG = 2, - UCOL_BOUND_VALUE_COUNT = 3, +extern "C" { + pub fn utext_next32_64(ut: *mut UText) -> UChar32; } extern "C" { - pub fn ucol_getBound_64( - source: *const u8, - sourceLength: i32, - boundType: UColBoundMode, - noOfLevels: u32, - result: *mut u8, - resultLength: i32, + pub fn utext_previous32_64(ut: *mut UText) -> UChar32; +} +extern "C" { + pub fn utext_next32From_64(ut: *mut UText, nativeIndex: i64) -> UChar32; +} +extern "C" { + pub fn utext_previous32From_64(ut: *mut UText, nativeIndex: i64) -> UChar32; +} +extern "C" { + pub fn utext_getNativeIndex_64(ut: *const UText) -> i64; +} +extern "C" { + pub fn utext_setNativeIndex_64(ut: *mut UText, nativeIndex: i64); +} +extern "C" { + pub fn utext_moveIndex32_64(ut: *mut UText, delta: i32) -> UBool; +} +extern "C" { + pub fn utext_getPreviousNativeIndex_64(ut: *mut UText) -> i64; +} +extern "C" { + pub fn utext_extract_64( + ut: *mut UText, + nativeStart: i64, + nativeLimit: i64, + dest: *mut UChar, + destCapacity: i32, status: *mut UErrorCode, ) -> i32; } extern "C" { - pub fn ucol_getVersion_64(coll: *const UCollator, info: *mut u8); + pub fn utext_isWritable_64(ut: *const UText) -> UBool; } extern "C" { - pub fn ucol_getUCAVersion_64(coll: *const UCollator, info: *mut u8); + pub fn utext_hasMetaData_64(ut: *const UText) -> UBool; } extern "C" { - pub fn ucol_mergeSortkeys_64( - src1: *const u8, - src1Length: i32, - src2: *const u8, - src2Length: i32, - dest: *mut u8, - destCapacity: i32, + pub fn utext_replace_64( + ut: *mut UText, + nativeStart: i64, + nativeLimit: i64, + replacementText: *const UChar, + replacementLength: i32, + status: *mut UErrorCode, ) -> i32; } extern "C" { - pub fn ucol_setAttribute_64( - coll: *mut UCollator, - attr: UColAttribute, - value: UColAttributeValue, + pub fn utext_copy_64( + ut: *mut UText, + nativeStart: i64, + nativeLimit: i64, + destIndex: i64, + move_: UBool, + status: *mut UErrorCode, + ); +} +extern "C" { + pub fn utext_freeze_64(ut: *mut UText); +} +pub type UTextClone = ::std::option::Option< + unsafe extern "C" fn( + dest: *mut UText, + src: *const UText, + deep: UBool, + status: *mut UErrorCode, + ) -> *mut UText, +>; +pub type UTextNativeLength = ::std::option::Option i64>; +pub type UTextAccess = ::std::option::Option< + unsafe extern "C" fn(ut: *mut UText, nativeIndex: i64, forward: UBool) -> UBool, +>; +pub type UTextExtract = ::std::option::Option< + unsafe extern "C" fn( + ut: *mut UText, + nativeStart: i64, + nativeLimit: i64, + dest: *mut UChar, + destCapacity: i32, + status: *mut UErrorCode, + ) -> i32, +>; +pub type UTextReplace = ::std::option::Option< + unsafe extern "C" fn( + ut: *mut UText, + nativeStart: i64, + nativeLimit: i64, + replacementText: *const UChar, + replacmentLength: i32, + status: *mut UErrorCode, + ) -> i32, +>; +pub type UTextCopy = ::std::option::Option< + unsafe extern "C" fn( + ut: *mut UText, + nativeStart: i64, + nativeLimit: i64, + nativeDest: i64, + move_: UBool, status: *mut UErrorCode, + ), +>; +pub type UTextMapOffsetToNative = + ::std::option::Option i64>; +pub type UTextMapNativeIndexToUTF16 = + ::std::option::Option i32>; +pub type UTextClose = ::std::option::Option; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, PartialEq)] +pub struct UTextFuncs { + pub tableSize: i32, + pub reserved1: i32, + pub reserved2: i32, + pub reserved3: i32, + pub clone: UTextClone, + pub nativeLength: UTextNativeLength, + pub access: UTextAccess, + pub extract: UTextExtract, + pub replace: UTextReplace, + pub copy: UTextCopy, + pub mapOffsetToNative: UTextMapOffsetToNative, + pub mapNativeIndexToUTF16: UTextMapNativeIndexToUTF16, + pub close: UTextClose, + pub spare1: UTextClose, + pub spare2: UTextClose, + pub spare3: UTextClose, +} +#[test] +fn bindgen_test_layout_UTextFuncs() { + assert_eq!( + ::std::mem::size_of::(), + 112usize, + concat!("Size of: ", stringify!(UTextFuncs)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(UTextFuncs)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tableSize as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(UTextFuncs), + "::", + stringify!(tableSize) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).reserved1 as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(UTextFuncs), + "::", + stringify!(reserved1) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).reserved2 as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(UTextFuncs), + "::", + stringify!(reserved2) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).reserved3 as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(UTextFuncs), + "::", + stringify!(reserved3) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).clone as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(UTextFuncs), + "::", + stringify!(clone) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).nativeLength as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(UTextFuncs), + "::", + stringify!(nativeLength) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).access as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(UTextFuncs), + "::", + stringify!(access) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).extract as *const _ as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(UTextFuncs), + "::", + stringify!(extract) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).replace as *const _ as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(UTextFuncs), + "::", + stringify!(replace) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).copy as *const _ as usize }, + 56usize, + concat!( + "Offset of field: ", + stringify!(UTextFuncs), + "::", + stringify!(copy) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).mapOffsetToNative as *const _ as usize }, + 64usize, + concat!( + "Offset of field: ", + stringify!(UTextFuncs), + "::", + stringify!(mapOffsetToNative) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).mapNativeIndexToUTF16 as *const _ as usize + }, + 72usize, + concat!( + "Offset of field: ", + stringify!(UTextFuncs), + "::", + stringify!(mapNativeIndexToUTF16) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).close as *const _ as usize }, + 80usize, + concat!( + "Offset of field: ", + stringify!(UTextFuncs), + "::", + stringify!(close) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).spare1 as *const _ as usize }, + 88usize, + concat!( + "Offset of field: ", + stringify!(UTextFuncs), + "::", + stringify!(spare1) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).spare2 as *const _ as usize }, + 96usize, + concat!( + "Offset of field: ", + stringify!(UTextFuncs), + "::", + stringify!(spare2) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).spare3 as *const _ as usize }, + 104usize, + concat!( + "Offset of field: ", + stringify!(UTextFuncs), + "::", + stringify!(spare3) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone, Hash, PartialOrd, PartialEq)] +pub struct UText { + pub magic: u32, + pub flags: i32, + pub providerProperties: i32, + pub sizeOfStruct: i32, + pub chunkNativeLimit: i64, + pub extraSize: i32, + pub nativeIndexingLimit: i32, + pub chunkNativeStart: i64, + pub chunkOffset: i32, + pub chunkLength: i32, + pub chunkContents: *const UChar, + pub pFuncs: *const UTextFuncs, + pub pExtra: *mut ::std::os::raw::c_void, + pub context: *const ::std::os::raw::c_void, + pub p: *const ::std::os::raw::c_void, + pub q: *const ::std::os::raw::c_void, + pub r: *const ::std::os::raw::c_void, + pub privP: *mut ::std::os::raw::c_void, + pub a: i64, + pub b: i32, + pub c: i32, + pub privA: i64, + pub privB: i32, + pub privC: i32, +} +#[test] +fn bindgen_test_layout_UText() { + assert_eq!( + ::std::mem::size_of::(), + 144usize, + concat!("Size of: ", stringify!(UText)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(UText)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).magic as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(magic) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).flags as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(flags) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).providerProperties as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(providerProperties) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).sizeOfStruct as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(sizeOfStruct) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).chunkNativeLimit as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(chunkNativeLimit) + ) ); -} -extern "C" { - pub fn ucol_getAttribute_64( - coll: *const UCollator, - attr: UColAttribute, - status: *mut UErrorCode, - ) -> UColAttributeValue; -} -extern "C" { - pub fn ucol_setMaxVariable_64( - coll: *mut UCollator, - group: UColReorderCode, - pErrorCode: *mut UErrorCode, + assert_eq!( + unsafe { &(*(::std::ptr::null::())).extraSize as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(extraSize) + ) ); -} -extern "C" { - pub fn ucol_getMaxVariable_64(coll: *const UCollator) -> UColReorderCode; -} -extern "C" { - pub fn ucol_setVariableTop_64( - coll: *mut UCollator, - varTop: *const UChar, - len: i32, - status: *mut UErrorCode, - ) -> u32; -} -extern "C" { - pub fn ucol_getVariableTop_64(coll: *const UCollator, status: *mut UErrorCode) -> u32; -} -extern "C" { - pub fn ucol_restoreVariableTop_64(coll: *mut UCollator, varTop: u32, status: *mut UErrorCode); -} -extern "C" { - pub fn ucol_safeClone_64( - coll: *const UCollator, - stackBuffer: *mut ::std::os::raw::c_void, - pBufferSize: *mut i32, - status: *mut UErrorCode, - ) -> *mut UCollator; -} -extern "C" { - pub fn ucol_getRulesEx_64( - coll: *const UCollator, - delta: UColRuleOption, - buffer: *mut UChar, - bufferLen: i32, - ) -> i32; -} -extern "C" { - pub fn ucol_getLocale_64( - coll: *const UCollator, - type_: ULocDataLocaleType, - status: *mut UErrorCode, - ) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn ucol_getLocaleByType_64( - coll: *const UCollator, - type_: ULocDataLocaleType, - status: *mut UErrorCode, - ) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn ucol_getTailoredSet_64(coll: *const UCollator, status: *mut UErrorCode) -> *mut USet; -} -extern "C" { - pub fn ucol_getUnsafeSet_64( - coll: *const UCollator, - unsafe_: *mut USet, - status: *mut UErrorCode, - ) -> i32; -} -extern "C" { - pub fn ucol_prepareShortStringOpen_64( - definition: *const ::std::os::raw::c_char, - forceDefaults: UBool, - parseError: *mut UParseError, - status: *mut UErrorCode, + assert_eq!( + unsafe { &(*(::std::ptr::null::())).nativeIndexingLimit as *const _ as usize }, + 28usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(nativeIndexingLimit) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).chunkNativeStart as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(chunkNativeStart) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).chunkOffset as *const _ as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(chunkOffset) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).chunkLength as *const _ as usize }, + 44usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(chunkLength) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).chunkContents as *const _ as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(chunkContents) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).pFuncs as *const _ as usize }, + 56usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(pFuncs) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).pExtra as *const _ as usize }, + 64usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(pExtra) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).context as *const _ as usize }, + 72usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(context) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).p as *const _ as usize }, + 80usize, + concat!("Offset of field: ", stringify!(UText), "::", stringify!(p)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).q as *const _ as usize }, + 88usize, + concat!("Offset of field: ", stringify!(UText), "::", stringify!(q)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).r as *const _ as usize }, + 96usize, + concat!("Offset of field: ", stringify!(UText), "::", stringify!(r)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).privP as *const _ as usize }, + 104usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(privP) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).a as *const _ as usize }, + 112usize, + concat!("Offset of field: ", stringify!(UText), "::", stringify!(a)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).b as *const _ as usize }, + 120usize, + concat!("Offset of field: ", stringify!(UText), "::", stringify!(b)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).c as *const _ as usize }, + 124usize, + concat!("Offset of field: ", stringify!(UText), "::", stringify!(c)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).privA as *const _ as usize }, + 128usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(privA) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).privB as *const _ as usize }, + 136usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(privB) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).privC as *const _ as usize }, + 140usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(privC) + ) ); } -extern "C" { - pub fn ucol_cloneBinary_64( - coll: *const UCollator, - buffer: *mut u8, - capacity: i32, - status: *mut UErrorCode, - ) -> i32; +impl Default for UText { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } } extern "C" { - pub fn ucol_openBinary_64( - bin: *const u8, - length: i32, - base: *const UCollator, - status: *mut UErrorCode, - ) -> *mut UCollator; + pub fn utext_setup_64(ut: *mut UText, extraSpace: i32, status: *mut UErrorCode) -> *mut UText; } pub type __builtin_va_list = [__va_list_tag; 1usize]; #[repr(C)] diff --git a/rust_icu_sys/bindgen/lib_65.rs b/rust_icu_sys/bindgen/lib_65.rs index ad91420f..7db2a129 100644 --- a/rust_icu_sys/bindgen/lib_65.rs +++ b/rust_icu_sys/bindgen/lib_65.rs @@ -982,3070 +982,3133 @@ extern "C" { status: *mut UErrorCode, ) -> i32; } +extern "C" { + pub fn u_init_65(status: *mut UErrorCode); +} +extern "C" { + pub fn u_cleanup_65(); +} +pub type UMemAllocFn = ::std::option::Option< + unsafe extern "C" fn( + context: *const ::std::os::raw::c_void, + size: size_t, + ) -> *mut ::std::os::raw::c_void, +>; +pub type UMemReallocFn = ::std::option::Option< + unsafe extern "C" fn( + context: *const ::std::os::raw::c_void, + mem: *mut ::std::os::raw::c_void, + size: size_t, + ) -> *mut ::std::os::raw::c_void, +>; +pub type UMemFreeFn = ::std::option::Option< + unsafe extern "C" fn(context: *const ::std::os::raw::c_void, mem: *mut ::std::os::raw::c_void), +>; +extern "C" { + pub fn u_setMemoryFunctions_65( + context: *const ::std::os::raw::c_void, + a: UMemAllocFn, + r: UMemReallocFn, + f: UMemFreeFn, + status: *mut UErrorCode, + ); +} +pub type UMTX = *mut ::std::os::raw::c_void; +pub type UMtxInitFn = ::std::option::Option< + unsafe extern "C" fn( + context: *const ::std::os::raw::c_void, + mutex: *mut UMTX, + status: *mut UErrorCode, + ), +>; +pub type UMtxFn = ::std::option::Option< + unsafe extern "C" fn(context: *const ::std::os::raw::c_void, mutex: *mut UMTX), +>; +extern "C" { + pub fn u_setMutexFunctions_65( + context: *const ::std::os::raw::c_void, + init: UMtxInitFn, + destroy: UMtxFn, + lock: UMtxFn, + unlock: UMtxFn, + status: *mut UErrorCode, + ); +} +pub type UMtxAtomicFn = ::std::option::Option< + unsafe extern "C" fn(context: *const ::std::os::raw::c_void, p: *mut i32) -> i32, +>; +extern "C" { + pub fn u_setAtomicIncDecFunctions_65( + context: *const ::std::os::raw::c_void, + inc: UMtxAtomicFn, + dec: UMtxAtomicFn, + status: *mut UErrorCode, + ); +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] +pub enum UCharIteratorOrigin { + UITER_START = 0, + UITER_CURRENT = 1, + UITER_LIMIT = 2, + UITER_ZERO = 3, + UITER_LENGTH = 4, +} +pub type UCharIteratorGetIndex = ::std::option::Option< + unsafe extern "C" fn(iter: *mut UCharIterator, origin: UCharIteratorOrigin) -> i32, +>; +pub type UCharIteratorMove = ::std::option::Option< + unsafe extern "C" fn(iter: *mut UCharIterator, delta: i32, origin: UCharIteratorOrigin) -> i32, +>; +pub type UCharIteratorHasNext = + ::std::option::Option UBool>; +pub type UCharIteratorHasPrevious = + ::std::option::Option UBool>; +pub type UCharIteratorCurrent = + ::std::option::Option UChar32>; +pub type UCharIteratorNext = + ::std::option::Option UChar32>; +pub type UCharIteratorPrevious = + ::std::option::Option UChar32>; +pub type UCharIteratorReserved = + ::std::option::Option i32>; +pub type UCharIteratorGetState = + ::std::option::Option u32>; +pub type UCharIteratorSetState = ::std::option::Option< + unsafe extern "C" fn(iter: *mut UCharIterator, state: u32, pErrorCode: *mut UErrorCode), +>; #[repr(C)] -#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, PartialEq)] -pub struct UFieldPosition { - pub field: i32, - pub beginIndex: i32, - pub endIndex: i32, +#[derive(Debug, Copy, Clone, Hash, PartialOrd, PartialEq)] +pub struct UCharIterator { + pub context: *const ::std::os::raw::c_void, + pub length: i32, + pub start: i32, + pub index: i32, + pub limit: i32, + pub reservedField: i32, + pub getIndex: UCharIteratorGetIndex, + pub move_: UCharIteratorMove, + pub hasNext: UCharIteratorHasNext, + pub hasPrevious: UCharIteratorHasPrevious, + pub current: UCharIteratorCurrent, + pub next: UCharIteratorNext, + pub previous: UCharIteratorPrevious, + pub reservedFn: UCharIteratorReserved, + pub getState: UCharIteratorGetState, + pub setState: UCharIteratorSetState, } #[test] -fn bindgen_test_layout_UFieldPosition() { +fn bindgen_test_layout_UCharIterator() { assert_eq!( - ::std::mem::size_of::(), - 12usize, - concat!("Size of: ", stringify!(UFieldPosition)) + ::std::mem::size_of::(), + 112usize, + concat!("Size of: ", stringify!(UCharIterator)) ); assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(UFieldPosition)) + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(UCharIterator)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).field as *const _ as usize }, + unsafe { &(*(::std::ptr::null::())).context as *const _ as usize }, 0usize, concat!( "Offset of field: ", - stringify!(UFieldPosition), + stringify!(UCharIterator), "::", - stringify!(field) + stringify!(context) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).beginIndex as *const _ as usize }, - 4usize, + unsafe { &(*(::std::ptr::null::())).length as *const _ as usize }, + 8usize, concat!( "Offset of field: ", - stringify!(UFieldPosition), + stringify!(UCharIterator), "::", - stringify!(beginIndex) + stringify!(length) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).endIndex as *const _ as usize }, - 8usize, + unsafe { &(*(::std::ptr::null::())).start as *const _ as usize }, + 12usize, concat!( "Offset of field: ", - stringify!(UFieldPosition), + stringify!(UCharIterator), "::", - stringify!(endIndex) + stringify!(start) ) ); -} -#[repr(C)] -#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, PartialEq)] -pub struct UParseError { - pub line: i32, - pub offset: i32, - pub preContext: [UChar; 16usize], - pub postContext: [UChar; 16usize], -} -#[test] -fn bindgen_test_layout_UParseError() { assert_eq!( - ::std::mem::size_of::(), - 72usize, - concat!("Size of: ", stringify!(UParseError)) + unsafe { &(*(::std::ptr::null::())).index as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(UCharIterator), + "::", + stringify!(index) + ) ); assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(UParseError)) + unsafe { &(*(::std::ptr::null::())).limit as *const _ as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(UCharIterator), + "::", + stringify!(limit) + ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).line as *const _ as usize }, - 0usize, + unsafe { &(*(::std::ptr::null::())).reservedField as *const _ as usize }, + 24usize, concat!( "Offset of field: ", - stringify!(UParseError), + stringify!(UCharIterator), "::", - stringify!(line) + stringify!(reservedField) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).offset as *const _ as usize }, - 4usize, + unsafe { &(*(::std::ptr::null::())).getIndex as *const _ as usize }, + 32usize, concat!( "Offset of field: ", - stringify!(UParseError), + stringify!(UCharIterator), "::", - stringify!(offset) + stringify!(getIndex) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).preContext as *const _ as usize }, - 8usize, + unsafe { &(*(::std::ptr::null::())).move_ as *const _ as usize }, + 40usize, concat!( "Offset of field: ", - stringify!(UParseError), + stringify!(UCharIterator), "::", - stringify!(preContext) + stringify!(move_) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).postContext as *const _ as usize }, - 40usize, + unsafe { &(*(::std::ptr::null::())).hasNext as *const _ as usize }, + 48usize, concat!( "Offset of field: ", - stringify!(UParseError), + stringify!(UCharIterator), "::", - stringify!(postContext) + stringify!(hasNext) ) ); -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UDisplayContextType { - UDISPCTX_TYPE_DIALECT_HANDLING = 0, - UDISPCTX_TYPE_CAPITALIZATION = 1, - UDISPCTX_TYPE_DISPLAY_LENGTH = 2, - UDISPCTX_TYPE_SUBSTITUTE_HANDLING = 3, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UDisplayContext { - UDISPCTX_STANDARD_NAMES = 0, - UDISPCTX_DIALECT_NAMES = 1, - UDISPCTX_CAPITALIZATION_NONE = 256, - UDISPCTX_CAPITALIZATION_FOR_MIDDLE_OF_SENTENCE = 257, - UDISPCTX_CAPITALIZATION_FOR_BEGINNING_OF_SENTENCE = 258, - UDISPCTX_CAPITALIZATION_FOR_UI_LIST_OR_MENU = 259, - UDISPCTX_CAPITALIZATION_FOR_STANDALONE = 260, - UDISPCTX_LENGTH_FULL = 512, - UDISPCTX_LENGTH_SHORT = 513, - UDISPCTX_SUBSTITUTE = 768, - UDISPCTX_NO_SUBSTITUTE = 769, -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct UFieldPositionIterator { - _unused: [u8; 0], -} -pub type UNumberFormat = *mut ::std::os::raw::c_void; -pub type UDateFormat = *mut ::std::os::raw::c_void; -impl UDateFormatStyle { - pub const UDAT_DEFAULT: UDateFormatStyle = UDateFormatStyle::UDAT_MEDIUM; -} -impl UDateFormatStyle { - pub const UDAT_FULL_RELATIVE: UDateFormatStyle = UDateFormatStyle::UDAT_RELATIVE; -} -impl UDateFormatStyle { - pub const UDAT_IGNORE: UDateFormatStyle = UDateFormatStyle::UDAT_PATTERN; -} -#[repr(i32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UDateFormatStyle { - UDAT_FULL = 0, - UDAT_LONG = 1, - UDAT_MEDIUM = 2, - UDAT_SHORT = 3, - UDAT_RELATIVE = 128, - UDAT_LONG_RELATIVE = 129, - UDAT_MEDIUM_RELATIVE = 130, - UDAT_SHORT_RELATIVE = 131, - UDAT_NONE = -1, - UDAT_PATTERN = -2, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UDateFormatField { - UDAT_ERA_FIELD = 0, - UDAT_YEAR_FIELD = 1, - UDAT_MONTH_FIELD = 2, - UDAT_DATE_FIELD = 3, - UDAT_HOUR_OF_DAY1_FIELD = 4, - UDAT_HOUR_OF_DAY0_FIELD = 5, - UDAT_MINUTE_FIELD = 6, - UDAT_SECOND_FIELD = 7, - UDAT_FRACTIONAL_SECOND_FIELD = 8, - UDAT_DAY_OF_WEEK_FIELD = 9, - UDAT_DAY_OF_YEAR_FIELD = 10, - UDAT_DAY_OF_WEEK_IN_MONTH_FIELD = 11, - UDAT_WEEK_OF_YEAR_FIELD = 12, - UDAT_WEEK_OF_MONTH_FIELD = 13, - UDAT_AM_PM_FIELD = 14, - UDAT_HOUR1_FIELD = 15, - UDAT_HOUR0_FIELD = 16, - UDAT_TIMEZONE_FIELD = 17, - UDAT_YEAR_WOY_FIELD = 18, - UDAT_DOW_LOCAL_FIELD = 19, - UDAT_EXTENDED_YEAR_FIELD = 20, - UDAT_JULIAN_DAY_FIELD = 21, - UDAT_MILLISECONDS_IN_DAY_FIELD = 22, - UDAT_TIMEZONE_RFC_FIELD = 23, - UDAT_TIMEZONE_GENERIC_FIELD = 24, - UDAT_STANDALONE_DAY_FIELD = 25, - UDAT_STANDALONE_MONTH_FIELD = 26, - UDAT_QUARTER_FIELD = 27, - UDAT_STANDALONE_QUARTER_FIELD = 28, - UDAT_TIMEZONE_SPECIAL_FIELD = 29, - UDAT_YEAR_NAME_FIELD = 30, - UDAT_TIMEZONE_LOCALIZED_GMT_OFFSET_FIELD = 31, - UDAT_TIMEZONE_ISO_FIELD = 32, - UDAT_TIMEZONE_ISO_LOCAL_FIELD = 33, - UDAT_RELATED_YEAR_FIELD = 34, - UDAT_AM_PM_MIDNIGHT_NOON_FIELD = 35, - UDAT_FLEXIBLE_DAY_PERIOD_FIELD = 36, - UDAT_TIME_SEPARATOR_FIELD = 37, - UDAT_FIELD_COUNT = 38, -} -extern "C" { - pub fn udat_toCalendarDateField_65(field: UDateFormatField) -> UCalendarDateFields; -} -extern "C" { - pub fn udat_open_65( - timeStyle: UDateFormatStyle, - dateStyle: UDateFormatStyle, - locale: *const ::std::os::raw::c_char, - tzID: *const UChar, - tzIDLength: i32, - pattern: *const UChar, - patternLength: i32, - status: *mut UErrorCode, - ) -> *mut UDateFormat; -} -extern "C" { - pub fn udat_close_65(format: *mut UDateFormat); -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UDateFormatBooleanAttribute { - UDAT_PARSE_ALLOW_WHITESPACE = 0, - UDAT_PARSE_ALLOW_NUMERIC = 1, - UDAT_PARSE_PARTIAL_LITERAL_MATCH = 2, - UDAT_PARSE_MULTIPLE_PATTERNS_FOR_MATCH = 3, - UDAT_BOOLEAN_ATTRIBUTE_COUNT = 4, -} -extern "C" { - pub fn udat_getBooleanAttribute_65( - fmt: *const UDateFormat, - attr: UDateFormatBooleanAttribute, - status: *mut UErrorCode, - ) -> UBool; -} -extern "C" { - pub fn udat_setBooleanAttribute_65( - fmt: *mut UDateFormat, - attr: UDateFormatBooleanAttribute, - newValue: UBool, - status: *mut UErrorCode, + assert_eq!( + unsafe { &(*(::std::ptr::null::())).hasPrevious as *const _ as usize }, + 56usize, + concat!( + "Offset of field: ", + stringify!(UCharIterator), + "::", + stringify!(hasPrevious) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).current as *const _ as usize }, + 64usize, + concat!( + "Offset of field: ", + stringify!(UCharIterator), + "::", + stringify!(current) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).next as *const _ as usize }, + 72usize, + concat!( + "Offset of field: ", + stringify!(UCharIterator), + "::", + stringify!(next) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).previous as *const _ as usize }, + 80usize, + concat!( + "Offset of field: ", + stringify!(UCharIterator), + "::", + stringify!(previous) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).reservedFn as *const _ as usize }, + 88usize, + concat!( + "Offset of field: ", + stringify!(UCharIterator), + "::", + stringify!(reservedFn) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).getState as *const _ as usize }, + 96usize, + concat!( + "Offset of field: ", + stringify!(UCharIterator), + "::", + stringify!(getState) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).setState as *const _ as usize }, + 104usize, + concat!( + "Offset of field: ", + stringify!(UCharIterator), + "::", + stringify!(setState) + ) ); } -extern "C" { - pub fn udat_clone_65(fmt: *const UDateFormat, status: *mut UErrorCode) -> *mut UDateFormat; -} -extern "C" { - pub fn udat_format_65( - format: *const UDateFormat, - dateToFormat: UDate, - result: *mut UChar, - resultLength: i32, - position: *mut UFieldPosition, - status: *mut UErrorCode, - ) -> i32; +impl Default for UCharIterator { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } } -extern "C" { - pub fn udat_formatCalendar_65( - format: *const UDateFormat, - calendar: *mut UCalendar, - result: *mut UChar, - capacity: i32, - position: *mut UFieldPosition, - status: *mut UErrorCode, - ) -> i32; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct UCPMap { + _unused: [u8; 0], } -extern "C" { - pub fn udat_formatForFields_65( - format: *const UDateFormat, - dateToFormat: UDate, - result: *mut UChar, - resultLength: i32, - fpositer: *mut UFieldPositionIterator, - status: *mut UErrorCode, - ) -> i32; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct USet { + _unused: [u8; 0], } -extern "C" { - pub fn udat_formatCalendarForFields_65( - format: *const UDateFormat, - calendar: *mut UCalendar, - result: *mut UChar, - capacity: i32, - fpositer: *mut UFieldPositionIterator, - status: *mut UErrorCode, - ) -> i32; +impl UProperty { + pub const UCHAR_BINARY_START: UProperty = UProperty::UCHAR_ALPHABETIC; } -extern "C" { - pub fn udat_parse_65( - format: *const UDateFormat, - text: *const UChar, - textLength: i32, - parsePos: *mut i32, - status: *mut UErrorCode, - ) -> UDate; +impl UProperty { + pub const UCHAR_INT_START: UProperty = UProperty::UCHAR_BIDI_CLASS; } -extern "C" { - pub fn udat_parseCalendar_65( - format: *const UDateFormat, - calendar: *mut UCalendar, - text: *const UChar, - textLength: i32, - parsePos: *mut i32, - status: *mut UErrorCode, - ); +impl UProperty { + pub const UCHAR_MASK_START: UProperty = UProperty::UCHAR_GENERAL_CATEGORY_MASK; } -extern "C" { - pub fn udat_isLenient_65(fmt: *const UDateFormat) -> UBool; +impl UProperty { + pub const UCHAR_DOUBLE_START: UProperty = UProperty::UCHAR_NUMERIC_VALUE; } -extern "C" { - pub fn udat_setLenient_65(fmt: *mut UDateFormat, isLenient: UBool); +impl UProperty { + pub const UCHAR_STRING_START: UProperty = UProperty::UCHAR_AGE; } -extern "C" { - pub fn udat_getCalendar_65(fmt: *const UDateFormat) -> *const UCalendar; +impl UProperty { + pub const UCHAR_OTHER_PROPERTY_START: UProperty = UProperty::UCHAR_SCRIPT_EXTENSIONS; } -extern "C" { - pub fn udat_setCalendar_65(fmt: *mut UDateFormat, calendarToSet: *const UCalendar); +#[repr(i32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] +pub enum UProperty { + UCHAR_ALPHABETIC = 0, + UCHAR_ASCII_HEX_DIGIT = 1, + UCHAR_BIDI_CONTROL = 2, + UCHAR_BIDI_MIRRORED = 3, + UCHAR_DASH = 4, + UCHAR_DEFAULT_IGNORABLE_CODE_POINT = 5, + UCHAR_DEPRECATED = 6, + UCHAR_DIACRITIC = 7, + UCHAR_EXTENDER = 8, + UCHAR_FULL_COMPOSITION_EXCLUSION = 9, + UCHAR_GRAPHEME_BASE = 10, + UCHAR_GRAPHEME_EXTEND = 11, + UCHAR_GRAPHEME_LINK = 12, + UCHAR_HEX_DIGIT = 13, + UCHAR_HYPHEN = 14, + UCHAR_ID_CONTINUE = 15, + UCHAR_ID_START = 16, + UCHAR_IDEOGRAPHIC = 17, + UCHAR_IDS_BINARY_OPERATOR = 18, + UCHAR_IDS_TRINARY_OPERATOR = 19, + UCHAR_JOIN_CONTROL = 20, + UCHAR_LOGICAL_ORDER_EXCEPTION = 21, + UCHAR_LOWERCASE = 22, + UCHAR_MATH = 23, + UCHAR_NONCHARACTER_CODE_POINT = 24, + UCHAR_QUOTATION_MARK = 25, + UCHAR_RADICAL = 26, + UCHAR_SOFT_DOTTED = 27, + UCHAR_TERMINAL_PUNCTUATION = 28, + UCHAR_UNIFIED_IDEOGRAPH = 29, + UCHAR_UPPERCASE = 30, + UCHAR_WHITE_SPACE = 31, + UCHAR_XID_CONTINUE = 32, + UCHAR_XID_START = 33, + UCHAR_CASE_SENSITIVE = 34, + UCHAR_S_TERM = 35, + UCHAR_VARIATION_SELECTOR = 36, + UCHAR_NFD_INERT = 37, + UCHAR_NFKD_INERT = 38, + UCHAR_NFC_INERT = 39, + UCHAR_NFKC_INERT = 40, + UCHAR_SEGMENT_STARTER = 41, + UCHAR_PATTERN_SYNTAX = 42, + UCHAR_PATTERN_WHITE_SPACE = 43, + UCHAR_POSIX_ALNUM = 44, + UCHAR_POSIX_BLANK = 45, + UCHAR_POSIX_GRAPH = 46, + UCHAR_POSIX_PRINT = 47, + UCHAR_POSIX_XDIGIT = 48, + UCHAR_CASED = 49, + UCHAR_CASE_IGNORABLE = 50, + UCHAR_CHANGES_WHEN_LOWERCASED = 51, + UCHAR_CHANGES_WHEN_UPPERCASED = 52, + UCHAR_CHANGES_WHEN_TITLECASED = 53, + UCHAR_CHANGES_WHEN_CASEFOLDED = 54, + UCHAR_CHANGES_WHEN_CASEMAPPED = 55, + UCHAR_CHANGES_WHEN_NFKC_CASEFOLDED = 56, + UCHAR_EMOJI = 57, + UCHAR_EMOJI_PRESENTATION = 58, + UCHAR_EMOJI_MODIFIER = 59, + UCHAR_EMOJI_MODIFIER_BASE = 60, + UCHAR_EMOJI_COMPONENT = 61, + UCHAR_REGIONAL_INDICATOR = 62, + UCHAR_PREPENDED_CONCATENATION_MARK = 63, + UCHAR_EXTENDED_PICTOGRAPHIC = 64, + UCHAR_BINARY_LIMIT = 65, + UCHAR_BIDI_CLASS = 4096, + UCHAR_BLOCK = 4097, + UCHAR_CANONICAL_COMBINING_CLASS = 4098, + UCHAR_DECOMPOSITION_TYPE = 4099, + UCHAR_EAST_ASIAN_WIDTH = 4100, + UCHAR_GENERAL_CATEGORY = 4101, + UCHAR_JOINING_GROUP = 4102, + UCHAR_JOINING_TYPE = 4103, + UCHAR_LINE_BREAK = 4104, + UCHAR_NUMERIC_TYPE = 4105, + UCHAR_SCRIPT = 4106, + UCHAR_HANGUL_SYLLABLE_TYPE = 4107, + UCHAR_NFD_QUICK_CHECK = 4108, + UCHAR_NFKD_QUICK_CHECK = 4109, + UCHAR_NFC_QUICK_CHECK = 4110, + UCHAR_NFKC_QUICK_CHECK = 4111, + UCHAR_LEAD_CANONICAL_COMBINING_CLASS = 4112, + UCHAR_TRAIL_CANONICAL_COMBINING_CLASS = 4113, + UCHAR_GRAPHEME_CLUSTER_BREAK = 4114, + UCHAR_SENTENCE_BREAK = 4115, + UCHAR_WORD_BREAK = 4116, + UCHAR_BIDI_PAIRED_BRACKET_TYPE = 4117, + UCHAR_INDIC_POSITIONAL_CATEGORY = 4118, + UCHAR_INDIC_SYLLABIC_CATEGORY = 4119, + UCHAR_VERTICAL_ORIENTATION = 4120, + UCHAR_INT_LIMIT = 4121, + UCHAR_GENERAL_CATEGORY_MASK = 8192, + UCHAR_MASK_LIMIT = 8193, + UCHAR_NUMERIC_VALUE = 12288, + UCHAR_DOUBLE_LIMIT = 12289, + UCHAR_AGE = 16384, + UCHAR_BIDI_MIRRORING_GLYPH = 16385, + UCHAR_CASE_FOLDING = 16386, + UCHAR_ISO_COMMENT = 16387, + UCHAR_LOWERCASE_MAPPING = 16388, + UCHAR_NAME = 16389, + UCHAR_SIMPLE_CASE_FOLDING = 16390, + UCHAR_SIMPLE_LOWERCASE_MAPPING = 16391, + UCHAR_SIMPLE_TITLECASE_MAPPING = 16392, + UCHAR_SIMPLE_UPPERCASE_MAPPING = 16393, + UCHAR_TITLECASE_MAPPING = 16394, + UCHAR_UNICODE_1_NAME = 16395, + UCHAR_UPPERCASE_MAPPING = 16396, + UCHAR_BIDI_PAIRED_BRACKET = 16397, + UCHAR_STRING_LIMIT = 16398, + UCHAR_SCRIPT_EXTENSIONS = 28672, + UCHAR_OTHER_PROPERTY_LIMIT = 28673, + UCHAR_INVALID_CODE = -1, +} +impl UCharCategory { + pub const U_GENERAL_OTHER_TYPES: UCharCategory = UCharCategory::U_UNASSIGNED; +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] +pub enum UCharCategory { + U_UNASSIGNED = 0, + U_UPPERCASE_LETTER = 1, + U_LOWERCASE_LETTER = 2, + U_TITLECASE_LETTER = 3, + U_MODIFIER_LETTER = 4, + U_OTHER_LETTER = 5, + U_NON_SPACING_MARK = 6, + U_ENCLOSING_MARK = 7, + U_COMBINING_SPACING_MARK = 8, + U_DECIMAL_DIGIT_NUMBER = 9, + U_LETTER_NUMBER = 10, + U_OTHER_NUMBER = 11, + U_SPACE_SEPARATOR = 12, + U_LINE_SEPARATOR = 13, + U_PARAGRAPH_SEPARATOR = 14, + U_CONTROL_CHAR = 15, + U_FORMAT_CHAR = 16, + U_PRIVATE_USE_CHAR = 17, + U_SURROGATE = 18, + U_DASH_PUNCTUATION = 19, + U_START_PUNCTUATION = 20, + U_END_PUNCTUATION = 21, + U_CONNECTOR_PUNCTUATION = 22, + U_OTHER_PUNCTUATION = 23, + U_MATH_SYMBOL = 24, + U_CURRENCY_SYMBOL = 25, + U_MODIFIER_SYMBOL = 26, + U_OTHER_SYMBOL = 27, + U_INITIAL_PUNCTUATION = 28, + U_FINAL_PUNCTUATION = 29, + U_CHAR_CATEGORY_COUNT = 30, +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] +pub enum UCharDirection { + U_LEFT_TO_RIGHT = 0, + U_RIGHT_TO_LEFT = 1, + U_EUROPEAN_NUMBER = 2, + U_EUROPEAN_NUMBER_SEPARATOR = 3, + U_EUROPEAN_NUMBER_TERMINATOR = 4, + U_ARABIC_NUMBER = 5, + U_COMMON_NUMBER_SEPARATOR = 6, + U_BLOCK_SEPARATOR = 7, + U_SEGMENT_SEPARATOR = 8, + U_WHITE_SPACE_NEUTRAL = 9, + U_OTHER_NEUTRAL = 10, + U_LEFT_TO_RIGHT_EMBEDDING = 11, + U_LEFT_TO_RIGHT_OVERRIDE = 12, + U_RIGHT_TO_LEFT_ARABIC = 13, + U_RIGHT_TO_LEFT_EMBEDDING = 14, + U_RIGHT_TO_LEFT_OVERRIDE = 15, + U_POP_DIRECTIONAL_FORMAT = 16, + U_DIR_NON_SPACING_MARK = 17, + U_BOUNDARY_NEUTRAL = 18, + U_FIRST_STRONG_ISOLATE = 19, + U_LEFT_TO_RIGHT_ISOLATE = 20, + U_RIGHT_TO_LEFT_ISOLATE = 21, + U_POP_DIRECTIONAL_ISOLATE = 22, + U_CHAR_DIRECTION_COUNT = 23, +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] +pub enum UCharNameChoice { + U_UNICODE_CHAR_NAME = 0, + U_UNICODE_10_CHAR_NAME = 1, + U_EXTENDED_CHAR_NAME = 2, + U_CHAR_NAME_ALIAS = 3, + U_CHAR_NAME_CHOICE_COUNT = 4, +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] +pub enum UPropertyNameChoice { + U_SHORT_PROPERTY_NAME = 0, + U_LONG_PROPERTY_NAME = 1, + U_PROPERTY_NAME_CHOICE_COUNT = 2, } extern "C" { - pub fn udat_getNumberFormat_65(fmt: *const UDateFormat) -> *const UNumberFormat; + pub fn u_hasBinaryProperty_65(c: UChar32, which: UProperty) -> UBool; } extern "C" { - pub fn udat_getNumberFormatForField_65( - fmt: *const UDateFormat, - field: UChar, - ) -> *const UNumberFormat; + pub fn u_getBinaryPropertySet_65( + property: UProperty, + pErrorCode: *mut UErrorCode, + ) -> *const USet; } extern "C" { - pub fn udat_adoptNumberFormatForFields_65( - fmt: *mut UDateFormat, - fields: *const UChar, - numberFormatToSet: *mut UNumberFormat, - status: *mut UErrorCode, - ); + pub fn u_isUAlphabetic_65(c: UChar32) -> UBool; } extern "C" { - pub fn udat_setNumberFormat_65(fmt: *mut UDateFormat, numberFormatToSet: *const UNumberFormat); + pub fn u_isULowercase_65(c: UChar32) -> UBool; } extern "C" { - pub fn udat_adoptNumberFormat_65( - fmt: *mut UDateFormat, - numberFormatToAdopt: *mut UNumberFormat, - ); + pub fn u_isUUppercase_65(c: UChar32) -> UBool; } extern "C" { - pub fn udat_getAvailable_65(localeIndex: i32) -> *const ::std::os::raw::c_char; + pub fn u_isUWhiteSpace_65(c: UChar32) -> UBool; } extern "C" { - pub fn udat_countAvailable_65() -> i32; + pub fn u_getIntPropertyValue_65(c: UChar32, which: UProperty) -> i32; } extern "C" { - pub fn udat_get2DigitYearStart_65(fmt: *const UDateFormat, status: *mut UErrorCode) -> UDate; + pub fn u_getIntPropertyMinValue_65(which: UProperty) -> i32; } extern "C" { - pub fn udat_set2DigitYearStart_65(fmt: *mut UDateFormat, d: UDate, status: *mut UErrorCode); + pub fn u_getIntPropertyMaxValue_65(which: UProperty) -> i32; } extern "C" { - pub fn udat_toPattern_65( - fmt: *const UDateFormat, - localized: UBool, - result: *mut UChar, - resultLength: i32, - status: *mut UErrorCode, - ) -> i32; + pub fn u_getIntPropertyMap_65( + property: UProperty, + pErrorCode: *mut UErrorCode, + ) -> *const UCPMap; } extern "C" { - pub fn udat_applyPattern_65( - format: *mut UDateFormat, - localized: UBool, - pattern: *const UChar, - patternLength: i32, - ); + pub fn u_getNumericValue_65(c: UChar32) -> f64; } -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UDateFormatSymbolType { - UDAT_ERAS = 0, - UDAT_MONTHS = 1, - UDAT_SHORT_MONTHS = 2, - UDAT_WEEKDAYS = 3, - UDAT_SHORT_WEEKDAYS = 4, - UDAT_AM_PMS = 5, - UDAT_LOCALIZED_CHARS = 6, - UDAT_ERA_NAMES = 7, - UDAT_NARROW_MONTHS = 8, - UDAT_NARROW_WEEKDAYS = 9, - UDAT_STANDALONE_MONTHS = 10, - UDAT_STANDALONE_SHORT_MONTHS = 11, - UDAT_STANDALONE_NARROW_MONTHS = 12, - UDAT_STANDALONE_WEEKDAYS = 13, - UDAT_STANDALONE_SHORT_WEEKDAYS = 14, - UDAT_STANDALONE_NARROW_WEEKDAYS = 15, - UDAT_QUARTERS = 16, - UDAT_SHORT_QUARTERS = 17, - UDAT_STANDALONE_QUARTERS = 18, - UDAT_STANDALONE_SHORT_QUARTERS = 19, - UDAT_SHORTER_WEEKDAYS = 20, - UDAT_STANDALONE_SHORTER_WEEKDAYS = 21, - UDAT_CYCLIC_YEARS_WIDE = 22, - UDAT_CYCLIC_YEARS_ABBREVIATED = 23, - UDAT_CYCLIC_YEARS_NARROW = 24, - UDAT_ZODIAC_NAMES_WIDE = 25, - UDAT_ZODIAC_NAMES_ABBREVIATED = 26, - UDAT_ZODIAC_NAMES_NARROW = 27, +extern "C" { + pub fn u_islower_65(c: UChar32) -> UBool; } -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct UDateFormatSymbols { - _unused: [u8; 0], +extern "C" { + pub fn u_isupper_65(c: UChar32) -> UBool; } extern "C" { - pub fn udat_getSymbols_65( - fmt: *const UDateFormat, - type_: UDateFormatSymbolType, - symbolIndex: i32, - result: *mut UChar, - resultLength: i32, - status: *mut UErrorCode, - ) -> i32; + pub fn u_istitle_65(c: UChar32) -> UBool; } extern "C" { - pub fn udat_countSymbols_65(fmt: *const UDateFormat, type_: UDateFormatSymbolType) -> i32; + pub fn u_isdigit_65(c: UChar32) -> UBool; } extern "C" { - pub fn udat_setSymbols_65( - format: *mut UDateFormat, - type_: UDateFormatSymbolType, - symbolIndex: i32, - value: *mut UChar, - valueLength: i32, - status: *mut UErrorCode, - ); + pub fn u_isalpha_65(c: UChar32) -> UBool; } extern "C" { - pub fn udat_getLocaleByType_65( - fmt: *const UDateFormat, - type_: ULocDataLocaleType, - status: *mut UErrorCode, - ) -> *const ::std::os::raw::c_char; + pub fn u_isalnum_65(c: UChar32) -> UBool; } extern "C" { - pub fn udat_setContext_65( - fmt: *mut UDateFormat, - value: UDisplayContext, - status: *mut UErrorCode, - ); + pub fn u_isxdigit_65(c: UChar32) -> UBool; } extern "C" { - pub fn udat_getContext_65( - fmt: *const UDateFormat, - type_: UDisplayContextType, - status: *mut UErrorCode, - ) -> UDisplayContext; + pub fn u_ispunct_65(c: UChar32) -> UBool; } extern "C" { - pub fn udat_toPatternRelativeDate_65( - fmt: *const UDateFormat, - result: *mut UChar, - resultLength: i32, - status: *mut UErrorCode, - ) -> i32; + pub fn u_isgraph_65(c: UChar32) -> UBool; } extern "C" { - pub fn udat_toPatternRelativeTime_65( - fmt: *const UDateFormat, - result: *mut UChar, - resultLength: i32, - status: *mut UErrorCode, - ) -> i32; + pub fn u_isblank_65(c: UChar32) -> UBool; } extern "C" { - pub fn udat_applyPatternRelative_65( - format: *mut UDateFormat, - datePattern: *const UChar, - datePatternLength: i32, - timePattern: *const UChar, - timePatternLength: i32, - status: *mut UErrorCode, - ); + pub fn u_isdefined_65(c: UChar32) -> UBool; } -pub type UDateFormatOpener = ::std::option::Option< - unsafe extern "C" fn( - timeStyle: UDateFormatStyle, - dateStyle: UDateFormatStyle, - locale: *const ::std::os::raw::c_char, - tzID: *const UChar, - tzIDLength: i32, - pattern: *const UChar, - patternLength: i32, - status: *mut UErrorCode, - ) -> *mut UDateFormat, ->; extern "C" { - pub fn udat_registerOpener_65(opener: UDateFormatOpener, status: *mut UErrorCode); + pub fn u_isspace_65(c: UChar32) -> UBool; } extern "C" { - pub fn udat_unregisterOpener_65( - opener: UDateFormatOpener, - status: *mut UErrorCode, - ) -> UDateFormatOpener; + pub fn u_isJavaSpaceChar_65(c: UChar32) -> UBool; } -#[repr(C)] -#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, PartialEq)] -pub struct UDataInfo { - pub size: u16, - pub reservedWord: u16, - pub isBigEndian: u8, - pub charsetFamily: u8, - pub sizeofUChar: u8, - pub reservedByte: u8, - pub dataFormat: [u8; 4usize], - pub formatVersion: [u8; 4usize], - pub dataVersion: [u8; 4usize], +extern "C" { + pub fn u_isWhitespace_65(c: UChar32) -> UBool; } -#[test] -fn bindgen_test_layout_UDataInfo() { - assert_eq!( - ::std::mem::size_of::(), - 20usize, - concat!("Size of: ", stringify!(UDataInfo)) - ); - assert_eq!( - ::std::mem::align_of::(), - 2usize, - concat!("Alignment of ", stringify!(UDataInfo)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).size as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(UDataInfo), - "::", - stringify!(size) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).reservedWord as *const _ as usize }, - 2usize, - concat!( - "Offset of field: ", - stringify!(UDataInfo), - "::", - stringify!(reservedWord) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).isBigEndian as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(UDataInfo), - "::", - stringify!(isBigEndian) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).charsetFamily as *const _ as usize }, - 5usize, - concat!( - "Offset of field: ", - stringify!(UDataInfo), - "::", - stringify!(charsetFamily) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).sizeofUChar as *const _ as usize }, - 6usize, - concat!( - "Offset of field: ", - stringify!(UDataInfo), - "::", - stringify!(sizeofUChar) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).reservedByte as *const _ as usize }, - 7usize, - concat!( - "Offset of field: ", - stringify!(UDataInfo), - "::", - stringify!(reservedByte) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).dataFormat as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(UDataInfo), - "::", - stringify!(dataFormat) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).formatVersion as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(UDataInfo), - "::", - stringify!(formatVersion) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).dataVersion as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(UDataInfo), - "::", - stringify!(dataVersion) - ) - ); +extern "C" { + pub fn u_iscntrl_65(c: UChar32) -> UBool; } -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct UDataMemory { - _unused: [u8; 0], +extern "C" { + pub fn u_isISOControl_65(c: UChar32) -> UBool; } -pub type UDataMemoryIsAcceptable = ::std::option::Option< - unsafe extern "C" fn( - context: *mut ::std::os::raw::c_void, - type_: *const ::std::os::raw::c_char, - name: *const ::std::os::raw::c_char, - pInfo: *const UDataInfo, - ) -> UBool, ->; extern "C" { - pub fn udata_open_65( - path: *const ::std::os::raw::c_char, - type_: *const ::std::os::raw::c_char, - name: *const ::std::os::raw::c_char, - pErrorCode: *mut UErrorCode, - ) -> *mut UDataMemory; + pub fn u_isprint_65(c: UChar32) -> UBool; } extern "C" { - pub fn udata_openChoice_65( - path: *const ::std::os::raw::c_char, - type_: *const ::std::os::raw::c_char, - name: *const ::std::os::raw::c_char, - isAcceptable: UDataMemoryIsAcceptable, + pub fn u_isbase_65(c: UChar32) -> UBool; +} +extern "C" { + pub fn u_charDirection_65(c: UChar32) -> UCharDirection; +} +extern "C" { + pub fn u_isMirrored_65(c: UChar32) -> UBool; +} +extern "C" { + pub fn u_charMirror_65(c: UChar32) -> UChar32; +} +extern "C" { + pub fn u_getBidiPairedBracket_65(c: UChar32) -> UChar32; +} +extern "C" { + pub fn u_charType_65(c: UChar32) -> i8; +} +pub type UCharEnumTypeRange = ::std::option::Option< + unsafe extern "C" fn( + context: *const ::std::os::raw::c_void, + start: UChar32, + limit: UChar32, + type_: UCharCategory, + ) -> UBool, +>; +extern "C" { + pub fn u_enumCharTypes_65( + enumRange: UCharEnumTypeRange, + context: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn u_getCombiningClass_65(c: UChar32) -> u8; +} +extern "C" { + pub fn u_charDigitValue_65(c: UChar32) -> i32; +} +extern "C" { + pub fn u_charName_65( + code: UChar32, + nameChoice: UCharNameChoice, + buffer: *mut ::std::os::raw::c_char, + bufferLength: i32, + pErrorCode: *mut UErrorCode, + ) -> i32; +} +extern "C" { + pub fn u_getISOComment_65( + c: UChar32, + dest: *mut ::std::os::raw::c_char, + destCapacity: i32, + pErrorCode: *mut UErrorCode, + ) -> i32; +} +extern "C" { + pub fn u_charFromName_65( + nameChoice: UCharNameChoice, + name: *const ::std::os::raw::c_char, + pErrorCode: *mut UErrorCode, + ) -> UChar32; +} +pub type UEnumCharNamesFn = ::std::option::Option< + unsafe extern "C" fn( context: *mut ::std::os::raw::c_void, + code: UChar32, + nameChoice: UCharNameChoice, + name: *const ::std::os::raw::c_char, + length: i32, + ) -> UBool, +>; +extern "C" { + pub fn u_enumCharNames_65( + start: UChar32, + limit: UChar32, + fn_: UEnumCharNamesFn, + context: *mut ::std::os::raw::c_void, + nameChoice: UCharNameChoice, pErrorCode: *mut UErrorCode, - ) -> *mut UDataMemory; + ); } extern "C" { - pub fn udata_close_65(pData: *mut UDataMemory); + pub fn u_getPropertyName_65( + property: UProperty, + nameChoice: UPropertyNameChoice, + ) -> *const ::std::os::raw::c_char; } extern "C" { - pub fn udata_getMemory_65(pData: *mut UDataMemory) -> *const ::std::os::raw::c_void; + pub fn u_getPropertyEnum_65(alias: *const ::std::os::raw::c_char) -> UProperty; } extern "C" { - pub fn udata_getInfo_65(pData: *mut UDataMemory, pInfo: *mut UDataInfo); + pub fn u_getPropertyValueName_65( + property: UProperty, + value: i32, + nameChoice: UPropertyNameChoice, + ) -> *const ::std::os::raw::c_char; } extern "C" { - pub fn udata_setCommonData_65(data: *const ::std::os::raw::c_void, err: *mut UErrorCode); + pub fn u_getPropertyValueEnum_65( + property: UProperty, + alias: *const ::std::os::raw::c_char, + ) -> i32; } extern "C" { - pub fn udata_setAppData_65( - packageName: *const ::std::os::raw::c_char, - data: *const ::std::os::raw::c_void, - err: *mut UErrorCode, - ); + pub fn u_isIDStart_65(c: UChar32) -> UBool; } -impl UDataFileAccess { - pub const UDATA_DEFAULT_ACCESS: UDataFileAccess = UDataFileAccess::UDATA_FILES_FIRST; +extern "C" { + pub fn u_isIDPart_65(c: UChar32) -> UBool; } -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UDataFileAccess { - UDATA_FILES_FIRST = 0, - UDATA_ONLY_PACKAGES = 1, - UDATA_PACKAGES_FIRST = 2, - UDATA_NO_FILES = 3, - UDATA_FILE_ACCESS_COUNT = 4, +extern "C" { + pub fn u_isIDIgnorable_65(c: UChar32) -> UBool; } extern "C" { - pub fn udata_setFileAccess_65(access: UDataFileAccess, status: *mut UErrorCode); + pub fn u_isJavaIDStart_65(c: UChar32) -> UBool; } extern "C" { - pub fn u_getDataDirectory_65() -> *const ::std::os::raw::c_char; + pub fn u_isJavaIDPart_65(c: UChar32) -> UBool; } extern "C" { - pub fn u_setDataDirectory_65(directory: *const ::std::os::raw::c_char); + pub fn u_tolower_65(c: UChar32) -> UChar32; } extern "C" { - pub fn u_getTimeZoneFilesDirectory_65(status: *mut UErrorCode) - -> *const ::std::os::raw::c_char; + pub fn u_toupper_65(c: UChar32) -> UChar32; } extern "C" { - pub fn u_setTimeZoneFilesDirectory_65( - path: *const ::std::os::raw::c_char, - status: *mut UErrorCode, - ); + pub fn u_totitle_65(c: UChar32) -> UChar32; } extern "C" { - pub fn u_charsToUChars_65(cs: *const ::std::os::raw::c_char, us: *mut UChar, length: i32); + pub fn u_foldCase_65(c: UChar32, options: u32) -> UChar32; } extern "C" { - pub fn u_UCharsToChars_65(us: *const UChar, cs: *mut ::std::os::raw::c_char, length: i32); + pub fn u_digit_65(ch: UChar32, radix: i8) -> i32; +} +extern "C" { + pub fn u_forDigit_65(digit: i32, radix: i8) -> UChar32; +} +extern "C" { + pub fn u_charAge_65(c: UChar32, versionArray: *mut u8); +} +extern "C" { + pub fn u_getUnicodeVersion_65(versionArray: *mut u8); +} +extern "C" { + pub fn u_getFC_NFKC_Closure_65( + c: UChar32, + dest: *mut UChar, + destCapacity: i32, + pErrorCode: *mut UErrorCode, + ) -> i32; } #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UCharIteratorOrigin { - UITER_START = 0, - UITER_CURRENT = 1, - UITER_LIMIT = 2, - UITER_ZERO = 3, - UITER_LENGTH = 4, +pub enum USetSpanCondition { + USET_SPAN_NOT_CONTAINED = 0, + USET_SPAN_CONTAINED = 1, + USET_SPAN_SIMPLE = 2, + USET_SPAN_CONDITION_COUNT = 3, } -pub type UCharIteratorGetIndex = ::std::option::Option< - unsafe extern "C" fn(iter: *mut UCharIterator, origin: UCharIteratorOrigin) -> i32, ->; -pub type UCharIteratorMove = ::std::option::Option< - unsafe extern "C" fn(iter: *mut UCharIterator, delta: i32, origin: UCharIteratorOrigin) -> i32, ->; -pub type UCharIteratorHasNext = - ::std::option::Option UBool>; -pub type UCharIteratorHasPrevious = - ::std::option::Option UBool>; -pub type UCharIteratorCurrent = - ::std::option::Option UChar32>; -pub type UCharIteratorNext = - ::std::option::Option UChar32>; -pub type UCharIteratorPrevious = - ::std::option::Option UChar32>; -pub type UCharIteratorReserved = - ::std::option::Option i32>; -pub type UCharIteratorGetState = - ::std::option::Option u32>; -pub type UCharIteratorSetState = ::std::option::Option< - unsafe extern "C" fn(iter: *mut UCharIterator, state: u32, pErrorCode: *mut UErrorCode), ->; #[repr(C)] -#[derive(Debug, Copy, Clone, Hash, PartialOrd, PartialEq)] -pub struct UCharIterator { - pub context: *const ::std::os::raw::c_void, - pub length: i32, - pub start: i32, - pub index: i32, - pub limit: i32, - pub reservedField: i32, - pub getIndex: UCharIteratorGetIndex, - pub move_: UCharIteratorMove, - pub hasNext: UCharIteratorHasNext, - pub hasPrevious: UCharIteratorHasPrevious, - pub current: UCharIteratorCurrent, - pub next: UCharIteratorNext, - pub previous: UCharIteratorPrevious, - pub reservedFn: UCharIteratorReserved, - pub getState: UCharIteratorGetState, - pub setState: UCharIteratorSetState, +#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, PartialEq)] +pub struct UParseError { + pub line: i32, + pub offset: i32, + pub preContext: [UChar; 16usize], + pub postContext: [UChar; 16usize], } #[test] -fn bindgen_test_layout_UCharIterator() { +fn bindgen_test_layout_UParseError() { assert_eq!( - ::std::mem::size_of::(), - 112usize, - concat!("Size of: ", stringify!(UCharIterator)) + ::std::mem::size_of::(), + 72usize, + concat!("Size of: ", stringify!(UParseError)) ); assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(UCharIterator)) + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(UParseError)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).context as *const _ as usize }, + unsafe { &(*(::std::ptr::null::())).line as *const _ as usize }, 0usize, concat!( "Offset of field: ", - stringify!(UCharIterator), + stringify!(UParseError), "::", - stringify!(context) + stringify!(line) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).length as *const _ as usize }, - 8usize, + unsafe { &(*(::std::ptr::null::())).offset as *const _ as usize }, + 4usize, concat!( "Offset of field: ", - stringify!(UCharIterator), + stringify!(UParseError), "::", - stringify!(length) + stringify!(offset) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).start as *const _ as usize }, - 12usize, + unsafe { &(*(::std::ptr::null::())).preContext as *const _ as usize }, + 8usize, concat!( "Offset of field: ", - stringify!(UCharIterator), + stringify!(UParseError), "::", - stringify!(start) + stringify!(preContext) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).index as *const _ as usize }, - 16usize, + unsafe { &(*(::std::ptr::null::())).postContext as *const _ as usize }, + 40usize, concat!( "Offset of field: ", - stringify!(UCharIterator), + stringify!(UParseError), "::", - stringify!(index) + stringify!(postContext) ) ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).limit as *const _ as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(UCharIterator), - "::", - stringify!(limit) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).reservedField as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(UCharIterator), - "::", - stringify!(reservedField) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).getIndex as *const _ as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(UCharIterator), - "::", - stringify!(getIndex) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).move_ as *const _ as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(UCharIterator), - "::", - stringify!(move_) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).hasNext as *const _ as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(UCharIterator), - "::", - stringify!(hasNext) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).hasPrevious as *const _ as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(UCharIterator), - "::", - stringify!(hasPrevious) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).current as *const _ as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(UCharIterator), - "::", - stringify!(current) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).next as *const _ as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(UCharIterator), - "::", - stringify!(next) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).previous as *const _ as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(UCharIterator), - "::", - stringify!(previous) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).reservedFn as *const _ as usize }, - 88usize, - concat!( - "Offset of field: ", - stringify!(UCharIterator), - "::", - stringify!(reservedFn) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).getState as *const _ as usize }, - 96usize, - concat!( - "Offset of field: ", - stringify!(UCharIterator), - "::", - stringify!(getState) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).setState as *const _ as usize }, - 104usize, - concat!( - "Offset of field: ", - stringify!(UCharIterator), - "::", - stringify!(setState) - ) - ); -} -impl Default for UCharIterator { - fn default() -> Self { - unsafe { ::std::mem::zeroed() } - } } #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct UBreakIterator { +pub struct UCollator { _unused: [u8; 0], } -extern "C" { - pub fn u_strlen_65(s: *const UChar) -> i32; +#[repr(i32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] +pub enum UCollationResult { + UCOL_EQUAL = 0, + UCOL_GREATER = 1, + UCOL_LESS = -1, } -extern "C" { - pub fn u_countChar32_65(s: *const UChar, length: i32) -> i32; +impl UColAttributeValue { + pub const UCOL_DEFAULT_STRENGTH: UColAttributeValue = UColAttributeValue::UCOL_TERTIARY; } -extern "C" { - pub fn u_strHasMoreChar32Than_65(s: *const UChar, length: i32, number: i32) -> UBool; +impl UColAttributeValue { + pub const UCOL_QUATERNARY: UColAttributeValue = UColAttributeValue::UCOL_CE_STRENGTH_LIMIT; } -extern "C" { - pub fn u_strcat_65(dst: *mut UChar, src: *const UChar) -> *mut UChar; +impl UColAttributeValue { + pub const UCOL_OFF: UColAttributeValue = UColAttributeValue::UCOL_STRENGTH_LIMIT; } -extern "C" { - pub fn u_strncat_65(dst: *mut UChar, src: *const UChar, n: i32) -> *mut UChar; +#[repr(i32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] +pub enum UColAttributeValue { + UCOL_DEFAULT = -1, + UCOL_PRIMARY = 0, + UCOL_SECONDARY = 1, + UCOL_TERTIARY = 2, + UCOL_CE_STRENGTH_LIMIT = 3, + UCOL_IDENTICAL = 15, + UCOL_STRENGTH_LIMIT = 16, + UCOL_ON = 17, + UCOL_SHIFTED = 20, + UCOL_NON_IGNORABLE = 21, + UCOL_LOWER_FIRST = 24, + UCOL_UPPER_FIRST = 25, + UCOL_ATTRIBUTE_VALUE_COUNT = 26, } -extern "C" { - pub fn u_strstr_65(s: *const UChar, substring: *const UChar) -> *mut UChar; +impl UColReorderCode { + pub const UCOL_REORDER_CODE_OTHERS: UColReorderCode = UColReorderCode::UCOL_REORDER_CODE_NONE; } -extern "C" { - pub fn u_strFindFirst_65( - s: *const UChar, - length: i32, - substring: *const UChar, - subLength: i32, - ) -> *mut UChar; +impl UColReorderCode { + pub const UCOL_REORDER_CODE_FIRST: UColReorderCode = UColReorderCode::UCOL_REORDER_CODE_SPACE; } -extern "C" { - pub fn u_strchr_65(s: *const UChar, c: UChar) -> *mut UChar; +#[repr(i32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] +pub enum UColReorderCode { + UCOL_REORDER_CODE_DEFAULT = -1, + UCOL_REORDER_CODE_NONE = 103, + UCOL_REORDER_CODE_SPACE = 4096, + UCOL_REORDER_CODE_PUNCTUATION = 4097, + UCOL_REORDER_CODE_SYMBOL = 4098, + UCOL_REORDER_CODE_CURRENCY = 4099, + UCOL_REORDER_CODE_DIGIT = 4100, + UCOL_REORDER_CODE_LIMIT = 4101, } -extern "C" { - pub fn u_strchr32_65(s: *const UChar, c: UChar32) -> *mut UChar; +pub use self::UColAttributeValue as UCollationStrength; +impl UColAttribute { + pub const UCOL_DECOMPOSITION_MODE: UColAttribute = UColAttribute::UCOL_NORMALIZATION_MODE; } -extern "C" { - pub fn u_strrstr_65(s: *const UChar, substring: *const UChar) -> *mut UChar; +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] +pub enum UColAttribute { + UCOL_FRENCH_COLLATION = 0, + UCOL_ALTERNATE_HANDLING = 1, + UCOL_CASE_FIRST = 2, + UCOL_CASE_LEVEL = 3, + UCOL_NORMALIZATION_MODE = 4, + UCOL_STRENGTH = 5, + UCOL_HIRAGANA_QUATERNARY_MODE = 6, + UCOL_NUMERIC_COLLATION = 7, + UCOL_ATTRIBUTE_COUNT = 8, +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] +pub enum UColRuleOption { + UCOL_TAILORING_ONLY = 0, + UCOL_FULL_RULES = 1, } extern "C" { - pub fn u_strFindLast_65( - s: *const UChar, - length: i32, - substring: *const UChar, - subLength: i32, - ) -> *mut UChar; + pub fn ucol_open_65( + loc: *const ::std::os::raw::c_char, + status: *mut UErrorCode, + ) -> *mut UCollator; } extern "C" { - pub fn u_strrchr_65(s: *const UChar, c: UChar) -> *mut UChar; + pub fn ucol_openRules_65( + rules: *const UChar, + rulesLength: i32, + normalizationMode: UColAttributeValue, + strength: UCollationStrength, + parseError: *mut UParseError, + status: *mut UErrorCode, + ) -> *mut UCollator; } extern "C" { - pub fn u_strrchr32_65(s: *const UChar, c: UChar32) -> *mut UChar; + pub fn ucol_openFromShortString_65( + definition: *const ::std::os::raw::c_char, + forceDefaults: UBool, + parseError: *mut UParseError, + status: *mut UErrorCode, + ) -> *mut UCollator; } extern "C" { - pub fn u_strpbrk_65(string: *const UChar, matchSet: *const UChar) -> *mut UChar; + pub fn ucol_getContractions_65( + coll: *const UCollator, + conts: *mut USet, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_strcspn_65(string: *const UChar, matchSet: *const UChar) -> i32; + pub fn ucol_getContractionsAndExpansions_65( + coll: *const UCollator, + contractions: *mut USet, + expansions: *mut USet, + addPrefixes: UBool, + status: *mut UErrorCode, + ); } extern "C" { - pub fn u_strspn_65(string: *const UChar, matchSet: *const UChar) -> i32; + pub fn ucol_close_65(coll: *mut UCollator); } extern "C" { - pub fn u_strtok_r_65( - src: *mut UChar, - delim: *const UChar, - saveState: *mut *mut UChar, - ) -> *mut UChar; + pub fn ucol_strcoll_65( + coll: *const UCollator, + source: *const UChar, + sourceLength: i32, + target: *const UChar, + targetLength: i32, + ) -> UCollationResult; } extern "C" { - pub fn u_strcmp_65(s1: *const UChar, s2: *const UChar) -> i32; + pub fn ucol_strcollUTF8_65( + coll: *const UCollator, + source: *const ::std::os::raw::c_char, + sourceLength: i32, + target: *const ::std::os::raw::c_char, + targetLength: i32, + status: *mut UErrorCode, + ) -> UCollationResult; } extern "C" { - pub fn u_strcmpCodePointOrder_65(s1: *const UChar, s2: *const UChar) -> i32; + pub fn ucol_greater_65( + coll: *const UCollator, + source: *const UChar, + sourceLength: i32, + target: *const UChar, + targetLength: i32, + ) -> UBool; } extern "C" { - pub fn u_strCompare_65( - s1: *const UChar, - length1: i32, - s2: *const UChar, - length2: i32, - codePointOrder: UBool, - ) -> i32; + pub fn ucol_greaterOrEqual_65( + coll: *const UCollator, + source: *const UChar, + sourceLength: i32, + target: *const UChar, + targetLength: i32, + ) -> UBool; } extern "C" { - pub fn u_strCompareIter_65( - iter1: *mut UCharIterator, - iter2: *mut UCharIterator, - codePointOrder: UBool, - ) -> i32; + pub fn ucol_equal_65( + coll: *const UCollator, + source: *const UChar, + sourceLength: i32, + target: *const UChar, + targetLength: i32, + ) -> UBool; } extern "C" { - pub fn u_strCaseCompare_65( - s1: *const UChar, - length1: i32, - s2: *const UChar, - length2: i32, - options: u32, - pErrorCode: *mut UErrorCode, - ) -> i32; + pub fn ucol_strcollIter_65( + coll: *const UCollator, + sIter: *mut UCharIterator, + tIter: *mut UCharIterator, + status: *mut UErrorCode, + ) -> UCollationResult; } extern "C" { - pub fn u_strncmp_65(ucs1: *const UChar, ucs2: *const UChar, n: i32) -> i32; + pub fn ucol_getStrength_65(coll: *const UCollator) -> UCollationStrength; } extern "C" { - pub fn u_strncmpCodePointOrder_65(s1: *const UChar, s2: *const UChar, n: i32) -> i32; + pub fn ucol_setStrength_65(coll: *mut UCollator, strength: UCollationStrength); } extern "C" { - pub fn u_strcasecmp_65(s1: *const UChar, s2: *const UChar, options: u32) -> i32; + pub fn ucol_getReorderCodes_65( + coll: *const UCollator, + dest: *mut i32, + destCapacity: i32, + pErrorCode: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_strncasecmp_65(s1: *const UChar, s2: *const UChar, n: i32, options: u32) -> i32; + pub fn ucol_setReorderCodes_65( + coll: *mut UCollator, + reorderCodes: *const i32, + reorderCodesLength: i32, + pErrorCode: *mut UErrorCode, + ); } extern "C" { - pub fn u_memcasecmp_65(s1: *const UChar, s2: *const UChar, length: i32, options: u32) -> i32; + pub fn ucol_getEquivalentReorderCodes_65( + reorderCode: i32, + dest: *mut i32, + destCapacity: i32, + pErrorCode: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_strcpy_65(dst: *mut UChar, src: *const UChar) -> *mut UChar; + pub fn ucol_getDisplayName_65( + objLoc: *const ::std::os::raw::c_char, + dispLoc: *const ::std::os::raw::c_char, + result: *mut UChar, + resultLength: i32, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_strncpy_65(dst: *mut UChar, src: *const UChar, n: i32) -> *mut UChar; + pub fn ucol_getAvailable_65(localeIndex: i32) -> *const ::std::os::raw::c_char; } extern "C" { - pub fn u_uastrcpy_65(dst: *mut UChar, src: *const ::std::os::raw::c_char) -> *mut UChar; + pub fn ucol_countAvailable_65() -> i32; } extern "C" { - pub fn u_uastrncpy_65( - dst: *mut UChar, - src: *const ::std::os::raw::c_char, - n: i32, - ) -> *mut UChar; + pub fn ucol_openAvailableLocales_65(status: *mut UErrorCode) -> *mut UEnumeration; } extern "C" { - pub fn u_austrcpy_65( - dst: *mut ::std::os::raw::c_char, - src: *const UChar, - ) -> *mut ::std::os::raw::c_char; + pub fn ucol_getKeywords_65(status: *mut UErrorCode) -> *mut UEnumeration; } extern "C" { - pub fn u_austrncpy_65( - dst: *mut ::std::os::raw::c_char, - src: *const UChar, - n: i32, - ) -> *mut ::std::os::raw::c_char; + pub fn ucol_getKeywordValues_65( + keyword: *const ::std::os::raw::c_char, + status: *mut UErrorCode, + ) -> *mut UEnumeration; } extern "C" { - pub fn u_memcpy_65(dest: *mut UChar, src: *const UChar, count: i32) -> *mut UChar; + pub fn ucol_getKeywordValuesForLocale_65( + key: *const ::std::os::raw::c_char, + locale: *const ::std::os::raw::c_char, + commonlyUsed: UBool, + status: *mut UErrorCode, + ) -> *mut UEnumeration; } extern "C" { - pub fn u_memmove_65(dest: *mut UChar, src: *const UChar, count: i32) -> *mut UChar; + pub fn ucol_getFunctionalEquivalent_65( + result: *mut ::std::os::raw::c_char, + resultCapacity: i32, + keyword: *const ::std::os::raw::c_char, + locale: *const ::std::os::raw::c_char, + isAvailable: *mut UBool, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_memset_65(dest: *mut UChar, c: UChar, count: i32) -> *mut UChar; + pub fn ucol_getRules_65(coll: *const UCollator, length: *mut i32) -> *const UChar; } extern "C" { - pub fn u_memcmp_65(buf1: *const UChar, buf2: *const UChar, count: i32) -> i32; + pub fn ucol_getShortDefinitionString_65( + coll: *const UCollator, + locale: *const ::std::os::raw::c_char, + buffer: *mut ::std::os::raw::c_char, + capacity: i32, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_memcmpCodePointOrder_65(s1: *const UChar, s2: *const UChar, count: i32) -> i32; + pub fn ucol_normalizeShortDefinitionString_65( + source: *const ::std::os::raw::c_char, + destination: *mut ::std::os::raw::c_char, + capacity: i32, + parseError: *mut UParseError, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_memchr_65(s: *const UChar, c: UChar, count: i32) -> *mut UChar; + pub fn ucol_getSortKey_65( + coll: *const UCollator, + source: *const UChar, + sourceLength: i32, + result: *mut u8, + resultLength: i32, + ) -> i32; } extern "C" { - pub fn u_memchr32_65(s: *const UChar, c: UChar32, count: i32) -> *mut UChar; + pub fn ucol_nextSortKeyPart_65( + coll: *const UCollator, + iter: *mut UCharIterator, + state: *mut u32, + dest: *mut u8, + count: i32, + status: *mut UErrorCode, + ) -> i32; } -extern "C" { - pub fn u_memrchr_65(s: *const UChar, c: UChar, count: i32) -> *mut UChar; +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] +pub enum UColBoundMode { + UCOL_BOUND_LOWER = 0, + UCOL_BOUND_UPPER = 1, + UCOL_BOUND_UPPER_LONG = 2, + UCOL_BOUND_VALUE_COUNT = 3, } extern "C" { - pub fn u_memrchr32_65(s: *const UChar, c: UChar32, count: i32) -> *mut UChar; + pub fn ucol_getBound_65( + source: *const u8, + sourceLength: i32, + boundType: UColBoundMode, + noOfLevels: u32, + result: *mut u8, + resultLength: i32, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_unescape_65( - src: *const ::std::os::raw::c_char, - dest: *mut UChar, - destCapacity: i32, - ) -> i32; + pub fn ucol_getVersion_65(coll: *const UCollator, info: *mut u8); } -pub type UNESCAPE_CHAR_AT = ::std::option::Option< - unsafe extern "C" fn(offset: i32, context: *mut ::std::os::raw::c_void) -> UChar, ->; extern "C" { - pub fn u_unescapeAt_65( - charAt: UNESCAPE_CHAR_AT, - offset: *mut i32, - length: i32, - context: *mut ::std::os::raw::c_void, - ) -> UChar32; + pub fn ucol_getUCAVersion_65(coll: *const UCollator, info: *mut u8); } extern "C" { - pub fn u_strToUpper_65( - dest: *mut UChar, + pub fn ucol_mergeSortkeys_65( + src1: *const u8, + src1Length: i32, + src2: *const u8, + src2Length: i32, + dest: *mut u8, destCapacity: i32, - src: *const UChar, - srcLength: i32, - locale: *const ::std::os::raw::c_char, - pErrorCode: *mut UErrorCode, ) -> i32; } extern "C" { - pub fn u_strToLower_65( - dest: *mut UChar, - destCapacity: i32, - src: *const UChar, - srcLength: i32, - locale: *const ::std::os::raw::c_char, - pErrorCode: *mut UErrorCode, - ) -> i32; + pub fn ucol_setAttribute_65( + coll: *mut UCollator, + attr: UColAttribute, + value: UColAttributeValue, + status: *mut UErrorCode, + ); } extern "C" { - pub fn u_strToTitle_65( - dest: *mut UChar, - destCapacity: i32, - src: *const UChar, - srcLength: i32, - titleIter: *mut UBreakIterator, - locale: *const ::std::os::raw::c_char, - pErrorCode: *mut UErrorCode, - ) -> i32; + pub fn ucol_getAttribute_65( + coll: *const UCollator, + attr: UColAttribute, + status: *mut UErrorCode, + ) -> UColAttributeValue; } extern "C" { - pub fn u_strFoldCase_65( - dest: *mut UChar, - destCapacity: i32, - src: *const UChar, - srcLength: i32, - options: u32, + pub fn ucol_setMaxVariable_65( + coll: *mut UCollator, + group: UColReorderCode, pErrorCode: *mut UErrorCode, - ) -> i32; + ); } extern "C" { - pub fn u_strToWCS_65( - dest: *mut wchar_t, - destCapacity: i32, - pDestLength: *mut i32, - src: *const UChar, - srcLength: i32, - pErrorCode: *mut UErrorCode, - ) -> *mut wchar_t; + pub fn ucol_getMaxVariable_65(coll: *const UCollator) -> UColReorderCode; } extern "C" { - pub fn u_strFromWCS_65( - dest: *mut UChar, - destCapacity: i32, - pDestLength: *mut i32, - src: *const wchar_t, - srcLength: i32, - pErrorCode: *mut UErrorCode, - ) -> *mut UChar; + pub fn ucol_setVariableTop_65( + coll: *mut UCollator, + varTop: *const UChar, + len: i32, + status: *mut UErrorCode, + ) -> u32; } extern "C" { - pub fn u_strToUTF8_65( - dest: *mut ::std::os::raw::c_char, - destCapacity: i32, - pDestLength: *mut i32, - src: *const UChar, - srcLength: i32, - pErrorCode: *mut UErrorCode, - ) -> *mut ::std::os::raw::c_char; + pub fn ucol_getVariableTop_65(coll: *const UCollator, status: *mut UErrorCode) -> u32; } extern "C" { - pub fn u_strFromUTF8_65( - dest: *mut UChar, - destCapacity: i32, - pDestLength: *mut i32, - src: *const ::std::os::raw::c_char, - srcLength: i32, - pErrorCode: *mut UErrorCode, - ) -> *mut UChar; + pub fn ucol_restoreVariableTop_65(coll: *mut UCollator, varTop: u32, status: *mut UErrorCode); } extern "C" { - pub fn u_strToUTF8WithSub_65( - dest: *mut ::std::os::raw::c_char, - destCapacity: i32, - pDestLength: *mut i32, - src: *const UChar, - srcLength: i32, - subchar: UChar32, - pNumSubstitutions: *mut i32, - pErrorCode: *mut UErrorCode, - ) -> *mut ::std::os::raw::c_char; + pub fn ucol_safeClone_65( + coll: *const UCollator, + stackBuffer: *mut ::std::os::raw::c_void, + pBufferSize: *mut i32, + status: *mut UErrorCode, + ) -> *mut UCollator; } extern "C" { - pub fn u_strFromUTF8WithSub_65( - dest: *mut UChar, - destCapacity: i32, - pDestLength: *mut i32, - src: *const ::std::os::raw::c_char, - srcLength: i32, - subchar: UChar32, - pNumSubstitutions: *mut i32, - pErrorCode: *mut UErrorCode, - ) -> *mut UChar; + pub fn ucol_getRulesEx_65( + coll: *const UCollator, + delta: UColRuleOption, + buffer: *mut UChar, + bufferLen: i32, + ) -> i32; } extern "C" { - pub fn u_strFromUTF8Lenient_65( - dest: *mut UChar, - destCapacity: i32, - pDestLength: *mut i32, - src: *const ::std::os::raw::c_char, - srcLength: i32, - pErrorCode: *mut UErrorCode, - ) -> *mut UChar; + pub fn ucol_getLocale_65( + coll: *const UCollator, + type_: ULocDataLocaleType, + status: *mut UErrorCode, + ) -> *const ::std::os::raw::c_char; } extern "C" { - pub fn u_strToUTF32_65( - dest: *mut UChar32, - destCapacity: i32, - pDestLength: *mut i32, - src: *const UChar, - srcLength: i32, - pErrorCode: *mut UErrorCode, - ) -> *mut UChar32; + pub fn ucol_getLocaleByType_65( + coll: *const UCollator, + type_: ULocDataLocaleType, + status: *mut UErrorCode, + ) -> *const ::std::os::raw::c_char; } extern "C" { - pub fn u_strFromUTF32_65( - dest: *mut UChar, - destCapacity: i32, - pDestLength: *mut i32, - src: *const UChar32, - srcLength: i32, - pErrorCode: *mut UErrorCode, - ) -> *mut UChar; + pub fn ucol_getTailoredSet_65(coll: *const UCollator, status: *mut UErrorCode) -> *mut USet; } extern "C" { - pub fn u_strToUTF32WithSub_65( - dest: *mut UChar32, - destCapacity: i32, - pDestLength: *mut i32, - src: *const UChar, - srcLength: i32, - subchar: UChar32, - pNumSubstitutions: *mut i32, - pErrorCode: *mut UErrorCode, - ) -> *mut UChar32; + pub fn ucol_getUnsafeSet_65( + coll: *const UCollator, + unsafe_: *mut USet, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_strFromUTF32WithSub_65( - dest: *mut UChar, - destCapacity: i32, - pDestLength: *mut i32, - src: *const UChar32, - srcLength: i32, - subchar: UChar32, - pNumSubstitutions: *mut i32, - pErrorCode: *mut UErrorCode, - ) -> *mut UChar; + pub fn ucol_prepareShortStringOpen_65( + definition: *const ::std::os::raw::c_char, + forceDefaults: UBool, + parseError: *mut UParseError, + status: *mut UErrorCode, + ); } extern "C" { - pub fn u_strToJavaModifiedUTF8_65( - dest: *mut ::std::os::raw::c_char, - destCapacity: i32, - pDestLength: *mut i32, - src: *const UChar, - srcLength: i32, - pErrorCode: *mut UErrorCode, - ) -> *mut ::std::os::raw::c_char; + pub fn ucol_cloneBinary_65( + coll: *const UCollator, + buffer: *mut u8, + capacity: i32, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_strFromJavaModifiedUTF8WithSub_65( - dest: *mut UChar, - destCapacity: i32, - pDestLength: *mut i32, - src: *const ::std::os::raw::c_char, - srcLength: i32, - subchar: UChar32, - pNumSubstitutions: *mut i32, - pErrorCode: *mut UErrorCode, - ) -> *mut UChar; + pub fn ucol_openBinary_65( + bin: *const u8, + length: i32, + base: *const UCollator, + status: *mut UErrorCode, + ) -> *mut UCollator; } #[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct UCPMap { - _unused: [u8; 0], +#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, PartialEq)] +pub struct UFieldPosition { + pub field: i32, + pub beginIndex: i32, + pub endIndex: i32, +} +#[test] +fn bindgen_test_layout_UFieldPosition() { + assert_eq!( + ::std::mem::size_of::(), + 12usize, + concat!("Size of: ", stringify!(UFieldPosition)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(UFieldPosition)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).field as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(UFieldPosition), + "::", + stringify!(field) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).beginIndex as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(UFieldPosition), + "::", + stringify!(beginIndex) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).endIndex as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(UFieldPosition), + "::", + stringify!(endIndex) + ) + ); +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] +pub enum UDisplayContextType { + UDISPCTX_TYPE_DIALECT_HANDLING = 0, + UDISPCTX_TYPE_CAPITALIZATION = 1, + UDISPCTX_TYPE_DISPLAY_LENGTH = 2, + UDISPCTX_TYPE_SUBSTITUTE_HANDLING = 3, +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] +pub enum UDisplayContext { + UDISPCTX_STANDARD_NAMES = 0, + UDISPCTX_DIALECT_NAMES = 1, + UDISPCTX_CAPITALIZATION_NONE = 256, + UDISPCTX_CAPITALIZATION_FOR_MIDDLE_OF_SENTENCE = 257, + UDISPCTX_CAPITALIZATION_FOR_BEGINNING_OF_SENTENCE = 258, + UDISPCTX_CAPITALIZATION_FOR_UI_LIST_OR_MENU = 259, + UDISPCTX_CAPITALIZATION_FOR_STANDALONE = 260, + UDISPCTX_LENGTH_FULL = 512, + UDISPCTX_LENGTH_SHORT = 513, + UDISPCTX_SUBSTITUTE = 768, + UDISPCTX_NO_SUBSTITUTE = 769, } #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct USet { +pub struct UFieldPositionIterator { _unused: [u8; 0], } -impl UProperty { - pub const UCHAR_BINARY_START: UProperty = UProperty::UCHAR_ALPHABETIC; -} -impl UProperty { - pub const UCHAR_INT_START: UProperty = UProperty::UCHAR_BIDI_CLASS; -} -impl UProperty { - pub const UCHAR_MASK_START: UProperty = UProperty::UCHAR_GENERAL_CATEGORY_MASK; -} -impl UProperty { - pub const UCHAR_DOUBLE_START: UProperty = UProperty::UCHAR_NUMERIC_VALUE; +pub type UNumberFormat = *mut ::std::os::raw::c_void; +pub type UDateFormat = *mut ::std::os::raw::c_void; +impl UDateFormatStyle { + pub const UDAT_DEFAULT: UDateFormatStyle = UDateFormatStyle::UDAT_MEDIUM; } -impl UProperty { - pub const UCHAR_STRING_START: UProperty = UProperty::UCHAR_AGE; +impl UDateFormatStyle { + pub const UDAT_FULL_RELATIVE: UDateFormatStyle = UDateFormatStyle::UDAT_RELATIVE; } -impl UProperty { - pub const UCHAR_OTHER_PROPERTY_START: UProperty = UProperty::UCHAR_SCRIPT_EXTENSIONS; +impl UDateFormatStyle { + pub const UDAT_IGNORE: UDateFormatStyle = UDateFormatStyle::UDAT_PATTERN; } #[repr(i32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UProperty { - UCHAR_ALPHABETIC = 0, - UCHAR_ASCII_HEX_DIGIT = 1, - UCHAR_BIDI_CONTROL = 2, - UCHAR_BIDI_MIRRORED = 3, - UCHAR_DASH = 4, - UCHAR_DEFAULT_IGNORABLE_CODE_POINT = 5, - UCHAR_DEPRECATED = 6, - UCHAR_DIACRITIC = 7, - UCHAR_EXTENDER = 8, - UCHAR_FULL_COMPOSITION_EXCLUSION = 9, - UCHAR_GRAPHEME_BASE = 10, - UCHAR_GRAPHEME_EXTEND = 11, - UCHAR_GRAPHEME_LINK = 12, - UCHAR_HEX_DIGIT = 13, - UCHAR_HYPHEN = 14, - UCHAR_ID_CONTINUE = 15, - UCHAR_ID_START = 16, - UCHAR_IDEOGRAPHIC = 17, - UCHAR_IDS_BINARY_OPERATOR = 18, - UCHAR_IDS_TRINARY_OPERATOR = 19, - UCHAR_JOIN_CONTROL = 20, - UCHAR_LOGICAL_ORDER_EXCEPTION = 21, - UCHAR_LOWERCASE = 22, - UCHAR_MATH = 23, - UCHAR_NONCHARACTER_CODE_POINT = 24, - UCHAR_QUOTATION_MARK = 25, - UCHAR_RADICAL = 26, - UCHAR_SOFT_DOTTED = 27, - UCHAR_TERMINAL_PUNCTUATION = 28, - UCHAR_UNIFIED_IDEOGRAPH = 29, - UCHAR_UPPERCASE = 30, - UCHAR_WHITE_SPACE = 31, - UCHAR_XID_CONTINUE = 32, - UCHAR_XID_START = 33, - UCHAR_CASE_SENSITIVE = 34, - UCHAR_S_TERM = 35, - UCHAR_VARIATION_SELECTOR = 36, - UCHAR_NFD_INERT = 37, - UCHAR_NFKD_INERT = 38, - UCHAR_NFC_INERT = 39, - UCHAR_NFKC_INERT = 40, - UCHAR_SEGMENT_STARTER = 41, - UCHAR_PATTERN_SYNTAX = 42, - UCHAR_PATTERN_WHITE_SPACE = 43, - UCHAR_POSIX_ALNUM = 44, - UCHAR_POSIX_BLANK = 45, - UCHAR_POSIX_GRAPH = 46, - UCHAR_POSIX_PRINT = 47, - UCHAR_POSIX_XDIGIT = 48, - UCHAR_CASED = 49, - UCHAR_CASE_IGNORABLE = 50, - UCHAR_CHANGES_WHEN_LOWERCASED = 51, - UCHAR_CHANGES_WHEN_UPPERCASED = 52, - UCHAR_CHANGES_WHEN_TITLECASED = 53, - UCHAR_CHANGES_WHEN_CASEFOLDED = 54, - UCHAR_CHANGES_WHEN_CASEMAPPED = 55, - UCHAR_CHANGES_WHEN_NFKC_CASEFOLDED = 56, - UCHAR_EMOJI = 57, - UCHAR_EMOJI_PRESENTATION = 58, - UCHAR_EMOJI_MODIFIER = 59, - UCHAR_EMOJI_MODIFIER_BASE = 60, - UCHAR_EMOJI_COMPONENT = 61, - UCHAR_REGIONAL_INDICATOR = 62, - UCHAR_PREPENDED_CONCATENATION_MARK = 63, - UCHAR_EXTENDED_PICTOGRAPHIC = 64, - UCHAR_BINARY_LIMIT = 65, - UCHAR_BIDI_CLASS = 4096, - UCHAR_BLOCK = 4097, - UCHAR_CANONICAL_COMBINING_CLASS = 4098, - UCHAR_DECOMPOSITION_TYPE = 4099, - UCHAR_EAST_ASIAN_WIDTH = 4100, - UCHAR_GENERAL_CATEGORY = 4101, - UCHAR_JOINING_GROUP = 4102, - UCHAR_JOINING_TYPE = 4103, - UCHAR_LINE_BREAK = 4104, - UCHAR_NUMERIC_TYPE = 4105, - UCHAR_SCRIPT = 4106, - UCHAR_HANGUL_SYLLABLE_TYPE = 4107, - UCHAR_NFD_QUICK_CHECK = 4108, - UCHAR_NFKD_QUICK_CHECK = 4109, - UCHAR_NFC_QUICK_CHECK = 4110, - UCHAR_NFKC_QUICK_CHECK = 4111, - UCHAR_LEAD_CANONICAL_COMBINING_CLASS = 4112, - UCHAR_TRAIL_CANONICAL_COMBINING_CLASS = 4113, - UCHAR_GRAPHEME_CLUSTER_BREAK = 4114, - UCHAR_SENTENCE_BREAK = 4115, - UCHAR_WORD_BREAK = 4116, - UCHAR_BIDI_PAIRED_BRACKET_TYPE = 4117, - UCHAR_INDIC_POSITIONAL_CATEGORY = 4118, - UCHAR_INDIC_SYLLABIC_CATEGORY = 4119, - UCHAR_VERTICAL_ORIENTATION = 4120, - UCHAR_INT_LIMIT = 4121, - UCHAR_GENERAL_CATEGORY_MASK = 8192, - UCHAR_MASK_LIMIT = 8193, - UCHAR_NUMERIC_VALUE = 12288, - UCHAR_DOUBLE_LIMIT = 12289, - UCHAR_AGE = 16384, - UCHAR_BIDI_MIRRORING_GLYPH = 16385, - UCHAR_CASE_FOLDING = 16386, - UCHAR_ISO_COMMENT = 16387, - UCHAR_LOWERCASE_MAPPING = 16388, - UCHAR_NAME = 16389, - UCHAR_SIMPLE_CASE_FOLDING = 16390, - UCHAR_SIMPLE_LOWERCASE_MAPPING = 16391, - UCHAR_SIMPLE_TITLECASE_MAPPING = 16392, - UCHAR_SIMPLE_UPPERCASE_MAPPING = 16393, - UCHAR_TITLECASE_MAPPING = 16394, - UCHAR_UNICODE_1_NAME = 16395, - UCHAR_UPPERCASE_MAPPING = 16396, - UCHAR_BIDI_PAIRED_BRACKET = 16397, - UCHAR_STRING_LIMIT = 16398, - UCHAR_SCRIPT_EXTENSIONS = 28672, - UCHAR_OTHER_PROPERTY_LIMIT = 28673, - UCHAR_INVALID_CODE = -1, -} -impl UCharCategory { - pub const U_GENERAL_OTHER_TYPES: UCharCategory = UCharCategory::U_UNASSIGNED; +pub enum UDateFormatStyle { + UDAT_FULL = 0, + UDAT_LONG = 1, + UDAT_MEDIUM = 2, + UDAT_SHORT = 3, + UDAT_RELATIVE = 128, + UDAT_LONG_RELATIVE = 129, + UDAT_MEDIUM_RELATIVE = 130, + UDAT_SHORT_RELATIVE = 131, + UDAT_NONE = -1, + UDAT_PATTERN = -2, } #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UCharCategory { - U_UNASSIGNED = 0, - U_UPPERCASE_LETTER = 1, - U_LOWERCASE_LETTER = 2, - U_TITLECASE_LETTER = 3, - U_MODIFIER_LETTER = 4, - U_OTHER_LETTER = 5, - U_NON_SPACING_MARK = 6, - U_ENCLOSING_MARK = 7, - U_COMBINING_SPACING_MARK = 8, - U_DECIMAL_DIGIT_NUMBER = 9, - U_LETTER_NUMBER = 10, - U_OTHER_NUMBER = 11, - U_SPACE_SEPARATOR = 12, - U_LINE_SEPARATOR = 13, - U_PARAGRAPH_SEPARATOR = 14, - U_CONTROL_CHAR = 15, - U_FORMAT_CHAR = 16, - U_PRIVATE_USE_CHAR = 17, - U_SURROGATE = 18, - U_DASH_PUNCTUATION = 19, - U_START_PUNCTUATION = 20, - U_END_PUNCTUATION = 21, - U_CONNECTOR_PUNCTUATION = 22, - U_OTHER_PUNCTUATION = 23, - U_MATH_SYMBOL = 24, - U_CURRENCY_SYMBOL = 25, - U_MODIFIER_SYMBOL = 26, - U_OTHER_SYMBOL = 27, - U_INITIAL_PUNCTUATION = 28, - U_FINAL_PUNCTUATION = 29, - U_CHAR_CATEGORY_COUNT = 30, +pub enum UDateFormatField { + UDAT_ERA_FIELD = 0, + UDAT_YEAR_FIELD = 1, + UDAT_MONTH_FIELD = 2, + UDAT_DATE_FIELD = 3, + UDAT_HOUR_OF_DAY1_FIELD = 4, + UDAT_HOUR_OF_DAY0_FIELD = 5, + UDAT_MINUTE_FIELD = 6, + UDAT_SECOND_FIELD = 7, + UDAT_FRACTIONAL_SECOND_FIELD = 8, + UDAT_DAY_OF_WEEK_FIELD = 9, + UDAT_DAY_OF_YEAR_FIELD = 10, + UDAT_DAY_OF_WEEK_IN_MONTH_FIELD = 11, + UDAT_WEEK_OF_YEAR_FIELD = 12, + UDAT_WEEK_OF_MONTH_FIELD = 13, + UDAT_AM_PM_FIELD = 14, + UDAT_HOUR1_FIELD = 15, + UDAT_HOUR0_FIELD = 16, + UDAT_TIMEZONE_FIELD = 17, + UDAT_YEAR_WOY_FIELD = 18, + UDAT_DOW_LOCAL_FIELD = 19, + UDAT_EXTENDED_YEAR_FIELD = 20, + UDAT_JULIAN_DAY_FIELD = 21, + UDAT_MILLISECONDS_IN_DAY_FIELD = 22, + UDAT_TIMEZONE_RFC_FIELD = 23, + UDAT_TIMEZONE_GENERIC_FIELD = 24, + UDAT_STANDALONE_DAY_FIELD = 25, + UDAT_STANDALONE_MONTH_FIELD = 26, + UDAT_QUARTER_FIELD = 27, + UDAT_STANDALONE_QUARTER_FIELD = 28, + UDAT_TIMEZONE_SPECIAL_FIELD = 29, + UDAT_YEAR_NAME_FIELD = 30, + UDAT_TIMEZONE_LOCALIZED_GMT_OFFSET_FIELD = 31, + UDAT_TIMEZONE_ISO_FIELD = 32, + UDAT_TIMEZONE_ISO_LOCAL_FIELD = 33, + UDAT_RELATED_YEAR_FIELD = 34, + UDAT_AM_PM_MIDNIGHT_NOON_FIELD = 35, + UDAT_FLEXIBLE_DAY_PERIOD_FIELD = 36, + UDAT_TIME_SEPARATOR_FIELD = 37, + UDAT_FIELD_COUNT = 38, +} +extern "C" { + pub fn udat_toCalendarDateField_65(field: UDateFormatField) -> UCalendarDateFields; +} +extern "C" { + pub fn udat_open_65( + timeStyle: UDateFormatStyle, + dateStyle: UDateFormatStyle, + locale: *const ::std::os::raw::c_char, + tzID: *const UChar, + tzIDLength: i32, + pattern: *const UChar, + patternLength: i32, + status: *mut UErrorCode, + ) -> *mut UDateFormat; +} +extern "C" { + pub fn udat_close_65(format: *mut UDateFormat); } #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UCharDirection { - U_LEFT_TO_RIGHT = 0, - U_RIGHT_TO_LEFT = 1, - U_EUROPEAN_NUMBER = 2, - U_EUROPEAN_NUMBER_SEPARATOR = 3, - U_EUROPEAN_NUMBER_TERMINATOR = 4, - U_ARABIC_NUMBER = 5, - U_COMMON_NUMBER_SEPARATOR = 6, - U_BLOCK_SEPARATOR = 7, - U_SEGMENT_SEPARATOR = 8, - U_WHITE_SPACE_NEUTRAL = 9, - U_OTHER_NEUTRAL = 10, - U_LEFT_TO_RIGHT_EMBEDDING = 11, - U_LEFT_TO_RIGHT_OVERRIDE = 12, - U_RIGHT_TO_LEFT_ARABIC = 13, - U_RIGHT_TO_LEFT_EMBEDDING = 14, - U_RIGHT_TO_LEFT_OVERRIDE = 15, - U_POP_DIRECTIONAL_FORMAT = 16, - U_DIR_NON_SPACING_MARK = 17, - U_BOUNDARY_NEUTRAL = 18, - U_FIRST_STRONG_ISOLATE = 19, - U_LEFT_TO_RIGHT_ISOLATE = 20, - U_RIGHT_TO_LEFT_ISOLATE = 21, - U_POP_DIRECTIONAL_ISOLATE = 22, - U_CHAR_DIRECTION_COUNT = 23, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UCharNameChoice { - U_UNICODE_CHAR_NAME = 0, - U_UNICODE_10_CHAR_NAME = 1, - U_EXTENDED_CHAR_NAME = 2, - U_CHAR_NAME_ALIAS = 3, - U_CHAR_NAME_CHOICE_COUNT = 4, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UPropertyNameChoice { - U_SHORT_PROPERTY_NAME = 0, - U_LONG_PROPERTY_NAME = 1, - U_PROPERTY_NAME_CHOICE_COUNT = 2, +pub enum UDateFormatBooleanAttribute { + UDAT_PARSE_ALLOW_WHITESPACE = 0, + UDAT_PARSE_ALLOW_NUMERIC = 1, + UDAT_PARSE_PARTIAL_LITERAL_MATCH = 2, + UDAT_PARSE_MULTIPLE_PATTERNS_FOR_MATCH = 3, + UDAT_BOOLEAN_ATTRIBUTE_COUNT = 4, } extern "C" { - pub fn u_hasBinaryProperty_65(c: UChar32, which: UProperty) -> UBool; + pub fn udat_getBooleanAttribute_65( + fmt: *const UDateFormat, + attr: UDateFormatBooleanAttribute, + status: *mut UErrorCode, + ) -> UBool; } extern "C" { - pub fn u_getBinaryPropertySet_65( - property: UProperty, - pErrorCode: *mut UErrorCode, - ) -> *const USet; + pub fn udat_setBooleanAttribute_65( + fmt: *mut UDateFormat, + attr: UDateFormatBooleanAttribute, + newValue: UBool, + status: *mut UErrorCode, + ); } extern "C" { - pub fn u_isUAlphabetic_65(c: UChar32) -> UBool; + pub fn udat_clone_65(fmt: *const UDateFormat, status: *mut UErrorCode) -> *mut UDateFormat; } extern "C" { - pub fn u_isULowercase_65(c: UChar32) -> UBool; + pub fn udat_format_65( + format: *const UDateFormat, + dateToFormat: UDate, + result: *mut UChar, + resultLength: i32, + position: *mut UFieldPosition, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_isUUppercase_65(c: UChar32) -> UBool; + pub fn udat_formatCalendar_65( + format: *const UDateFormat, + calendar: *mut UCalendar, + result: *mut UChar, + capacity: i32, + position: *mut UFieldPosition, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_isUWhiteSpace_65(c: UChar32) -> UBool; + pub fn udat_formatForFields_65( + format: *const UDateFormat, + dateToFormat: UDate, + result: *mut UChar, + resultLength: i32, + fpositer: *mut UFieldPositionIterator, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_getIntPropertyValue_65(c: UChar32, which: UProperty) -> i32; + pub fn udat_formatCalendarForFields_65( + format: *const UDateFormat, + calendar: *mut UCalendar, + result: *mut UChar, + capacity: i32, + fpositer: *mut UFieldPositionIterator, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_getIntPropertyMinValue_65(which: UProperty) -> i32; + pub fn udat_parse_65( + format: *const UDateFormat, + text: *const UChar, + textLength: i32, + parsePos: *mut i32, + status: *mut UErrorCode, + ) -> UDate; } extern "C" { - pub fn u_getIntPropertyMaxValue_65(which: UProperty) -> i32; + pub fn udat_parseCalendar_65( + format: *const UDateFormat, + calendar: *mut UCalendar, + text: *const UChar, + textLength: i32, + parsePos: *mut i32, + status: *mut UErrorCode, + ); } extern "C" { - pub fn u_getIntPropertyMap_65( - property: UProperty, - pErrorCode: *mut UErrorCode, - ) -> *const UCPMap; + pub fn udat_isLenient_65(fmt: *const UDateFormat) -> UBool; } extern "C" { - pub fn u_getNumericValue_65(c: UChar32) -> f64; + pub fn udat_setLenient_65(fmt: *mut UDateFormat, isLenient: UBool); } extern "C" { - pub fn u_islower_65(c: UChar32) -> UBool; + pub fn udat_getCalendar_65(fmt: *const UDateFormat) -> *const UCalendar; } extern "C" { - pub fn u_isupper_65(c: UChar32) -> UBool; + pub fn udat_setCalendar_65(fmt: *mut UDateFormat, calendarToSet: *const UCalendar); } extern "C" { - pub fn u_istitle_65(c: UChar32) -> UBool; + pub fn udat_getNumberFormat_65(fmt: *const UDateFormat) -> *const UNumberFormat; } extern "C" { - pub fn u_isdigit_65(c: UChar32) -> UBool; + pub fn udat_getNumberFormatForField_65( + fmt: *const UDateFormat, + field: UChar, + ) -> *const UNumberFormat; } extern "C" { - pub fn u_isalpha_65(c: UChar32) -> UBool; + pub fn udat_adoptNumberFormatForFields_65( + fmt: *mut UDateFormat, + fields: *const UChar, + numberFormatToSet: *mut UNumberFormat, + status: *mut UErrorCode, + ); } extern "C" { - pub fn u_isalnum_65(c: UChar32) -> UBool; + pub fn udat_setNumberFormat_65(fmt: *mut UDateFormat, numberFormatToSet: *const UNumberFormat); } extern "C" { - pub fn u_isxdigit_65(c: UChar32) -> UBool; + pub fn udat_adoptNumberFormat_65( + fmt: *mut UDateFormat, + numberFormatToAdopt: *mut UNumberFormat, + ); } extern "C" { - pub fn u_ispunct_65(c: UChar32) -> UBool; + pub fn udat_getAvailable_65(localeIndex: i32) -> *const ::std::os::raw::c_char; } extern "C" { - pub fn u_isgraph_65(c: UChar32) -> UBool; + pub fn udat_countAvailable_65() -> i32; } extern "C" { - pub fn u_isblank_65(c: UChar32) -> UBool; + pub fn udat_get2DigitYearStart_65(fmt: *const UDateFormat, status: *mut UErrorCode) -> UDate; } extern "C" { - pub fn u_isdefined_65(c: UChar32) -> UBool; + pub fn udat_set2DigitYearStart_65(fmt: *mut UDateFormat, d: UDate, status: *mut UErrorCode); } extern "C" { - pub fn u_isspace_65(c: UChar32) -> UBool; + pub fn udat_toPattern_65( + fmt: *const UDateFormat, + localized: UBool, + result: *mut UChar, + resultLength: i32, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_isJavaSpaceChar_65(c: UChar32) -> UBool; + pub fn udat_applyPattern_65( + format: *mut UDateFormat, + localized: UBool, + pattern: *const UChar, + patternLength: i32, + ); } -extern "C" { - pub fn u_isWhitespace_65(c: UChar32) -> UBool; +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] +pub enum UDateFormatSymbolType { + UDAT_ERAS = 0, + UDAT_MONTHS = 1, + UDAT_SHORT_MONTHS = 2, + UDAT_WEEKDAYS = 3, + UDAT_SHORT_WEEKDAYS = 4, + UDAT_AM_PMS = 5, + UDAT_LOCALIZED_CHARS = 6, + UDAT_ERA_NAMES = 7, + UDAT_NARROW_MONTHS = 8, + UDAT_NARROW_WEEKDAYS = 9, + UDAT_STANDALONE_MONTHS = 10, + UDAT_STANDALONE_SHORT_MONTHS = 11, + UDAT_STANDALONE_NARROW_MONTHS = 12, + UDAT_STANDALONE_WEEKDAYS = 13, + UDAT_STANDALONE_SHORT_WEEKDAYS = 14, + UDAT_STANDALONE_NARROW_WEEKDAYS = 15, + UDAT_QUARTERS = 16, + UDAT_SHORT_QUARTERS = 17, + UDAT_STANDALONE_QUARTERS = 18, + UDAT_STANDALONE_SHORT_QUARTERS = 19, + UDAT_SHORTER_WEEKDAYS = 20, + UDAT_STANDALONE_SHORTER_WEEKDAYS = 21, + UDAT_CYCLIC_YEARS_WIDE = 22, + UDAT_CYCLIC_YEARS_ABBREVIATED = 23, + UDAT_CYCLIC_YEARS_NARROW = 24, + UDAT_ZODIAC_NAMES_WIDE = 25, + UDAT_ZODIAC_NAMES_ABBREVIATED = 26, + UDAT_ZODIAC_NAMES_NARROW = 27, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct UDateFormatSymbols { + _unused: [u8; 0], } extern "C" { - pub fn u_iscntrl_65(c: UChar32) -> UBool; + pub fn udat_getSymbols_65( + fmt: *const UDateFormat, + type_: UDateFormatSymbolType, + symbolIndex: i32, + result: *mut UChar, + resultLength: i32, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_isISOControl_65(c: UChar32) -> UBool; + pub fn udat_countSymbols_65(fmt: *const UDateFormat, type_: UDateFormatSymbolType) -> i32; } extern "C" { - pub fn u_isprint_65(c: UChar32) -> UBool; + pub fn udat_setSymbols_65( + format: *mut UDateFormat, + type_: UDateFormatSymbolType, + symbolIndex: i32, + value: *mut UChar, + valueLength: i32, + status: *mut UErrorCode, + ); } extern "C" { - pub fn u_isbase_65(c: UChar32) -> UBool; + pub fn udat_getLocaleByType_65( + fmt: *const UDateFormat, + type_: ULocDataLocaleType, + status: *mut UErrorCode, + ) -> *const ::std::os::raw::c_char; } extern "C" { - pub fn u_charDirection_65(c: UChar32) -> UCharDirection; + pub fn udat_setContext_65( + fmt: *mut UDateFormat, + value: UDisplayContext, + status: *mut UErrorCode, + ); } extern "C" { - pub fn u_isMirrored_65(c: UChar32) -> UBool; + pub fn udat_getContext_65( + fmt: *const UDateFormat, + type_: UDisplayContextType, + status: *mut UErrorCode, + ) -> UDisplayContext; } extern "C" { - pub fn u_charMirror_65(c: UChar32) -> UChar32; + pub fn udat_toPatternRelativeDate_65( + fmt: *const UDateFormat, + result: *mut UChar, + resultLength: i32, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_getBidiPairedBracket_65(c: UChar32) -> UChar32; + pub fn udat_toPatternRelativeTime_65( + fmt: *const UDateFormat, + result: *mut UChar, + resultLength: i32, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_charType_65(c: UChar32) -> i8; + pub fn udat_applyPatternRelative_65( + format: *mut UDateFormat, + datePattern: *const UChar, + datePatternLength: i32, + timePattern: *const UChar, + timePatternLength: i32, + status: *mut UErrorCode, + ); } -pub type UCharEnumTypeRange = ::std::option::Option< +pub type UDateFormatOpener = ::std::option::Option< unsafe extern "C" fn( - context: *const ::std::os::raw::c_void, - start: UChar32, - limit: UChar32, - type_: UCharCategory, - ) -> UBool, + timeStyle: UDateFormatStyle, + dateStyle: UDateFormatStyle, + locale: *const ::std::os::raw::c_char, + tzID: *const UChar, + tzIDLength: i32, + pattern: *const UChar, + patternLength: i32, + status: *mut UErrorCode, + ) -> *mut UDateFormat, >; extern "C" { - pub fn u_enumCharTypes_65( - enumRange: UCharEnumTypeRange, - context: *const ::std::os::raw::c_void, - ); -} -extern "C" { - pub fn u_getCombiningClass_65(c: UChar32) -> u8; + pub fn udat_registerOpener_65(opener: UDateFormatOpener, status: *mut UErrorCode); } extern "C" { - pub fn u_charDigitValue_65(c: UChar32) -> i32; + pub fn udat_unregisterOpener_65( + opener: UDateFormatOpener, + status: *mut UErrorCode, + ) -> UDateFormatOpener; } -extern "C" { - pub fn u_charName_65( - code: UChar32, - nameChoice: UCharNameChoice, - buffer: *mut ::std::os::raw::c_char, - bufferLength: i32, - pErrorCode: *mut UErrorCode, - ) -> i32; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, PartialEq)] +pub struct UDataInfo { + pub size: u16, + pub reservedWord: u16, + pub isBigEndian: u8, + pub charsetFamily: u8, + pub sizeofUChar: u8, + pub reservedByte: u8, + pub dataFormat: [u8; 4usize], + pub formatVersion: [u8; 4usize], + pub dataVersion: [u8; 4usize], } -extern "C" { - pub fn u_getISOComment_65( - c: UChar32, - dest: *mut ::std::os::raw::c_char, - destCapacity: i32, - pErrorCode: *mut UErrorCode, - ) -> i32; +#[test] +fn bindgen_test_layout_UDataInfo() { + assert_eq!( + ::std::mem::size_of::(), + 20usize, + concat!("Size of: ", stringify!(UDataInfo)) + ); + assert_eq!( + ::std::mem::align_of::(), + 2usize, + concat!("Alignment of ", stringify!(UDataInfo)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).size as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(UDataInfo), + "::", + stringify!(size) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).reservedWord as *const _ as usize }, + 2usize, + concat!( + "Offset of field: ", + stringify!(UDataInfo), + "::", + stringify!(reservedWord) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).isBigEndian as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(UDataInfo), + "::", + stringify!(isBigEndian) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).charsetFamily as *const _ as usize }, + 5usize, + concat!( + "Offset of field: ", + stringify!(UDataInfo), + "::", + stringify!(charsetFamily) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).sizeofUChar as *const _ as usize }, + 6usize, + concat!( + "Offset of field: ", + stringify!(UDataInfo), + "::", + stringify!(sizeofUChar) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).reservedByte as *const _ as usize }, + 7usize, + concat!( + "Offset of field: ", + stringify!(UDataInfo), + "::", + stringify!(reservedByte) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).dataFormat as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(UDataInfo), + "::", + stringify!(dataFormat) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).formatVersion as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(UDataInfo), + "::", + stringify!(formatVersion) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).dataVersion as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(UDataInfo), + "::", + stringify!(dataVersion) + ) + ); } -extern "C" { - pub fn u_charFromName_65( - nameChoice: UCharNameChoice, - name: *const ::std::os::raw::c_char, - pErrorCode: *mut UErrorCode, - ) -> UChar32; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct UDataMemory { + _unused: [u8; 0], } -pub type UEnumCharNamesFn = ::std::option::Option< +pub type UDataMemoryIsAcceptable = ::std::option::Option< unsafe extern "C" fn( context: *mut ::std::os::raw::c_void, - code: UChar32, - nameChoice: UCharNameChoice, + type_: *const ::std::os::raw::c_char, name: *const ::std::os::raw::c_char, - length: i32, + pInfo: *const UDataInfo, ) -> UBool, >; extern "C" { - pub fn u_enumCharNames_65( - start: UChar32, - limit: UChar32, - fn_: UEnumCharNamesFn, - context: *mut ::std::os::raw::c_void, - nameChoice: UCharNameChoice, + pub fn udata_open_65( + path: *const ::std::os::raw::c_char, + type_: *const ::std::os::raw::c_char, + name: *const ::std::os::raw::c_char, pErrorCode: *mut UErrorCode, - ); + ) -> *mut UDataMemory; } extern "C" { - pub fn u_getPropertyName_65( - property: UProperty, - nameChoice: UPropertyNameChoice, - ) -> *const ::std::os::raw::c_char; + pub fn udata_openChoice_65( + path: *const ::std::os::raw::c_char, + type_: *const ::std::os::raw::c_char, + name: *const ::std::os::raw::c_char, + isAcceptable: UDataMemoryIsAcceptable, + context: *mut ::std::os::raw::c_void, + pErrorCode: *mut UErrorCode, + ) -> *mut UDataMemory; } extern "C" { - pub fn u_getPropertyEnum_65(alias: *const ::std::os::raw::c_char) -> UProperty; + pub fn udata_close_65(pData: *mut UDataMemory); } extern "C" { - pub fn u_getPropertyValueName_65( - property: UProperty, - value: i32, - nameChoice: UPropertyNameChoice, - ) -> *const ::std::os::raw::c_char; + pub fn udata_getMemory_65(pData: *mut UDataMemory) -> *const ::std::os::raw::c_void; } extern "C" { - pub fn u_getPropertyValueEnum_65( - property: UProperty, - alias: *const ::std::os::raw::c_char, - ) -> i32; + pub fn udata_getInfo_65(pData: *mut UDataMemory, pInfo: *mut UDataInfo); } extern "C" { - pub fn u_isIDStart_65(c: UChar32) -> UBool; + pub fn udata_setCommonData_65(data: *const ::std::os::raw::c_void, err: *mut UErrorCode); } extern "C" { - pub fn u_isIDPart_65(c: UChar32) -> UBool; + pub fn udata_setAppData_65( + packageName: *const ::std::os::raw::c_char, + data: *const ::std::os::raw::c_void, + err: *mut UErrorCode, + ); } -extern "C" { - pub fn u_isIDIgnorable_65(c: UChar32) -> UBool; +impl UDataFileAccess { + pub const UDATA_DEFAULT_ACCESS: UDataFileAccess = UDataFileAccess::UDATA_FILES_FIRST; +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] +pub enum UDataFileAccess { + UDATA_FILES_FIRST = 0, + UDATA_ONLY_PACKAGES = 1, + UDATA_PACKAGES_FIRST = 2, + UDATA_NO_FILES = 3, + UDATA_FILE_ACCESS_COUNT = 4, } extern "C" { - pub fn u_isJavaIDStart_65(c: UChar32) -> UBool; + pub fn udata_setFileAccess_65(access: UDataFileAccess, status: *mut UErrorCode); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct UFormattedValue { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct UListFormatter { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct UFormattedList { + _unused: [u8; 0], +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] +pub enum UListFormatterField { + ULISTFMT_LITERAL_FIELD = 0, + ULISTFMT_ELEMENT_FIELD = 1, } extern "C" { - pub fn u_isJavaIDPart_65(c: UChar32) -> UBool; + pub fn ulistfmt_open_65( + locale: *const ::std::os::raw::c_char, + status: *mut UErrorCode, + ) -> *mut UListFormatter; } extern "C" { - pub fn u_tolower_65(c: UChar32) -> UChar32; + pub fn ulistfmt_close_65(listfmt: *mut UListFormatter); } extern "C" { - pub fn u_toupper_65(c: UChar32) -> UChar32; + pub fn ulistfmt_openResult_65(ec: *mut UErrorCode) -> *mut UFormattedList; } extern "C" { - pub fn u_totitle_65(c: UChar32) -> UChar32; + pub fn ulistfmt_resultAsValue_65( + uresult: *const UFormattedList, + ec: *mut UErrorCode, + ) -> *const UFormattedValue; } extern "C" { - pub fn u_foldCase_65(c: UChar32, options: u32) -> UChar32; + pub fn ulistfmt_closeResult_65(uresult: *mut UFormattedList); } extern "C" { - pub fn u_digit_65(ch: UChar32, radix: i8) -> i32; -} -extern "C" { - pub fn u_forDigit_65(digit: i32, radix: i8) -> UChar32; + pub fn ulistfmt_format_65( + listfmt: *const UListFormatter, + strings: *const *const UChar, + stringLengths: *const i32, + stringCount: i32, + result: *mut UChar, + resultCapacity: i32, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_charAge_65(c: UChar32, versionArray: *mut u8); + pub fn ulistfmt_formatStringsToResult_65( + listfmt: *const UListFormatter, + strings: *const *const UChar, + stringLengths: *const i32, + stringCount: i32, + uresult: *mut UFormattedList, + status: *mut UErrorCode, + ); } +pub type va_list = __builtin_va_list; extern "C" { - pub fn u_getUnicodeVersion_65(versionArray: *mut u8); + pub fn u_formatMessage_65( + locale: *const ::std::os::raw::c_char, + pattern: *const UChar, + patternLength: i32, + result: *mut UChar, + resultLength: i32, + status: *mut UErrorCode, + ... + ) -> i32; } extern "C" { - pub fn u_getFC_NFKC_Closure_65( - c: UChar32, - dest: *mut UChar, - destCapacity: i32, - pErrorCode: *mut UErrorCode, + pub fn u_vformatMessage_65( + locale: *const ::std::os::raw::c_char, + pattern: *const UChar, + patternLength: i32, + result: *mut UChar, + resultLength: i32, + ap: *mut __va_list_tag, + status: *mut UErrorCode, ) -> i32; } extern "C" { - pub fn utext_close_65(ut: *mut UText) -> *mut UText; + pub fn u_parseMessage_65( + locale: *const ::std::os::raw::c_char, + pattern: *const UChar, + patternLength: i32, + source: *const UChar, + sourceLength: i32, + status: *mut UErrorCode, + ... + ); } extern "C" { - pub fn utext_openUTF8_65( - ut: *mut UText, - s: *const ::std::os::raw::c_char, - length: i64, + pub fn u_vparseMessage_65( + locale: *const ::std::os::raw::c_char, + pattern: *const UChar, + patternLength: i32, + source: *const UChar, + sourceLength: i32, + ap: *mut __va_list_tag, status: *mut UErrorCode, - ) -> *mut UText; + ); } extern "C" { - pub fn utext_openUChars_65( - ut: *mut UText, - s: *const UChar, - length: i64, + pub fn u_formatMessageWithError_65( + locale: *const ::std::os::raw::c_char, + pattern: *const UChar, + patternLength: i32, + result: *mut UChar, + resultLength: i32, + parseError: *mut UParseError, status: *mut UErrorCode, - ) -> *mut UText; + ... + ) -> i32; } extern "C" { - pub fn utext_clone_65( - dest: *mut UText, - src: *const UText, - deep: UBool, - readOnly: UBool, + pub fn u_vformatMessageWithError_65( + locale: *const ::std::os::raw::c_char, + pattern: *const UChar, + patternLength: i32, + result: *mut UChar, + resultLength: i32, + parseError: *mut UParseError, + ap: *mut __va_list_tag, status: *mut UErrorCode, - ) -> *mut UText; + ) -> i32; } extern "C" { - pub fn utext_equals_65(a: *const UText, b: *const UText) -> UBool; + pub fn u_parseMessageWithError_65( + locale: *const ::std::os::raw::c_char, + pattern: *const UChar, + patternLength: i32, + source: *const UChar, + sourceLength: i32, + parseError: *mut UParseError, + status: *mut UErrorCode, + ... + ); } extern "C" { - pub fn utext_nativeLength_65(ut: *mut UText) -> i64; + pub fn u_vparseMessageWithError_65( + locale: *const ::std::os::raw::c_char, + pattern: *const UChar, + patternLength: i32, + source: *const UChar, + sourceLength: i32, + ap: *mut __va_list_tag, + parseError: *mut UParseError, + status: *mut UErrorCode, + ); } +pub type UMessageFormat = *mut ::std::os::raw::c_void; extern "C" { - pub fn utext_isLengthExpensive_65(ut: *const UText) -> UBool; + pub fn umsg_open_65( + pattern: *const UChar, + patternLength: i32, + locale: *const ::std::os::raw::c_char, + parseError: *mut UParseError, + status: *mut UErrorCode, + ) -> *mut UMessageFormat; } extern "C" { - pub fn utext_char32At_65(ut: *mut UText, nativeIndex: i64) -> UChar32; + pub fn umsg_close_65(format: *mut UMessageFormat); } extern "C" { - pub fn utext_current32_65(ut: *mut UText) -> UChar32; + pub fn umsg_clone_65(fmt: *const UMessageFormat, status: *mut UErrorCode) -> UMessageFormat; } extern "C" { - pub fn utext_next32_65(ut: *mut UText) -> UChar32; + pub fn umsg_setLocale_65(fmt: *mut UMessageFormat, locale: *const ::std::os::raw::c_char); } extern "C" { - pub fn utext_previous32_65(ut: *mut UText) -> UChar32; + pub fn umsg_getLocale_65(fmt: *const UMessageFormat) -> *const ::std::os::raw::c_char; } extern "C" { - pub fn utext_next32From_65(ut: *mut UText, nativeIndex: i64) -> UChar32; + pub fn umsg_applyPattern_65( + fmt: *mut UMessageFormat, + pattern: *const UChar, + patternLength: i32, + parseError: *mut UParseError, + status: *mut UErrorCode, + ); } extern "C" { - pub fn utext_previous32From_65(ut: *mut UText, nativeIndex: i64) -> UChar32; + pub fn umsg_toPattern_65( + fmt: *const UMessageFormat, + result: *mut UChar, + resultLength: i32, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn utext_getNativeIndex_65(ut: *const UText) -> i64; + pub fn umsg_format_65( + fmt: *const UMessageFormat, + result: *mut UChar, + resultLength: i32, + status: *mut UErrorCode, + ... + ) -> i32; } extern "C" { - pub fn utext_setNativeIndex_65(ut: *mut UText, nativeIndex: i64); + pub fn umsg_vformat_65( + fmt: *const UMessageFormat, + result: *mut UChar, + resultLength: i32, + ap: *mut __va_list_tag, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn utext_moveIndex32_65(ut: *mut UText, delta: i32) -> UBool; + pub fn umsg_parse_65( + fmt: *const UMessageFormat, + source: *const UChar, + sourceLength: i32, + count: *mut i32, + status: *mut UErrorCode, + ... + ); } extern "C" { - pub fn utext_getPreviousNativeIndex_65(ut: *mut UText) -> i64; + pub fn umsg_vparse_65( + fmt: *const UMessageFormat, + source: *const UChar, + sourceLength: i32, + count: *mut i32, + ap: *mut __va_list_tag, + status: *mut UErrorCode, + ); } extern "C" { - pub fn utext_extract_65( - ut: *mut UText, - nativeStart: i64, - nativeLimit: i64, + pub fn umsg_autoQuoteApostrophe_65( + pattern: *const UChar, + patternLength: i32, dest: *mut UChar, destCapacity: i32, - status: *mut UErrorCode, + ec: *mut UErrorCode, ) -> i32; } extern "C" { - pub fn utext_isWritable_65(ut: *const UText) -> UBool; + pub fn u_getDataDirectory_65() -> *const ::std::os::raw::c_char; } extern "C" { - pub fn utext_hasMetaData_65(ut: *const UText) -> UBool; + pub fn u_setDataDirectory_65(directory: *const ::std::os::raw::c_char); } extern "C" { - pub fn utext_replace_65( - ut: *mut UText, - nativeStart: i64, - nativeLimit: i64, - replacementText: *const UChar, - replacementLength: i32, - status: *mut UErrorCode, - ) -> i32; + pub fn u_getTimeZoneFilesDirectory_65(status: *mut UErrorCode) + -> *const ::std::os::raw::c_char; } extern "C" { - pub fn utext_copy_65( - ut: *mut UText, - nativeStart: i64, - nativeLimit: i64, - destIndex: i64, - move_: UBool, + pub fn u_setTimeZoneFilesDirectory_65( + path: *const ::std::os::raw::c_char, status: *mut UErrorCode, ); } extern "C" { - pub fn utext_freeze_65(ut: *mut UText); + pub fn u_charsToUChars_65(cs: *const ::std::os::raw::c_char, us: *mut UChar, length: i32); +} +extern "C" { + pub fn u_UCharsToChars_65(us: *const UChar, cs: *mut ::std::os::raw::c_char, length: i32); } -pub type UTextClone = ::std::option::Option< - unsafe extern "C" fn( - dest: *mut UText, - src: *const UText, - deep: UBool, - status: *mut UErrorCode, - ) -> *mut UText, ->; -pub type UTextNativeLength = ::std::option::Option i64>; -pub type UTextAccess = ::std::option::Option< - unsafe extern "C" fn(ut: *mut UText, nativeIndex: i64, forward: UBool) -> UBool, ->; -pub type UTextExtract = ::std::option::Option< - unsafe extern "C" fn( - ut: *mut UText, - nativeStart: i64, - nativeLimit: i64, - dest: *mut UChar, - destCapacity: i32, - status: *mut UErrorCode, - ) -> i32, ->; -pub type UTextReplace = ::std::option::Option< - unsafe extern "C" fn( - ut: *mut UText, - nativeStart: i64, - nativeLimit: i64, - replacementText: *const UChar, - replacmentLength: i32, - status: *mut UErrorCode, - ) -> i32, ->; -pub type UTextCopy = ::std::option::Option< - unsafe extern "C" fn( - ut: *mut UText, - nativeStart: i64, - nativeLimit: i64, - nativeDest: i64, - move_: UBool, - status: *mut UErrorCode, - ), ->; -pub type UTextMapOffsetToNative = - ::std::option::Option i64>; -pub type UTextMapNativeIndexToUTF16 = - ::std::option::Option i32>; -pub type UTextClose = ::std::option::Option; #[repr(C)] -#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, PartialEq)] -pub struct UTextFuncs { - pub tableSize: i32, - pub reserved1: i32, - pub reserved2: i32, - pub reserved3: i32, - pub clone: UTextClone, - pub nativeLength: UTextNativeLength, - pub access: UTextAccess, - pub extract: UTextExtract, - pub replace: UTextReplace, - pub copy: UTextCopy, - pub mapOffsetToNative: UTextMapOffsetToNative, - pub mapNativeIndexToUTF16: UTextMapNativeIndexToUTF16, - pub close: UTextClose, - pub spare1: UTextClose, - pub spare2: UTextClose, - pub spare3: UTextClose, +#[derive(Debug, Copy, Clone)] +pub struct UBreakIterator { + _unused: [u8; 0], } -#[test] -fn bindgen_test_layout_UTextFuncs() { - assert_eq!( - ::std::mem::size_of::(), - 112usize, - concat!("Size of: ", stringify!(UTextFuncs)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(UTextFuncs)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).tableSize as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(UTextFuncs), - "::", - stringify!(tableSize) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).reserved1 as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(UTextFuncs), - "::", - stringify!(reserved1) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).reserved2 as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(UTextFuncs), - "::", - stringify!(reserved2) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).reserved3 as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(UTextFuncs), - "::", - stringify!(reserved3) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).clone as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(UTextFuncs), - "::", - stringify!(clone) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).nativeLength as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(UTextFuncs), - "::", - stringify!(nativeLength) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).access as *const _ as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(UTextFuncs), - "::", - stringify!(access) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).extract as *const _ as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(UTextFuncs), - "::", - stringify!(extract) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).replace as *const _ as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(UTextFuncs), - "::", - stringify!(replace) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).copy as *const _ as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(UTextFuncs), - "::", - stringify!(copy) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).mapOffsetToNative as *const _ as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(UTextFuncs), - "::", - stringify!(mapOffsetToNative) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).mapNativeIndexToUTF16 as *const _ as usize - }, - 72usize, - concat!( - "Offset of field: ", - stringify!(UTextFuncs), - "::", - stringify!(mapNativeIndexToUTF16) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).close as *const _ as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(UTextFuncs), - "::", - stringify!(close) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).spare1 as *const _ as usize }, - 88usize, - concat!( - "Offset of field: ", - stringify!(UTextFuncs), - "::", - stringify!(spare1) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).spare2 as *const _ as usize }, - 96usize, - concat!( - "Offset of field: ", - stringify!(UTextFuncs), - "::", - stringify!(spare2) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).spare3 as *const _ as usize }, - 104usize, - concat!( - "Offset of field: ", - stringify!(UTextFuncs), - "::", - stringify!(spare3) - ) - ); +extern "C" { + pub fn u_strlen_65(s: *const UChar) -> i32; } -#[repr(C)] -#[derive(Debug, Copy, Clone, Hash, PartialOrd, PartialEq)] -pub struct UText { - pub magic: u32, - pub flags: i32, - pub providerProperties: i32, - pub sizeOfStruct: i32, - pub chunkNativeLimit: i64, - pub extraSize: i32, - pub nativeIndexingLimit: i32, - pub chunkNativeStart: i64, - pub chunkOffset: i32, - pub chunkLength: i32, - pub chunkContents: *const UChar, - pub pFuncs: *const UTextFuncs, - pub pExtra: *mut ::std::os::raw::c_void, - pub context: *const ::std::os::raw::c_void, - pub p: *const ::std::os::raw::c_void, - pub q: *const ::std::os::raw::c_void, - pub r: *const ::std::os::raw::c_void, - pub privP: *mut ::std::os::raw::c_void, - pub a: i64, - pub b: i32, - pub c: i32, - pub privA: i64, - pub privB: i32, - pub privC: i32, +extern "C" { + pub fn u_countChar32_65(s: *const UChar, length: i32) -> i32; } -#[test] -fn bindgen_test_layout_UText() { - assert_eq!( - ::std::mem::size_of::(), - 144usize, - concat!("Size of: ", stringify!(UText)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(UText)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).magic as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(magic) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).flags as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(flags) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).providerProperties as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(providerProperties) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).sizeOfStruct as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(sizeOfStruct) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).chunkNativeLimit as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(chunkNativeLimit) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).extraSize as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(extraSize) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).nativeIndexingLimit as *const _ as usize }, - 28usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(nativeIndexingLimit) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).chunkNativeStart as *const _ as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(chunkNativeStart) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).chunkOffset as *const _ as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(chunkOffset) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).chunkLength as *const _ as usize }, - 44usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(chunkLength) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).chunkContents as *const _ as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(chunkContents) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).pFuncs as *const _ as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(pFuncs) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).pExtra as *const _ as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(pExtra) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).context as *const _ as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(context) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).p as *const _ as usize }, - 80usize, - concat!("Offset of field: ", stringify!(UText), "::", stringify!(p)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).q as *const _ as usize }, - 88usize, - concat!("Offset of field: ", stringify!(UText), "::", stringify!(q)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).r as *const _ as usize }, - 96usize, - concat!("Offset of field: ", stringify!(UText), "::", stringify!(r)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).privP as *const _ as usize }, - 104usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(privP) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).a as *const _ as usize }, - 112usize, - concat!("Offset of field: ", stringify!(UText), "::", stringify!(a)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).b as *const _ as usize }, - 120usize, - concat!("Offset of field: ", stringify!(UText), "::", stringify!(b)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).c as *const _ as usize }, - 124usize, - concat!("Offset of field: ", stringify!(UText), "::", stringify!(c)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).privA as *const _ as usize }, - 128usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(privA) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).privB as *const _ as usize }, - 136usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(privB) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).privC as *const _ as usize }, - 140usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(privC) - ) - ); +extern "C" { + pub fn u_strHasMoreChar32Than_65(s: *const UChar, length: i32, number: i32) -> UBool; } -impl Default for UText { - fn default() -> Self { - unsafe { ::std::mem::zeroed() } - } +extern "C" { + pub fn u_strcat_65(dst: *mut UChar, src: *const UChar) -> *mut UChar; } extern "C" { - pub fn utext_setup_65(ut: *mut UText, extraSpace: i32, status: *mut UErrorCode) -> *mut UText; + pub fn u_strncat_65(dst: *mut UChar, src: *const UChar, n: i32) -> *mut UChar; } extern "C" { - pub fn u_init_65(status: *mut UErrorCode); + pub fn u_strstr_65(s: *const UChar, substring: *const UChar) -> *mut UChar; } extern "C" { - pub fn u_cleanup_65(); + pub fn u_strFindFirst_65( + s: *const UChar, + length: i32, + substring: *const UChar, + subLength: i32, + ) -> *mut UChar; } -pub type UMemAllocFn = ::std::option::Option< - unsafe extern "C" fn( - context: *const ::std::os::raw::c_void, - size: size_t, - ) -> *mut ::std::os::raw::c_void, ->; -pub type UMemReallocFn = ::std::option::Option< - unsafe extern "C" fn( - context: *const ::std::os::raw::c_void, - mem: *mut ::std::os::raw::c_void, - size: size_t, - ) -> *mut ::std::os::raw::c_void, ->; -pub type UMemFreeFn = ::std::option::Option< - unsafe extern "C" fn(context: *const ::std::os::raw::c_void, mem: *mut ::std::os::raw::c_void), ->; extern "C" { - pub fn u_setMemoryFunctions_65( - context: *const ::std::os::raw::c_void, - a: UMemAllocFn, - r: UMemReallocFn, - f: UMemFreeFn, - status: *mut UErrorCode, - ); + pub fn u_strchr_65(s: *const UChar, c: UChar) -> *mut UChar; } -pub type UMTX = *mut ::std::os::raw::c_void; -pub type UMtxInitFn = ::std::option::Option< - unsafe extern "C" fn( - context: *const ::std::os::raw::c_void, - mutex: *mut UMTX, - status: *mut UErrorCode, - ), ->; -pub type UMtxFn = ::std::option::Option< - unsafe extern "C" fn(context: *const ::std::os::raw::c_void, mutex: *mut UMTX), ->; extern "C" { - pub fn u_setMutexFunctions_65( - context: *const ::std::os::raw::c_void, - init: UMtxInitFn, - destroy: UMtxFn, - lock: UMtxFn, - unlock: UMtxFn, - status: *mut UErrorCode, - ); + pub fn u_strchr32_65(s: *const UChar, c: UChar32) -> *mut UChar; } -pub type UMtxAtomicFn = ::std::option::Option< - unsafe extern "C" fn(context: *const ::std::os::raw::c_void, p: *mut i32) -> i32, ->; extern "C" { - pub fn u_setAtomicIncDecFunctions_65( - context: *const ::std::os::raw::c_void, - inc: UMtxAtomicFn, - dec: UMtxAtomicFn, - status: *mut UErrorCode, - ); + pub fn u_strrstr_65(s: *const UChar, substring: *const UChar) -> *mut UChar; } -pub type va_list = __builtin_va_list; extern "C" { - pub fn u_formatMessage_65( - locale: *const ::std::os::raw::c_char, - pattern: *const UChar, - patternLength: i32, - result: *mut UChar, - resultLength: i32, - status: *mut UErrorCode, - ... - ) -> i32; + pub fn u_strFindLast_65( + s: *const UChar, + length: i32, + substring: *const UChar, + subLength: i32, + ) -> *mut UChar; } extern "C" { - pub fn u_vformatMessage_65( - locale: *const ::std::os::raw::c_char, - pattern: *const UChar, - patternLength: i32, - result: *mut UChar, - resultLength: i32, - ap: *mut __va_list_tag, - status: *mut UErrorCode, - ) -> i32; + pub fn u_strrchr_65(s: *const UChar, c: UChar) -> *mut UChar; } extern "C" { - pub fn u_parseMessage_65( - locale: *const ::std::os::raw::c_char, - pattern: *const UChar, - patternLength: i32, - source: *const UChar, - sourceLength: i32, - status: *mut UErrorCode, - ... - ); + pub fn u_strrchr32_65(s: *const UChar, c: UChar32) -> *mut UChar; } extern "C" { - pub fn u_vparseMessage_65( - locale: *const ::std::os::raw::c_char, - pattern: *const UChar, - patternLength: i32, - source: *const UChar, - sourceLength: i32, - ap: *mut __va_list_tag, - status: *mut UErrorCode, - ); + pub fn u_strpbrk_65(string: *const UChar, matchSet: *const UChar) -> *mut UChar; } extern "C" { - pub fn u_formatMessageWithError_65( - locale: *const ::std::os::raw::c_char, - pattern: *const UChar, - patternLength: i32, - result: *mut UChar, - resultLength: i32, - parseError: *mut UParseError, - status: *mut UErrorCode, - ... + pub fn u_strcspn_65(string: *const UChar, matchSet: *const UChar) -> i32; +} +extern "C" { + pub fn u_strspn_65(string: *const UChar, matchSet: *const UChar) -> i32; +} +extern "C" { + pub fn u_strtok_r_65( + src: *mut UChar, + delim: *const UChar, + saveState: *mut *mut UChar, + ) -> *mut UChar; +} +extern "C" { + pub fn u_strcmp_65(s1: *const UChar, s2: *const UChar) -> i32; +} +extern "C" { + pub fn u_strcmpCodePointOrder_65(s1: *const UChar, s2: *const UChar) -> i32; +} +extern "C" { + pub fn u_strCompare_65( + s1: *const UChar, + length1: i32, + s2: *const UChar, + length2: i32, + codePointOrder: UBool, ) -> i32; } extern "C" { - pub fn u_vformatMessageWithError_65( - locale: *const ::std::os::raw::c_char, - pattern: *const UChar, - patternLength: i32, - result: *mut UChar, - resultLength: i32, - parseError: *mut UParseError, - ap: *mut __va_list_tag, - status: *mut UErrorCode, + pub fn u_strCompareIter_65( + iter1: *mut UCharIterator, + iter2: *mut UCharIterator, + codePointOrder: UBool, ) -> i32; } extern "C" { - pub fn u_parseMessageWithError_65( - locale: *const ::std::os::raw::c_char, - pattern: *const UChar, - patternLength: i32, - source: *const UChar, - sourceLength: i32, - parseError: *mut UParseError, - status: *mut UErrorCode, - ... - ); + pub fn u_strCaseCompare_65( + s1: *const UChar, + length1: i32, + s2: *const UChar, + length2: i32, + options: u32, + pErrorCode: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_vparseMessageWithError_65( - locale: *const ::std::os::raw::c_char, - pattern: *const UChar, - patternLength: i32, - source: *const UChar, - sourceLength: i32, - ap: *mut __va_list_tag, - parseError: *mut UParseError, - status: *mut UErrorCode, - ); + pub fn u_strncmp_65(ucs1: *const UChar, ucs2: *const UChar, n: i32) -> i32; } -pub type UMessageFormat = *mut ::std::os::raw::c_void; extern "C" { - pub fn umsg_open_65( - pattern: *const UChar, - patternLength: i32, - locale: *const ::std::os::raw::c_char, - parseError: *mut UParseError, - status: *mut UErrorCode, - ) -> *mut UMessageFormat; + pub fn u_strncmpCodePointOrder_65(s1: *const UChar, s2: *const UChar, n: i32) -> i32; } extern "C" { - pub fn umsg_close_65(format: *mut UMessageFormat); + pub fn u_strcasecmp_65(s1: *const UChar, s2: *const UChar, options: u32) -> i32; } extern "C" { - pub fn umsg_clone_65(fmt: *const UMessageFormat, status: *mut UErrorCode) -> UMessageFormat; + pub fn u_strncasecmp_65(s1: *const UChar, s2: *const UChar, n: i32, options: u32) -> i32; } extern "C" { - pub fn umsg_setLocale_65(fmt: *mut UMessageFormat, locale: *const ::std::os::raw::c_char); + pub fn u_memcasecmp_65(s1: *const UChar, s2: *const UChar, length: i32, options: u32) -> i32; } extern "C" { - pub fn umsg_getLocale_65(fmt: *const UMessageFormat) -> *const ::std::os::raw::c_char; + pub fn u_strcpy_65(dst: *mut UChar, src: *const UChar) -> *mut UChar; } extern "C" { - pub fn umsg_applyPattern_65( - fmt: *mut UMessageFormat, - pattern: *const UChar, - patternLength: i32, - parseError: *mut UParseError, - status: *mut UErrorCode, - ); + pub fn u_strncpy_65(dst: *mut UChar, src: *const UChar, n: i32) -> *mut UChar; } extern "C" { - pub fn umsg_toPattern_65( - fmt: *const UMessageFormat, - result: *mut UChar, - resultLength: i32, - status: *mut UErrorCode, - ) -> i32; + pub fn u_uastrcpy_65(dst: *mut UChar, src: *const ::std::os::raw::c_char) -> *mut UChar; } extern "C" { - pub fn umsg_format_65( - fmt: *const UMessageFormat, - result: *mut UChar, - resultLength: i32, - status: *mut UErrorCode, - ... - ) -> i32; + pub fn u_uastrncpy_65( + dst: *mut UChar, + src: *const ::std::os::raw::c_char, + n: i32, + ) -> *mut UChar; } extern "C" { - pub fn umsg_vformat_65( - fmt: *const UMessageFormat, - result: *mut UChar, - resultLength: i32, - ap: *mut __va_list_tag, - status: *mut UErrorCode, - ) -> i32; + pub fn u_austrcpy_65( + dst: *mut ::std::os::raw::c_char, + src: *const UChar, + ) -> *mut ::std::os::raw::c_char; } extern "C" { - pub fn umsg_parse_65( - fmt: *const UMessageFormat, - source: *const UChar, - sourceLength: i32, - count: *mut i32, - status: *mut UErrorCode, - ... - ); + pub fn u_austrncpy_65( + dst: *mut ::std::os::raw::c_char, + src: *const UChar, + n: i32, + ) -> *mut ::std::os::raw::c_char; } extern "C" { - pub fn umsg_vparse_65( - fmt: *const UMessageFormat, - source: *const UChar, - sourceLength: i32, - count: *mut i32, - ap: *mut __va_list_tag, - status: *mut UErrorCode, - ); + pub fn u_memcpy_65(dest: *mut UChar, src: *const UChar, count: i32) -> *mut UChar; } extern "C" { - pub fn umsg_autoQuoteApostrophe_65( - pattern: *const UChar, - patternLength: i32, - dest: *mut UChar, - destCapacity: i32, - ec: *mut UErrorCode, - ) -> i32; + pub fn u_memmove_65(dest: *mut UChar, src: *const UChar, count: i32) -> *mut UChar; } -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum USetSpanCondition { - USET_SPAN_NOT_CONTAINED = 0, - USET_SPAN_CONTAINED = 1, - USET_SPAN_SIMPLE = 2, - USET_SPAN_CONDITION_COUNT = 3, +extern "C" { + pub fn u_memset_65(dest: *mut UChar, c: UChar, count: i32) -> *mut UChar; } -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct UCollator { - _unused: [u8; 0], +extern "C" { + pub fn u_memcmp_65(buf1: *const UChar, buf2: *const UChar, count: i32) -> i32; } -#[repr(i32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UCollationResult { - UCOL_EQUAL = 0, - UCOL_GREATER = 1, - UCOL_LESS = -1, +extern "C" { + pub fn u_memcmpCodePointOrder_65(s1: *const UChar, s2: *const UChar, count: i32) -> i32; } -impl UColAttributeValue { - pub const UCOL_DEFAULT_STRENGTH: UColAttributeValue = UColAttributeValue::UCOL_TERTIARY; +extern "C" { + pub fn u_memchr_65(s: *const UChar, c: UChar, count: i32) -> *mut UChar; } -impl UColAttributeValue { - pub const UCOL_QUATERNARY: UColAttributeValue = UColAttributeValue::UCOL_CE_STRENGTH_LIMIT; +extern "C" { + pub fn u_memchr32_65(s: *const UChar, c: UChar32, count: i32) -> *mut UChar; } -impl UColAttributeValue { - pub const UCOL_OFF: UColAttributeValue = UColAttributeValue::UCOL_STRENGTH_LIMIT; -} -#[repr(i32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UColAttributeValue { - UCOL_DEFAULT = -1, - UCOL_PRIMARY = 0, - UCOL_SECONDARY = 1, - UCOL_TERTIARY = 2, - UCOL_CE_STRENGTH_LIMIT = 3, - UCOL_IDENTICAL = 15, - UCOL_STRENGTH_LIMIT = 16, - UCOL_ON = 17, - UCOL_SHIFTED = 20, - UCOL_NON_IGNORABLE = 21, - UCOL_LOWER_FIRST = 24, - UCOL_UPPER_FIRST = 25, - UCOL_ATTRIBUTE_VALUE_COUNT = 26, -} -impl UColReorderCode { - pub const UCOL_REORDER_CODE_OTHERS: UColReorderCode = UColReorderCode::UCOL_REORDER_CODE_NONE; -} -impl UColReorderCode { - pub const UCOL_REORDER_CODE_FIRST: UColReorderCode = UColReorderCode::UCOL_REORDER_CODE_SPACE; -} -#[repr(i32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UColReorderCode { - UCOL_REORDER_CODE_DEFAULT = -1, - UCOL_REORDER_CODE_NONE = 103, - UCOL_REORDER_CODE_SPACE = 4096, - UCOL_REORDER_CODE_PUNCTUATION = 4097, - UCOL_REORDER_CODE_SYMBOL = 4098, - UCOL_REORDER_CODE_CURRENCY = 4099, - UCOL_REORDER_CODE_DIGIT = 4100, - UCOL_REORDER_CODE_LIMIT = 4101, -} -pub use self::UColAttributeValue as UCollationStrength; -impl UColAttribute { - pub const UCOL_DECOMPOSITION_MODE: UColAttribute = UColAttribute::UCOL_NORMALIZATION_MODE; -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UColAttribute { - UCOL_FRENCH_COLLATION = 0, - UCOL_ALTERNATE_HANDLING = 1, - UCOL_CASE_FIRST = 2, - UCOL_CASE_LEVEL = 3, - UCOL_NORMALIZATION_MODE = 4, - UCOL_STRENGTH = 5, - UCOL_HIRAGANA_QUATERNARY_MODE = 6, - UCOL_NUMERIC_COLLATION = 7, - UCOL_ATTRIBUTE_COUNT = 8, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UColRuleOption { - UCOL_TAILORING_ONLY = 0, - UCOL_FULL_RULES = 1, -} -extern "C" { - pub fn ucol_open_65( - loc: *const ::std::os::raw::c_char, - status: *mut UErrorCode, - ) -> *mut UCollator; -} -extern "C" { - pub fn ucol_openRules_65( - rules: *const UChar, - rulesLength: i32, - normalizationMode: UColAttributeValue, - strength: UCollationStrength, - parseError: *mut UParseError, - status: *mut UErrorCode, - ) -> *mut UCollator; +extern "C" { + pub fn u_memrchr_65(s: *const UChar, c: UChar, count: i32) -> *mut UChar; } extern "C" { - pub fn ucol_openFromShortString_65( - definition: *const ::std::os::raw::c_char, - forceDefaults: UBool, - parseError: *mut UParseError, - status: *mut UErrorCode, - ) -> *mut UCollator; + pub fn u_memrchr32_65(s: *const UChar, c: UChar32, count: i32) -> *mut UChar; } extern "C" { - pub fn ucol_getContractions_65( - coll: *const UCollator, - conts: *mut USet, - status: *mut UErrorCode, + pub fn u_unescape_65( + src: *const ::std::os::raw::c_char, + dest: *mut UChar, + destCapacity: i32, ) -> i32; } +pub type UNESCAPE_CHAR_AT = ::std::option::Option< + unsafe extern "C" fn(offset: i32, context: *mut ::std::os::raw::c_void) -> UChar, +>; extern "C" { - pub fn ucol_getContractionsAndExpansions_65( - coll: *const UCollator, - contractions: *mut USet, - expansions: *mut USet, - addPrefixes: UBool, - status: *mut UErrorCode, - ); -} -extern "C" { - pub fn ucol_close_65(coll: *mut UCollator); + pub fn u_unescapeAt_65( + charAt: UNESCAPE_CHAR_AT, + offset: *mut i32, + length: i32, + context: *mut ::std::os::raw::c_void, + ) -> UChar32; } extern "C" { - pub fn ucol_strcoll_65( - coll: *const UCollator, - source: *const UChar, - sourceLength: i32, - target: *const UChar, - targetLength: i32, - ) -> UCollationResult; + pub fn u_strToUpper_65( + dest: *mut UChar, + destCapacity: i32, + src: *const UChar, + srcLength: i32, + locale: *const ::std::os::raw::c_char, + pErrorCode: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn ucol_strcollUTF8_65( - coll: *const UCollator, - source: *const ::std::os::raw::c_char, - sourceLength: i32, - target: *const ::std::os::raw::c_char, - targetLength: i32, - status: *mut UErrorCode, - ) -> UCollationResult; + pub fn u_strToLower_65( + dest: *mut UChar, + destCapacity: i32, + src: *const UChar, + srcLength: i32, + locale: *const ::std::os::raw::c_char, + pErrorCode: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn ucol_greater_65( - coll: *const UCollator, - source: *const UChar, - sourceLength: i32, - target: *const UChar, - targetLength: i32, - ) -> UBool; + pub fn u_strToTitle_65( + dest: *mut UChar, + destCapacity: i32, + src: *const UChar, + srcLength: i32, + titleIter: *mut UBreakIterator, + locale: *const ::std::os::raw::c_char, + pErrorCode: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn ucol_greaterOrEqual_65( - coll: *const UCollator, - source: *const UChar, - sourceLength: i32, - target: *const UChar, - targetLength: i32, - ) -> UBool; + pub fn u_strFoldCase_65( + dest: *mut UChar, + destCapacity: i32, + src: *const UChar, + srcLength: i32, + options: u32, + pErrorCode: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn ucol_equal_65( - coll: *const UCollator, - source: *const UChar, - sourceLength: i32, - target: *const UChar, - targetLength: i32, - ) -> UBool; + pub fn u_strToWCS_65( + dest: *mut wchar_t, + destCapacity: i32, + pDestLength: *mut i32, + src: *const UChar, + srcLength: i32, + pErrorCode: *mut UErrorCode, + ) -> *mut wchar_t; } extern "C" { - pub fn ucol_strcollIter_65( - coll: *const UCollator, - sIter: *mut UCharIterator, - tIter: *mut UCharIterator, - status: *mut UErrorCode, - ) -> UCollationResult; + pub fn u_strFromWCS_65( + dest: *mut UChar, + destCapacity: i32, + pDestLength: *mut i32, + src: *const wchar_t, + srcLength: i32, + pErrorCode: *mut UErrorCode, + ) -> *mut UChar; } extern "C" { - pub fn ucol_getStrength_65(coll: *const UCollator) -> UCollationStrength; + pub fn u_strToUTF8_65( + dest: *mut ::std::os::raw::c_char, + destCapacity: i32, + pDestLength: *mut i32, + src: *const UChar, + srcLength: i32, + pErrorCode: *mut UErrorCode, + ) -> *mut ::std::os::raw::c_char; } extern "C" { - pub fn ucol_setStrength_65(coll: *mut UCollator, strength: UCollationStrength); + pub fn u_strFromUTF8_65( + dest: *mut UChar, + destCapacity: i32, + pDestLength: *mut i32, + src: *const ::std::os::raw::c_char, + srcLength: i32, + pErrorCode: *mut UErrorCode, + ) -> *mut UChar; } extern "C" { - pub fn ucol_getReorderCodes_65( - coll: *const UCollator, - dest: *mut i32, + pub fn u_strToUTF8WithSub_65( + dest: *mut ::std::os::raw::c_char, destCapacity: i32, + pDestLength: *mut i32, + src: *const UChar, + srcLength: i32, + subchar: UChar32, + pNumSubstitutions: *mut i32, pErrorCode: *mut UErrorCode, - ) -> i32; + ) -> *mut ::std::os::raw::c_char; } extern "C" { - pub fn ucol_setReorderCodes_65( - coll: *mut UCollator, - reorderCodes: *const i32, - reorderCodesLength: i32, + pub fn u_strFromUTF8WithSub_65( + dest: *mut UChar, + destCapacity: i32, + pDestLength: *mut i32, + src: *const ::std::os::raw::c_char, + srcLength: i32, + subchar: UChar32, + pNumSubstitutions: *mut i32, pErrorCode: *mut UErrorCode, - ); + ) -> *mut UChar; } extern "C" { - pub fn ucol_getEquivalentReorderCodes_65( - reorderCode: i32, - dest: *mut i32, + pub fn u_strFromUTF8Lenient_65( + dest: *mut UChar, destCapacity: i32, + pDestLength: *mut i32, + src: *const ::std::os::raw::c_char, + srcLength: i32, pErrorCode: *mut UErrorCode, - ) -> i32; + ) -> *mut UChar; } extern "C" { - pub fn ucol_getDisplayName_65( - objLoc: *const ::std::os::raw::c_char, - dispLoc: *const ::std::os::raw::c_char, - result: *mut UChar, - resultLength: i32, - status: *mut UErrorCode, - ) -> i32; + pub fn u_strToUTF32_65( + dest: *mut UChar32, + destCapacity: i32, + pDestLength: *mut i32, + src: *const UChar, + srcLength: i32, + pErrorCode: *mut UErrorCode, + ) -> *mut UChar32; } extern "C" { - pub fn ucol_getAvailable_65(localeIndex: i32) -> *const ::std::os::raw::c_char; + pub fn u_strFromUTF32_65( + dest: *mut UChar, + destCapacity: i32, + pDestLength: *mut i32, + src: *const UChar32, + srcLength: i32, + pErrorCode: *mut UErrorCode, + ) -> *mut UChar; } extern "C" { - pub fn ucol_countAvailable_65() -> i32; + pub fn u_strToUTF32WithSub_65( + dest: *mut UChar32, + destCapacity: i32, + pDestLength: *mut i32, + src: *const UChar, + srcLength: i32, + subchar: UChar32, + pNumSubstitutions: *mut i32, + pErrorCode: *mut UErrorCode, + ) -> *mut UChar32; } extern "C" { - pub fn ucol_openAvailableLocales_65(status: *mut UErrorCode) -> *mut UEnumeration; + pub fn u_strFromUTF32WithSub_65( + dest: *mut UChar, + destCapacity: i32, + pDestLength: *mut i32, + src: *const UChar32, + srcLength: i32, + subchar: UChar32, + pNumSubstitutions: *mut i32, + pErrorCode: *mut UErrorCode, + ) -> *mut UChar; } extern "C" { - pub fn ucol_getKeywords_65(status: *mut UErrorCode) -> *mut UEnumeration; + pub fn u_strToJavaModifiedUTF8_65( + dest: *mut ::std::os::raw::c_char, + destCapacity: i32, + pDestLength: *mut i32, + src: *const UChar, + srcLength: i32, + pErrorCode: *mut UErrorCode, + ) -> *mut ::std::os::raw::c_char; } extern "C" { - pub fn ucol_getKeywordValues_65( - keyword: *const ::std::os::raw::c_char, + pub fn u_strFromJavaModifiedUTF8WithSub_65( + dest: *mut UChar, + destCapacity: i32, + pDestLength: *mut i32, + src: *const ::std::os::raw::c_char, + srcLength: i32, + subchar: UChar32, + pNumSubstitutions: *mut i32, + pErrorCode: *mut UErrorCode, + ) -> *mut UChar; +} +extern "C" { + pub fn utext_close_65(ut: *mut UText) -> *mut UText; +} +extern "C" { + pub fn utext_openUTF8_65( + ut: *mut UText, + s: *const ::std::os::raw::c_char, + length: i64, status: *mut UErrorCode, - ) -> *mut UEnumeration; + ) -> *mut UText; } extern "C" { - pub fn ucol_getKeywordValuesForLocale_65( - key: *const ::std::os::raw::c_char, - locale: *const ::std::os::raw::c_char, - commonlyUsed: UBool, + pub fn utext_openUChars_65( + ut: *mut UText, + s: *const UChar, + length: i64, status: *mut UErrorCode, - ) -> *mut UEnumeration; + ) -> *mut UText; } extern "C" { - pub fn ucol_getFunctionalEquivalent_65( - result: *mut ::std::os::raw::c_char, - resultCapacity: i32, - keyword: *const ::std::os::raw::c_char, - locale: *const ::std::os::raw::c_char, - isAvailable: *mut UBool, + pub fn utext_clone_65( + dest: *mut UText, + src: *const UText, + deep: UBool, + readOnly: UBool, status: *mut UErrorCode, - ) -> i32; + ) -> *mut UText; } extern "C" { - pub fn ucol_getRules_65(coll: *const UCollator, length: *mut i32) -> *const UChar; + pub fn utext_equals_65(a: *const UText, b: *const UText) -> UBool; } extern "C" { - pub fn ucol_getShortDefinitionString_65( - coll: *const UCollator, - locale: *const ::std::os::raw::c_char, - buffer: *mut ::std::os::raw::c_char, - capacity: i32, - status: *mut UErrorCode, - ) -> i32; + pub fn utext_nativeLength_65(ut: *mut UText) -> i64; } extern "C" { - pub fn ucol_normalizeShortDefinitionString_65( - source: *const ::std::os::raw::c_char, - destination: *mut ::std::os::raw::c_char, - capacity: i32, - parseError: *mut UParseError, - status: *mut UErrorCode, - ) -> i32; + pub fn utext_isLengthExpensive_65(ut: *const UText) -> UBool; } extern "C" { - pub fn ucol_getSortKey_65( - coll: *const UCollator, - source: *const UChar, - sourceLength: i32, - result: *mut u8, - resultLength: i32, - ) -> i32; + pub fn utext_char32At_65(ut: *mut UText, nativeIndex: i64) -> UChar32; } extern "C" { - pub fn ucol_nextSortKeyPart_65( - coll: *const UCollator, - iter: *mut UCharIterator, - state: *mut u32, - dest: *mut u8, - count: i32, - status: *mut UErrorCode, - ) -> i32; + pub fn utext_current32_65(ut: *mut UText) -> UChar32; } -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UColBoundMode { - UCOL_BOUND_LOWER = 0, - UCOL_BOUND_UPPER = 1, - UCOL_BOUND_UPPER_LONG = 2, - UCOL_BOUND_VALUE_COUNT = 3, +extern "C" { + pub fn utext_next32_65(ut: *mut UText) -> UChar32; } extern "C" { - pub fn ucol_getBound_65( - source: *const u8, - sourceLength: i32, - boundType: UColBoundMode, - noOfLevels: u32, - result: *mut u8, - resultLength: i32, + pub fn utext_previous32_65(ut: *mut UText) -> UChar32; +} +extern "C" { + pub fn utext_next32From_65(ut: *mut UText, nativeIndex: i64) -> UChar32; +} +extern "C" { + pub fn utext_previous32From_65(ut: *mut UText, nativeIndex: i64) -> UChar32; +} +extern "C" { + pub fn utext_getNativeIndex_65(ut: *const UText) -> i64; +} +extern "C" { + pub fn utext_setNativeIndex_65(ut: *mut UText, nativeIndex: i64); +} +extern "C" { + pub fn utext_moveIndex32_65(ut: *mut UText, delta: i32) -> UBool; +} +extern "C" { + pub fn utext_getPreviousNativeIndex_65(ut: *mut UText) -> i64; +} +extern "C" { + pub fn utext_extract_65( + ut: *mut UText, + nativeStart: i64, + nativeLimit: i64, + dest: *mut UChar, + destCapacity: i32, status: *mut UErrorCode, ) -> i32; } extern "C" { - pub fn ucol_getVersion_65(coll: *const UCollator, info: *mut u8); + pub fn utext_isWritable_65(ut: *const UText) -> UBool; } extern "C" { - pub fn ucol_getUCAVersion_65(coll: *const UCollator, info: *mut u8); + pub fn utext_hasMetaData_65(ut: *const UText) -> UBool; } extern "C" { - pub fn ucol_mergeSortkeys_65( - src1: *const u8, - src1Length: i32, - src2: *const u8, - src2Length: i32, - dest: *mut u8, - destCapacity: i32, + pub fn utext_replace_65( + ut: *mut UText, + nativeStart: i64, + nativeLimit: i64, + replacementText: *const UChar, + replacementLength: i32, + status: *mut UErrorCode, ) -> i32; } extern "C" { - pub fn ucol_setAttribute_65( - coll: *mut UCollator, - attr: UColAttribute, - value: UColAttributeValue, + pub fn utext_copy_65( + ut: *mut UText, + nativeStart: i64, + nativeLimit: i64, + destIndex: i64, + move_: UBool, + status: *mut UErrorCode, + ); +} +extern "C" { + pub fn utext_freeze_65(ut: *mut UText); +} +pub type UTextClone = ::std::option::Option< + unsafe extern "C" fn( + dest: *mut UText, + src: *const UText, + deep: UBool, + status: *mut UErrorCode, + ) -> *mut UText, +>; +pub type UTextNativeLength = ::std::option::Option i64>; +pub type UTextAccess = ::std::option::Option< + unsafe extern "C" fn(ut: *mut UText, nativeIndex: i64, forward: UBool) -> UBool, +>; +pub type UTextExtract = ::std::option::Option< + unsafe extern "C" fn( + ut: *mut UText, + nativeStart: i64, + nativeLimit: i64, + dest: *mut UChar, + destCapacity: i32, + status: *mut UErrorCode, + ) -> i32, +>; +pub type UTextReplace = ::std::option::Option< + unsafe extern "C" fn( + ut: *mut UText, + nativeStart: i64, + nativeLimit: i64, + replacementText: *const UChar, + replacmentLength: i32, + status: *mut UErrorCode, + ) -> i32, +>; +pub type UTextCopy = ::std::option::Option< + unsafe extern "C" fn( + ut: *mut UText, + nativeStart: i64, + nativeLimit: i64, + nativeDest: i64, + move_: UBool, status: *mut UErrorCode, + ), +>; +pub type UTextMapOffsetToNative = + ::std::option::Option i64>; +pub type UTextMapNativeIndexToUTF16 = + ::std::option::Option i32>; +pub type UTextClose = ::std::option::Option; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, PartialEq)] +pub struct UTextFuncs { + pub tableSize: i32, + pub reserved1: i32, + pub reserved2: i32, + pub reserved3: i32, + pub clone: UTextClone, + pub nativeLength: UTextNativeLength, + pub access: UTextAccess, + pub extract: UTextExtract, + pub replace: UTextReplace, + pub copy: UTextCopy, + pub mapOffsetToNative: UTextMapOffsetToNative, + pub mapNativeIndexToUTF16: UTextMapNativeIndexToUTF16, + pub close: UTextClose, + pub spare1: UTextClose, + pub spare2: UTextClose, + pub spare3: UTextClose, +} +#[test] +fn bindgen_test_layout_UTextFuncs() { + assert_eq!( + ::std::mem::size_of::(), + 112usize, + concat!("Size of: ", stringify!(UTextFuncs)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(UTextFuncs)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tableSize as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(UTextFuncs), + "::", + stringify!(tableSize) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).reserved1 as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(UTextFuncs), + "::", + stringify!(reserved1) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).reserved2 as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(UTextFuncs), + "::", + stringify!(reserved2) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).reserved3 as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(UTextFuncs), + "::", + stringify!(reserved3) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).clone as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(UTextFuncs), + "::", + stringify!(clone) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).nativeLength as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(UTextFuncs), + "::", + stringify!(nativeLength) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).access as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(UTextFuncs), + "::", + stringify!(access) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).extract as *const _ as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(UTextFuncs), + "::", + stringify!(extract) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).replace as *const _ as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(UTextFuncs), + "::", + stringify!(replace) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).copy as *const _ as usize }, + 56usize, + concat!( + "Offset of field: ", + stringify!(UTextFuncs), + "::", + stringify!(copy) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).mapOffsetToNative as *const _ as usize }, + 64usize, + concat!( + "Offset of field: ", + stringify!(UTextFuncs), + "::", + stringify!(mapOffsetToNative) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).mapNativeIndexToUTF16 as *const _ as usize + }, + 72usize, + concat!( + "Offset of field: ", + stringify!(UTextFuncs), + "::", + stringify!(mapNativeIndexToUTF16) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).close as *const _ as usize }, + 80usize, + concat!( + "Offset of field: ", + stringify!(UTextFuncs), + "::", + stringify!(close) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).spare1 as *const _ as usize }, + 88usize, + concat!( + "Offset of field: ", + stringify!(UTextFuncs), + "::", + stringify!(spare1) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).spare2 as *const _ as usize }, + 96usize, + concat!( + "Offset of field: ", + stringify!(UTextFuncs), + "::", + stringify!(spare2) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).spare3 as *const _ as usize }, + 104usize, + concat!( + "Offset of field: ", + stringify!(UTextFuncs), + "::", + stringify!(spare3) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone, Hash, PartialOrd, PartialEq)] +pub struct UText { + pub magic: u32, + pub flags: i32, + pub providerProperties: i32, + pub sizeOfStruct: i32, + pub chunkNativeLimit: i64, + pub extraSize: i32, + pub nativeIndexingLimit: i32, + pub chunkNativeStart: i64, + pub chunkOffset: i32, + pub chunkLength: i32, + pub chunkContents: *const UChar, + pub pFuncs: *const UTextFuncs, + pub pExtra: *mut ::std::os::raw::c_void, + pub context: *const ::std::os::raw::c_void, + pub p: *const ::std::os::raw::c_void, + pub q: *const ::std::os::raw::c_void, + pub r: *const ::std::os::raw::c_void, + pub privP: *mut ::std::os::raw::c_void, + pub a: i64, + pub b: i32, + pub c: i32, + pub privA: i64, + pub privB: i32, + pub privC: i32, +} +#[test] +fn bindgen_test_layout_UText() { + assert_eq!( + ::std::mem::size_of::(), + 144usize, + concat!("Size of: ", stringify!(UText)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(UText)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).magic as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(magic) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).flags as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(flags) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).providerProperties as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(providerProperties) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).sizeOfStruct as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(sizeOfStruct) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).chunkNativeLimit as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(chunkNativeLimit) + ) ); -} -extern "C" { - pub fn ucol_getAttribute_65( - coll: *const UCollator, - attr: UColAttribute, - status: *mut UErrorCode, - ) -> UColAttributeValue; -} -extern "C" { - pub fn ucol_setMaxVariable_65( - coll: *mut UCollator, - group: UColReorderCode, - pErrorCode: *mut UErrorCode, + assert_eq!( + unsafe { &(*(::std::ptr::null::())).extraSize as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(extraSize) + ) ); -} -extern "C" { - pub fn ucol_getMaxVariable_65(coll: *const UCollator) -> UColReorderCode; -} -extern "C" { - pub fn ucol_setVariableTop_65( - coll: *mut UCollator, - varTop: *const UChar, - len: i32, - status: *mut UErrorCode, - ) -> u32; -} -extern "C" { - pub fn ucol_getVariableTop_65(coll: *const UCollator, status: *mut UErrorCode) -> u32; -} -extern "C" { - pub fn ucol_restoreVariableTop_65(coll: *mut UCollator, varTop: u32, status: *mut UErrorCode); -} -extern "C" { - pub fn ucol_safeClone_65( - coll: *const UCollator, - stackBuffer: *mut ::std::os::raw::c_void, - pBufferSize: *mut i32, - status: *mut UErrorCode, - ) -> *mut UCollator; -} -extern "C" { - pub fn ucol_getRulesEx_65( - coll: *const UCollator, - delta: UColRuleOption, - buffer: *mut UChar, - bufferLen: i32, - ) -> i32; -} -extern "C" { - pub fn ucol_getLocale_65( - coll: *const UCollator, - type_: ULocDataLocaleType, - status: *mut UErrorCode, - ) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn ucol_getLocaleByType_65( - coll: *const UCollator, - type_: ULocDataLocaleType, - status: *mut UErrorCode, - ) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn ucol_getTailoredSet_65(coll: *const UCollator, status: *mut UErrorCode) -> *mut USet; -} -extern "C" { - pub fn ucol_getUnsafeSet_65( - coll: *const UCollator, - unsafe_: *mut USet, - status: *mut UErrorCode, - ) -> i32; -} -extern "C" { - pub fn ucol_prepareShortStringOpen_65( - definition: *const ::std::os::raw::c_char, - forceDefaults: UBool, - parseError: *mut UParseError, - status: *mut UErrorCode, + assert_eq!( + unsafe { &(*(::std::ptr::null::())).nativeIndexingLimit as *const _ as usize }, + 28usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(nativeIndexingLimit) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).chunkNativeStart as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(chunkNativeStart) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).chunkOffset as *const _ as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(chunkOffset) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).chunkLength as *const _ as usize }, + 44usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(chunkLength) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).chunkContents as *const _ as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(chunkContents) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).pFuncs as *const _ as usize }, + 56usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(pFuncs) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).pExtra as *const _ as usize }, + 64usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(pExtra) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).context as *const _ as usize }, + 72usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(context) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).p as *const _ as usize }, + 80usize, + concat!("Offset of field: ", stringify!(UText), "::", stringify!(p)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).q as *const _ as usize }, + 88usize, + concat!("Offset of field: ", stringify!(UText), "::", stringify!(q)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).r as *const _ as usize }, + 96usize, + concat!("Offset of field: ", stringify!(UText), "::", stringify!(r)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).privP as *const _ as usize }, + 104usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(privP) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).a as *const _ as usize }, + 112usize, + concat!("Offset of field: ", stringify!(UText), "::", stringify!(a)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).b as *const _ as usize }, + 120usize, + concat!("Offset of field: ", stringify!(UText), "::", stringify!(b)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).c as *const _ as usize }, + 124usize, + concat!("Offset of field: ", stringify!(UText), "::", stringify!(c)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).privA as *const _ as usize }, + 128usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(privA) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).privB as *const _ as usize }, + 136usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(privB) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).privC as *const _ as usize }, + 140usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(privC) + ) ); } -extern "C" { - pub fn ucol_cloneBinary_65( - coll: *const UCollator, - buffer: *mut u8, - capacity: i32, - status: *mut UErrorCode, - ) -> i32; +impl Default for UText { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } } extern "C" { - pub fn ucol_openBinary_65( - bin: *const u8, - length: i32, - base: *const UCollator, - status: *mut UErrorCode, - ) -> *mut UCollator; + pub fn utext_setup_65(ut: *mut UText, extraSpace: i32, status: *mut UErrorCode) -> *mut UText; } pub type __builtin_va_list = [__va_list_tag; 1usize]; #[repr(C)] diff --git a/rust_icu_sys/bindgen/lib_66.rs b/rust_icu_sys/bindgen/lib_66.rs index c57d6c51..1e2db02c 100644 --- a/rust_icu_sys/bindgen/lib_66.rs +++ b/rust_icu_sys/bindgen/lib_66.rs @@ -982,3070 +982,3133 @@ extern "C" { status: *mut UErrorCode, ) -> i32; } +extern "C" { + pub fn u_init_66(status: *mut UErrorCode); +} +extern "C" { + pub fn u_cleanup_66(); +} +pub type UMemAllocFn = ::std::option::Option< + unsafe extern "C" fn( + context: *const ::std::os::raw::c_void, + size: size_t, + ) -> *mut ::std::os::raw::c_void, +>; +pub type UMemReallocFn = ::std::option::Option< + unsafe extern "C" fn( + context: *const ::std::os::raw::c_void, + mem: *mut ::std::os::raw::c_void, + size: size_t, + ) -> *mut ::std::os::raw::c_void, +>; +pub type UMemFreeFn = ::std::option::Option< + unsafe extern "C" fn(context: *const ::std::os::raw::c_void, mem: *mut ::std::os::raw::c_void), +>; +extern "C" { + pub fn u_setMemoryFunctions_66( + context: *const ::std::os::raw::c_void, + a: UMemAllocFn, + r: UMemReallocFn, + f: UMemFreeFn, + status: *mut UErrorCode, + ); +} +pub type UMTX = *mut ::std::os::raw::c_void; +pub type UMtxInitFn = ::std::option::Option< + unsafe extern "C" fn( + context: *const ::std::os::raw::c_void, + mutex: *mut UMTX, + status: *mut UErrorCode, + ), +>; +pub type UMtxFn = ::std::option::Option< + unsafe extern "C" fn(context: *const ::std::os::raw::c_void, mutex: *mut UMTX), +>; +extern "C" { + pub fn u_setMutexFunctions_66( + context: *const ::std::os::raw::c_void, + init: UMtxInitFn, + destroy: UMtxFn, + lock: UMtxFn, + unlock: UMtxFn, + status: *mut UErrorCode, + ); +} +pub type UMtxAtomicFn = ::std::option::Option< + unsafe extern "C" fn(context: *const ::std::os::raw::c_void, p: *mut i32) -> i32, +>; +extern "C" { + pub fn u_setAtomicIncDecFunctions_66( + context: *const ::std::os::raw::c_void, + inc: UMtxAtomicFn, + dec: UMtxAtomicFn, + status: *mut UErrorCode, + ); +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] +pub enum UCharIteratorOrigin { + UITER_START = 0, + UITER_CURRENT = 1, + UITER_LIMIT = 2, + UITER_ZERO = 3, + UITER_LENGTH = 4, +} +pub type UCharIteratorGetIndex = ::std::option::Option< + unsafe extern "C" fn(iter: *mut UCharIterator, origin: UCharIteratorOrigin) -> i32, +>; +pub type UCharIteratorMove = ::std::option::Option< + unsafe extern "C" fn(iter: *mut UCharIterator, delta: i32, origin: UCharIteratorOrigin) -> i32, +>; +pub type UCharIteratorHasNext = + ::std::option::Option UBool>; +pub type UCharIteratorHasPrevious = + ::std::option::Option UBool>; +pub type UCharIteratorCurrent = + ::std::option::Option UChar32>; +pub type UCharIteratorNext = + ::std::option::Option UChar32>; +pub type UCharIteratorPrevious = + ::std::option::Option UChar32>; +pub type UCharIteratorReserved = + ::std::option::Option i32>; +pub type UCharIteratorGetState = + ::std::option::Option u32>; +pub type UCharIteratorSetState = ::std::option::Option< + unsafe extern "C" fn(iter: *mut UCharIterator, state: u32, pErrorCode: *mut UErrorCode), +>; #[repr(C)] -#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, PartialEq)] -pub struct UFieldPosition { - pub field: i32, - pub beginIndex: i32, - pub endIndex: i32, +#[derive(Debug, Copy, Clone, Hash, PartialOrd, PartialEq)] +pub struct UCharIterator { + pub context: *const ::std::os::raw::c_void, + pub length: i32, + pub start: i32, + pub index: i32, + pub limit: i32, + pub reservedField: i32, + pub getIndex: UCharIteratorGetIndex, + pub move_: UCharIteratorMove, + pub hasNext: UCharIteratorHasNext, + pub hasPrevious: UCharIteratorHasPrevious, + pub current: UCharIteratorCurrent, + pub next: UCharIteratorNext, + pub previous: UCharIteratorPrevious, + pub reservedFn: UCharIteratorReserved, + pub getState: UCharIteratorGetState, + pub setState: UCharIteratorSetState, } #[test] -fn bindgen_test_layout_UFieldPosition() { +fn bindgen_test_layout_UCharIterator() { assert_eq!( - ::std::mem::size_of::(), - 12usize, - concat!("Size of: ", stringify!(UFieldPosition)) + ::std::mem::size_of::(), + 112usize, + concat!("Size of: ", stringify!(UCharIterator)) ); assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(UFieldPosition)) + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(UCharIterator)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).field as *const _ as usize }, + unsafe { &(*(::std::ptr::null::())).context as *const _ as usize }, 0usize, concat!( "Offset of field: ", - stringify!(UFieldPosition), + stringify!(UCharIterator), "::", - stringify!(field) + stringify!(context) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).beginIndex as *const _ as usize }, - 4usize, + unsafe { &(*(::std::ptr::null::())).length as *const _ as usize }, + 8usize, concat!( "Offset of field: ", - stringify!(UFieldPosition), + stringify!(UCharIterator), "::", - stringify!(beginIndex) + stringify!(length) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).endIndex as *const _ as usize }, - 8usize, + unsafe { &(*(::std::ptr::null::())).start as *const _ as usize }, + 12usize, concat!( "Offset of field: ", - stringify!(UFieldPosition), + stringify!(UCharIterator), "::", - stringify!(endIndex) + stringify!(start) ) ); -} -#[repr(C)] -#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, PartialEq)] -pub struct UParseError { - pub line: i32, - pub offset: i32, - pub preContext: [UChar; 16usize], - pub postContext: [UChar; 16usize], -} -#[test] -fn bindgen_test_layout_UParseError() { assert_eq!( - ::std::mem::size_of::(), - 72usize, - concat!("Size of: ", stringify!(UParseError)) + unsafe { &(*(::std::ptr::null::())).index as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(UCharIterator), + "::", + stringify!(index) + ) ); assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(UParseError)) + unsafe { &(*(::std::ptr::null::())).limit as *const _ as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(UCharIterator), + "::", + stringify!(limit) + ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).line as *const _ as usize }, - 0usize, + unsafe { &(*(::std::ptr::null::())).reservedField as *const _ as usize }, + 24usize, concat!( "Offset of field: ", - stringify!(UParseError), + stringify!(UCharIterator), "::", - stringify!(line) + stringify!(reservedField) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).offset as *const _ as usize }, - 4usize, + unsafe { &(*(::std::ptr::null::())).getIndex as *const _ as usize }, + 32usize, concat!( "Offset of field: ", - stringify!(UParseError), + stringify!(UCharIterator), "::", - stringify!(offset) + stringify!(getIndex) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).preContext as *const _ as usize }, - 8usize, + unsafe { &(*(::std::ptr::null::())).move_ as *const _ as usize }, + 40usize, concat!( "Offset of field: ", - stringify!(UParseError), + stringify!(UCharIterator), "::", - stringify!(preContext) + stringify!(move_) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).postContext as *const _ as usize }, - 40usize, + unsafe { &(*(::std::ptr::null::())).hasNext as *const _ as usize }, + 48usize, concat!( "Offset of field: ", - stringify!(UParseError), + stringify!(UCharIterator), "::", - stringify!(postContext) + stringify!(hasNext) ) ); -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UDisplayContextType { - UDISPCTX_TYPE_DIALECT_HANDLING = 0, - UDISPCTX_TYPE_CAPITALIZATION = 1, - UDISPCTX_TYPE_DISPLAY_LENGTH = 2, - UDISPCTX_TYPE_SUBSTITUTE_HANDLING = 3, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UDisplayContext { - UDISPCTX_STANDARD_NAMES = 0, - UDISPCTX_DIALECT_NAMES = 1, - UDISPCTX_CAPITALIZATION_NONE = 256, - UDISPCTX_CAPITALIZATION_FOR_MIDDLE_OF_SENTENCE = 257, - UDISPCTX_CAPITALIZATION_FOR_BEGINNING_OF_SENTENCE = 258, - UDISPCTX_CAPITALIZATION_FOR_UI_LIST_OR_MENU = 259, - UDISPCTX_CAPITALIZATION_FOR_STANDALONE = 260, - UDISPCTX_LENGTH_FULL = 512, - UDISPCTX_LENGTH_SHORT = 513, - UDISPCTX_SUBSTITUTE = 768, - UDISPCTX_NO_SUBSTITUTE = 769, -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct UFieldPositionIterator { - _unused: [u8; 0], -} -pub type UNumberFormat = *mut ::std::os::raw::c_void; -pub type UDateFormat = *mut ::std::os::raw::c_void; -impl UDateFormatStyle { - pub const UDAT_DEFAULT: UDateFormatStyle = UDateFormatStyle::UDAT_MEDIUM; -} -impl UDateFormatStyle { - pub const UDAT_FULL_RELATIVE: UDateFormatStyle = UDateFormatStyle::UDAT_RELATIVE; -} -impl UDateFormatStyle { - pub const UDAT_IGNORE: UDateFormatStyle = UDateFormatStyle::UDAT_PATTERN; -} -#[repr(i32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UDateFormatStyle { - UDAT_FULL = 0, - UDAT_LONG = 1, - UDAT_MEDIUM = 2, - UDAT_SHORT = 3, - UDAT_RELATIVE = 128, - UDAT_LONG_RELATIVE = 129, - UDAT_MEDIUM_RELATIVE = 130, - UDAT_SHORT_RELATIVE = 131, - UDAT_NONE = -1, - UDAT_PATTERN = -2, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UDateFormatField { - UDAT_ERA_FIELD = 0, - UDAT_YEAR_FIELD = 1, - UDAT_MONTH_FIELD = 2, - UDAT_DATE_FIELD = 3, - UDAT_HOUR_OF_DAY1_FIELD = 4, - UDAT_HOUR_OF_DAY0_FIELD = 5, - UDAT_MINUTE_FIELD = 6, - UDAT_SECOND_FIELD = 7, - UDAT_FRACTIONAL_SECOND_FIELD = 8, - UDAT_DAY_OF_WEEK_FIELD = 9, - UDAT_DAY_OF_YEAR_FIELD = 10, - UDAT_DAY_OF_WEEK_IN_MONTH_FIELD = 11, - UDAT_WEEK_OF_YEAR_FIELD = 12, - UDAT_WEEK_OF_MONTH_FIELD = 13, - UDAT_AM_PM_FIELD = 14, - UDAT_HOUR1_FIELD = 15, - UDAT_HOUR0_FIELD = 16, - UDAT_TIMEZONE_FIELD = 17, - UDAT_YEAR_WOY_FIELD = 18, - UDAT_DOW_LOCAL_FIELD = 19, - UDAT_EXTENDED_YEAR_FIELD = 20, - UDAT_JULIAN_DAY_FIELD = 21, - UDAT_MILLISECONDS_IN_DAY_FIELD = 22, - UDAT_TIMEZONE_RFC_FIELD = 23, - UDAT_TIMEZONE_GENERIC_FIELD = 24, - UDAT_STANDALONE_DAY_FIELD = 25, - UDAT_STANDALONE_MONTH_FIELD = 26, - UDAT_QUARTER_FIELD = 27, - UDAT_STANDALONE_QUARTER_FIELD = 28, - UDAT_TIMEZONE_SPECIAL_FIELD = 29, - UDAT_YEAR_NAME_FIELD = 30, - UDAT_TIMEZONE_LOCALIZED_GMT_OFFSET_FIELD = 31, - UDAT_TIMEZONE_ISO_FIELD = 32, - UDAT_TIMEZONE_ISO_LOCAL_FIELD = 33, - UDAT_RELATED_YEAR_FIELD = 34, - UDAT_AM_PM_MIDNIGHT_NOON_FIELD = 35, - UDAT_FLEXIBLE_DAY_PERIOD_FIELD = 36, - UDAT_TIME_SEPARATOR_FIELD = 37, - UDAT_FIELD_COUNT = 38, -} -extern "C" { - pub fn udat_toCalendarDateField_66(field: UDateFormatField) -> UCalendarDateFields; -} -extern "C" { - pub fn udat_open_66( - timeStyle: UDateFormatStyle, - dateStyle: UDateFormatStyle, - locale: *const ::std::os::raw::c_char, - tzID: *const UChar, - tzIDLength: i32, - pattern: *const UChar, - patternLength: i32, - status: *mut UErrorCode, - ) -> *mut UDateFormat; -} -extern "C" { - pub fn udat_close_66(format: *mut UDateFormat); -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UDateFormatBooleanAttribute { - UDAT_PARSE_ALLOW_WHITESPACE = 0, - UDAT_PARSE_ALLOW_NUMERIC = 1, - UDAT_PARSE_PARTIAL_LITERAL_MATCH = 2, - UDAT_PARSE_MULTIPLE_PATTERNS_FOR_MATCH = 3, - UDAT_BOOLEAN_ATTRIBUTE_COUNT = 4, -} -extern "C" { - pub fn udat_getBooleanAttribute_66( - fmt: *const UDateFormat, - attr: UDateFormatBooleanAttribute, - status: *mut UErrorCode, - ) -> UBool; -} -extern "C" { - pub fn udat_setBooleanAttribute_66( - fmt: *mut UDateFormat, - attr: UDateFormatBooleanAttribute, - newValue: UBool, - status: *mut UErrorCode, + assert_eq!( + unsafe { &(*(::std::ptr::null::())).hasPrevious as *const _ as usize }, + 56usize, + concat!( + "Offset of field: ", + stringify!(UCharIterator), + "::", + stringify!(hasPrevious) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).current as *const _ as usize }, + 64usize, + concat!( + "Offset of field: ", + stringify!(UCharIterator), + "::", + stringify!(current) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).next as *const _ as usize }, + 72usize, + concat!( + "Offset of field: ", + stringify!(UCharIterator), + "::", + stringify!(next) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).previous as *const _ as usize }, + 80usize, + concat!( + "Offset of field: ", + stringify!(UCharIterator), + "::", + stringify!(previous) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).reservedFn as *const _ as usize }, + 88usize, + concat!( + "Offset of field: ", + stringify!(UCharIterator), + "::", + stringify!(reservedFn) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).getState as *const _ as usize }, + 96usize, + concat!( + "Offset of field: ", + stringify!(UCharIterator), + "::", + stringify!(getState) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).setState as *const _ as usize }, + 104usize, + concat!( + "Offset of field: ", + stringify!(UCharIterator), + "::", + stringify!(setState) + ) ); } -extern "C" { - pub fn udat_clone_66(fmt: *const UDateFormat, status: *mut UErrorCode) -> *mut UDateFormat; -} -extern "C" { - pub fn udat_format_66( - format: *const UDateFormat, - dateToFormat: UDate, - result: *mut UChar, - resultLength: i32, - position: *mut UFieldPosition, - status: *mut UErrorCode, - ) -> i32; +impl Default for UCharIterator { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } } -extern "C" { - pub fn udat_formatCalendar_66( - format: *const UDateFormat, - calendar: *mut UCalendar, - result: *mut UChar, - capacity: i32, - position: *mut UFieldPosition, - status: *mut UErrorCode, - ) -> i32; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct UCPMap { + _unused: [u8; 0], } -extern "C" { - pub fn udat_formatForFields_66( - format: *const UDateFormat, - dateToFormat: UDate, - result: *mut UChar, - resultLength: i32, - fpositer: *mut UFieldPositionIterator, - status: *mut UErrorCode, - ) -> i32; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct USet { + _unused: [u8; 0], } -extern "C" { - pub fn udat_formatCalendarForFields_66( - format: *const UDateFormat, - calendar: *mut UCalendar, - result: *mut UChar, - capacity: i32, - fpositer: *mut UFieldPositionIterator, - status: *mut UErrorCode, - ) -> i32; +impl UProperty { + pub const UCHAR_BINARY_START: UProperty = UProperty::UCHAR_ALPHABETIC; } -extern "C" { - pub fn udat_parse_66( - format: *const UDateFormat, - text: *const UChar, - textLength: i32, - parsePos: *mut i32, - status: *mut UErrorCode, - ) -> UDate; +impl UProperty { + pub const UCHAR_INT_START: UProperty = UProperty::UCHAR_BIDI_CLASS; } -extern "C" { - pub fn udat_parseCalendar_66( - format: *const UDateFormat, - calendar: *mut UCalendar, - text: *const UChar, - textLength: i32, - parsePos: *mut i32, - status: *mut UErrorCode, - ); +impl UProperty { + pub const UCHAR_MASK_START: UProperty = UProperty::UCHAR_GENERAL_CATEGORY_MASK; } -extern "C" { - pub fn udat_isLenient_66(fmt: *const UDateFormat) -> UBool; +impl UProperty { + pub const UCHAR_DOUBLE_START: UProperty = UProperty::UCHAR_NUMERIC_VALUE; } -extern "C" { - pub fn udat_setLenient_66(fmt: *mut UDateFormat, isLenient: UBool); +impl UProperty { + pub const UCHAR_STRING_START: UProperty = UProperty::UCHAR_AGE; } -extern "C" { - pub fn udat_getCalendar_66(fmt: *const UDateFormat) -> *const UCalendar; +impl UProperty { + pub const UCHAR_OTHER_PROPERTY_START: UProperty = UProperty::UCHAR_SCRIPT_EXTENSIONS; } -extern "C" { - pub fn udat_setCalendar_66(fmt: *mut UDateFormat, calendarToSet: *const UCalendar); +#[repr(i32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] +pub enum UProperty { + UCHAR_ALPHABETIC = 0, + UCHAR_ASCII_HEX_DIGIT = 1, + UCHAR_BIDI_CONTROL = 2, + UCHAR_BIDI_MIRRORED = 3, + UCHAR_DASH = 4, + UCHAR_DEFAULT_IGNORABLE_CODE_POINT = 5, + UCHAR_DEPRECATED = 6, + UCHAR_DIACRITIC = 7, + UCHAR_EXTENDER = 8, + UCHAR_FULL_COMPOSITION_EXCLUSION = 9, + UCHAR_GRAPHEME_BASE = 10, + UCHAR_GRAPHEME_EXTEND = 11, + UCHAR_GRAPHEME_LINK = 12, + UCHAR_HEX_DIGIT = 13, + UCHAR_HYPHEN = 14, + UCHAR_ID_CONTINUE = 15, + UCHAR_ID_START = 16, + UCHAR_IDEOGRAPHIC = 17, + UCHAR_IDS_BINARY_OPERATOR = 18, + UCHAR_IDS_TRINARY_OPERATOR = 19, + UCHAR_JOIN_CONTROL = 20, + UCHAR_LOGICAL_ORDER_EXCEPTION = 21, + UCHAR_LOWERCASE = 22, + UCHAR_MATH = 23, + UCHAR_NONCHARACTER_CODE_POINT = 24, + UCHAR_QUOTATION_MARK = 25, + UCHAR_RADICAL = 26, + UCHAR_SOFT_DOTTED = 27, + UCHAR_TERMINAL_PUNCTUATION = 28, + UCHAR_UNIFIED_IDEOGRAPH = 29, + UCHAR_UPPERCASE = 30, + UCHAR_WHITE_SPACE = 31, + UCHAR_XID_CONTINUE = 32, + UCHAR_XID_START = 33, + UCHAR_CASE_SENSITIVE = 34, + UCHAR_S_TERM = 35, + UCHAR_VARIATION_SELECTOR = 36, + UCHAR_NFD_INERT = 37, + UCHAR_NFKD_INERT = 38, + UCHAR_NFC_INERT = 39, + UCHAR_NFKC_INERT = 40, + UCHAR_SEGMENT_STARTER = 41, + UCHAR_PATTERN_SYNTAX = 42, + UCHAR_PATTERN_WHITE_SPACE = 43, + UCHAR_POSIX_ALNUM = 44, + UCHAR_POSIX_BLANK = 45, + UCHAR_POSIX_GRAPH = 46, + UCHAR_POSIX_PRINT = 47, + UCHAR_POSIX_XDIGIT = 48, + UCHAR_CASED = 49, + UCHAR_CASE_IGNORABLE = 50, + UCHAR_CHANGES_WHEN_LOWERCASED = 51, + UCHAR_CHANGES_WHEN_UPPERCASED = 52, + UCHAR_CHANGES_WHEN_TITLECASED = 53, + UCHAR_CHANGES_WHEN_CASEFOLDED = 54, + UCHAR_CHANGES_WHEN_CASEMAPPED = 55, + UCHAR_CHANGES_WHEN_NFKC_CASEFOLDED = 56, + UCHAR_EMOJI = 57, + UCHAR_EMOJI_PRESENTATION = 58, + UCHAR_EMOJI_MODIFIER = 59, + UCHAR_EMOJI_MODIFIER_BASE = 60, + UCHAR_EMOJI_COMPONENT = 61, + UCHAR_REGIONAL_INDICATOR = 62, + UCHAR_PREPENDED_CONCATENATION_MARK = 63, + UCHAR_EXTENDED_PICTOGRAPHIC = 64, + UCHAR_BINARY_LIMIT = 65, + UCHAR_BIDI_CLASS = 4096, + UCHAR_BLOCK = 4097, + UCHAR_CANONICAL_COMBINING_CLASS = 4098, + UCHAR_DECOMPOSITION_TYPE = 4099, + UCHAR_EAST_ASIAN_WIDTH = 4100, + UCHAR_GENERAL_CATEGORY = 4101, + UCHAR_JOINING_GROUP = 4102, + UCHAR_JOINING_TYPE = 4103, + UCHAR_LINE_BREAK = 4104, + UCHAR_NUMERIC_TYPE = 4105, + UCHAR_SCRIPT = 4106, + UCHAR_HANGUL_SYLLABLE_TYPE = 4107, + UCHAR_NFD_QUICK_CHECK = 4108, + UCHAR_NFKD_QUICK_CHECK = 4109, + UCHAR_NFC_QUICK_CHECK = 4110, + UCHAR_NFKC_QUICK_CHECK = 4111, + UCHAR_LEAD_CANONICAL_COMBINING_CLASS = 4112, + UCHAR_TRAIL_CANONICAL_COMBINING_CLASS = 4113, + UCHAR_GRAPHEME_CLUSTER_BREAK = 4114, + UCHAR_SENTENCE_BREAK = 4115, + UCHAR_WORD_BREAK = 4116, + UCHAR_BIDI_PAIRED_BRACKET_TYPE = 4117, + UCHAR_INDIC_POSITIONAL_CATEGORY = 4118, + UCHAR_INDIC_SYLLABIC_CATEGORY = 4119, + UCHAR_VERTICAL_ORIENTATION = 4120, + UCHAR_INT_LIMIT = 4121, + UCHAR_GENERAL_CATEGORY_MASK = 8192, + UCHAR_MASK_LIMIT = 8193, + UCHAR_NUMERIC_VALUE = 12288, + UCHAR_DOUBLE_LIMIT = 12289, + UCHAR_AGE = 16384, + UCHAR_BIDI_MIRRORING_GLYPH = 16385, + UCHAR_CASE_FOLDING = 16386, + UCHAR_ISO_COMMENT = 16387, + UCHAR_LOWERCASE_MAPPING = 16388, + UCHAR_NAME = 16389, + UCHAR_SIMPLE_CASE_FOLDING = 16390, + UCHAR_SIMPLE_LOWERCASE_MAPPING = 16391, + UCHAR_SIMPLE_TITLECASE_MAPPING = 16392, + UCHAR_SIMPLE_UPPERCASE_MAPPING = 16393, + UCHAR_TITLECASE_MAPPING = 16394, + UCHAR_UNICODE_1_NAME = 16395, + UCHAR_UPPERCASE_MAPPING = 16396, + UCHAR_BIDI_PAIRED_BRACKET = 16397, + UCHAR_STRING_LIMIT = 16398, + UCHAR_SCRIPT_EXTENSIONS = 28672, + UCHAR_OTHER_PROPERTY_LIMIT = 28673, + UCHAR_INVALID_CODE = -1, +} +impl UCharCategory { + pub const U_GENERAL_OTHER_TYPES: UCharCategory = UCharCategory::U_UNASSIGNED; +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] +pub enum UCharCategory { + U_UNASSIGNED = 0, + U_UPPERCASE_LETTER = 1, + U_LOWERCASE_LETTER = 2, + U_TITLECASE_LETTER = 3, + U_MODIFIER_LETTER = 4, + U_OTHER_LETTER = 5, + U_NON_SPACING_MARK = 6, + U_ENCLOSING_MARK = 7, + U_COMBINING_SPACING_MARK = 8, + U_DECIMAL_DIGIT_NUMBER = 9, + U_LETTER_NUMBER = 10, + U_OTHER_NUMBER = 11, + U_SPACE_SEPARATOR = 12, + U_LINE_SEPARATOR = 13, + U_PARAGRAPH_SEPARATOR = 14, + U_CONTROL_CHAR = 15, + U_FORMAT_CHAR = 16, + U_PRIVATE_USE_CHAR = 17, + U_SURROGATE = 18, + U_DASH_PUNCTUATION = 19, + U_START_PUNCTUATION = 20, + U_END_PUNCTUATION = 21, + U_CONNECTOR_PUNCTUATION = 22, + U_OTHER_PUNCTUATION = 23, + U_MATH_SYMBOL = 24, + U_CURRENCY_SYMBOL = 25, + U_MODIFIER_SYMBOL = 26, + U_OTHER_SYMBOL = 27, + U_INITIAL_PUNCTUATION = 28, + U_FINAL_PUNCTUATION = 29, + U_CHAR_CATEGORY_COUNT = 30, +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] +pub enum UCharDirection { + U_LEFT_TO_RIGHT = 0, + U_RIGHT_TO_LEFT = 1, + U_EUROPEAN_NUMBER = 2, + U_EUROPEAN_NUMBER_SEPARATOR = 3, + U_EUROPEAN_NUMBER_TERMINATOR = 4, + U_ARABIC_NUMBER = 5, + U_COMMON_NUMBER_SEPARATOR = 6, + U_BLOCK_SEPARATOR = 7, + U_SEGMENT_SEPARATOR = 8, + U_WHITE_SPACE_NEUTRAL = 9, + U_OTHER_NEUTRAL = 10, + U_LEFT_TO_RIGHT_EMBEDDING = 11, + U_LEFT_TO_RIGHT_OVERRIDE = 12, + U_RIGHT_TO_LEFT_ARABIC = 13, + U_RIGHT_TO_LEFT_EMBEDDING = 14, + U_RIGHT_TO_LEFT_OVERRIDE = 15, + U_POP_DIRECTIONAL_FORMAT = 16, + U_DIR_NON_SPACING_MARK = 17, + U_BOUNDARY_NEUTRAL = 18, + U_FIRST_STRONG_ISOLATE = 19, + U_LEFT_TO_RIGHT_ISOLATE = 20, + U_RIGHT_TO_LEFT_ISOLATE = 21, + U_POP_DIRECTIONAL_ISOLATE = 22, + U_CHAR_DIRECTION_COUNT = 23, +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] +pub enum UCharNameChoice { + U_UNICODE_CHAR_NAME = 0, + U_UNICODE_10_CHAR_NAME = 1, + U_EXTENDED_CHAR_NAME = 2, + U_CHAR_NAME_ALIAS = 3, + U_CHAR_NAME_CHOICE_COUNT = 4, +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] +pub enum UPropertyNameChoice { + U_SHORT_PROPERTY_NAME = 0, + U_LONG_PROPERTY_NAME = 1, + U_PROPERTY_NAME_CHOICE_COUNT = 2, } extern "C" { - pub fn udat_getNumberFormat_66(fmt: *const UDateFormat) -> *const UNumberFormat; + pub fn u_hasBinaryProperty_66(c: UChar32, which: UProperty) -> UBool; } extern "C" { - pub fn udat_getNumberFormatForField_66( - fmt: *const UDateFormat, - field: UChar, - ) -> *const UNumberFormat; + pub fn u_getBinaryPropertySet_66( + property: UProperty, + pErrorCode: *mut UErrorCode, + ) -> *const USet; } extern "C" { - pub fn udat_adoptNumberFormatForFields_66( - fmt: *mut UDateFormat, - fields: *const UChar, - numberFormatToSet: *mut UNumberFormat, - status: *mut UErrorCode, - ); + pub fn u_isUAlphabetic_66(c: UChar32) -> UBool; } extern "C" { - pub fn udat_setNumberFormat_66(fmt: *mut UDateFormat, numberFormatToSet: *const UNumberFormat); + pub fn u_isULowercase_66(c: UChar32) -> UBool; } extern "C" { - pub fn udat_adoptNumberFormat_66( - fmt: *mut UDateFormat, - numberFormatToAdopt: *mut UNumberFormat, - ); + pub fn u_isUUppercase_66(c: UChar32) -> UBool; } extern "C" { - pub fn udat_getAvailable_66(localeIndex: i32) -> *const ::std::os::raw::c_char; + pub fn u_isUWhiteSpace_66(c: UChar32) -> UBool; } extern "C" { - pub fn udat_countAvailable_66() -> i32; + pub fn u_getIntPropertyValue_66(c: UChar32, which: UProperty) -> i32; } extern "C" { - pub fn udat_get2DigitYearStart_66(fmt: *const UDateFormat, status: *mut UErrorCode) -> UDate; + pub fn u_getIntPropertyMinValue_66(which: UProperty) -> i32; } extern "C" { - pub fn udat_set2DigitYearStart_66(fmt: *mut UDateFormat, d: UDate, status: *mut UErrorCode); + pub fn u_getIntPropertyMaxValue_66(which: UProperty) -> i32; } extern "C" { - pub fn udat_toPattern_66( - fmt: *const UDateFormat, - localized: UBool, - result: *mut UChar, - resultLength: i32, - status: *mut UErrorCode, - ) -> i32; + pub fn u_getIntPropertyMap_66( + property: UProperty, + pErrorCode: *mut UErrorCode, + ) -> *const UCPMap; } extern "C" { - pub fn udat_applyPattern_66( - format: *mut UDateFormat, - localized: UBool, - pattern: *const UChar, - patternLength: i32, - ); + pub fn u_getNumericValue_66(c: UChar32) -> f64; } -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UDateFormatSymbolType { - UDAT_ERAS = 0, - UDAT_MONTHS = 1, - UDAT_SHORT_MONTHS = 2, - UDAT_WEEKDAYS = 3, - UDAT_SHORT_WEEKDAYS = 4, - UDAT_AM_PMS = 5, - UDAT_LOCALIZED_CHARS = 6, - UDAT_ERA_NAMES = 7, - UDAT_NARROW_MONTHS = 8, - UDAT_NARROW_WEEKDAYS = 9, - UDAT_STANDALONE_MONTHS = 10, - UDAT_STANDALONE_SHORT_MONTHS = 11, - UDAT_STANDALONE_NARROW_MONTHS = 12, - UDAT_STANDALONE_WEEKDAYS = 13, - UDAT_STANDALONE_SHORT_WEEKDAYS = 14, - UDAT_STANDALONE_NARROW_WEEKDAYS = 15, - UDAT_QUARTERS = 16, - UDAT_SHORT_QUARTERS = 17, - UDAT_STANDALONE_QUARTERS = 18, - UDAT_STANDALONE_SHORT_QUARTERS = 19, - UDAT_SHORTER_WEEKDAYS = 20, - UDAT_STANDALONE_SHORTER_WEEKDAYS = 21, - UDAT_CYCLIC_YEARS_WIDE = 22, - UDAT_CYCLIC_YEARS_ABBREVIATED = 23, - UDAT_CYCLIC_YEARS_NARROW = 24, - UDAT_ZODIAC_NAMES_WIDE = 25, - UDAT_ZODIAC_NAMES_ABBREVIATED = 26, - UDAT_ZODIAC_NAMES_NARROW = 27, +extern "C" { + pub fn u_islower_66(c: UChar32) -> UBool; } -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct UDateFormatSymbols { - _unused: [u8; 0], +extern "C" { + pub fn u_isupper_66(c: UChar32) -> UBool; } extern "C" { - pub fn udat_getSymbols_66( - fmt: *const UDateFormat, - type_: UDateFormatSymbolType, - symbolIndex: i32, - result: *mut UChar, - resultLength: i32, - status: *mut UErrorCode, - ) -> i32; + pub fn u_istitle_66(c: UChar32) -> UBool; } extern "C" { - pub fn udat_countSymbols_66(fmt: *const UDateFormat, type_: UDateFormatSymbolType) -> i32; + pub fn u_isdigit_66(c: UChar32) -> UBool; } extern "C" { - pub fn udat_setSymbols_66( - format: *mut UDateFormat, - type_: UDateFormatSymbolType, - symbolIndex: i32, - value: *mut UChar, - valueLength: i32, - status: *mut UErrorCode, - ); + pub fn u_isalpha_66(c: UChar32) -> UBool; } extern "C" { - pub fn udat_getLocaleByType_66( - fmt: *const UDateFormat, - type_: ULocDataLocaleType, - status: *mut UErrorCode, - ) -> *const ::std::os::raw::c_char; + pub fn u_isalnum_66(c: UChar32) -> UBool; } extern "C" { - pub fn udat_setContext_66( - fmt: *mut UDateFormat, - value: UDisplayContext, - status: *mut UErrorCode, - ); + pub fn u_isxdigit_66(c: UChar32) -> UBool; } extern "C" { - pub fn udat_getContext_66( - fmt: *const UDateFormat, - type_: UDisplayContextType, - status: *mut UErrorCode, - ) -> UDisplayContext; + pub fn u_ispunct_66(c: UChar32) -> UBool; } extern "C" { - pub fn udat_toPatternRelativeDate_66( - fmt: *const UDateFormat, - result: *mut UChar, - resultLength: i32, - status: *mut UErrorCode, - ) -> i32; + pub fn u_isgraph_66(c: UChar32) -> UBool; } extern "C" { - pub fn udat_toPatternRelativeTime_66( - fmt: *const UDateFormat, - result: *mut UChar, - resultLength: i32, - status: *mut UErrorCode, - ) -> i32; + pub fn u_isblank_66(c: UChar32) -> UBool; } extern "C" { - pub fn udat_applyPatternRelative_66( - format: *mut UDateFormat, - datePattern: *const UChar, - datePatternLength: i32, - timePattern: *const UChar, - timePatternLength: i32, - status: *mut UErrorCode, - ); + pub fn u_isdefined_66(c: UChar32) -> UBool; } -pub type UDateFormatOpener = ::std::option::Option< - unsafe extern "C" fn( - timeStyle: UDateFormatStyle, - dateStyle: UDateFormatStyle, - locale: *const ::std::os::raw::c_char, - tzID: *const UChar, - tzIDLength: i32, - pattern: *const UChar, - patternLength: i32, - status: *mut UErrorCode, - ) -> *mut UDateFormat, ->; extern "C" { - pub fn udat_registerOpener_66(opener: UDateFormatOpener, status: *mut UErrorCode); + pub fn u_isspace_66(c: UChar32) -> UBool; } extern "C" { - pub fn udat_unregisterOpener_66( - opener: UDateFormatOpener, - status: *mut UErrorCode, - ) -> UDateFormatOpener; + pub fn u_isJavaSpaceChar_66(c: UChar32) -> UBool; } -#[repr(C)] -#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, PartialEq)] -pub struct UDataInfo { - pub size: u16, - pub reservedWord: u16, - pub isBigEndian: u8, - pub charsetFamily: u8, - pub sizeofUChar: u8, - pub reservedByte: u8, - pub dataFormat: [u8; 4usize], - pub formatVersion: [u8; 4usize], - pub dataVersion: [u8; 4usize], +extern "C" { + pub fn u_isWhitespace_66(c: UChar32) -> UBool; } -#[test] -fn bindgen_test_layout_UDataInfo() { - assert_eq!( - ::std::mem::size_of::(), - 20usize, - concat!("Size of: ", stringify!(UDataInfo)) - ); - assert_eq!( - ::std::mem::align_of::(), - 2usize, - concat!("Alignment of ", stringify!(UDataInfo)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).size as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(UDataInfo), - "::", - stringify!(size) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).reservedWord as *const _ as usize }, - 2usize, - concat!( - "Offset of field: ", - stringify!(UDataInfo), - "::", - stringify!(reservedWord) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).isBigEndian as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(UDataInfo), - "::", - stringify!(isBigEndian) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).charsetFamily as *const _ as usize }, - 5usize, - concat!( - "Offset of field: ", - stringify!(UDataInfo), - "::", - stringify!(charsetFamily) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).sizeofUChar as *const _ as usize }, - 6usize, - concat!( - "Offset of field: ", - stringify!(UDataInfo), - "::", - stringify!(sizeofUChar) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).reservedByte as *const _ as usize }, - 7usize, - concat!( - "Offset of field: ", - stringify!(UDataInfo), - "::", - stringify!(reservedByte) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).dataFormat as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(UDataInfo), - "::", - stringify!(dataFormat) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).formatVersion as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(UDataInfo), - "::", - stringify!(formatVersion) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).dataVersion as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(UDataInfo), - "::", - stringify!(dataVersion) - ) - ); +extern "C" { + pub fn u_iscntrl_66(c: UChar32) -> UBool; } -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct UDataMemory { - _unused: [u8; 0], +extern "C" { + pub fn u_isISOControl_66(c: UChar32) -> UBool; } -pub type UDataMemoryIsAcceptable = ::std::option::Option< - unsafe extern "C" fn( - context: *mut ::std::os::raw::c_void, - type_: *const ::std::os::raw::c_char, - name: *const ::std::os::raw::c_char, - pInfo: *const UDataInfo, - ) -> UBool, ->; extern "C" { - pub fn udata_open_66( - path: *const ::std::os::raw::c_char, - type_: *const ::std::os::raw::c_char, - name: *const ::std::os::raw::c_char, - pErrorCode: *mut UErrorCode, - ) -> *mut UDataMemory; + pub fn u_isprint_66(c: UChar32) -> UBool; } extern "C" { - pub fn udata_openChoice_66( - path: *const ::std::os::raw::c_char, - type_: *const ::std::os::raw::c_char, - name: *const ::std::os::raw::c_char, - isAcceptable: UDataMemoryIsAcceptable, + pub fn u_isbase_66(c: UChar32) -> UBool; +} +extern "C" { + pub fn u_charDirection_66(c: UChar32) -> UCharDirection; +} +extern "C" { + pub fn u_isMirrored_66(c: UChar32) -> UBool; +} +extern "C" { + pub fn u_charMirror_66(c: UChar32) -> UChar32; +} +extern "C" { + pub fn u_getBidiPairedBracket_66(c: UChar32) -> UChar32; +} +extern "C" { + pub fn u_charType_66(c: UChar32) -> i8; +} +pub type UCharEnumTypeRange = ::std::option::Option< + unsafe extern "C" fn( + context: *const ::std::os::raw::c_void, + start: UChar32, + limit: UChar32, + type_: UCharCategory, + ) -> UBool, +>; +extern "C" { + pub fn u_enumCharTypes_66( + enumRange: UCharEnumTypeRange, + context: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn u_getCombiningClass_66(c: UChar32) -> u8; +} +extern "C" { + pub fn u_charDigitValue_66(c: UChar32) -> i32; +} +extern "C" { + pub fn u_charName_66( + code: UChar32, + nameChoice: UCharNameChoice, + buffer: *mut ::std::os::raw::c_char, + bufferLength: i32, + pErrorCode: *mut UErrorCode, + ) -> i32; +} +extern "C" { + pub fn u_getISOComment_66( + c: UChar32, + dest: *mut ::std::os::raw::c_char, + destCapacity: i32, + pErrorCode: *mut UErrorCode, + ) -> i32; +} +extern "C" { + pub fn u_charFromName_66( + nameChoice: UCharNameChoice, + name: *const ::std::os::raw::c_char, + pErrorCode: *mut UErrorCode, + ) -> UChar32; +} +pub type UEnumCharNamesFn = ::std::option::Option< + unsafe extern "C" fn( context: *mut ::std::os::raw::c_void, + code: UChar32, + nameChoice: UCharNameChoice, + name: *const ::std::os::raw::c_char, + length: i32, + ) -> UBool, +>; +extern "C" { + pub fn u_enumCharNames_66( + start: UChar32, + limit: UChar32, + fn_: UEnumCharNamesFn, + context: *mut ::std::os::raw::c_void, + nameChoice: UCharNameChoice, pErrorCode: *mut UErrorCode, - ) -> *mut UDataMemory; + ); } extern "C" { - pub fn udata_close_66(pData: *mut UDataMemory); + pub fn u_getPropertyName_66( + property: UProperty, + nameChoice: UPropertyNameChoice, + ) -> *const ::std::os::raw::c_char; } extern "C" { - pub fn udata_getMemory_66(pData: *mut UDataMemory) -> *const ::std::os::raw::c_void; + pub fn u_getPropertyEnum_66(alias: *const ::std::os::raw::c_char) -> UProperty; } extern "C" { - pub fn udata_getInfo_66(pData: *mut UDataMemory, pInfo: *mut UDataInfo); + pub fn u_getPropertyValueName_66( + property: UProperty, + value: i32, + nameChoice: UPropertyNameChoice, + ) -> *const ::std::os::raw::c_char; } extern "C" { - pub fn udata_setCommonData_66(data: *const ::std::os::raw::c_void, err: *mut UErrorCode); + pub fn u_getPropertyValueEnum_66( + property: UProperty, + alias: *const ::std::os::raw::c_char, + ) -> i32; } extern "C" { - pub fn udata_setAppData_66( - packageName: *const ::std::os::raw::c_char, - data: *const ::std::os::raw::c_void, - err: *mut UErrorCode, - ); + pub fn u_isIDStart_66(c: UChar32) -> UBool; } -impl UDataFileAccess { - pub const UDATA_DEFAULT_ACCESS: UDataFileAccess = UDataFileAccess::UDATA_FILES_FIRST; +extern "C" { + pub fn u_isIDPart_66(c: UChar32) -> UBool; } -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UDataFileAccess { - UDATA_FILES_FIRST = 0, - UDATA_ONLY_PACKAGES = 1, - UDATA_PACKAGES_FIRST = 2, - UDATA_NO_FILES = 3, - UDATA_FILE_ACCESS_COUNT = 4, +extern "C" { + pub fn u_isIDIgnorable_66(c: UChar32) -> UBool; } extern "C" { - pub fn udata_setFileAccess_66(access: UDataFileAccess, status: *mut UErrorCode); + pub fn u_isJavaIDStart_66(c: UChar32) -> UBool; } extern "C" { - pub fn u_getDataDirectory_66() -> *const ::std::os::raw::c_char; + pub fn u_isJavaIDPart_66(c: UChar32) -> UBool; } extern "C" { - pub fn u_setDataDirectory_66(directory: *const ::std::os::raw::c_char); + pub fn u_tolower_66(c: UChar32) -> UChar32; } extern "C" { - pub fn u_getTimeZoneFilesDirectory_66(status: *mut UErrorCode) - -> *const ::std::os::raw::c_char; + pub fn u_toupper_66(c: UChar32) -> UChar32; } extern "C" { - pub fn u_setTimeZoneFilesDirectory_66( - path: *const ::std::os::raw::c_char, - status: *mut UErrorCode, - ); + pub fn u_totitle_66(c: UChar32) -> UChar32; } extern "C" { - pub fn u_charsToUChars_66(cs: *const ::std::os::raw::c_char, us: *mut UChar, length: i32); + pub fn u_foldCase_66(c: UChar32, options: u32) -> UChar32; } extern "C" { - pub fn u_UCharsToChars_66(us: *const UChar, cs: *mut ::std::os::raw::c_char, length: i32); + pub fn u_digit_66(ch: UChar32, radix: i8) -> i32; +} +extern "C" { + pub fn u_forDigit_66(digit: i32, radix: i8) -> UChar32; +} +extern "C" { + pub fn u_charAge_66(c: UChar32, versionArray: *mut u8); +} +extern "C" { + pub fn u_getUnicodeVersion_66(versionArray: *mut u8); +} +extern "C" { + pub fn u_getFC_NFKC_Closure_66( + c: UChar32, + dest: *mut UChar, + destCapacity: i32, + pErrorCode: *mut UErrorCode, + ) -> i32; } #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UCharIteratorOrigin { - UITER_START = 0, - UITER_CURRENT = 1, - UITER_LIMIT = 2, - UITER_ZERO = 3, - UITER_LENGTH = 4, +pub enum USetSpanCondition { + USET_SPAN_NOT_CONTAINED = 0, + USET_SPAN_CONTAINED = 1, + USET_SPAN_SIMPLE = 2, + USET_SPAN_CONDITION_COUNT = 3, } -pub type UCharIteratorGetIndex = ::std::option::Option< - unsafe extern "C" fn(iter: *mut UCharIterator, origin: UCharIteratorOrigin) -> i32, ->; -pub type UCharIteratorMove = ::std::option::Option< - unsafe extern "C" fn(iter: *mut UCharIterator, delta: i32, origin: UCharIteratorOrigin) -> i32, ->; -pub type UCharIteratorHasNext = - ::std::option::Option UBool>; -pub type UCharIteratorHasPrevious = - ::std::option::Option UBool>; -pub type UCharIteratorCurrent = - ::std::option::Option UChar32>; -pub type UCharIteratorNext = - ::std::option::Option UChar32>; -pub type UCharIteratorPrevious = - ::std::option::Option UChar32>; -pub type UCharIteratorReserved = - ::std::option::Option i32>; -pub type UCharIteratorGetState = - ::std::option::Option u32>; -pub type UCharIteratorSetState = ::std::option::Option< - unsafe extern "C" fn(iter: *mut UCharIterator, state: u32, pErrorCode: *mut UErrorCode), ->; #[repr(C)] -#[derive(Debug, Copy, Clone, Hash, PartialOrd, PartialEq)] -pub struct UCharIterator { - pub context: *const ::std::os::raw::c_void, - pub length: i32, - pub start: i32, - pub index: i32, - pub limit: i32, - pub reservedField: i32, - pub getIndex: UCharIteratorGetIndex, - pub move_: UCharIteratorMove, - pub hasNext: UCharIteratorHasNext, - pub hasPrevious: UCharIteratorHasPrevious, - pub current: UCharIteratorCurrent, - pub next: UCharIteratorNext, - pub previous: UCharIteratorPrevious, - pub reservedFn: UCharIteratorReserved, - pub getState: UCharIteratorGetState, - pub setState: UCharIteratorSetState, +#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, PartialEq)] +pub struct UParseError { + pub line: i32, + pub offset: i32, + pub preContext: [UChar; 16usize], + pub postContext: [UChar; 16usize], } #[test] -fn bindgen_test_layout_UCharIterator() { +fn bindgen_test_layout_UParseError() { assert_eq!( - ::std::mem::size_of::(), - 112usize, - concat!("Size of: ", stringify!(UCharIterator)) + ::std::mem::size_of::(), + 72usize, + concat!("Size of: ", stringify!(UParseError)) ); assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(UCharIterator)) + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(UParseError)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).context as *const _ as usize }, + unsafe { &(*(::std::ptr::null::())).line as *const _ as usize }, 0usize, concat!( "Offset of field: ", - stringify!(UCharIterator), + stringify!(UParseError), "::", - stringify!(context) + stringify!(line) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).length as *const _ as usize }, - 8usize, + unsafe { &(*(::std::ptr::null::())).offset as *const _ as usize }, + 4usize, concat!( "Offset of field: ", - stringify!(UCharIterator), + stringify!(UParseError), "::", - stringify!(length) + stringify!(offset) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).start as *const _ as usize }, - 12usize, + unsafe { &(*(::std::ptr::null::())).preContext as *const _ as usize }, + 8usize, concat!( "Offset of field: ", - stringify!(UCharIterator), + stringify!(UParseError), "::", - stringify!(start) + stringify!(preContext) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).index as *const _ as usize }, - 16usize, + unsafe { &(*(::std::ptr::null::())).postContext as *const _ as usize }, + 40usize, concat!( "Offset of field: ", - stringify!(UCharIterator), + stringify!(UParseError), "::", - stringify!(index) + stringify!(postContext) ) ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).limit as *const _ as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(UCharIterator), - "::", - stringify!(limit) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).reservedField as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(UCharIterator), - "::", - stringify!(reservedField) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).getIndex as *const _ as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(UCharIterator), - "::", - stringify!(getIndex) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).move_ as *const _ as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(UCharIterator), - "::", - stringify!(move_) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).hasNext as *const _ as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(UCharIterator), - "::", - stringify!(hasNext) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).hasPrevious as *const _ as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(UCharIterator), - "::", - stringify!(hasPrevious) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).current as *const _ as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(UCharIterator), - "::", - stringify!(current) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).next as *const _ as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(UCharIterator), - "::", - stringify!(next) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).previous as *const _ as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(UCharIterator), - "::", - stringify!(previous) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).reservedFn as *const _ as usize }, - 88usize, - concat!( - "Offset of field: ", - stringify!(UCharIterator), - "::", - stringify!(reservedFn) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).getState as *const _ as usize }, - 96usize, - concat!( - "Offset of field: ", - stringify!(UCharIterator), - "::", - stringify!(getState) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).setState as *const _ as usize }, - 104usize, - concat!( - "Offset of field: ", - stringify!(UCharIterator), - "::", - stringify!(setState) - ) - ); -} -impl Default for UCharIterator { - fn default() -> Self { - unsafe { ::std::mem::zeroed() } - } } #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct UBreakIterator { +pub struct UCollator { _unused: [u8; 0], } -extern "C" { - pub fn u_strlen_66(s: *const UChar) -> i32; +#[repr(i32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] +pub enum UCollationResult { + UCOL_EQUAL = 0, + UCOL_GREATER = 1, + UCOL_LESS = -1, } -extern "C" { - pub fn u_countChar32_66(s: *const UChar, length: i32) -> i32; +impl UColAttributeValue { + pub const UCOL_DEFAULT_STRENGTH: UColAttributeValue = UColAttributeValue::UCOL_TERTIARY; } -extern "C" { - pub fn u_strHasMoreChar32Than_66(s: *const UChar, length: i32, number: i32) -> UBool; +impl UColAttributeValue { + pub const UCOL_QUATERNARY: UColAttributeValue = UColAttributeValue::UCOL_CE_STRENGTH_LIMIT; } -extern "C" { - pub fn u_strcat_66(dst: *mut UChar, src: *const UChar) -> *mut UChar; +impl UColAttributeValue { + pub const UCOL_OFF: UColAttributeValue = UColAttributeValue::UCOL_STRENGTH_LIMIT; } -extern "C" { - pub fn u_strncat_66(dst: *mut UChar, src: *const UChar, n: i32) -> *mut UChar; +#[repr(i32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] +pub enum UColAttributeValue { + UCOL_DEFAULT = -1, + UCOL_PRIMARY = 0, + UCOL_SECONDARY = 1, + UCOL_TERTIARY = 2, + UCOL_CE_STRENGTH_LIMIT = 3, + UCOL_IDENTICAL = 15, + UCOL_STRENGTH_LIMIT = 16, + UCOL_ON = 17, + UCOL_SHIFTED = 20, + UCOL_NON_IGNORABLE = 21, + UCOL_LOWER_FIRST = 24, + UCOL_UPPER_FIRST = 25, + UCOL_ATTRIBUTE_VALUE_COUNT = 26, } -extern "C" { - pub fn u_strstr_66(s: *const UChar, substring: *const UChar) -> *mut UChar; +impl UColReorderCode { + pub const UCOL_REORDER_CODE_OTHERS: UColReorderCode = UColReorderCode::UCOL_REORDER_CODE_NONE; } -extern "C" { - pub fn u_strFindFirst_66( - s: *const UChar, - length: i32, - substring: *const UChar, - subLength: i32, - ) -> *mut UChar; +impl UColReorderCode { + pub const UCOL_REORDER_CODE_FIRST: UColReorderCode = UColReorderCode::UCOL_REORDER_CODE_SPACE; } -extern "C" { - pub fn u_strchr_66(s: *const UChar, c: UChar) -> *mut UChar; +#[repr(i32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] +pub enum UColReorderCode { + UCOL_REORDER_CODE_DEFAULT = -1, + UCOL_REORDER_CODE_NONE = 103, + UCOL_REORDER_CODE_SPACE = 4096, + UCOL_REORDER_CODE_PUNCTUATION = 4097, + UCOL_REORDER_CODE_SYMBOL = 4098, + UCOL_REORDER_CODE_CURRENCY = 4099, + UCOL_REORDER_CODE_DIGIT = 4100, + UCOL_REORDER_CODE_LIMIT = 4101, } -extern "C" { - pub fn u_strchr32_66(s: *const UChar, c: UChar32) -> *mut UChar; +pub use self::UColAttributeValue as UCollationStrength; +impl UColAttribute { + pub const UCOL_DECOMPOSITION_MODE: UColAttribute = UColAttribute::UCOL_NORMALIZATION_MODE; } -extern "C" { - pub fn u_strrstr_66(s: *const UChar, substring: *const UChar) -> *mut UChar; +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] +pub enum UColAttribute { + UCOL_FRENCH_COLLATION = 0, + UCOL_ALTERNATE_HANDLING = 1, + UCOL_CASE_FIRST = 2, + UCOL_CASE_LEVEL = 3, + UCOL_NORMALIZATION_MODE = 4, + UCOL_STRENGTH = 5, + UCOL_HIRAGANA_QUATERNARY_MODE = 6, + UCOL_NUMERIC_COLLATION = 7, + UCOL_ATTRIBUTE_COUNT = 8, +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] +pub enum UColRuleOption { + UCOL_TAILORING_ONLY = 0, + UCOL_FULL_RULES = 1, } extern "C" { - pub fn u_strFindLast_66( - s: *const UChar, - length: i32, - substring: *const UChar, - subLength: i32, - ) -> *mut UChar; + pub fn ucol_open_66( + loc: *const ::std::os::raw::c_char, + status: *mut UErrorCode, + ) -> *mut UCollator; } extern "C" { - pub fn u_strrchr_66(s: *const UChar, c: UChar) -> *mut UChar; + pub fn ucol_openRules_66( + rules: *const UChar, + rulesLength: i32, + normalizationMode: UColAttributeValue, + strength: UCollationStrength, + parseError: *mut UParseError, + status: *mut UErrorCode, + ) -> *mut UCollator; } extern "C" { - pub fn u_strrchr32_66(s: *const UChar, c: UChar32) -> *mut UChar; + pub fn ucol_openFromShortString_66( + definition: *const ::std::os::raw::c_char, + forceDefaults: UBool, + parseError: *mut UParseError, + status: *mut UErrorCode, + ) -> *mut UCollator; } extern "C" { - pub fn u_strpbrk_66(string: *const UChar, matchSet: *const UChar) -> *mut UChar; + pub fn ucol_getContractions_66( + coll: *const UCollator, + conts: *mut USet, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_strcspn_66(string: *const UChar, matchSet: *const UChar) -> i32; + pub fn ucol_getContractionsAndExpansions_66( + coll: *const UCollator, + contractions: *mut USet, + expansions: *mut USet, + addPrefixes: UBool, + status: *mut UErrorCode, + ); } extern "C" { - pub fn u_strspn_66(string: *const UChar, matchSet: *const UChar) -> i32; + pub fn ucol_close_66(coll: *mut UCollator); } extern "C" { - pub fn u_strtok_r_66( - src: *mut UChar, - delim: *const UChar, - saveState: *mut *mut UChar, - ) -> *mut UChar; + pub fn ucol_strcoll_66( + coll: *const UCollator, + source: *const UChar, + sourceLength: i32, + target: *const UChar, + targetLength: i32, + ) -> UCollationResult; } extern "C" { - pub fn u_strcmp_66(s1: *const UChar, s2: *const UChar) -> i32; + pub fn ucol_strcollUTF8_66( + coll: *const UCollator, + source: *const ::std::os::raw::c_char, + sourceLength: i32, + target: *const ::std::os::raw::c_char, + targetLength: i32, + status: *mut UErrorCode, + ) -> UCollationResult; } extern "C" { - pub fn u_strcmpCodePointOrder_66(s1: *const UChar, s2: *const UChar) -> i32; + pub fn ucol_greater_66( + coll: *const UCollator, + source: *const UChar, + sourceLength: i32, + target: *const UChar, + targetLength: i32, + ) -> UBool; } extern "C" { - pub fn u_strCompare_66( - s1: *const UChar, - length1: i32, - s2: *const UChar, - length2: i32, - codePointOrder: UBool, - ) -> i32; + pub fn ucol_greaterOrEqual_66( + coll: *const UCollator, + source: *const UChar, + sourceLength: i32, + target: *const UChar, + targetLength: i32, + ) -> UBool; } extern "C" { - pub fn u_strCompareIter_66( - iter1: *mut UCharIterator, - iter2: *mut UCharIterator, - codePointOrder: UBool, - ) -> i32; + pub fn ucol_equal_66( + coll: *const UCollator, + source: *const UChar, + sourceLength: i32, + target: *const UChar, + targetLength: i32, + ) -> UBool; } extern "C" { - pub fn u_strCaseCompare_66( - s1: *const UChar, - length1: i32, - s2: *const UChar, - length2: i32, - options: u32, - pErrorCode: *mut UErrorCode, - ) -> i32; + pub fn ucol_strcollIter_66( + coll: *const UCollator, + sIter: *mut UCharIterator, + tIter: *mut UCharIterator, + status: *mut UErrorCode, + ) -> UCollationResult; } extern "C" { - pub fn u_strncmp_66(ucs1: *const UChar, ucs2: *const UChar, n: i32) -> i32; + pub fn ucol_getStrength_66(coll: *const UCollator) -> UCollationStrength; } extern "C" { - pub fn u_strncmpCodePointOrder_66(s1: *const UChar, s2: *const UChar, n: i32) -> i32; + pub fn ucol_setStrength_66(coll: *mut UCollator, strength: UCollationStrength); } extern "C" { - pub fn u_strcasecmp_66(s1: *const UChar, s2: *const UChar, options: u32) -> i32; + pub fn ucol_getReorderCodes_66( + coll: *const UCollator, + dest: *mut i32, + destCapacity: i32, + pErrorCode: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_strncasecmp_66(s1: *const UChar, s2: *const UChar, n: i32, options: u32) -> i32; + pub fn ucol_setReorderCodes_66( + coll: *mut UCollator, + reorderCodes: *const i32, + reorderCodesLength: i32, + pErrorCode: *mut UErrorCode, + ); } extern "C" { - pub fn u_memcasecmp_66(s1: *const UChar, s2: *const UChar, length: i32, options: u32) -> i32; + pub fn ucol_getEquivalentReorderCodes_66( + reorderCode: i32, + dest: *mut i32, + destCapacity: i32, + pErrorCode: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_strcpy_66(dst: *mut UChar, src: *const UChar) -> *mut UChar; + pub fn ucol_getDisplayName_66( + objLoc: *const ::std::os::raw::c_char, + dispLoc: *const ::std::os::raw::c_char, + result: *mut UChar, + resultLength: i32, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_strncpy_66(dst: *mut UChar, src: *const UChar, n: i32) -> *mut UChar; + pub fn ucol_getAvailable_66(localeIndex: i32) -> *const ::std::os::raw::c_char; } extern "C" { - pub fn u_uastrcpy_66(dst: *mut UChar, src: *const ::std::os::raw::c_char) -> *mut UChar; + pub fn ucol_countAvailable_66() -> i32; } extern "C" { - pub fn u_uastrncpy_66( - dst: *mut UChar, - src: *const ::std::os::raw::c_char, - n: i32, - ) -> *mut UChar; + pub fn ucol_openAvailableLocales_66(status: *mut UErrorCode) -> *mut UEnumeration; } extern "C" { - pub fn u_austrcpy_66( - dst: *mut ::std::os::raw::c_char, - src: *const UChar, - ) -> *mut ::std::os::raw::c_char; + pub fn ucol_getKeywords_66(status: *mut UErrorCode) -> *mut UEnumeration; } extern "C" { - pub fn u_austrncpy_66( - dst: *mut ::std::os::raw::c_char, - src: *const UChar, - n: i32, - ) -> *mut ::std::os::raw::c_char; + pub fn ucol_getKeywordValues_66( + keyword: *const ::std::os::raw::c_char, + status: *mut UErrorCode, + ) -> *mut UEnumeration; } extern "C" { - pub fn u_memcpy_66(dest: *mut UChar, src: *const UChar, count: i32) -> *mut UChar; + pub fn ucol_getKeywordValuesForLocale_66( + key: *const ::std::os::raw::c_char, + locale: *const ::std::os::raw::c_char, + commonlyUsed: UBool, + status: *mut UErrorCode, + ) -> *mut UEnumeration; } extern "C" { - pub fn u_memmove_66(dest: *mut UChar, src: *const UChar, count: i32) -> *mut UChar; + pub fn ucol_getFunctionalEquivalent_66( + result: *mut ::std::os::raw::c_char, + resultCapacity: i32, + keyword: *const ::std::os::raw::c_char, + locale: *const ::std::os::raw::c_char, + isAvailable: *mut UBool, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_memset_66(dest: *mut UChar, c: UChar, count: i32) -> *mut UChar; + pub fn ucol_getRules_66(coll: *const UCollator, length: *mut i32) -> *const UChar; } extern "C" { - pub fn u_memcmp_66(buf1: *const UChar, buf2: *const UChar, count: i32) -> i32; + pub fn ucol_getShortDefinitionString_66( + coll: *const UCollator, + locale: *const ::std::os::raw::c_char, + buffer: *mut ::std::os::raw::c_char, + capacity: i32, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_memcmpCodePointOrder_66(s1: *const UChar, s2: *const UChar, count: i32) -> i32; + pub fn ucol_normalizeShortDefinitionString_66( + source: *const ::std::os::raw::c_char, + destination: *mut ::std::os::raw::c_char, + capacity: i32, + parseError: *mut UParseError, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_memchr_66(s: *const UChar, c: UChar, count: i32) -> *mut UChar; + pub fn ucol_getSortKey_66( + coll: *const UCollator, + source: *const UChar, + sourceLength: i32, + result: *mut u8, + resultLength: i32, + ) -> i32; } extern "C" { - pub fn u_memchr32_66(s: *const UChar, c: UChar32, count: i32) -> *mut UChar; + pub fn ucol_nextSortKeyPart_66( + coll: *const UCollator, + iter: *mut UCharIterator, + state: *mut u32, + dest: *mut u8, + count: i32, + status: *mut UErrorCode, + ) -> i32; } -extern "C" { - pub fn u_memrchr_66(s: *const UChar, c: UChar, count: i32) -> *mut UChar; +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] +pub enum UColBoundMode { + UCOL_BOUND_LOWER = 0, + UCOL_BOUND_UPPER = 1, + UCOL_BOUND_UPPER_LONG = 2, + UCOL_BOUND_VALUE_COUNT = 3, } extern "C" { - pub fn u_memrchr32_66(s: *const UChar, c: UChar32, count: i32) -> *mut UChar; + pub fn ucol_getBound_66( + source: *const u8, + sourceLength: i32, + boundType: UColBoundMode, + noOfLevels: u32, + result: *mut u8, + resultLength: i32, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_unescape_66( - src: *const ::std::os::raw::c_char, - dest: *mut UChar, - destCapacity: i32, - ) -> i32; + pub fn ucol_getVersion_66(coll: *const UCollator, info: *mut u8); } -pub type UNESCAPE_CHAR_AT = ::std::option::Option< - unsafe extern "C" fn(offset: i32, context: *mut ::std::os::raw::c_void) -> UChar, ->; extern "C" { - pub fn u_unescapeAt_66( - charAt: UNESCAPE_CHAR_AT, - offset: *mut i32, - length: i32, - context: *mut ::std::os::raw::c_void, - ) -> UChar32; + pub fn ucol_getUCAVersion_66(coll: *const UCollator, info: *mut u8); } extern "C" { - pub fn u_strToUpper_66( - dest: *mut UChar, + pub fn ucol_mergeSortkeys_66( + src1: *const u8, + src1Length: i32, + src2: *const u8, + src2Length: i32, + dest: *mut u8, destCapacity: i32, - src: *const UChar, - srcLength: i32, - locale: *const ::std::os::raw::c_char, - pErrorCode: *mut UErrorCode, ) -> i32; } extern "C" { - pub fn u_strToLower_66( - dest: *mut UChar, - destCapacity: i32, - src: *const UChar, - srcLength: i32, - locale: *const ::std::os::raw::c_char, - pErrorCode: *mut UErrorCode, - ) -> i32; + pub fn ucol_setAttribute_66( + coll: *mut UCollator, + attr: UColAttribute, + value: UColAttributeValue, + status: *mut UErrorCode, + ); } extern "C" { - pub fn u_strToTitle_66( - dest: *mut UChar, - destCapacity: i32, - src: *const UChar, - srcLength: i32, - titleIter: *mut UBreakIterator, - locale: *const ::std::os::raw::c_char, - pErrorCode: *mut UErrorCode, - ) -> i32; + pub fn ucol_getAttribute_66( + coll: *const UCollator, + attr: UColAttribute, + status: *mut UErrorCode, + ) -> UColAttributeValue; } extern "C" { - pub fn u_strFoldCase_66( - dest: *mut UChar, - destCapacity: i32, - src: *const UChar, - srcLength: i32, - options: u32, + pub fn ucol_setMaxVariable_66( + coll: *mut UCollator, + group: UColReorderCode, pErrorCode: *mut UErrorCode, - ) -> i32; + ); } extern "C" { - pub fn u_strToWCS_66( - dest: *mut wchar_t, - destCapacity: i32, - pDestLength: *mut i32, - src: *const UChar, - srcLength: i32, - pErrorCode: *mut UErrorCode, - ) -> *mut wchar_t; + pub fn ucol_getMaxVariable_66(coll: *const UCollator) -> UColReorderCode; } extern "C" { - pub fn u_strFromWCS_66( - dest: *mut UChar, - destCapacity: i32, - pDestLength: *mut i32, - src: *const wchar_t, - srcLength: i32, - pErrorCode: *mut UErrorCode, - ) -> *mut UChar; + pub fn ucol_setVariableTop_66( + coll: *mut UCollator, + varTop: *const UChar, + len: i32, + status: *mut UErrorCode, + ) -> u32; } extern "C" { - pub fn u_strToUTF8_66( - dest: *mut ::std::os::raw::c_char, - destCapacity: i32, - pDestLength: *mut i32, - src: *const UChar, - srcLength: i32, - pErrorCode: *mut UErrorCode, - ) -> *mut ::std::os::raw::c_char; + pub fn ucol_getVariableTop_66(coll: *const UCollator, status: *mut UErrorCode) -> u32; } extern "C" { - pub fn u_strFromUTF8_66( - dest: *mut UChar, - destCapacity: i32, - pDestLength: *mut i32, - src: *const ::std::os::raw::c_char, - srcLength: i32, - pErrorCode: *mut UErrorCode, - ) -> *mut UChar; + pub fn ucol_restoreVariableTop_66(coll: *mut UCollator, varTop: u32, status: *mut UErrorCode); } extern "C" { - pub fn u_strToUTF8WithSub_66( - dest: *mut ::std::os::raw::c_char, - destCapacity: i32, - pDestLength: *mut i32, - src: *const UChar, - srcLength: i32, - subchar: UChar32, - pNumSubstitutions: *mut i32, - pErrorCode: *mut UErrorCode, - ) -> *mut ::std::os::raw::c_char; + pub fn ucol_safeClone_66( + coll: *const UCollator, + stackBuffer: *mut ::std::os::raw::c_void, + pBufferSize: *mut i32, + status: *mut UErrorCode, + ) -> *mut UCollator; } extern "C" { - pub fn u_strFromUTF8WithSub_66( - dest: *mut UChar, - destCapacity: i32, - pDestLength: *mut i32, - src: *const ::std::os::raw::c_char, - srcLength: i32, - subchar: UChar32, - pNumSubstitutions: *mut i32, - pErrorCode: *mut UErrorCode, - ) -> *mut UChar; + pub fn ucol_getRulesEx_66( + coll: *const UCollator, + delta: UColRuleOption, + buffer: *mut UChar, + bufferLen: i32, + ) -> i32; } extern "C" { - pub fn u_strFromUTF8Lenient_66( - dest: *mut UChar, - destCapacity: i32, - pDestLength: *mut i32, - src: *const ::std::os::raw::c_char, - srcLength: i32, - pErrorCode: *mut UErrorCode, - ) -> *mut UChar; + pub fn ucol_getLocale_66( + coll: *const UCollator, + type_: ULocDataLocaleType, + status: *mut UErrorCode, + ) -> *const ::std::os::raw::c_char; } extern "C" { - pub fn u_strToUTF32_66( - dest: *mut UChar32, - destCapacity: i32, - pDestLength: *mut i32, - src: *const UChar, - srcLength: i32, - pErrorCode: *mut UErrorCode, - ) -> *mut UChar32; + pub fn ucol_getLocaleByType_66( + coll: *const UCollator, + type_: ULocDataLocaleType, + status: *mut UErrorCode, + ) -> *const ::std::os::raw::c_char; } extern "C" { - pub fn u_strFromUTF32_66( - dest: *mut UChar, - destCapacity: i32, - pDestLength: *mut i32, - src: *const UChar32, - srcLength: i32, - pErrorCode: *mut UErrorCode, - ) -> *mut UChar; + pub fn ucol_getTailoredSet_66(coll: *const UCollator, status: *mut UErrorCode) -> *mut USet; } extern "C" { - pub fn u_strToUTF32WithSub_66( - dest: *mut UChar32, - destCapacity: i32, - pDestLength: *mut i32, - src: *const UChar, - srcLength: i32, - subchar: UChar32, - pNumSubstitutions: *mut i32, - pErrorCode: *mut UErrorCode, - ) -> *mut UChar32; + pub fn ucol_getUnsafeSet_66( + coll: *const UCollator, + unsafe_: *mut USet, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_strFromUTF32WithSub_66( - dest: *mut UChar, - destCapacity: i32, - pDestLength: *mut i32, - src: *const UChar32, - srcLength: i32, - subchar: UChar32, - pNumSubstitutions: *mut i32, - pErrorCode: *mut UErrorCode, - ) -> *mut UChar; + pub fn ucol_prepareShortStringOpen_66( + definition: *const ::std::os::raw::c_char, + forceDefaults: UBool, + parseError: *mut UParseError, + status: *mut UErrorCode, + ); } extern "C" { - pub fn u_strToJavaModifiedUTF8_66( - dest: *mut ::std::os::raw::c_char, - destCapacity: i32, - pDestLength: *mut i32, - src: *const UChar, - srcLength: i32, - pErrorCode: *mut UErrorCode, - ) -> *mut ::std::os::raw::c_char; + pub fn ucol_cloneBinary_66( + coll: *const UCollator, + buffer: *mut u8, + capacity: i32, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_strFromJavaModifiedUTF8WithSub_66( - dest: *mut UChar, - destCapacity: i32, - pDestLength: *mut i32, - src: *const ::std::os::raw::c_char, - srcLength: i32, - subchar: UChar32, - pNumSubstitutions: *mut i32, - pErrorCode: *mut UErrorCode, - ) -> *mut UChar; + pub fn ucol_openBinary_66( + bin: *const u8, + length: i32, + base: *const UCollator, + status: *mut UErrorCode, + ) -> *mut UCollator; } #[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct UCPMap { - _unused: [u8; 0], +#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, PartialEq)] +pub struct UFieldPosition { + pub field: i32, + pub beginIndex: i32, + pub endIndex: i32, +} +#[test] +fn bindgen_test_layout_UFieldPosition() { + assert_eq!( + ::std::mem::size_of::(), + 12usize, + concat!("Size of: ", stringify!(UFieldPosition)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(UFieldPosition)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).field as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(UFieldPosition), + "::", + stringify!(field) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).beginIndex as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(UFieldPosition), + "::", + stringify!(beginIndex) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).endIndex as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(UFieldPosition), + "::", + stringify!(endIndex) + ) + ); +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] +pub enum UDisplayContextType { + UDISPCTX_TYPE_DIALECT_HANDLING = 0, + UDISPCTX_TYPE_CAPITALIZATION = 1, + UDISPCTX_TYPE_DISPLAY_LENGTH = 2, + UDISPCTX_TYPE_SUBSTITUTE_HANDLING = 3, +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] +pub enum UDisplayContext { + UDISPCTX_STANDARD_NAMES = 0, + UDISPCTX_DIALECT_NAMES = 1, + UDISPCTX_CAPITALIZATION_NONE = 256, + UDISPCTX_CAPITALIZATION_FOR_MIDDLE_OF_SENTENCE = 257, + UDISPCTX_CAPITALIZATION_FOR_BEGINNING_OF_SENTENCE = 258, + UDISPCTX_CAPITALIZATION_FOR_UI_LIST_OR_MENU = 259, + UDISPCTX_CAPITALIZATION_FOR_STANDALONE = 260, + UDISPCTX_LENGTH_FULL = 512, + UDISPCTX_LENGTH_SHORT = 513, + UDISPCTX_SUBSTITUTE = 768, + UDISPCTX_NO_SUBSTITUTE = 769, } #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct USet { +pub struct UFieldPositionIterator { _unused: [u8; 0], } -impl UProperty { - pub const UCHAR_BINARY_START: UProperty = UProperty::UCHAR_ALPHABETIC; -} -impl UProperty { - pub const UCHAR_INT_START: UProperty = UProperty::UCHAR_BIDI_CLASS; -} -impl UProperty { - pub const UCHAR_MASK_START: UProperty = UProperty::UCHAR_GENERAL_CATEGORY_MASK; -} -impl UProperty { - pub const UCHAR_DOUBLE_START: UProperty = UProperty::UCHAR_NUMERIC_VALUE; +pub type UNumberFormat = *mut ::std::os::raw::c_void; +pub type UDateFormat = *mut ::std::os::raw::c_void; +impl UDateFormatStyle { + pub const UDAT_DEFAULT: UDateFormatStyle = UDateFormatStyle::UDAT_MEDIUM; } -impl UProperty { - pub const UCHAR_STRING_START: UProperty = UProperty::UCHAR_AGE; +impl UDateFormatStyle { + pub const UDAT_FULL_RELATIVE: UDateFormatStyle = UDateFormatStyle::UDAT_RELATIVE; } -impl UProperty { - pub const UCHAR_OTHER_PROPERTY_START: UProperty = UProperty::UCHAR_SCRIPT_EXTENSIONS; +impl UDateFormatStyle { + pub const UDAT_IGNORE: UDateFormatStyle = UDateFormatStyle::UDAT_PATTERN; } #[repr(i32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UProperty { - UCHAR_ALPHABETIC = 0, - UCHAR_ASCII_HEX_DIGIT = 1, - UCHAR_BIDI_CONTROL = 2, - UCHAR_BIDI_MIRRORED = 3, - UCHAR_DASH = 4, - UCHAR_DEFAULT_IGNORABLE_CODE_POINT = 5, - UCHAR_DEPRECATED = 6, - UCHAR_DIACRITIC = 7, - UCHAR_EXTENDER = 8, - UCHAR_FULL_COMPOSITION_EXCLUSION = 9, - UCHAR_GRAPHEME_BASE = 10, - UCHAR_GRAPHEME_EXTEND = 11, - UCHAR_GRAPHEME_LINK = 12, - UCHAR_HEX_DIGIT = 13, - UCHAR_HYPHEN = 14, - UCHAR_ID_CONTINUE = 15, - UCHAR_ID_START = 16, - UCHAR_IDEOGRAPHIC = 17, - UCHAR_IDS_BINARY_OPERATOR = 18, - UCHAR_IDS_TRINARY_OPERATOR = 19, - UCHAR_JOIN_CONTROL = 20, - UCHAR_LOGICAL_ORDER_EXCEPTION = 21, - UCHAR_LOWERCASE = 22, - UCHAR_MATH = 23, - UCHAR_NONCHARACTER_CODE_POINT = 24, - UCHAR_QUOTATION_MARK = 25, - UCHAR_RADICAL = 26, - UCHAR_SOFT_DOTTED = 27, - UCHAR_TERMINAL_PUNCTUATION = 28, - UCHAR_UNIFIED_IDEOGRAPH = 29, - UCHAR_UPPERCASE = 30, - UCHAR_WHITE_SPACE = 31, - UCHAR_XID_CONTINUE = 32, - UCHAR_XID_START = 33, - UCHAR_CASE_SENSITIVE = 34, - UCHAR_S_TERM = 35, - UCHAR_VARIATION_SELECTOR = 36, - UCHAR_NFD_INERT = 37, - UCHAR_NFKD_INERT = 38, - UCHAR_NFC_INERT = 39, - UCHAR_NFKC_INERT = 40, - UCHAR_SEGMENT_STARTER = 41, - UCHAR_PATTERN_SYNTAX = 42, - UCHAR_PATTERN_WHITE_SPACE = 43, - UCHAR_POSIX_ALNUM = 44, - UCHAR_POSIX_BLANK = 45, - UCHAR_POSIX_GRAPH = 46, - UCHAR_POSIX_PRINT = 47, - UCHAR_POSIX_XDIGIT = 48, - UCHAR_CASED = 49, - UCHAR_CASE_IGNORABLE = 50, - UCHAR_CHANGES_WHEN_LOWERCASED = 51, - UCHAR_CHANGES_WHEN_UPPERCASED = 52, - UCHAR_CHANGES_WHEN_TITLECASED = 53, - UCHAR_CHANGES_WHEN_CASEFOLDED = 54, - UCHAR_CHANGES_WHEN_CASEMAPPED = 55, - UCHAR_CHANGES_WHEN_NFKC_CASEFOLDED = 56, - UCHAR_EMOJI = 57, - UCHAR_EMOJI_PRESENTATION = 58, - UCHAR_EMOJI_MODIFIER = 59, - UCHAR_EMOJI_MODIFIER_BASE = 60, - UCHAR_EMOJI_COMPONENT = 61, - UCHAR_REGIONAL_INDICATOR = 62, - UCHAR_PREPENDED_CONCATENATION_MARK = 63, - UCHAR_EXTENDED_PICTOGRAPHIC = 64, - UCHAR_BINARY_LIMIT = 65, - UCHAR_BIDI_CLASS = 4096, - UCHAR_BLOCK = 4097, - UCHAR_CANONICAL_COMBINING_CLASS = 4098, - UCHAR_DECOMPOSITION_TYPE = 4099, - UCHAR_EAST_ASIAN_WIDTH = 4100, - UCHAR_GENERAL_CATEGORY = 4101, - UCHAR_JOINING_GROUP = 4102, - UCHAR_JOINING_TYPE = 4103, - UCHAR_LINE_BREAK = 4104, - UCHAR_NUMERIC_TYPE = 4105, - UCHAR_SCRIPT = 4106, - UCHAR_HANGUL_SYLLABLE_TYPE = 4107, - UCHAR_NFD_QUICK_CHECK = 4108, - UCHAR_NFKD_QUICK_CHECK = 4109, - UCHAR_NFC_QUICK_CHECK = 4110, - UCHAR_NFKC_QUICK_CHECK = 4111, - UCHAR_LEAD_CANONICAL_COMBINING_CLASS = 4112, - UCHAR_TRAIL_CANONICAL_COMBINING_CLASS = 4113, - UCHAR_GRAPHEME_CLUSTER_BREAK = 4114, - UCHAR_SENTENCE_BREAK = 4115, - UCHAR_WORD_BREAK = 4116, - UCHAR_BIDI_PAIRED_BRACKET_TYPE = 4117, - UCHAR_INDIC_POSITIONAL_CATEGORY = 4118, - UCHAR_INDIC_SYLLABIC_CATEGORY = 4119, - UCHAR_VERTICAL_ORIENTATION = 4120, - UCHAR_INT_LIMIT = 4121, - UCHAR_GENERAL_CATEGORY_MASK = 8192, - UCHAR_MASK_LIMIT = 8193, - UCHAR_NUMERIC_VALUE = 12288, - UCHAR_DOUBLE_LIMIT = 12289, - UCHAR_AGE = 16384, - UCHAR_BIDI_MIRRORING_GLYPH = 16385, - UCHAR_CASE_FOLDING = 16386, - UCHAR_ISO_COMMENT = 16387, - UCHAR_LOWERCASE_MAPPING = 16388, - UCHAR_NAME = 16389, - UCHAR_SIMPLE_CASE_FOLDING = 16390, - UCHAR_SIMPLE_LOWERCASE_MAPPING = 16391, - UCHAR_SIMPLE_TITLECASE_MAPPING = 16392, - UCHAR_SIMPLE_UPPERCASE_MAPPING = 16393, - UCHAR_TITLECASE_MAPPING = 16394, - UCHAR_UNICODE_1_NAME = 16395, - UCHAR_UPPERCASE_MAPPING = 16396, - UCHAR_BIDI_PAIRED_BRACKET = 16397, - UCHAR_STRING_LIMIT = 16398, - UCHAR_SCRIPT_EXTENSIONS = 28672, - UCHAR_OTHER_PROPERTY_LIMIT = 28673, - UCHAR_INVALID_CODE = -1, -} -impl UCharCategory { - pub const U_GENERAL_OTHER_TYPES: UCharCategory = UCharCategory::U_UNASSIGNED; +pub enum UDateFormatStyle { + UDAT_FULL = 0, + UDAT_LONG = 1, + UDAT_MEDIUM = 2, + UDAT_SHORT = 3, + UDAT_RELATIVE = 128, + UDAT_LONG_RELATIVE = 129, + UDAT_MEDIUM_RELATIVE = 130, + UDAT_SHORT_RELATIVE = 131, + UDAT_NONE = -1, + UDAT_PATTERN = -2, } #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UCharCategory { - U_UNASSIGNED = 0, - U_UPPERCASE_LETTER = 1, - U_LOWERCASE_LETTER = 2, - U_TITLECASE_LETTER = 3, - U_MODIFIER_LETTER = 4, - U_OTHER_LETTER = 5, - U_NON_SPACING_MARK = 6, - U_ENCLOSING_MARK = 7, - U_COMBINING_SPACING_MARK = 8, - U_DECIMAL_DIGIT_NUMBER = 9, - U_LETTER_NUMBER = 10, - U_OTHER_NUMBER = 11, - U_SPACE_SEPARATOR = 12, - U_LINE_SEPARATOR = 13, - U_PARAGRAPH_SEPARATOR = 14, - U_CONTROL_CHAR = 15, - U_FORMAT_CHAR = 16, - U_PRIVATE_USE_CHAR = 17, - U_SURROGATE = 18, - U_DASH_PUNCTUATION = 19, - U_START_PUNCTUATION = 20, - U_END_PUNCTUATION = 21, - U_CONNECTOR_PUNCTUATION = 22, - U_OTHER_PUNCTUATION = 23, - U_MATH_SYMBOL = 24, - U_CURRENCY_SYMBOL = 25, - U_MODIFIER_SYMBOL = 26, - U_OTHER_SYMBOL = 27, - U_INITIAL_PUNCTUATION = 28, - U_FINAL_PUNCTUATION = 29, - U_CHAR_CATEGORY_COUNT = 30, +pub enum UDateFormatField { + UDAT_ERA_FIELD = 0, + UDAT_YEAR_FIELD = 1, + UDAT_MONTH_FIELD = 2, + UDAT_DATE_FIELD = 3, + UDAT_HOUR_OF_DAY1_FIELD = 4, + UDAT_HOUR_OF_DAY0_FIELD = 5, + UDAT_MINUTE_FIELD = 6, + UDAT_SECOND_FIELD = 7, + UDAT_FRACTIONAL_SECOND_FIELD = 8, + UDAT_DAY_OF_WEEK_FIELD = 9, + UDAT_DAY_OF_YEAR_FIELD = 10, + UDAT_DAY_OF_WEEK_IN_MONTH_FIELD = 11, + UDAT_WEEK_OF_YEAR_FIELD = 12, + UDAT_WEEK_OF_MONTH_FIELD = 13, + UDAT_AM_PM_FIELD = 14, + UDAT_HOUR1_FIELD = 15, + UDAT_HOUR0_FIELD = 16, + UDAT_TIMEZONE_FIELD = 17, + UDAT_YEAR_WOY_FIELD = 18, + UDAT_DOW_LOCAL_FIELD = 19, + UDAT_EXTENDED_YEAR_FIELD = 20, + UDAT_JULIAN_DAY_FIELD = 21, + UDAT_MILLISECONDS_IN_DAY_FIELD = 22, + UDAT_TIMEZONE_RFC_FIELD = 23, + UDAT_TIMEZONE_GENERIC_FIELD = 24, + UDAT_STANDALONE_DAY_FIELD = 25, + UDAT_STANDALONE_MONTH_FIELD = 26, + UDAT_QUARTER_FIELD = 27, + UDAT_STANDALONE_QUARTER_FIELD = 28, + UDAT_TIMEZONE_SPECIAL_FIELD = 29, + UDAT_YEAR_NAME_FIELD = 30, + UDAT_TIMEZONE_LOCALIZED_GMT_OFFSET_FIELD = 31, + UDAT_TIMEZONE_ISO_FIELD = 32, + UDAT_TIMEZONE_ISO_LOCAL_FIELD = 33, + UDAT_RELATED_YEAR_FIELD = 34, + UDAT_AM_PM_MIDNIGHT_NOON_FIELD = 35, + UDAT_FLEXIBLE_DAY_PERIOD_FIELD = 36, + UDAT_TIME_SEPARATOR_FIELD = 37, + UDAT_FIELD_COUNT = 38, +} +extern "C" { + pub fn udat_toCalendarDateField_66(field: UDateFormatField) -> UCalendarDateFields; +} +extern "C" { + pub fn udat_open_66( + timeStyle: UDateFormatStyle, + dateStyle: UDateFormatStyle, + locale: *const ::std::os::raw::c_char, + tzID: *const UChar, + tzIDLength: i32, + pattern: *const UChar, + patternLength: i32, + status: *mut UErrorCode, + ) -> *mut UDateFormat; +} +extern "C" { + pub fn udat_close_66(format: *mut UDateFormat); } #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UCharDirection { - U_LEFT_TO_RIGHT = 0, - U_RIGHT_TO_LEFT = 1, - U_EUROPEAN_NUMBER = 2, - U_EUROPEAN_NUMBER_SEPARATOR = 3, - U_EUROPEAN_NUMBER_TERMINATOR = 4, - U_ARABIC_NUMBER = 5, - U_COMMON_NUMBER_SEPARATOR = 6, - U_BLOCK_SEPARATOR = 7, - U_SEGMENT_SEPARATOR = 8, - U_WHITE_SPACE_NEUTRAL = 9, - U_OTHER_NEUTRAL = 10, - U_LEFT_TO_RIGHT_EMBEDDING = 11, - U_LEFT_TO_RIGHT_OVERRIDE = 12, - U_RIGHT_TO_LEFT_ARABIC = 13, - U_RIGHT_TO_LEFT_EMBEDDING = 14, - U_RIGHT_TO_LEFT_OVERRIDE = 15, - U_POP_DIRECTIONAL_FORMAT = 16, - U_DIR_NON_SPACING_MARK = 17, - U_BOUNDARY_NEUTRAL = 18, - U_FIRST_STRONG_ISOLATE = 19, - U_LEFT_TO_RIGHT_ISOLATE = 20, - U_RIGHT_TO_LEFT_ISOLATE = 21, - U_POP_DIRECTIONAL_ISOLATE = 22, - U_CHAR_DIRECTION_COUNT = 23, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UCharNameChoice { - U_UNICODE_CHAR_NAME = 0, - U_UNICODE_10_CHAR_NAME = 1, - U_EXTENDED_CHAR_NAME = 2, - U_CHAR_NAME_ALIAS = 3, - U_CHAR_NAME_CHOICE_COUNT = 4, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UPropertyNameChoice { - U_SHORT_PROPERTY_NAME = 0, - U_LONG_PROPERTY_NAME = 1, - U_PROPERTY_NAME_CHOICE_COUNT = 2, +pub enum UDateFormatBooleanAttribute { + UDAT_PARSE_ALLOW_WHITESPACE = 0, + UDAT_PARSE_ALLOW_NUMERIC = 1, + UDAT_PARSE_PARTIAL_LITERAL_MATCH = 2, + UDAT_PARSE_MULTIPLE_PATTERNS_FOR_MATCH = 3, + UDAT_BOOLEAN_ATTRIBUTE_COUNT = 4, } extern "C" { - pub fn u_hasBinaryProperty_66(c: UChar32, which: UProperty) -> UBool; + pub fn udat_getBooleanAttribute_66( + fmt: *const UDateFormat, + attr: UDateFormatBooleanAttribute, + status: *mut UErrorCode, + ) -> UBool; } extern "C" { - pub fn u_getBinaryPropertySet_66( - property: UProperty, - pErrorCode: *mut UErrorCode, - ) -> *const USet; + pub fn udat_setBooleanAttribute_66( + fmt: *mut UDateFormat, + attr: UDateFormatBooleanAttribute, + newValue: UBool, + status: *mut UErrorCode, + ); } extern "C" { - pub fn u_isUAlphabetic_66(c: UChar32) -> UBool; + pub fn udat_clone_66(fmt: *const UDateFormat, status: *mut UErrorCode) -> *mut UDateFormat; } extern "C" { - pub fn u_isULowercase_66(c: UChar32) -> UBool; + pub fn udat_format_66( + format: *const UDateFormat, + dateToFormat: UDate, + result: *mut UChar, + resultLength: i32, + position: *mut UFieldPosition, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_isUUppercase_66(c: UChar32) -> UBool; + pub fn udat_formatCalendar_66( + format: *const UDateFormat, + calendar: *mut UCalendar, + result: *mut UChar, + capacity: i32, + position: *mut UFieldPosition, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_isUWhiteSpace_66(c: UChar32) -> UBool; + pub fn udat_formatForFields_66( + format: *const UDateFormat, + dateToFormat: UDate, + result: *mut UChar, + resultLength: i32, + fpositer: *mut UFieldPositionIterator, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_getIntPropertyValue_66(c: UChar32, which: UProperty) -> i32; + pub fn udat_formatCalendarForFields_66( + format: *const UDateFormat, + calendar: *mut UCalendar, + result: *mut UChar, + capacity: i32, + fpositer: *mut UFieldPositionIterator, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_getIntPropertyMinValue_66(which: UProperty) -> i32; + pub fn udat_parse_66( + format: *const UDateFormat, + text: *const UChar, + textLength: i32, + parsePos: *mut i32, + status: *mut UErrorCode, + ) -> UDate; } extern "C" { - pub fn u_getIntPropertyMaxValue_66(which: UProperty) -> i32; + pub fn udat_parseCalendar_66( + format: *const UDateFormat, + calendar: *mut UCalendar, + text: *const UChar, + textLength: i32, + parsePos: *mut i32, + status: *mut UErrorCode, + ); } extern "C" { - pub fn u_getIntPropertyMap_66( - property: UProperty, - pErrorCode: *mut UErrorCode, - ) -> *const UCPMap; + pub fn udat_isLenient_66(fmt: *const UDateFormat) -> UBool; } extern "C" { - pub fn u_getNumericValue_66(c: UChar32) -> f64; + pub fn udat_setLenient_66(fmt: *mut UDateFormat, isLenient: UBool); } extern "C" { - pub fn u_islower_66(c: UChar32) -> UBool; + pub fn udat_getCalendar_66(fmt: *const UDateFormat) -> *const UCalendar; } extern "C" { - pub fn u_isupper_66(c: UChar32) -> UBool; + pub fn udat_setCalendar_66(fmt: *mut UDateFormat, calendarToSet: *const UCalendar); } extern "C" { - pub fn u_istitle_66(c: UChar32) -> UBool; + pub fn udat_getNumberFormat_66(fmt: *const UDateFormat) -> *const UNumberFormat; } extern "C" { - pub fn u_isdigit_66(c: UChar32) -> UBool; + pub fn udat_getNumberFormatForField_66( + fmt: *const UDateFormat, + field: UChar, + ) -> *const UNumberFormat; } extern "C" { - pub fn u_isalpha_66(c: UChar32) -> UBool; + pub fn udat_adoptNumberFormatForFields_66( + fmt: *mut UDateFormat, + fields: *const UChar, + numberFormatToSet: *mut UNumberFormat, + status: *mut UErrorCode, + ); } extern "C" { - pub fn u_isalnum_66(c: UChar32) -> UBool; + pub fn udat_setNumberFormat_66(fmt: *mut UDateFormat, numberFormatToSet: *const UNumberFormat); } extern "C" { - pub fn u_isxdigit_66(c: UChar32) -> UBool; + pub fn udat_adoptNumberFormat_66( + fmt: *mut UDateFormat, + numberFormatToAdopt: *mut UNumberFormat, + ); } extern "C" { - pub fn u_ispunct_66(c: UChar32) -> UBool; + pub fn udat_getAvailable_66(localeIndex: i32) -> *const ::std::os::raw::c_char; } extern "C" { - pub fn u_isgraph_66(c: UChar32) -> UBool; + pub fn udat_countAvailable_66() -> i32; } extern "C" { - pub fn u_isblank_66(c: UChar32) -> UBool; + pub fn udat_get2DigitYearStart_66(fmt: *const UDateFormat, status: *mut UErrorCode) -> UDate; } extern "C" { - pub fn u_isdefined_66(c: UChar32) -> UBool; + pub fn udat_set2DigitYearStart_66(fmt: *mut UDateFormat, d: UDate, status: *mut UErrorCode); } extern "C" { - pub fn u_isspace_66(c: UChar32) -> UBool; + pub fn udat_toPattern_66( + fmt: *const UDateFormat, + localized: UBool, + result: *mut UChar, + resultLength: i32, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_isJavaSpaceChar_66(c: UChar32) -> UBool; + pub fn udat_applyPattern_66( + format: *mut UDateFormat, + localized: UBool, + pattern: *const UChar, + patternLength: i32, + ); } -extern "C" { - pub fn u_isWhitespace_66(c: UChar32) -> UBool; +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] +pub enum UDateFormatSymbolType { + UDAT_ERAS = 0, + UDAT_MONTHS = 1, + UDAT_SHORT_MONTHS = 2, + UDAT_WEEKDAYS = 3, + UDAT_SHORT_WEEKDAYS = 4, + UDAT_AM_PMS = 5, + UDAT_LOCALIZED_CHARS = 6, + UDAT_ERA_NAMES = 7, + UDAT_NARROW_MONTHS = 8, + UDAT_NARROW_WEEKDAYS = 9, + UDAT_STANDALONE_MONTHS = 10, + UDAT_STANDALONE_SHORT_MONTHS = 11, + UDAT_STANDALONE_NARROW_MONTHS = 12, + UDAT_STANDALONE_WEEKDAYS = 13, + UDAT_STANDALONE_SHORT_WEEKDAYS = 14, + UDAT_STANDALONE_NARROW_WEEKDAYS = 15, + UDAT_QUARTERS = 16, + UDAT_SHORT_QUARTERS = 17, + UDAT_STANDALONE_QUARTERS = 18, + UDAT_STANDALONE_SHORT_QUARTERS = 19, + UDAT_SHORTER_WEEKDAYS = 20, + UDAT_STANDALONE_SHORTER_WEEKDAYS = 21, + UDAT_CYCLIC_YEARS_WIDE = 22, + UDAT_CYCLIC_YEARS_ABBREVIATED = 23, + UDAT_CYCLIC_YEARS_NARROW = 24, + UDAT_ZODIAC_NAMES_WIDE = 25, + UDAT_ZODIAC_NAMES_ABBREVIATED = 26, + UDAT_ZODIAC_NAMES_NARROW = 27, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct UDateFormatSymbols { + _unused: [u8; 0], } extern "C" { - pub fn u_iscntrl_66(c: UChar32) -> UBool; + pub fn udat_getSymbols_66( + fmt: *const UDateFormat, + type_: UDateFormatSymbolType, + symbolIndex: i32, + result: *mut UChar, + resultLength: i32, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_isISOControl_66(c: UChar32) -> UBool; + pub fn udat_countSymbols_66(fmt: *const UDateFormat, type_: UDateFormatSymbolType) -> i32; } extern "C" { - pub fn u_isprint_66(c: UChar32) -> UBool; + pub fn udat_setSymbols_66( + format: *mut UDateFormat, + type_: UDateFormatSymbolType, + symbolIndex: i32, + value: *mut UChar, + valueLength: i32, + status: *mut UErrorCode, + ); } extern "C" { - pub fn u_isbase_66(c: UChar32) -> UBool; + pub fn udat_getLocaleByType_66( + fmt: *const UDateFormat, + type_: ULocDataLocaleType, + status: *mut UErrorCode, + ) -> *const ::std::os::raw::c_char; } extern "C" { - pub fn u_charDirection_66(c: UChar32) -> UCharDirection; + pub fn udat_setContext_66( + fmt: *mut UDateFormat, + value: UDisplayContext, + status: *mut UErrorCode, + ); } extern "C" { - pub fn u_isMirrored_66(c: UChar32) -> UBool; + pub fn udat_getContext_66( + fmt: *const UDateFormat, + type_: UDisplayContextType, + status: *mut UErrorCode, + ) -> UDisplayContext; } extern "C" { - pub fn u_charMirror_66(c: UChar32) -> UChar32; + pub fn udat_toPatternRelativeDate_66( + fmt: *const UDateFormat, + result: *mut UChar, + resultLength: i32, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_getBidiPairedBracket_66(c: UChar32) -> UChar32; + pub fn udat_toPatternRelativeTime_66( + fmt: *const UDateFormat, + result: *mut UChar, + resultLength: i32, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_charType_66(c: UChar32) -> i8; + pub fn udat_applyPatternRelative_66( + format: *mut UDateFormat, + datePattern: *const UChar, + datePatternLength: i32, + timePattern: *const UChar, + timePatternLength: i32, + status: *mut UErrorCode, + ); } -pub type UCharEnumTypeRange = ::std::option::Option< +pub type UDateFormatOpener = ::std::option::Option< unsafe extern "C" fn( - context: *const ::std::os::raw::c_void, - start: UChar32, - limit: UChar32, - type_: UCharCategory, - ) -> UBool, + timeStyle: UDateFormatStyle, + dateStyle: UDateFormatStyle, + locale: *const ::std::os::raw::c_char, + tzID: *const UChar, + tzIDLength: i32, + pattern: *const UChar, + patternLength: i32, + status: *mut UErrorCode, + ) -> *mut UDateFormat, >; extern "C" { - pub fn u_enumCharTypes_66( - enumRange: UCharEnumTypeRange, - context: *const ::std::os::raw::c_void, - ); -} -extern "C" { - pub fn u_getCombiningClass_66(c: UChar32) -> u8; + pub fn udat_registerOpener_66(opener: UDateFormatOpener, status: *mut UErrorCode); } extern "C" { - pub fn u_charDigitValue_66(c: UChar32) -> i32; + pub fn udat_unregisterOpener_66( + opener: UDateFormatOpener, + status: *mut UErrorCode, + ) -> UDateFormatOpener; } -extern "C" { - pub fn u_charName_66( - code: UChar32, - nameChoice: UCharNameChoice, - buffer: *mut ::std::os::raw::c_char, - bufferLength: i32, - pErrorCode: *mut UErrorCode, - ) -> i32; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, PartialEq)] +pub struct UDataInfo { + pub size: u16, + pub reservedWord: u16, + pub isBigEndian: u8, + pub charsetFamily: u8, + pub sizeofUChar: u8, + pub reservedByte: u8, + pub dataFormat: [u8; 4usize], + pub formatVersion: [u8; 4usize], + pub dataVersion: [u8; 4usize], } -extern "C" { - pub fn u_getISOComment_66( - c: UChar32, - dest: *mut ::std::os::raw::c_char, - destCapacity: i32, - pErrorCode: *mut UErrorCode, - ) -> i32; +#[test] +fn bindgen_test_layout_UDataInfo() { + assert_eq!( + ::std::mem::size_of::(), + 20usize, + concat!("Size of: ", stringify!(UDataInfo)) + ); + assert_eq!( + ::std::mem::align_of::(), + 2usize, + concat!("Alignment of ", stringify!(UDataInfo)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).size as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(UDataInfo), + "::", + stringify!(size) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).reservedWord as *const _ as usize }, + 2usize, + concat!( + "Offset of field: ", + stringify!(UDataInfo), + "::", + stringify!(reservedWord) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).isBigEndian as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(UDataInfo), + "::", + stringify!(isBigEndian) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).charsetFamily as *const _ as usize }, + 5usize, + concat!( + "Offset of field: ", + stringify!(UDataInfo), + "::", + stringify!(charsetFamily) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).sizeofUChar as *const _ as usize }, + 6usize, + concat!( + "Offset of field: ", + stringify!(UDataInfo), + "::", + stringify!(sizeofUChar) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).reservedByte as *const _ as usize }, + 7usize, + concat!( + "Offset of field: ", + stringify!(UDataInfo), + "::", + stringify!(reservedByte) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).dataFormat as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(UDataInfo), + "::", + stringify!(dataFormat) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).formatVersion as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(UDataInfo), + "::", + stringify!(formatVersion) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).dataVersion as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(UDataInfo), + "::", + stringify!(dataVersion) + ) + ); } -extern "C" { - pub fn u_charFromName_66( - nameChoice: UCharNameChoice, - name: *const ::std::os::raw::c_char, - pErrorCode: *mut UErrorCode, - ) -> UChar32; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct UDataMemory { + _unused: [u8; 0], } -pub type UEnumCharNamesFn = ::std::option::Option< +pub type UDataMemoryIsAcceptable = ::std::option::Option< unsafe extern "C" fn( context: *mut ::std::os::raw::c_void, - code: UChar32, - nameChoice: UCharNameChoice, + type_: *const ::std::os::raw::c_char, name: *const ::std::os::raw::c_char, - length: i32, + pInfo: *const UDataInfo, ) -> UBool, >; extern "C" { - pub fn u_enumCharNames_66( - start: UChar32, - limit: UChar32, - fn_: UEnumCharNamesFn, - context: *mut ::std::os::raw::c_void, - nameChoice: UCharNameChoice, + pub fn udata_open_66( + path: *const ::std::os::raw::c_char, + type_: *const ::std::os::raw::c_char, + name: *const ::std::os::raw::c_char, pErrorCode: *mut UErrorCode, - ); + ) -> *mut UDataMemory; } extern "C" { - pub fn u_getPropertyName_66( - property: UProperty, - nameChoice: UPropertyNameChoice, - ) -> *const ::std::os::raw::c_char; + pub fn udata_openChoice_66( + path: *const ::std::os::raw::c_char, + type_: *const ::std::os::raw::c_char, + name: *const ::std::os::raw::c_char, + isAcceptable: UDataMemoryIsAcceptable, + context: *mut ::std::os::raw::c_void, + pErrorCode: *mut UErrorCode, + ) -> *mut UDataMemory; } extern "C" { - pub fn u_getPropertyEnum_66(alias: *const ::std::os::raw::c_char) -> UProperty; + pub fn udata_close_66(pData: *mut UDataMemory); } extern "C" { - pub fn u_getPropertyValueName_66( - property: UProperty, - value: i32, - nameChoice: UPropertyNameChoice, - ) -> *const ::std::os::raw::c_char; + pub fn udata_getMemory_66(pData: *mut UDataMemory) -> *const ::std::os::raw::c_void; } extern "C" { - pub fn u_getPropertyValueEnum_66( - property: UProperty, - alias: *const ::std::os::raw::c_char, - ) -> i32; + pub fn udata_getInfo_66(pData: *mut UDataMemory, pInfo: *mut UDataInfo); } extern "C" { - pub fn u_isIDStart_66(c: UChar32) -> UBool; + pub fn udata_setCommonData_66(data: *const ::std::os::raw::c_void, err: *mut UErrorCode); } extern "C" { - pub fn u_isIDPart_66(c: UChar32) -> UBool; + pub fn udata_setAppData_66( + packageName: *const ::std::os::raw::c_char, + data: *const ::std::os::raw::c_void, + err: *mut UErrorCode, + ); } -extern "C" { - pub fn u_isIDIgnorable_66(c: UChar32) -> UBool; +impl UDataFileAccess { + pub const UDATA_DEFAULT_ACCESS: UDataFileAccess = UDataFileAccess::UDATA_FILES_FIRST; +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] +pub enum UDataFileAccess { + UDATA_FILES_FIRST = 0, + UDATA_ONLY_PACKAGES = 1, + UDATA_PACKAGES_FIRST = 2, + UDATA_NO_FILES = 3, + UDATA_FILE_ACCESS_COUNT = 4, } extern "C" { - pub fn u_isJavaIDStart_66(c: UChar32) -> UBool; + pub fn udata_setFileAccess_66(access: UDataFileAccess, status: *mut UErrorCode); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct UFormattedValue { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct UListFormatter { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct UFormattedList { + _unused: [u8; 0], +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] +pub enum UListFormatterField { + ULISTFMT_LITERAL_FIELD = 0, + ULISTFMT_ELEMENT_FIELD = 1, } extern "C" { - pub fn u_isJavaIDPart_66(c: UChar32) -> UBool; + pub fn ulistfmt_open_66( + locale: *const ::std::os::raw::c_char, + status: *mut UErrorCode, + ) -> *mut UListFormatter; } extern "C" { - pub fn u_tolower_66(c: UChar32) -> UChar32; + pub fn ulistfmt_close_66(listfmt: *mut UListFormatter); } extern "C" { - pub fn u_toupper_66(c: UChar32) -> UChar32; + pub fn ulistfmt_openResult_66(ec: *mut UErrorCode) -> *mut UFormattedList; } extern "C" { - pub fn u_totitle_66(c: UChar32) -> UChar32; + pub fn ulistfmt_resultAsValue_66( + uresult: *const UFormattedList, + ec: *mut UErrorCode, + ) -> *const UFormattedValue; } extern "C" { - pub fn u_foldCase_66(c: UChar32, options: u32) -> UChar32; + pub fn ulistfmt_closeResult_66(uresult: *mut UFormattedList); } extern "C" { - pub fn u_digit_66(ch: UChar32, radix: i8) -> i32; -} -extern "C" { - pub fn u_forDigit_66(digit: i32, radix: i8) -> UChar32; + pub fn ulistfmt_format_66( + listfmt: *const UListFormatter, + strings: *const *const UChar, + stringLengths: *const i32, + stringCount: i32, + result: *mut UChar, + resultCapacity: i32, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_charAge_66(c: UChar32, versionArray: *mut u8); + pub fn ulistfmt_formatStringsToResult_66( + listfmt: *const UListFormatter, + strings: *const *const UChar, + stringLengths: *const i32, + stringCount: i32, + uresult: *mut UFormattedList, + status: *mut UErrorCode, + ); } +pub type va_list = __builtin_va_list; extern "C" { - pub fn u_getUnicodeVersion_66(versionArray: *mut u8); + pub fn u_formatMessage_66( + locale: *const ::std::os::raw::c_char, + pattern: *const UChar, + patternLength: i32, + result: *mut UChar, + resultLength: i32, + status: *mut UErrorCode, + ... + ) -> i32; } extern "C" { - pub fn u_getFC_NFKC_Closure_66( - c: UChar32, - dest: *mut UChar, - destCapacity: i32, - pErrorCode: *mut UErrorCode, + pub fn u_vformatMessage_66( + locale: *const ::std::os::raw::c_char, + pattern: *const UChar, + patternLength: i32, + result: *mut UChar, + resultLength: i32, + ap: *mut __va_list_tag, + status: *mut UErrorCode, ) -> i32; } extern "C" { - pub fn utext_close_66(ut: *mut UText) -> *mut UText; + pub fn u_parseMessage_66( + locale: *const ::std::os::raw::c_char, + pattern: *const UChar, + patternLength: i32, + source: *const UChar, + sourceLength: i32, + status: *mut UErrorCode, + ... + ); } extern "C" { - pub fn utext_openUTF8_66( - ut: *mut UText, - s: *const ::std::os::raw::c_char, - length: i64, + pub fn u_vparseMessage_66( + locale: *const ::std::os::raw::c_char, + pattern: *const UChar, + patternLength: i32, + source: *const UChar, + sourceLength: i32, + ap: *mut __va_list_tag, status: *mut UErrorCode, - ) -> *mut UText; + ); } extern "C" { - pub fn utext_openUChars_66( - ut: *mut UText, - s: *const UChar, - length: i64, + pub fn u_formatMessageWithError_66( + locale: *const ::std::os::raw::c_char, + pattern: *const UChar, + patternLength: i32, + result: *mut UChar, + resultLength: i32, + parseError: *mut UParseError, status: *mut UErrorCode, - ) -> *mut UText; + ... + ) -> i32; } extern "C" { - pub fn utext_clone_66( - dest: *mut UText, - src: *const UText, - deep: UBool, - readOnly: UBool, + pub fn u_vformatMessageWithError_66( + locale: *const ::std::os::raw::c_char, + pattern: *const UChar, + patternLength: i32, + result: *mut UChar, + resultLength: i32, + parseError: *mut UParseError, + ap: *mut __va_list_tag, status: *mut UErrorCode, - ) -> *mut UText; + ) -> i32; } extern "C" { - pub fn utext_equals_66(a: *const UText, b: *const UText) -> UBool; + pub fn u_parseMessageWithError_66( + locale: *const ::std::os::raw::c_char, + pattern: *const UChar, + patternLength: i32, + source: *const UChar, + sourceLength: i32, + parseError: *mut UParseError, + status: *mut UErrorCode, + ... + ); } extern "C" { - pub fn utext_nativeLength_66(ut: *mut UText) -> i64; + pub fn u_vparseMessageWithError_66( + locale: *const ::std::os::raw::c_char, + pattern: *const UChar, + patternLength: i32, + source: *const UChar, + sourceLength: i32, + ap: *mut __va_list_tag, + parseError: *mut UParseError, + status: *mut UErrorCode, + ); } +pub type UMessageFormat = *mut ::std::os::raw::c_void; extern "C" { - pub fn utext_isLengthExpensive_66(ut: *const UText) -> UBool; + pub fn umsg_open_66( + pattern: *const UChar, + patternLength: i32, + locale: *const ::std::os::raw::c_char, + parseError: *mut UParseError, + status: *mut UErrorCode, + ) -> *mut UMessageFormat; } extern "C" { - pub fn utext_char32At_66(ut: *mut UText, nativeIndex: i64) -> UChar32; + pub fn umsg_close_66(format: *mut UMessageFormat); } extern "C" { - pub fn utext_current32_66(ut: *mut UText) -> UChar32; + pub fn umsg_clone_66(fmt: *const UMessageFormat, status: *mut UErrorCode) -> UMessageFormat; } extern "C" { - pub fn utext_next32_66(ut: *mut UText) -> UChar32; + pub fn umsg_setLocale_66(fmt: *mut UMessageFormat, locale: *const ::std::os::raw::c_char); } extern "C" { - pub fn utext_previous32_66(ut: *mut UText) -> UChar32; + pub fn umsg_getLocale_66(fmt: *const UMessageFormat) -> *const ::std::os::raw::c_char; } extern "C" { - pub fn utext_next32From_66(ut: *mut UText, nativeIndex: i64) -> UChar32; + pub fn umsg_applyPattern_66( + fmt: *mut UMessageFormat, + pattern: *const UChar, + patternLength: i32, + parseError: *mut UParseError, + status: *mut UErrorCode, + ); } extern "C" { - pub fn utext_previous32From_66(ut: *mut UText, nativeIndex: i64) -> UChar32; + pub fn umsg_toPattern_66( + fmt: *const UMessageFormat, + result: *mut UChar, + resultLength: i32, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn utext_getNativeIndex_66(ut: *const UText) -> i64; + pub fn umsg_format_66( + fmt: *const UMessageFormat, + result: *mut UChar, + resultLength: i32, + status: *mut UErrorCode, + ... + ) -> i32; } extern "C" { - pub fn utext_setNativeIndex_66(ut: *mut UText, nativeIndex: i64); + pub fn umsg_vformat_66( + fmt: *const UMessageFormat, + result: *mut UChar, + resultLength: i32, + ap: *mut __va_list_tag, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn utext_moveIndex32_66(ut: *mut UText, delta: i32) -> UBool; + pub fn umsg_parse_66( + fmt: *const UMessageFormat, + source: *const UChar, + sourceLength: i32, + count: *mut i32, + status: *mut UErrorCode, + ... + ); } extern "C" { - pub fn utext_getPreviousNativeIndex_66(ut: *mut UText) -> i64; + pub fn umsg_vparse_66( + fmt: *const UMessageFormat, + source: *const UChar, + sourceLength: i32, + count: *mut i32, + ap: *mut __va_list_tag, + status: *mut UErrorCode, + ); } extern "C" { - pub fn utext_extract_66( - ut: *mut UText, - nativeStart: i64, - nativeLimit: i64, + pub fn umsg_autoQuoteApostrophe_66( + pattern: *const UChar, + patternLength: i32, dest: *mut UChar, destCapacity: i32, - status: *mut UErrorCode, + ec: *mut UErrorCode, ) -> i32; } extern "C" { - pub fn utext_isWritable_66(ut: *const UText) -> UBool; + pub fn u_getDataDirectory_66() -> *const ::std::os::raw::c_char; } extern "C" { - pub fn utext_hasMetaData_66(ut: *const UText) -> UBool; + pub fn u_setDataDirectory_66(directory: *const ::std::os::raw::c_char); } extern "C" { - pub fn utext_replace_66( - ut: *mut UText, - nativeStart: i64, - nativeLimit: i64, - replacementText: *const UChar, - replacementLength: i32, - status: *mut UErrorCode, - ) -> i32; + pub fn u_getTimeZoneFilesDirectory_66(status: *mut UErrorCode) + -> *const ::std::os::raw::c_char; } extern "C" { - pub fn utext_copy_66( - ut: *mut UText, - nativeStart: i64, - nativeLimit: i64, - destIndex: i64, - move_: UBool, + pub fn u_setTimeZoneFilesDirectory_66( + path: *const ::std::os::raw::c_char, status: *mut UErrorCode, ); } extern "C" { - pub fn utext_freeze_66(ut: *mut UText); + pub fn u_charsToUChars_66(cs: *const ::std::os::raw::c_char, us: *mut UChar, length: i32); +} +extern "C" { + pub fn u_UCharsToChars_66(us: *const UChar, cs: *mut ::std::os::raw::c_char, length: i32); } -pub type UTextClone = ::std::option::Option< - unsafe extern "C" fn( - dest: *mut UText, - src: *const UText, - deep: UBool, - status: *mut UErrorCode, - ) -> *mut UText, ->; -pub type UTextNativeLength = ::std::option::Option i64>; -pub type UTextAccess = ::std::option::Option< - unsafe extern "C" fn(ut: *mut UText, nativeIndex: i64, forward: UBool) -> UBool, ->; -pub type UTextExtract = ::std::option::Option< - unsafe extern "C" fn( - ut: *mut UText, - nativeStart: i64, - nativeLimit: i64, - dest: *mut UChar, - destCapacity: i32, - status: *mut UErrorCode, - ) -> i32, ->; -pub type UTextReplace = ::std::option::Option< - unsafe extern "C" fn( - ut: *mut UText, - nativeStart: i64, - nativeLimit: i64, - replacementText: *const UChar, - replacmentLength: i32, - status: *mut UErrorCode, - ) -> i32, ->; -pub type UTextCopy = ::std::option::Option< - unsafe extern "C" fn( - ut: *mut UText, - nativeStart: i64, - nativeLimit: i64, - nativeDest: i64, - move_: UBool, - status: *mut UErrorCode, - ), ->; -pub type UTextMapOffsetToNative = - ::std::option::Option i64>; -pub type UTextMapNativeIndexToUTF16 = - ::std::option::Option i32>; -pub type UTextClose = ::std::option::Option; #[repr(C)] -#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, PartialEq)] -pub struct UTextFuncs { - pub tableSize: i32, - pub reserved1: i32, - pub reserved2: i32, - pub reserved3: i32, - pub clone: UTextClone, - pub nativeLength: UTextNativeLength, - pub access: UTextAccess, - pub extract: UTextExtract, - pub replace: UTextReplace, - pub copy: UTextCopy, - pub mapOffsetToNative: UTextMapOffsetToNative, - pub mapNativeIndexToUTF16: UTextMapNativeIndexToUTF16, - pub close: UTextClose, - pub spare1: UTextClose, - pub spare2: UTextClose, - pub spare3: UTextClose, +#[derive(Debug, Copy, Clone)] +pub struct UBreakIterator { + _unused: [u8; 0], } -#[test] -fn bindgen_test_layout_UTextFuncs() { - assert_eq!( - ::std::mem::size_of::(), - 112usize, - concat!("Size of: ", stringify!(UTextFuncs)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(UTextFuncs)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).tableSize as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(UTextFuncs), - "::", - stringify!(tableSize) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).reserved1 as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(UTextFuncs), - "::", - stringify!(reserved1) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).reserved2 as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(UTextFuncs), - "::", - stringify!(reserved2) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).reserved3 as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(UTextFuncs), - "::", - stringify!(reserved3) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).clone as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(UTextFuncs), - "::", - stringify!(clone) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).nativeLength as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(UTextFuncs), - "::", - stringify!(nativeLength) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).access as *const _ as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(UTextFuncs), - "::", - stringify!(access) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).extract as *const _ as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(UTextFuncs), - "::", - stringify!(extract) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).replace as *const _ as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(UTextFuncs), - "::", - stringify!(replace) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).copy as *const _ as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(UTextFuncs), - "::", - stringify!(copy) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).mapOffsetToNative as *const _ as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(UTextFuncs), - "::", - stringify!(mapOffsetToNative) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).mapNativeIndexToUTF16 as *const _ as usize - }, - 72usize, - concat!( - "Offset of field: ", - stringify!(UTextFuncs), - "::", - stringify!(mapNativeIndexToUTF16) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).close as *const _ as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(UTextFuncs), - "::", - stringify!(close) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).spare1 as *const _ as usize }, - 88usize, - concat!( - "Offset of field: ", - stringify!(UTextFuncs), - "::", - stringify!(spare1) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).spare2 as *const _ as usize }, - 96usize, - concat!( - "Offset of field: ", - stringify!(UTextFuncs), - "::", - stringify!(spare2) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).spare3 as *const _ as usize }, - 104usize, - concat!( - "Offset of field: ", - stringify!(UTextFuncs), - "::", - stringify!(spare3) - ) - ); +extern "C" { + pub fn u_strlen_66(s: *const UChar) -> i32; } -#[repr(C)] -#[derive(Debug, Copy, Clone, Hash, PartialOrd, PartialEq)] -pub struct UText { - pub magic: u32, - pub flags: i32, - pub providerProperties: i32, - pub sizeOfStruct: i32, - pub chunkNativeLimit: i64, - pub extraSize: i32, - pub nativeIndexingLimit: i32, - pub chunkNativeStart: i64, - pub chunkOffset: i32, - pub chunkLength: i32, - pub chunkContents: *const UChar, - pub pFuncs: *const UTextFuncs, - pub pExtra: *mut ::std::os::raw::c_void, - pub context: *const ::std::os::raw::c_void, - pub p: *const ::std::os::raw::c_void, - pub q: *const ::std::os::raw::c_void, - pub r: *const ::std::os::raw::c_void, - pub privP: *mut ::std::os::raw::c_void, - pub a: i64, - pub b: i32, - pub c: i32, - pub privA: i64, - pub privB: i32, - pub privC: i32, +extern "C" { + pub fn u_countChar32_66(s: *const UChar, length: i32) -> i32; } -#[test] -fn bindgen_test_layout_UText() { - assert_eq!( - ::std::mem::size_of::(), - 144usize, - concat!("Size of: ", stringify!(UText)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(UText)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).magic as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(magic) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).flags as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(flags) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).providerProperties as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(providerProperties) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).sizeOfStruct as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(sizeOfStruct) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).chunkNativeLimit as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(chunkNativeLimit) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).extraSize as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(extraSize) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).nativeIndexingLimit as *const _ as usize }, - 28usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(nativeIndexingLimit) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).chunkNativeStart as *const _ as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(chunkNativeStart) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).chunkOffset as *const _ as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(chunkOffset) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).chunkLength as *const _ as usize }, - 44usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(chunkLength) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).chunkContents as *const _ as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(chunkContents) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).pFuncs as *const _ as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(pFuncs) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).pExtra as *const _ as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(pExtra) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).context as *const _ as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(context) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).p as *const _ as usize }, - 80usize, - concat!("Offset of field: ", stringify!(UText), "::", stringify!(p)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).q as *const _ as usize }, - 88usize, - concat!("Offset of field: ", stringify!(UText), "::", stringify!(q)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).r as *const _ as usize }, - 96usize, - concat!("Offset of field: ", stringify!(UText), "::", stringify!(r)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).privP as *const _ as usize }, - 104usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(privP) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).a as *const _ as usize }, - 112usize, - concat!("Offset of field: ", stringify!(UText), "::", stringify!(a)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).b as *const _ as usize }, - 120usize, - concat!("Offset of field: ", stringify!(UText), "::", stringify!(b)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).c as *const _ as usize }, - 124usize, - concat!("Offset of field: ", stringify!(UText), "::", stringify!(c)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).privA as *const _ as usize }, - 128usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(privA) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).privB as *const _ as usize }, - 136usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(privB) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).privC as *const _ as usize }, - 140usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(privC) - ) - ); +extern "C" { + pub fn u_strHasMoreChar32Than_66(s: *const UChar, length: i32, number: i32) -> UBool; } -impl Default for UText { - fn default() -> Self { - unsafe { ::std::mem::zeroed() } - } +extern "C" { + pub fn u_strcat_66(dst: *mut UChar, src: *const UChar) -> *mut UChar; } extern "C" { - pub fn utext_setup_66(ut: *mut UText, extraSpace: i32, status: *mut UErrorCode) -> *mut UText; + pub fn u_strncat_66(dst: *mut UChar, src: *const UChar, n: i32) -> *mut UChar; } extern "C" { - pub fn u_init_66(status: *mut UErrorCode); + pub fn u_strstr_66(s: *const UChar, substring: *const UChar) -> *mut UChar; } extern "C" { - pub fn u_cleanup_66(); + pub fn u_strFindFirst_66( + s: *const UChar, + length: i32, + substring: *const UChar, + subLength: i32, + ) -> *mut UChar; } -pub type UMemAllocFn = ::std::option::Option< - unsafe extern "C" fn( - context: *const ::std::os::raw::c_void, - size: size_t, - ) -> *mut ::std::os::raw::c_void, ->; -pub type UMemReallocFn = ::std::option::Option< - unsafe extern "C" fn( - context: *const ::std::os::raw::c_void, - mem: *mut ::std::os::raw::c_void, - size: size_t, - ) -> *mut ::std::os::raw::c_void, ->; -pub type UMemFreeFn = ::std::option::Option< - unsafe extern "C" fn(context: *const ::std::os::raw::c_void, mem: *mut ::std::os::raw::c_void), ->; extern "C" { - pub fn u_setMemoryFunctions_66( - context: *const ::std::os::raw::c_void, - a: UMemAllocFn, - r: UMemReallocFn, - f: UMemFreeFn, - status: *mut UErrorCode, - ); + pub fn u_strchr_66(s: *const UChar, c: UChar) -> *mut UChar; } -pub type UMTX = *mut ::std::os::raw::c_void; -pub type UMtxInitFn = ::std::option::Option< - unsafe extern "C" fn( - context: *const ::std::os::raw::c_void, - mutex: *mut UMTX, - status: *mut UErrorCode, - ), ->; -pub type UMtxFn = ::std::option::Option< - unsafe extern "C" fn(context: *const ::std::os::raw::c_void, mutex: *mut UMTX), ->; extern "C" { - pub fn u_setMutexFunctions_66( - context: *const ::std::os::raw::c_void, - init: UMtxInitFn, - destroy: UMtxFn, - lock: UMtxFn, - unlock: UMtxFn, - status: *mut UErrorCode, - ); + pub fn u_strchr32_66(s: *const UChar, c: UChar32) -> *mut UChar; } -pub type UMtxAtomicFn = ::std::option::Option< - unsafe extern "C" fn(context: *const ::std::os::raw::c_void, p: *mut i32) -> i32, ->; extern "C" { - pub fn u_setAtomicIncDecFunctions_66( - context: *const ::std::os::raw::c_void, - inc: UMtxAtomicFn, - dec: UMtxAtomicFn, - status: *mut UErrorCode, - ); + pub fn u_strrstr_66(s: *const UChar, substring: *const UChar) -> *mut UChar; } -pub type va_list = __builtin_va_list; extern "C" { - pub fn u_formatMessage_66( - locale: *const ::std::os::raw::c_char, - pattern: *const UChar, - patternLength: i32, - result: *mut UChar, - resultLength: i32, - status: *mut UErrorCode, - ... - ) -> i32; + pub fn u_strFindLast_66( + s: *const UChar, + length: i32, + substring: *const UChar, + subLength: i32, + ) -> *mut UChar; } extern "C" { - pub fn u_vformatMessage_66( - locale: *const ::std::os::raw::c_char, - pattern: *const UChar, - patternLength: i32, - result: *mut UChar, - resultLength: i32, - ap: *mut __va_list_tag, - status: *mut UErrorCode, - ) -> i32; + pub fn u_strrchr_66(s: *const UChar, c: UChar) -> *mut UChar; } extern "C" { - pub fn u_parseMessage_66( - locale: *const ::std::os::raw::c_char, - pattern: *const UChar, - patternLength: i32, - source: *const UChar, - sourceLength: i32, - status: *mut UErrorCode, - ... - ); + pub fn u_strrchr32_66(s: *const UChar, c: UChar32) -> *mut UChar; } extern "C" { - pub fn u_vparseMessage_66( - locale: *const ::std::os::raw::c_char, - pattern: *const UChar, - patternLength: i32, - source: *const UChar, - sourceLength: i32, - ap: *mut __va_list_tag, - status: *mut UErrorCode, - ); + pub fn u_strpbrk_66(string: *const UChar, matchSet: *const UChar) -> *mut UChar; } extern "C" { - pub fn u_formatMessageWithError_66( - locale: *const ::std::os::raw::c_char, - pattern: *const UChar, - patternLength: i32, - result: *mut UChar, - resultLength: i32, - parseError: *mut UParseError, - status: *mut UErrorCode, - ... + pub fn u_strcspn_66(string: *const UChar, matchSet: *const UChar) -> i32; +} +extern "C" { + pub fn u_strspn_66(string: *const UChar, matchSet: *const UChar) -> i32; +} +extern "C" { + pub fn u_strtok_r_66( + src: *mut UChar, + delim: *const UChar, + saveState: *mut *mut UChar, + ) -> *mut UChar; +} +extern "C" { + pub fn u_strcmp_66(s1: *const UChar, s2: *const UChar) -> i32; +} +extern "C" { + pub fn u_strcmpCodePointOrder_66(s1: *const UChar, s2: *const UChar) -> i32; +} +extern "C" { + pub fn u_strCompare_66( + s1: *const UChar, + length1: i32, + s2: *const UChar, + length2: i32, + codePointOrder: UBool, ) -> i32; } extern "C" { - pub fn u_vformatMessageWithError_66( - locale: *const ::std::os::raw::c_char, - pattern: *const UChar, - patternLength: i32, - result: *mut UChar, - resultLength: i32, - parseError: *mut UParseError, - ap: *mut __va_list_tag, - status: *mut UErrorCode, + pub fn u_strCompareIter_66( + iter1: *mut UCharIterator, + iter2: *mut UCharIterator, + codePointOrder: UBool, ) -> i32; } extern "C" { - pub fn u_parseMessageWithError_66( - locale: *const ::std::os::raw::c_char, - pattern: *const UChar, - patternLength: i32, - source: *const UChar, - sourceLength: i32, - parseError: *mut UParseError, - status: *mut UErrorCode, - ... - ); + pub fn u_strCaseCompare_66( + s1: *const UChar, + length1: i32, + s2: *const UChar, + length2: i32, + options: u32, + pErrorCode: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_vparseMessageWithError_66( - locale: *const ::std::os::raw::c_char, - pattern: *const UChar, - patternLength: i32, - source: *const UChar, - sourceLength: i32, - ap: *mut __va_list_tag, - parseError: *mut UParseError, - status: *mut UErrorCode, - ); + pub fn u_strncmp_66(ucs1: *const UChar, ucs2: *const UChar, n: i32) -> i32; } -pub type UMessageFormat = *mut ::std::os::raw::c_void; extern "C" { - pub fn umsg_open_66( - pattern: *const UChar, - patternLength: i32, - locale: *const ::std::os::raw::c_char, - parseError: *mut UParseError, - status: *mut UErrorCode, - ) -> *mut UMessageFormat; + pub fn u_strncmpCodePointOrder_66(s1: *const UChar, s2: *const UChar, n: i32) -> i32; } extern "C" { - pub fn umsg_close_66(format: *mut UMessageFormat); + pub fn u_strcasecmp_66(s1: *const UChar, s2: *const UChar, options: u32) -> i32; } extern "C" { - pub fn umsg_clone_66(fmt: *const UMessageFormat, status: *mut UErrorCode) -> UMessageFormat; + pub fn u_strncasecmp_66(s1: *const UChar, s2: *const UChar, n: i32, options: u32) -> i32; } extern "C" { - pub fn umsg_setLocale_66(fmt: *mut UMessageFormat, locale: *const ::std::os::raw::c_char); + pub fn u_memcasecmp_66(s1: *const UChar, s2: *const UChar, length: i32, options: u32) -> i32; } extern "C" { - pub fn umsg_getLocale_66(fmt: *const UMessageFormat) -> *const ::std::os::raw::c_char; + pub fn u_strcpy_66(dst: *mut UChar, src: *const UChar) -> *mut UChar; } extern "C" { - pub fn umsg_applyPattern_66( - fmt: *mut UMessageFormat, - pattern: *const UChar, - patternLength: i32, - parseError: *mut UParseError, - status: *mut UErrorCode, - ); + pub fn u_strncpy_66(dst: *mut UChar, src: *const UChar, n: i32) -> *mut UChar; } extern "C" { - pub fn umsg_toPattern_66( - fmt: *const UMessageFormat, - result: *mut UChar, - resultLength: i32, - status: *mut UErrorCode, - ) -> i32; + pub fn u_uastrcpy_66(dst: *mut UChar, src: *const ::std::os::raw::c_char) -> *mut UChar; } extern "C" { - pub fn umsg_format_66( - fmt: *const UMessageFormat, - result: *mut UChar, - resultLength: i32, - status: *mut UErrorCode, - ... - ) -> i32; + pub fn u_uastrncpy_66( + dst: *mut UChar, + src: *const ::std::os::raw::c_char, + n: i32, + ) -> *mut UChar; } extern "C" { - pub fn umsg_vformat_66( - fmt: *const UMessageFormat, - result: *mut UChar, - resultLength: i32, - ap: *mut __va_list_tag, - status: *mut UErrorCode, - ) -> i32; + pub fn u_austrcpy_66( + dst: *mut ::std::os::raw::c_char, + src: *const UChar, + ) -> *mut ::std::os::raw::c_char; } extern "C" { - pub fn umsg_parse_66( - fmt: *const UMessageFormat, - source: *const UChar, - sourceLength: i32, - count: *mut i32, - status: *mut UErrorCode, - ... - ); + pub fn u_austrncpy_66( + dst: *mut ::std::os::raw::c_char, + src: *const UChar, + n: i32, + ) -> *mut ::std::os::raw::c_char; } extern "C" { - pub fn umsg_vparse_66( - fmt: *const UMessageFormat, - source: *const UChar, - sourceLength: i32, - count: *mut i32, - ap: *mut __va_list_tag, - status: *mut UErrorCode, - ); + pub fn u_memcpy_66(dest: *mut UChar, src: *const UChar, count: i32) -> *mut UChar; } extern "C" { - pub fn umsg_autoQuoteApostrophe_66( - pattern: *const UChar, - patternLength: i32, - dest: *mut UChar, - destCapacity: i32, - ec: *mut UErrorCode, - ) -> i32; + pub fn u_memmove_66(dest: *mut UChar, src: *const UChar, count: i32) -> *mut UChar; } -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum USetSpanCondition { - USET_SPAN_NOT_CONTAINED = 0, - USET_SPAN_CONTAINED = 1, - USET_SPAN_SIMPLE = 2, - USET_SPAN_CONDITION_COUNT = 3, +extern "C" { + pub fn u_memset_66(dest: *mut UChar, c: UChar, count: i32) -> *mut UChar; } -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct UCollator { - _unused: [u8; 0], +extern "C" { + pub fn u_memcmp_66(buf1: *const UChar, buf2: *const UChar, count: i32) -> i32; } -#[repr(i32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UCollationResult { - UCOL_EQUAL = 0, - UCOL_GREATER = 1, - UCOL_LESS = -1, +extern "C" { + pub fn u_memcmpCodePointOrder_66(s1: *const UChar, s2: *const UChar, count: i32) -> i32; } -impl UColAttributeValue { - pub const UCOL_DEFAULT_STRENGTH: UColAttributeValue = UColAttributeValue::UCOL_TERTIARY; +extern "C" { + pub fn u_memchr_66(s: *const UChar, c: UChar, count: i32) -> *mut UChar; } -impl UColAttributeValue { - pub const UCOL_QUATERNARY: UColAttributeValue = UColAttributeValue::UCOL_CE_STRENGTH_LIMIT; +extern "C" { + pub fn u_memchr32_66(s: *const UChar, c: UChar32, count: i32) -> *mut UChar; } -impl UColAttributeValue { - pub const UCOL_OFF: UColAttributeValue = UColAttributeValue::UCOL_STRENGTH_LIMIT; -} -#[repr(i32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UColAttributeValue { - UCOL_DEFAULT = -1, - UCOL_PRIMARY = 0, - UCOL_SECONDARY = 1, - UCOL_TERTIARY = 2, - UCOL_CE_STRENGTH_LIMIT = 3, - UCOL_IDENTICAL = 15, - UCOL_STRENGTH_LIMIT = 16, - UCOL_ON = 17, - UCOL_SHIFTED = 20, - UCOL_NON_IGNORABLE = 21, - UCOL_LOWER_FIRST = 24, - UCOL_UPPER_FIRST = 25, - UCOL_ATTRIBUTE_VALUE_COUNT = 26, -} -impl UColReorderCode { - pub const UCOL_REORDER_CODE_OTHERS: UColReorderCode = UColReorderCode::UCOL_REORDER_CODE_NONE; -} -impl UColReorderCode { - pub const UCOL_REORDER_CODE_FIRST: UColReorderCode = UColReorderCode::UCOL_REORDER_CODE_SPACE; -} -#[repr(i32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UColReorderCode { - UCOL_REORDER_CODE_DEFAULT = -1, - UCOL_REORDER_CODE_NONE = 103, - UCOL_REORDER_CODE_SPACE = 4096, - UCOL_REORDER_CODE_PUNCTUATION = 4097, - UCOL_REORDER_CODE_SYMBOL = 4098, - UCOL_REORDER_CODE_CURRENCY = 4099, - UCOL_REORDER_CODE_DIGIT = 4100, - UCOL_REORDER_CODE_LIMIT = 4101, -} -pub use self::UColAttributeValue as UCollationStrength; -impl UColAttribute { - pub const UCOL_DECOMPOSITION_MODE: UColAttribute = UColAttribute::UCOL_NORMALIZATION_MODE; -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UColAttribute { - UCOL_FRENCH_COLLATION = 0, - UCOL_ALTERNATE_HANDLING = 1, - UCOL_CASE_FIRST = 2, - UCOL_CASE_LEVEL = 3, - UCOL_NORMALIZATION_MODE = 4, - UCOL_STRENGTH = 5, - UCOL_HIRAGANA_QUATERNARY_MODE = 6, - UCOL_NUMERIC_COLLATION = 7, - UCOL_ATTRIBUTE_COUNT = 8, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UColRuleOption { - UCOL_TAILORING_ONLY = 0, - UCOL_FULL_RULES = 1, -} -extern "C" { - pub fn ucol_open_66( - loc: *const ::std::os::raw::c_char, - status: *mut UErrorCode, - ) -> *mut UCollator; -} -extern "C" { - pub fn ucol_openRules_66( - rules: *const UChar, - rulesLength: i32, - normalizationMode: UColAttributeValue, - strength: UCollationStrength, - parseError: *mut UParseError, - status: *mut UErrorCode, - ) -> *mut UCollator; +extern "C" { + pub fn u_memrchr_66(s: *const UChar, c: UChar, count: i32) -> *mut UChar; } extern "C" { - pub fn ucol_openFromShortString_66( - definition: *const ::std::os::raw::c_char, - forceDefaults: UBool, - parseError: *mut UParseError, - status: *mut UErrorCode, - ) -> *mut UCollator; + pub fn u_memrchr32_66(s: *const UChar, c: UChar32, count: i32) -> *mut UChar; } extern "C" { - pub fn ucol_getContractions_66( - coll: *const UCollator, - conts: *mut USet, - status: *mut UErrorCode, + pub fn u_unescape_66( + src: *const ::std::os::raw::c_char, + dest: *mut UChar, + destCapacity: i32, ) -> i32; } +pub type UNESCAPE_CHAR_AT = ::std::option::Option< + unsafe extern "C" fn(offset: i32, context: *mut ::std::os::raw::c_void) -> UChar, +>; extern "C" { - pub fn ucol_getContractionsAndExpansions_66( - coll: *const UCollator, - contractions: *mut USet, - expansions: *mut USet, - addPrefixes: UBool, - status: *mut UErrorCode, - ); -} -extern "C" { - pub fn ucol_close_66(coll: *mut UCollator); + pub fn u_unescapeAt_66( + charAt: UNESCAPE_CHAR_AT, + offset: *mut i32, + length: i32, + context: *mut ::std::os::raw::c_void, + ) -> UChar32; } extern "C" { - pub fn ucol_strcoll_66( - coll: *const UCollator, - source: *const UChar, - sourceLength: i32, - target: *const UChar, - targetLength: i32, - ) -> UCollationResult; + pub fn u_strToUpper_66( + dest: *mut UChar, + destCapacity: i32, + src: *const UChar, + srcLength: i32, + locale: *const ::std::os::raw::c_char, + pErrorCode: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn ucol_strcollUTF8_66( - coll: *const UCollator, - source: *const ::std::os::raw::c_char, - sourceLength: i32, - target: *const ::std::os::raw::c_char, - targetLength: i32, - status: *mut UErrorCode, - ) -> UCollationResult; + pub fn u_strToLower_66( + dest: *mut UChar, + destCapacity: i32, + src: *const UChar, + srcLength: i32, + locale: *const ::std::os::raw::c_char, + pErrorCode: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn ucol_greater_66( - coll: *const UCollator, - source: *const UChar, - sourceLength: i32, - target: *const UChar, - targetLength: i32, - ) -> UBool; + pub fn u_strToTitle_66( + dest: *mut UChar, + destCapacity: i32, + src: *const UChar, + srcLength: i32, + titleIter: *mut UBreakIterator, + locale: *const ::std::os::raw::c_char, + pErrorCode: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn ucol_greaterOrEqual_66( - coll: *const UCollator, - source: *const UChar, - sourceLength: i32, - target: *const UChar, - targetLength: i32, - ) -> UBool; + pub fn u_strFoldCase_66( + dest: *mut UChar, + destCapacity: i32, + src: *const UChar, + srcLength: i32, + options: u32, + pErrorCode: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn ucol_equal_66( - coll: *const UCollator, - source: *const UChar, - sourceLength: i32, - target: *const UChar, - targetLength: i32, - ) -> UBool; + pub fn u_strToWCS_66( + dest: *mut wchar_t, + destCapacity: i32, + pDestLength: *mut i32, + src: *const UChar, + srcLength: i32, + pErrorCode: *mut UErrorCode, + ) -> *mut wchar_t; } extern "C" { - pub fn ucol_strcollIter_66( - coll: *const UCollator, - sIter: *mut UCharIterator, - tIter: *mut UCharIterator, - status: *mut UErrorCode, - ) -> UCollationResult; + pub fn u_strFromWCS_66( + dest: *mut UChar, + destCapacity: i32, + pDestLength: *mut i32, + src: *const wchar_t, + srcLength: i32, + pErrorCode: *mut UErrorCode, + ) -> *mut UChar; } extern "C" { - pub fn ucol_getStrength_66(coll: *const UCollator) -> UCollationStrength; + pub fn u_strToUTF8_66( + dest: *mut ::std::os::raw::c_char, + destCapacity: i32, + pDestLength: *mut i32, + src: *const UChar, + srcLength: i32, + pErrorCode: *mut UErrorCode, + ) -> *mut ::std::os::raw::c_char; } extern "C" { - pub fn ucol_setStrength_66(coll: *mut UCollator, strength: UCollationStrength); + pub fn u_strFromUTF8_66( + dest: *mut UChar, + destCapacity: i32, + pDestLength: *mut i32, + src: *const ::std::os::raw::c_char, + srcLength: i32, + pErrorCode: *mut UErrorCode, + ) -> *mut UChar; } extern "C" { - pub fn ucol_getReorderCodes_66( - coll: *const UCollator, - dest: *mut i32, + pub fn u_strToUTF8WithSub_66( + dest: *mut ::std::os::raw::c_char, destCapacity: i32, + pDestLength: *mut i32, + src: *const UChar, + srcLength: i32, + subchar: UChar32, + pNumSubstitutions: *mut i32, pErrorCode: *mut UErrorCode, - ) -> i32; + ) -> *mut ::std::os::raw::c_char; } extern "C" { - pub fn ucol_setReorderCodes_66( - coll: *mut UCollator, - reorderCodes: *const i32, - reorderCodesLength: i32, + pub fn u_strFromUTF8WithSub_66( + dest: *mut UChar, + destCapacity: i32, + pDestLength: *mut i32, + src: *const ::std::os::raw::c_char, + srcLength: i32, + subchar: UChar32, + pNumSubstitutions: *mut i32, pErrorCode: *mut UErrorCode, - ); + ) -> *mut UChar; } extern "C" { - pub fn ucol_getEquivalentReorderCodes_66( - reorderCode: i32, - dest: *mut i32, + pub fn u_strFromUTF8Lenient_66( + dest: *mut UChar, destCapacity: i32, + pDestLength: *mut i32, + src: *const ::std::os::raw::c_char, + srcLength: i32, pErrorCode: *mut UErrorCode, - ) -> i32; + ) -> *mut UChar; } extern "C" { - pub fn ucol_getDisplayName_66( - objLoc: *const ::std::os::raw::c_char, - dispLoc: *const ::std::os::raw::c_char, - result: *mut UChar, - resultLength: i32, - status: *mut UErrorCode, - ) -> i32; + pub fn u_strToUTF32_66( + dest: *mut UChar32, + destCapacity: i32, + pDestLength: *mut i32, + src: *const UChar, + srcLength: i32, + pErrorCode: *mut UErrorCode, + ) -> *mut UChar32; } extern "C" { - pub fn ucol_getAvailable_66(localeIndex: i32) -> *const ::std::os::raw::c_char; + pub fn u_strFromUTF32_66( + dest: *mut UChar, + destCapacity: i32, + pDestLength: *mut i32, + src: *const UChar32, + srcLength: i32, + pErrorCode: *mut UErrorCode, + ) -> *mut UChar; } extern "C" { - pub fn ucol_countAvailable_66() -> i32; + pub fn u_strToUTF32WithSub_66( + dest: *mut UChar32, + destCapacity: i32, + pDestLength: *mut i32, + src: *const UChar, + srcLength: i32, + subchar: UChar32, + pNumSubstitutions: *mut i32, + pErrorCode: *mut UErrorCode, + ) -> *mut UChar32; } extern "C" { - pub fn ucol_openAvailableLocales_66(status: *mut UErrorCode) -> *mut UEnumeration; + pub fn u_strFromUTF32WithSub_66( + dest: *mut UChar, + destCapacity: i32, + pDestLength: *mut i32, + src: *const UChar32, + srcLength: i32, + subchar: UChar32, + pNumSubstitutions: *mut i32, + pErrorCode: *mut UErrorCode, + ) -> *mut UChar; } extern "C" { - pub fn ucol_getKeywords_66(status: *mut UErrorCode) -> *mut UEnumeration; + pub fn u_strToJavaModifiedUTF8_66( + dest: *mut ::std::os::raw::c_char, + destCapacity: i32, + pDestLength: *mut i32, + src: *const UChar, + srcLength: i32, + pErrorCode: *mut UErrorCode, + ) -> *mut ::std::os::raw::c_char; } extern "C" { - pub fn ucol_getKeywordValues_66( - keyword: *const ::std::os::raw::c_char, + pub fn u_strFromJavaModifiedUTF8WithSub_66( + dest: *mut UChar, + destCapacity: i32, + pDestLength: *mut i32, + src: *const ::std::os::raw::c_char, + srcLength: i32, + subchar: UChar32, + pNumSubstitutions: *mut i32, + pErrorCode: *mut UErrorCode, + ) -> *mut UChar; +} +extern "C" { + pub fn utext_close_66(ut: *mut UText) -> *mut UText; +} +extern "C" { + pub fn utext_openUTF8_66( + ut: *mut UText, + s: *const ::std::os::raw::c_char, + length: i64, status: *mut UErrorCode, - ) -> *mut UEnumeration; + ) -> *mut UText; } extern "C" { - pub fn ucol_getKeywordValuesForLocale_66( - key: *const ::std::os::raw::c_char, - locale: *const ::std::os::raw::c_char, - commonlyUsed: UBool, + pub fn utext_openUChars_66( + ut: *mut UText, + s: *const UChar, + length: i64, status: *mut UErrorCode, - ) -> *mut UEnumeration; + ) -> *mut UText; } extern "C" { - pub fn ucol_getFunctionalEquivalent_66( - result: *mut ::std::os::raw::c_char, - resultCapacity: i32, - keyword: *const ::std::os::raw::c_char, - locale: *const ::std::os::raw::c_char, - isAvailable: *mut UBool, + pub fn utext_clone_66( + dest: *mut UText, + src: *const UText, + deep: UBool, + readOnly: UBool, status: *mut UErrorCode, - ) -> i32; + ) -> *mut UText; } extern "C" { - pub fn ucol_getRules_66(coll: *const UCollator, length: *mut i32) -> *const UChar; + pub fn utext_equals_66(a: *const UText, b: *const UText) -> UBool; } extern "C" { - pub fn ucol_getShortDefinitionString_66( - coll: *const UCollator, - locale: *const ::std::os::raw::c_char, - buffer: *mut ::std::os::raw::c_char, - capacity: i32, - status: *mut UErrorCode, - ) -> i32; + pub fn utext_nativeLength_66(ut: *mut UText) -> i64; } extern "C" { - pub fn ucol_normalizeShortDefinitionString_66( - source: *const ::std::os::raw::c_char, - destination: *mut ::std::os::raw::c_char, - capacity: i32, - parseError: *mut UParseError, - status: *mut UErrorCode, - ) -> i32; + pub fn utext_isLengthExpensive_66(ut: *const UText) -> UBool; } extern "C" { - pub fn ucol_getSortKey_66( - coll: *const UCollator, - source: *const UChar, - sourceLength: i32, - result: *mut u8, - resultLength: i32, - ) -> i32; + pub fn utext_char32At_66(ut: *mut UText, nativeIndex: i64) -> UChar32; } extern "C" { - pub fn ucol_nextSortKeyPart_66( - coll: *const UCollator, - iter: *mut UCharIterator, - state: *mut u32, - dest: *mut u8, - count: i32, - status: *mut UErrorCode, - ) -> i32; + pub fn utext_current32_66(ut: *mut UText) -> UChar32; } -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UColBoundMode { - UCOL_BOUND_LOWER = 0, - UCOL_BOUND_UPPER = 1, - UCOL_BOUND_UPPER_LONG = 2, - UCOL_BOUND_VALUE_COUNT = 3, +extern "C" { + pub fn utext_next32_66(ut: *mut UText) -> UChar32; } extern "C" { - pub fn ucol_getBound_66( - source: *const u8, - sourceLength: i32, - boundType: UColBoundMode, - noOfLevels: u32, - result: *mut u8, - resultLength: i32, + pub fn utext_previous32_66(ut: *mut UText) -> UChar32; +} +extern "C" { + pub fn utext_next32From_66(ut: *mut UText, nativeIndex: i64) -> UChar32; +} +extern "C" { + pub fn utext_previous32From_66(ut: *mut UText, nativeIndex: i64) -> UChar32; +} +extern "C" { + pub fn utext_getNativeIndex_66(ut: *const UText) -> i64; +} +extern "C" { + pub fn utext_setNativeIndex_66(ut: *mut UText, nativeIndex: i64); +} +extern "C" { + pub fn utext_moveIndex32_66(ut: *mut UText, delta: i32) -> UBool; +} +extern "C" { + pub fn utext_getPreviousNativeIndex_66(ut: *mut UText) -> i64; +} +extern "C" { + pub fn utext_extract_66( + ut: *mut UText, + nativeStart: i64, + nativeLimit: i64, + dest: *mut UChar, + destCapacity: i32, status: *mut UErrorCode, ) -> i32; } extern "C" { - pub fn ucol_getVersion_66(coll: *const UCollator, info: *mut u8); + pub fn utext_isWritable_66(ut: *const UText) -> UBool; } extern "C" { - pub fn ucol_getUCAVersion_66(coll: *const UCollator, info: *mut u8); + pub fn utext_hasMetaData_66(ut: *const UText) -> UBool; } extern "C" { - pub fn ucol_mergeSortkeys_66( - src1: *const u8, - src1Length: i32, - src2: *const u8, - src2Length: i32, - dest: *mut u8, - destCapacity: i32, + pub fn utext_replace_66( + ut: *mut UText, + nativeStart: i64, + nativeLimit: i64, + replacementText: *const UChar, + replacementLength: i32, + status: *mut UErrorCode, ) -> i32; } extern "C" { - pub fn ucol_setAttribute_66( - coll: *mut UCollator, - attr: UColAttribute, - value: UColAttributeValue, + pub fn utext_copy_66( + ut: *mut UText, + nativeStart: i64, + nativeLimit: i64, + destIndex: i64, + move_: UBool, + status: *mut UErrorCode, + ); +} +extern "C" { + pub fn utext_freeze_66(ut: *mut UText); +} +pub type UTextClone = ::std::option::Option< + unsafe extern "C" fn( + dest: *mut UText, + src: *const UText, + deep: UBool, + status: *mut UErrorCode, + ) -> *mut UText, +>; +pub type UTextNativeLength = ::std::option::Option i64>; +pub type UTextAccess = ::std::option::Option< + unsafe extern "C" fn(ut: *mut UText, nativeIndex: i64, forward: UBool) -> UBool, +>; +pub type UTextExtract = ::std::option::Option< + unsafe extern "C" fn( + ut: *mut UText, + nativeStart: i64, + nativeLimit: i64, + dest: *mut UChar, + destCapacity: i32, + status: *mut UErrorCode, + ) -> i32, +>; +pub type UTextReplace = ::std::option::Option< + unsafe extern "C" fn( + ut: *mut UText, + nativeStart: i64, + nativeLimit: i64, + replacementText: *const UChar, + replacmentLength: i32, + status: *mut UErrorCode, + ) -> i32, +>; +pub type UTextCopy = ::std::option::Option< + unsafe extern "C" fn( + ut: *mut UText, + nativeStart: i64, + nativeLimit: i64, + nativeDest: i64, + move_: UBool, status: *mut UErrorCode, + ), +>; +pub type UTextMapOffsetToNative = + ::std::option::Option i64>; +pub type UTextMapNativeIndexToUTF16 = + ::std::option::Option i32>; +pub type UTextClose = ::std::option::Option; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, PartialEq)] +pub struct UTextFuncs { + pub tableSize: i32, + pub reserved1: i32, + pub reserved2: i32, + pub reserved3: i32, + pub clone: UTextClone, + pub nativeLength: UTextNativeLength, + pub access: UTextAccess, + pub extract: UTextExtract, + pub replace: UTextReplace, + pub copy: UTextCopy, + pub mapOffsetToNative: UTextMapOffsetToNative, + pub mapNativeIndexToUTF16: UTextMapNativeIndexToUTF16, + pub close: UTextClose, + pub spare1: UTextClose, + pub spare2: UTextClose, + pub spare3: UTextClose, +} +#[test] +fn bindgen_test_layout_UTextFuncs() { + assert_eq!( + ::std::mem::size_of::(), + 112usize, + concat!("Size of: ", stringify!(UTextFuncs)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(UTextFuncs)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tableSize as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(UTextFuncs), + "::", + stringify!(tableSize) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).reserved1 as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(UTextFuncs), + "::", + stringify!(reserved1) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).reserved2 as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(UTextFuncs), + "::", + stringify!(reserved2) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).reserved3 as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(UTextFuncs), + "::", + stringify!(reserved3) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).clone as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(UTextFuncs), + "::", + stringify!(clone) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).nativeLength as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(UTextFuncs), + "::", + stringify!(nativeLength) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).access as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(UTextFuncs), + "::", + stringify!(access) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).extract as *const _ as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(UTextFuncs), + "::", + stringify!(extract) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).replace as *const _ as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(UTextFuncs), + "::", + stringify!(replace) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).copy as *const _ as usize }, + 56usize, + concat!( + "Offset of field: ", + stringify!(UTextFuncs), + "::", + stringify!(copy) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).mapOffsetToNative as *const _ as usize }, + 64usize, + concat!( + "Offset of field: ", + stringify!(UTextFuncs), + "::", + stringify!(mapOffsetToNative) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).mapNativeIndexToUTF16 as *const _ as usize + }, + 72usize, + concat!( + "Offset of field: ", + stringify!(UTextFuncs), + "::", + stringify!(mapNativeIndexToUTF16) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).close as *const _ as usize }, + 80usize, + concat!( + "Offset of field: ", + stringify!(UTextFuncs), + "::", + stringify!(close) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).spare1 as *const _ as usize }, + 88usize, + concat!( + "Offset of field: ", + stringify!(UTextFuncs), + "::", + stringify!(spare1) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).spare2 as *const _ as usize }, + 96usize, + concat!( + "Offset of field: ", + stringify!(UTextFuncs), + "::", + stringify!(spare2) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).spare3 as *const _ as usize }, + 104usize, + concat!( + "Offset of field: ", + stringify!(UTextFuncs), + "::", + stringify!(spare3) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone, Hash, PartialOrd, PartialEq)] +pub struct UText { + pub magic: u32, + pub flags: i32, + pub providerProperties: i32, + pub sizeOfStruct: i32, + pub chunkNativeLimit: i64, + pub extraSize: i32, + pub nativeIndexingLimit: i32, + pub chunkNativeStart: i64, + pub chunkOffset: i32, + pub chunkLength: i32, + pub chunkContents: *const UChar, + pub pFuncs: *const UTextFuncs, + pub pExtra: *mut ::std::os::raw::c_void, + pub context: *const ::std::os::raw::c_void, + pub p: *const ::std::os::raw::c_void, + pub q: *const ::std::os::raw::c_void, + pub r: *const ::std::os::raw::c_void, + pub privP: *mut ::std::os::raw::c_void, + pub a: i64, + pub b: i32, + pub c: i32, + pub privA: i64, + pub privB: i32, + pub privC: i32, +} +#[test] +fn bindgen_test_layout_UText() { + assert_eq!( + ::std::mem::size_of::(), + 144usize, + concat!("Size of: ", stringify!(UText)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(UText)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).magic as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(magic) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).flags as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(flags) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).providerProperties as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(providerProperties) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).sizeOfStruct as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(sizeOfStruct) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).chunkNativeLimit as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(chunkNativeLimit) + ) ); -} -extern "C" { - pub fn ucol_getAttribute_66( - coll: *const UCollator, - attr: UColAttribute, - status: *mut UErrorCode, - ) -> UColAttributeValue; -} -extern "C" { - pub fn ucol_setMaxVariable_66( - coll: *mut UCollator, - group: UColReorderCode, - pErrorCode: *mut UErrorCode, + assert_eq!( + unsafe { &(*(::std::ptr::null::())).extraSize as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(extraSize) + ) ); -} -extern "C" { - pub fn ucol_getMaxVariable_66(coll: *const UCollator) -> UColReorderCode; -} -extern "C" { - pub fn ucol_setVariableTop_66( - coll: *mut UCollator, - varTop: *const UChar, - len: i32, - status: *mut UErrorCode, - ) -> u32; -} -extern "C" { - pub fn ucol_getVariableTop_66(coll: *const UCollator, status: *mut UErrorCode) -> u32; -} -extern "C" { - pub fn ucol_restoreVariableTop_66(coll: *mut UCollator, varTop: u32, status: *mut UErrorCode); -} -extern "C" { - pub fn ucol_safeClone_66( - coll: *const UCollator, - stackBuffer: *mut ::std::os::raw::c_void, - pBufferSize: *mut i32, - status: *mut UErrorCode, - ) -> *mut UCollator; -} -extern "C" { - pub fn ucol_getRulesEx_66( - coll: *const UCollator, - delta: UColRuleOption, - buffer: *mut UChar, - bufferLen: i32, - ) -> i32; -} -extern "C" { - pub fn ucol_getLocale_66( - coll: *const UCollator, - type_: ULocDataLocaleType, - status: *mut UErrorCode, - ) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn ucol_getLocaleByType_66( - coll: *const UCollator, - type_: ULocDataLocaleType, - status: *mut UErrorCode, - ) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn ucol_getTailoredSet_66(coll: *const UCollator, status: *mut UErrorCode) -> *mut USet; -} -extern "C" { - pub fn ucol_getUnsafeSet_66( - coll: *const UCollator, - unsafe_: *mut USet, - status: *mut UErrorCode, - ) -> i32; -} -extern "C" { - pub fn ucol_prepareShortStringOpen_66( - definition: *const ::std::os::raw::c_char, - forceDefaults: UBool, - parseError: *mut UParseError, - status: *mut UErrorCode, + assert_eq!( + unsafe { &(*(::std::ptr::null::())).nativeIndexingLimit as *const _ as usize }, + 28usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(nativeIndexingLimit) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).chunkNativeStart as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(chunkNativeStart) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).chunkOffset as *const _ as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(chunkOffset) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).chunkLength as *const _ as usize }, + 44usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(chunkLength) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).chunkContents as *const _ as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(chunkContents) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).pFuncs as *const _ as usize }, + 56usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(pFuncs) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).pExtra as *const _ as usize }, + 64usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(pExtra) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).context as *const _ as usize }, + 72usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(context) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).p as *const _ as usize }, + 80usize, + concat!("Offset of field: ", stringify!(UText), "::", stringify!(p)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).q as *const _ as usize }, + 88usize, + concat!("Offset of field: ", stringify!(UText), "::", stringify!(q)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).r as *const _ as usize }, + 96usize, + concat!("Offset of field: ", stringify!(UText), "::", stringify!(r)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).privP as *const _ as usize }, + 104usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(privP) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).a as *const _ as usize }, + 112usize, + concat!("Offset of field: ", stringify!(UText), "::", stringify!(a)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).b as *const _ as usize }, + 120usize, + concat!("Offset of field: ", stringify!(UText), "::", stringify!(b)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).c as *const _ as usize }, + 124usize, + concat!("Offset of field: ", stringify!(UText), "::", stringify!(c)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).privA as *const _ as usize }, + 128usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(privA) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).privB as *const _ as usize }, + 136usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(privB) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).privC as *const _ as usize }, + 140usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(privC) + ) ); } -extern "C" { - pub fn ucol_cloneBinary_66( - coll: *const UCollator, - buffer: *mut u8, - capacity: i32, - status: *mut UErrorCode, - ) -> i32; +impl Default for UText { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } } extern "C" { - pub fn ucol_openBinary_66( - bin: *const u8, - length: i32, - base: *const UCollator, - status: *mut UErrorCode, - ) -> *mut UCollator; + pub fn utext_setup_66(ut: *mut UText, extraSpace: i32, status: *mut UErrorCode) -> *mut UText; } pub type __builtin_va_list = [__va_list_tag; 1usize]; #[repr(C)] diff --git a/rust_icu_sys/bindgen/lib_67.rs b/rust_icu_sys/bindgen/lib_67.rs index de54fd3d..a5ece765 100644 --- a/rust_icu_sys/bindgen/lib_67.rs +++ b/rust_icu_sys/bindgen/lib_67.rs @@ -982,3078 +982,3163 @@ extern "C" { status: *mut UErrorCode, ) -> i32; } +extern "C" { + pub fn u_init_67(status: *mut UErrorCode); +} +extern "C" { + pub fn u_cleanup_67(); +} +pub type UMemAllocFn = ::std::option::Option< + unsafe extern "C" fn( + context: *const ::std::os::raw::c_void, + size: size_t, + ) -> *mut ::std::os::raw::c_void, +>; +pub type UMemReallocFn = ::std::option::Option< + unsafe extern "C" fn( + context: *const ::std::os::raw::c_void, + mem: *mut ::std::os::raw::c_void, + size: size_t, + ) -> *mut ::std::os::raw::c_void, +>; +pub type UMemFreeFn = ::std::option::Option< + unsafe extern "C" fn(context: *const ::std::os::raw::c_void, mem: *mut ::std::os::raw::c_void), +>; +extern "C" { + pub fn u_setMemoryFunctions_67( + context: *const ::std::os::raw::c_void, + a: UMemAllocFn, + r: UMemReallocFn, + f: UMemFreeFn, + status: *mut UErrorCode, + ); +} +pub type UMTX = *mut ::std::os::raw::c_void; +pub type UMtxInitFn = ::std::option::Option< + unsafe extern "C" fn( + context: *const ::std::os::raw::c_void, + mutex: *mut UMTX, + status: *mut UErrorCode, + ), +>; +pub type UMtxFn = ::std::option::Option< + unsafe extern "C" fn(context: *const ::std::os::raw::c_void, mutex: *mut UMTX), +>; +extern "C" { + pub fn u_setMutexFunctions_67( + context: *const ::std::os::raw::c_void, + init: UMtxInitFn, + destroy: UMtxFn, + lock: UMtxFn, + unlock: UMtxFn, + status: *mut UErrorCode, + ); +} +pub type UMtxAtomicFn = ::std::option::Option< + unsafe extern "C" fn(context: *const ::std::os::raw::c_void, p: *mut i32) -> i32, +>; +extern "C" { + pub fn u_setAtomicIncDecFunctions_67( + context: *const ::std::os::raw::c_void, + inc: UMtxAtomicFn, + dec: UMtxAtomicFn, + status: *mut UErrorCode, + ); +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] +pub enum UCharIteratorOrigin { + UITER_START = 0, + UITER_CURRENT = 1, + UITER_LIMIT = 2, + UITER_ZERO = 3, + UITER_LENGTH = 4, +} +pub type UCharIteratorGetIndex = ::std::option::Option< + unsafe extern "C" fn(iter: *mut UCharIterator, origin: UCharIteratorOrigin) -> i32, +>; +pub type UCharIteratorMove = ::std::option::Option< + unsafe extern "C" fn(iter: *mut UCharIterator, delta: i32, origin: UCharIteratorOrigin) -> i32, +>; +pub type UCharIteratorHasNext = + ::std::option::Option UBool>; +pub type UCharIteratorHasPrevious = + ::std::option::Option UBool>; +pub type UCharIteratorCurrent = + ::std::option::Option UChar32>; +pub type UCharIteratorNext = + ::std::option::Option UChar32>; +pub type UCharIteratorPrevious = + ::std::option::Option UChar32>; +pub type UCharIteratorReserved = + ::std::option::Option i32>; +pub type UCharIteratorGetState = + ::std::option::Option u32>; +pub type UCharIteratorSetState = ::std::option::Option< + unsafe extern "C" fn(iter: *mut UCharIterator, state: u32, pErrorCode: *mut UErrorCode), +>; #[repr(C)] -#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, PartialEq)] -pub struct UFieldPosition { - pub field: i32, - pub beginIndex: i32, - pub endIndex: i32, +#[derive(Debug, Copy, Clone, Hash, PartialOrd, PartialEq)] +pub struct UCharIterator { + pub context: *const ::std::os::raw::c_void, + pub length: i32, + pub start: i32, + pub index: i32, + pub limit: i32, + pub reservedField: i32, + pub getIndex: UCharIteratorGetIndex, + pub move_: UCharIteratorMove, + pub hasNext: UCharIteratorHasNext, + pub hasPrevious: UCharIteratorHasPrevious, + pub current: UCharIteratorCurrent, + pub next: UCharIteratorNext, + pub previous: UCharIteratorPrevious, + pub reservedFn: UCharIteratorReserved, + pub getState: UCharIteratorGetState, + pub setState: UCharIteratorSetState, } #[test] -fn bindgen_test_layout_UFieldPosition() { +fn bindgen_test_layout_UCharIterator() { assert_eq!( - ::std::mem::size_of::(), - 12usize, - concat!("Size of: ", stringify!(UFieldPosition)) + ::std::mem::size_of::(), + 112usize, + concat!("Size of: ", stringify!(UCharIterator)) ); assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(UFieldPosition)) + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(UCharIterator)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).field as *const _ as usize }, + unsafe { &(*(::std::ptr::null::())).context as *const _ as usize }, 0usize, concat!( "Offset of field: ", - stringify!(UFieldPosition), + stringify!(UCharIterator), "::", - stringify!(field) + stringify!(context) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).beginIndex as *const _ as usize }, - 4usize, + unsafe { &(*(::std::ptr::null::())).length as *const _ as usize }, + 8usize, concat!( "Offset of field: ", - stringify!(UFieldPosition), + stringify!(UCharIterator), "::", - stringify!(beginIndex) + stringify!(length) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).endIndex as *const _ as usize }, - 8usize, + unsafe { &(*(::std::ptr::null::())).start as *const _ as usize }, + 12usize, concat!( "Offset of field: ", - stringify!(UFieldPosition), + stringify!(UCharIterator), "::", - stringify!(endIndex) + stringify!(start) ) ); -} -#[repr(C)] -#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, PartialEq)] -pub struct UParseError { - pub line: i32, - pub offset: i32, - pub preContext: [UChar; 16usize], - pub postContext: [UChar; 16usize], -} -#[test] -fn bindgen_test_layout_UParseError() { assert_eq!( - ::std::mem::size_of::(), - 72usize, - concat!("Size of: ", stringify!(UParseError)) + unsafe { &(*(::std::ptr::null::())).index as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(UCharIterator), + "::", + stringify!(index) + ) ); assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(UParseError)) + unsafe { &(*(::std::ptr::null::())).limit as *const _ as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(UCharIterator), + "::", + stringify!(limit) + ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).line as *const _ as usize }, - 0usize, + unsafe { &(*(::std::ptr::null::())).reservedField as *const _ as usize }, + 24usize, concat!( "Offset of field: ", - stringify!(UParseError), + stringify!(UCharIterator), "::", - stringify!(line) + stringify!(reservedField) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).offset as *const _ as usize }, - 4usize, + unsafe { &(*(::std::ptr::null::())).getIndex as *const _ as usize }, + 32usize, concat!( "Offset of field: ", - stringify!(UParseError), + stringify!(UCharIterator), "::", - stringify!(offset) + stringify!(getIndex) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).preContext as *const _ as usize }, - 8usize, + unsafe { &(*(::std::ptr::null::())).move_ as *const _ as usize }, + 40usize, concat!( "Offset of field: ", - stringify!(UParseError), + stringify!(UCharIterator), "::", - stringify!(preContext) + stringify!(move_) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).postContext as *const _ as usize }, - 40usize, + unsafe { &(*(::std::ptr::null::())).hasNext as *const _ as usize }, + 48usize, concat!( "Offset of field: ", - stringify!(UParseError), + stringify!(UCharIterator), "::", - stringify!(postContext) + stringify!(hasNext) ) ); -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UDisplayContextType { - UDISPCTX_TYPE_DIALECT_HANDLING = 0, - UDISPCTX_TYPE_CAPITALIZATION = 1, - UDISPCTX_TYPE_DISPLAY_LENGTH = 2, - UDISPCTX_TYPE_SUBSTITUTE_HANDLING = 3, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UDisplayContext { - UDISPCTX_STANDARD_NAMES = 0, - UDISPCTX_DIALECT_NAMES = 1, - UDISPCTX_CAPITALIZATION_NONE = 256, - UDISPCTX_CAPITALIZATION_FOR_MIDDLE_OF_SENTENCE = 257, - UDISPCTX_CAPITALIZATION_FOR_BEGINNING_OF_SENTENCE = 258, - UDISPCTX_CAPITALIZATION_FOR_UI_LIST_OR_MENU = 259, - UDISPCTX_CAPITALIZATION_FOR_STANDALONE = 260, - UDISPCTX_LENGTH_FULL = 512, - UDISPCTX_LENGTH_SHORT = 513, - UDISPCTX_SUBSTITUTE = 768, - UDISPCTX_NO_SUBSTITUTE = 769, -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct UFieldPositionIterator { - _unused: [u8; 0], -} -pub type UNumberFormat = *mut ::std::os::raw::c_void; -pub type UDateFormat = *mut ::std::os::raw::c_void; -impl UDateFormatStyle { - pub const UDAT_DEFAULT: UDateFormatStyle = UDateFormatStyle::UDAT_MEDIUM; -} -impl UDateFormatStyle { - pub const UDAT_FULL_RELATIVE: UDateFormatStyle = UDateFormatStyle::UDAT_RELATIVE; -} -impl UDateFormatStyle { - pub const UDAT_IGNORE: UDateFormatStyle = UDateFormatStyle::UDAT_PATTERN; -} -#[repr(i32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UDateFormatStyle { - UDAT_FULL = 0, - UDAT_LONG = 1, - UDAT_MEDIUM = 2, - UDAT_SHORT = 3, - UDAT_RELATIVE = 128, - UDAT_LONG_RELATIVE = 129, - UDAT_MEDIUM_RELATIVE = 130, - UDAT_SHORT_RELATIVE = 131, - UDAT_NONE = -1, - UDAT_PATTERN = -2, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UDateFormatField { - UDAT_ERA_FIELD = 0, - UDAT_YEAR_FIELD = 1, - UDAT_MONTH_FIELD = 2, - UDAT_DATE_FIELD = 3, - UDAT_HOUR_OF_DAY1_FIELD = 4, - UDAT_HOUR_OF_DAY0_FIELD = 5, - UDAT_MINUTE_FIELD = 6, - UDAT_SECOND_FIELD = 7, - UDAT_FRACTIONAL_SECOND_FIELD = 8, - UDAT_DAY_OF_WEEK_FIELD = 9, - UDAT_DAY_OF_YEAR_FIELD = 10, - UDAT_DAY_OF_WEEK_IN_MONTH_FIELD = 11, - UDAT_WEEK_OF_YEAR_FIELD = 12, - UDAT_WEEK_OF_MONTH_FIELD = 13, - UDAT_AM_PM_FIELD = 14, - UDAT_HOUR1_FIELD = 15, - UDAT_HOUR0_FIELD = 16, - UDAT_TIMEZONE_FIELD = 17, - UDAT_YEAR_WOY_FIELD = 18, - UDAT_DOW_LOCAL_FIELD = 19, - UDAT_EXTENDED_YEAR_FIELD = 20, - UDAT_JULIAN_DAY_FIELD = 21, - UDAT_MILLISECONDS_IN_DAY_FIELD = 22, - UDAT_TIMEZONE_RFC_FIELD = 23, - UDAT_TIMEZONE_GENERIC_FIELD = 24, - UDAT_STANDALONE_DAY_FIELD = 25, - UDAT_STANDALONE_MONTH_FIELD = 26, - UDAT_QUARTER_FIELD = 27, - UDAT_STANDALONE_QUARTER_FIELD = 28, - UDAT_TIMEZONE_SPECIAL_FIELD = 29, - UDAT_YEAR_NAME_FIELD = 30, - UDAT_TIMEZONE_LOCALIZED_GMT_OFFSET_FIELD = 31, - UDAT_TIMEZONE_ISO_FIELD = 32, - UDAT_TIMEZONE_ISO_LOCAL_FIELD = 33, - UDAT_RELATED_YEAR_FIELD = 34, - UDAT_AM_PM_MIDNIGHT_NOON_FIELD = 35, - UDAT_FLEXIBLE_DAY_PERIOD_FIELD = 36, - UDAT_TIME_SEPARATOR_FIELD = 37, - UDAT_FIELD_COUNT = 38, -} -extern "C" { - pub fn udat_toCalendarDateField_67(field: UDateFormatField) -> UCalendarDateFields; -} -extern "C" { - pub fn udat_open_67( - timeStyle: UDateFormatStyle, - dateStyle: UDateFormatStyle, - locale: *const ::std::os::raw::c_char, - tzID: *const UChar, - tzIDLength: i32, - pattern: *const UChar, - patternLength: i32, - status: *mut UErrorCode, - ) -> *mut UDateFormat; -} -extern "C" { - pub fn udat_close_67(format: *mut UDateFormat); -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UDateFormatBooleanAttribute { - UDAT_PARSE_ALLOW_WHITESPACE = 0, - UDAT_PARSE_ALLOW_NUMERIC = 1, - UDAT_PARSE_PARTIAL_LITERAL_MATCH = 2, - UDAT_PARSE_MULTIPLE_PATTERNS_FOR_MATCH = 3, - UDAT_BOOLEAN_ATTRIBUTE_COUNT = 4, -} -extern "C" { - pub fn udat_getBooleanAttribute_67( - fmt: *const UDateFormat, - attr: UDateFormatBooleanAttribute, - status: *mut UErrorCode, - ) -> UBool; -} -extern "C" { - pub fn udat_setBooleanAttribute_67( - fmt: *mut UDateFormat, - attr: UDateFormatBooleanAttribute, - newValue: UBool, - status: *mut UErrorCode, + assert_eq!( + unsafe { &(*(::std::ptr::null::())).hasPrevious as *const _ as usize }, + 56usize, + concat!( + "Offset of field: ", + stringify!(UCharIterator), + "::", + stringify!(hasPrevious) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).current as *const _ as usize }, + 64usize, + concat!( + "Offset of field: ", + stringify!(UCharIterator), + "::", + stringify!(current) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).next as *const _ as usize }, + 72usize, + concat!( + "Offset of field: ", + stringify!(UCharIterator), + "::", + stringify!(next) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).previous as *const _ as usize }, + 80usize, + concat!( + "Offset of field: ", + stringify!(UCharIterator), + "::", + stringify!(previous) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).reservedFn as *const _ as usize }, + 88usize, + concat!( + "Offset of field: ", + stringify!(UCharIterator), + "::", + stringify!(reservedFn) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).getState as *const _ as usize }, + 96usize, + concat!( + "Offset of field: ", + stringify!(UCharIterator), + "::", + stringify!(getState) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).setState as *const _ as usize }, + 104usize, + concat!( + "Offset of field: ", + stringify!(UCharIterator), + "::", + stringify!(setState) + ) ); } -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UDateFormatHourCycle { - UDAT_HOUR_CYCLE_11 = 0, - UDAT_HOUR_CYCLE_12 = 1, - UDAT_HOUR_CYCLE_23 = 2, - UDAT_HOUR_CYCLE_24 = 3, -} -extern "C" { - pub fn udat_clone_67(fmt: *const UDateFormat, status: *mut UErrorCode) -> *mut UDateFormat; +impl Default for UCharIterator { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } } -extern "C" { - pub fn udat_format_67( - format: *const UDateFormat, - dateToFormat: UDate, - result: *mut UChar, - resultLength: i32, - position: *mut UFieldPosition, - status: *mut UErrorCode, - ) -> i32; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct UCPMap { + _unused: [u8; 0], } -extern "C" { - pub fn udat_formatCalendar_67( - format: *const UDateFormat, - calendar: *mut UCalendar, - result: *mut UChar, - capacity: i32, - position: *mut UFieldPosition, - status: *mut UErrorCode, - ) -> i32; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct USet { + _unused: [u8; 0], } -extern "C" { - pub fn udat_formatForFields_67( - format: *const UDateFormat, - dateToFormat: UDate, - result: *mut UChar, - resultLength: i32, - fpositer: *mut UFieldPositionIterator, - status: *mut UErrorCode, - ) -> i32; +impl UProperty { + pub const UCHAR_BINARY_START: UProperty = UProperty::UCHAR_ALPHABETIC; } -extern "C" { - pub fn udat_formatCalendarForFields_67( - format: *const UDateFormat, - calendar: *mut UCalendar, - result: *mut UChar, - capacity: i32, - fpositer: *mut UFieldPositionIterator, - status: *mut UErrorCode, - ) -> i32; +impl UProperty { + pub const UCHAR_INT_START: UProperty = UProperty::UCHAR_BIDI_CLASS; } -extern "C" { - pub fn udat_parse_67( - format: *const UDateFormat, - text: *const UChar, - textLength: i32, - parsePos: *mut i32, - status: *mut UErrorCode, - ) -> UDate; +impl UProperty { + pub const UCHAR_MASK_START: UProperty = UProperty::UCHAR_GENERAL_CATEGORY_MASK; } -extern "C" { - pub fn udat_parseCalendar_67( - format: *const UDateFormat, - calendar: *mut UCalendar, - text: *const UChar, - textLength: i32, - parsePos: *mut i32, - status: *mut UErrorCode, - ); +impl UProperty { + pub const UCHAR_DOUBLE_START: UProperty = UProperty::UCHAR_NUMERIC_VALUE; } -extern "C" { - pub fn udat_isLenient_67(fmt: *const UDateFormat) -> UBool; +impl UProperty { + pub const UCHAR_STRING_START: UProperty = UProperty::UCHAR_AGE; +} +impl UProperty { + pub const UCHAR_OTHER_PROPERTY_START: UProperty = UProperty::UCHAR_SCRIPT_EXTENSIONS; +} +#[repr(i32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] +pub enum UProperty { + UCHAR_ALPHABETIC = 0, + UCHAR_ASCII_HEX_DIGIT = 1, + UCHAR_BIDI_CONTROL = 2, + UCHAR_BIDI_MIRRORED = 3, + UCHAR_DASH = 4, + UCHAR_DEFAULT_IGNORABLE_CODE_POINT = 5, + UCHAR_DEPRECATED = 6, + UCHAR_DIACRITIC = 7, + UCHAR_EXTENDER = 8, + UCHAR_FULL_COMPOSITION_EXCLUSION = 9, + UCHAR_GRAPHEME_BASE = 10, + UCHAR_GRAPHEME_EXTEND = 11, + UCHAR_GRAPHEME_LINK = 12, + UCHAR_HEX_DIGIT = 13, + UCHAR_HYPHEN = 14, + UCHAR_ID_CONTINUE = 15, + UCHAR_ID_START = 16, + UCHAR_IDEOGRAPHIC = 17, + UCHAR_IDS_BINARY_OPERATOR = 18, + UCHAR_IDS_TRINARY_OPERATOR = 19, + UCHAR_JOIN_CONTROL = 20, + UCHAR_LOGICAL_ORDER_EXCEPTION = 21, + UCHAR_LOWERCASE = 22, + UCHAR_MATH = 23, + UCHAR_NONCHARACTER_CODE_POINT = 24, + UCHAR_QUOTATION_MARK = 25, + UCHAR_RADICAL = 26, + UCHAR_SOFT_DOTTED = 27, + UCHAR_TERMINAL_PUNCTUATION = 28, + UCHAR_UNIFIED_IDEOGRAPH = 29, + UCHAR_UPPERCASE = 30, + UCHAR_WHITE_SPACE = 31, + UCHAR_XID_CONTINUE = 32, + UCHAR_XID_START = 33, + UCHAR_CASE_SENSITIVE = 34, + UCHAR_S_TERM = 35, + UCHAR_VARIATION_SELECTOR = 36, + UCHAR_NFD_INERT = 37, + UCHAR_NFKD_INERT = 38, + UCHAR_NFC_INERT = 39, + UCHAR_NFKC_INERT = 40, + UCHAR_SEGMENT_STARTER = 41, + UCHAR_PATTERN_SYNTAX = 42, + UCHAR_PATTERN_WHITE_SPACE = 43, + UCHAR_POSIX_ALNUM = 44, + UCHAR_POSIX_BLANK = 45, + UCHAR_POSIX_GRAPH = 46, + UCHAR_POSIX_PRINT = 47, + UCHAR_POSIX_XDIGIT = 48, + UCHAR_CASED = 49, + UCHAR_CASE_IGNORABLE = 50, + UCHAR_CHANGES_WHEN_LOWERCASED = 51, + UCHAR_CHANGES_WHEN_UPPERCASED = 52, + UCHAR_CHANGES_WHEN_TITLECASED = 53, + UCHAR_CHANGES_WHEN_CASEFOLDED = 54, + UCHAR_CHANGES_WHEN_CASEMAPPED = 55, + UCHAR_CHANGES_WHEN_NFKC_CASEFOLDED = 56, + UCHAR_EMOJI = 57, + UCHAR_EMOJI_PRESENTATION = 58, + UCHAR_EMOJI_MODIFIER = 59, + UCHAR_EMOJI_MODIFIER_BASE = 60, + UCHAR_EMOJI_COMPONENT = 61, + UCHAR_REGIONAL_INDICATOR = 62, + UCHAR_PREPENDED_CONCATENATION_MARK = 63, + UCHAR_EXTENDED_PICTOGRAPHIC = 64, + UCHAR_BINARY_LIMIT = 65, + UCHAR_BIDI_CLASS = 4096, + UCHAR_BLOCK = 4097, + UCHAR_CANONICAL_COMBINING_CLASS = 4098, + UCHAR_DECOMPOSITION_TYPE = 4099, + UCHAR_EAST_ASIAN_WIDTH = 4100, + UCHAR_GENERAL_CATEGORY = 4101, + UCHAR_JOINING_GROUP = 4102, + UCHAR_JOINING_TYPE = 4103, + UCHAR_LINE_BREAK = 4104, + UCHAR_NUMERIC_TYPE = 4105, + UCHAR_SCRIPT = 4106, + UCHAR_HANGUL_SYLLABLE_TYPE = 4107, + UCHAR_NFD_QUICK_CHECK = 4108, + UCHAR_NFKD_QUICK_CHECK = 4109, + UCHAR_NFC_QUICK_CHECK = 4110, + UCHAR_NFKC_QUICK_CHECK = 4111, + UCHAR_LEAD_CANONICAL_COMBINING_CLASS = 4112, + UCHAR_TRAIL_CANONICAL_COMBINING_CLASS = 4113, + UCHAR_GRAPHEME_CLUSTER_BREAK = 4114, + UCHAR_SENTENCE_BREAK = 4115, + UCHAR_WORD_BREAK = 4116, + UCHAR_BIDI_PAIRED_BRACKET_TYPE = 4117, + UCHAR_INDIC_POSITIONAL_CATEGORY = 4118, + UCHAR_INDIC_SYLLABIC_CATEGORY = 4119, + UCHAR_VERTICAL_ORIENTATION = 4120, + UCHAR_INT_LIMIT = 4121, + UCHAR_GENERAL_CATEGORY_MASK = 8192, + UCHAR_MASK_LIMIT = 8193, + UCHAR_NUMERIC_VALUE = 12288, + UCHAR_DOUBLE_LIMIT = 12289, + UCHAR_AGE = 16384, + UCHAR_BIDI_MIRRORING_GLYPH = 16385, + UCHAR_CASE_FOLDING = 16386, + UCHAR_ISO_COMMENT = 16387, + UCHAR_LOWERCASE_MAPPING = 16388, + UCHAR_NAME = 16389, + UCHAR_SIMPLE_CASE_FOLDING = 16390, + UCHAR_SIMPLE_LOWERCASE_MAPPING = 16391, + UCHAR_SIMPLE_TITLECASE_MAPPING = 16392, + UCHAR_SIMPLE_UPPERCASE_MAPPING = 16393, + UCHAR_TITLECASE_MAPPING = 16394, + UCHAR_UNICODE_1_NAME = 16395, + UCHAR_UPPERCASE_MAPPING = 16396, + UCHAR_BIDI_PAIRED_BRACKET = 16397, + UCHAR_STRING_LIMIT = 16398, + UCHAR_SCRIPT_EXTENSIONS = 28672, + UCHAR_OTHER_PROPERTY_LIMIT = 28673, + UCHAR_INVALID_CODE = -1, +} +impl UCharCategory { + pub const U_GENERAL_OTHER_TYPES: UCharCategory = UCharCategory::U_UNASSIGNED; +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] +pub enum UCharCategory { + U_UNASSIGNED = 0, + U_UPPERCASE_LETTER = 1, + U_LOWERCASE_LETTER = 2, + U_TITLECASE_LETTER = 3, + U_MODIFIER_LETTER = 4, + U_OTHER_LETTER = 5, + U_NON_SPACING_MARK = 6, + U_ENCLOSING_MARK = 7, + U_COMBINING_SPACING_MARK = 8, + U_DECIMAL_DIGIT_NUMBER = 9, + U_LETTER_NUMBER = 10, + U_OTHER_NUMBER = 11, + U_SPACE_SEPARATOR = 12, + U_LINE_SEPARATOR = 13, + U_PARAGRAPH_SEPARATOR = 14, + U_CONTROL_CHAR = 15, + U_FORMAT_CHAR = 16, + U_PRIVATE_USE_CHAR = 17, + U_SURROGATE = 18, + U_DASH_PUNCTUATION = 19, + U_START_PUNCTUATION = 20, + U_END_PUNCTUATION = 21, + U_CONNECTOR_PUNCTUATION = 22, + U_OTHER_PUNCTUATION = 23, + U_MATH_SYMBOL = 24, + U_CURRENCY_SYMBOL = 25, + U_MODIFIER_SYMBOL = 26, + U_OTHER_SYMBOL = 27, + U_INITIAL_PUNCTUATION = 28, + U_FINAL_PUNCTUATION = 29, + U_CHAR_CATEGORY_COUNT = 30, +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] +pub enum UCharDirection { + U_LEFT_TO_RIGHT = 0, + U_RIGHT_TO_LEFT = 1, + U_EUROPEAN_NUMBER = 2, + U_EUROPEAN_NUMBER_SEPARATOR = 3, + U_EUROPEAN_NUMBER_TERMINATOR = 4, + U_ARABIC_NUMBER = 5, + U_COMMON_NUMBER_SEPARATOR = 6, + U_BLOCK_SEPARATOR = 7, + U_SEGMENT_SEPARATOR = 8, + U_WHITE_SPACE_NEUTRAL = 9, + U_OTHER_NEUTRAL = 10, + U_LEFT_TO_RIGHT_EMBEDDING = 11, + U_LEFT_TO_RIGHT_OVERRIDE = 12, + U_RIGHT_TO_LEFT_ARABIC = 13, + U_RIGHT_TO_LEFT_EMBEDDING = 14, + U_RIGHT_TO_LEFT_OVERRIDE = 15, + U_POP_DIRECTIONAL_FORMAT = 16, + U_DIR_NON_SPACING_MARK = 17, + U_BOUNDARY_NEUTRAL = 18, + U_FIRST_STRONG_ISOLATE = 19, + U_LEFT_TO_RIGHT_ISOLATE = 20, + U_RIGHT_TO_LEFT_ISOLATE = 21, + U_POP_DIRECTIONAL_ISOLATE = 22, + U_CHAR_DIRECTION_COUNT = 23, +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] +pub enum UCharNameChoice { + U_UNICODE_CHAR_NAME = 0, + U_UNICODE_10_CHAR_NAME = 1, + U_EXTENDED_CHAR_NAME = 2, + U_CHAR_NAME_ALIAS = 3, + U_CHAR_NAME_CHOICE_COUNT = 4, +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] +pub enum UPropertyNameChoice { + U_SHORT_PROPERTY_NAME = 0, + U_LONG_PROPERTY_NAME = 1, + U_PROPERTY_NAME_CHOICE_COUNT = 2, } extern "C" { - pub fn udat_setLenient_67(fmt: *mut UDateFormat, isLenient: UBool); + pub fn u_hasBinaryProperty_67(c: UChar32, which: UProperty) -> UBool; } extern "C" { - pub fn udat_getCalendar_67(fmt: *const UDateFormat) -> *const UCalendar; + pub fn u_getBinaryPropertySet_67( + property: UProperty, + pErrorCode: *mut UErrorCode, + ) -> *const USet; } extern "C" { - pub fn udat_setCalendar_67(fmt: *mut UDateFormat, calendarToSet: *const UCalendar); + pub fn u_isUAlphabetic_67(c: UChar32) -> UBool; } extern "C" { - pub fn udat_getNumberFormat_67(fmt: *const UDateFormat) -> *const UNumberFormat; + pub fn u_isULowercase_67(c: UChar32) -> UBool; } extern "C" { - pub fn udat_getNumberFormatForField_67( - fmt: *const UDateFormat, - field: UChar, - ) -> *const UNumberFormat; + pub fn u_isUUppercase_67(c: UChar32) -> UBool; } extern "C" { - pub fn udat_adoptNumberFormatForFields_67( - fmt: *mut UDateFormat, - fields: *const UChar, - numberFormatToSet: *mut UNumberFormat, - status: *mut UErrorCode, - ); + pub fn u_isUWhiteSpace_67(c: UChar32) -> UBool; } extern "C" { - pub fn udat_setNumberFormat_67(fmt: *mut UDateFormat, numberFormatToSet: *const UNumberFormat); + pub fn u_getIntPropertyValue_67(c: UChar32, which: UProperty) -> i32; } extern "C" { - pub fn udat_adoptNumberFormat_67( - fmt: *mut UDateFormat, - numberFormatToAdopt: *mut UNumberFormat, - ); + pub fn u_getIntPropertyMinValue_67(which: UProperty) -> i32; } extern "C" { - pub fn udat_getAvailable_67(localeIndex: i32) -> *const ::std::os::raw::c_char; + pub fn u_getIntPropertyMaxValue_67(which: UProperty) -> i32; } extern "C" { - pub fn udat_countAvailable_67() -> i32; + pub fn u_getIntPropertyMap_67( + property: UProperty, + pErrorCode: *mut UErrorCode, + ) -> *const UCPMap; } extern "C" { - pub fn udat_get2DigitYearStart_67(fmt: *const UDateFormat, status: *mut UErrorCode) -> UDate; + pub fn u_getNumericValue_67(c: UChar32) -> f64; } extern "C" { - pub fn udat_set2DigitYearStart_67(fmt: *mut UDateFormat, d: UDate, status: *mut UErrorCode); + pub fn u_islower_67(c: UChar32) -> UBool; } extern "C" { - pub fn udat_toPattern_67( - fmt: *const UDateFormat, - localized: UBool, - result: *mut UChar, - resultLength: i32, - status: *mut UErrorCode, - ) -> i32; + pub fn u_isupper_67(c: UChar32) -> UBool; } extern "C" { - pub fn udat_applyPattern_67( - format: *mut UDateFormat, - localized: UBool, - pattern: *const UChar, - patternLength: i32, - ); + pub fn u_istitle_67(c: UChar32) -> UBool; } -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UDateFormatSymbolType { - UDAT_ERAS = 0, - UDAT_MONTHS = 1, - UDAT_SHORT_MONTHS = 2, - UDAT_WEEKDAYS = 3, - UDAT_SHORT_WEEKDAYS = 4, - UDAT_AM_PMS = 5, - UDAT_LOCALIZED_CHARS = 6, - UDAT_ERA_NAMES = 7, - UDAT_NARROW_MONTHS = 8, - UDAT_NARROW_WEEKDAYS = 9, - UDAT_STANDALONE_MONTHS = 10, - UDAT_STANDALONE_SHORT_MONTHS = 11, - UDAT_STANDALONE_NARROW_MONTHS = 12, - UDAT_STANDALONE_WEEKDAYS = 13, - UDAT_STANDALONE_SHORT_WEEKDAYS = 14, - UDAT_STANDALONE_NARROW_WEEKDAYS = 15, - UDAT_QUARTERS = 16, - UDAT_SHORT_QUARTERS = 17, - UDAT_STANDALONE_QUARTERS = 18, - UDAT_STANDALONE_SHORT_QUARTERS = 19, - UDAT_SHORTER_WEEKDAYS = 20, - UDAT_STANDALONE_SHORTER_WEEKDAYS = 21, - UDAT_CYCLIC_YEARS_WIDE = 22, - UDAT_CYCLIC_YEARS_ABBREVIATED = 23, - UDAT_CYCLIC_YEARS_NARROW = 24, - UDAT_ZODIAC_NAMES_WIDE = 25, - UDAT_ZODIAC_NAMES_ABBREVIATED = 26, - UDAT_ZODIAC_NAMES_NARROW = 27, +extern "C" { + pub fn u_isdigit_67(c: UChar32) -> UBool; } -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct UDateFormatSymbols { - _unused: [u8; 0], +extern "C" { + pub fn u_isalpha_67(c: UChar32) -> UBool; } extern "C" { - pub fn udat_getSymbols_67( - fmt: *const UDateFormat, - type_: UDateFormatSymbolType, - symbolIndex: i32, - result: *mut UChar, - resultLength: i32, - status: *mut UErrorCode, - ) -> i32; + pub fn u_isalnum_67(c: UChar32) -> UBool; } extern "C" { - pub fn udat_countSymbols_67(fmt: *const UDateFormat, type_: UDateFormatSymbolType) -> i32; + pub fn u_isxdigit_67(c: UChar32) -> UBool; } extern "C" { - pub fn udat_setSymbols_67( - format: *mut UDateFormat, - type_: UDateFormatSymbolType, - symbolIndex: i32, - value: *mut UChar, - valueLength: i32, - status: *mut UErrorCode, - ); + pub fn u_ispunct_67(c: UChar32) -> UBool; } extern "C" { - pub fn udat_getLocaleByType_67( - fmt: *const UDateFormat, - type_: ULocDataLocaleType, - status: *mut UErrorCode, - ) -> *const ::std::os::raw::c_char; + pub fn u_isgraph_67(c: UChar32) -> UBool; } extern "C" { - pub fn udat_setContext_67( - fmt: *mut UDateFormat, - value: UDisplayContext, - status: *mut UErrorCode, + pub fn u_isblank_67(c: UChar32) -> UBool; +} +extern "C" { + pub fn u_isdefined_67(c: UChar32) -> UBool; +} +extern "C" { + pub fn u_isspace_67(c: UChar32) -> UBool; +} +extern "C" { + pub fn u_isJavaSpaceChar_67(c: UChar32) -> UBool; +} +extern "C" { + pub fn u_isWhitespace_67(c: UChar32) -> UBool; +} +extern "C" { + pub fn u_iscntrl_67(c: UChar32) -> UBool; +} +extern "C" { + pub fn u_isISOControl_67(c: UChar32) -> UBool; +} +extern "C" { + pub fn u_isprint_67(c: UChar32) -> UBool; +} +extern "C" { + pub fn u_isbase_67(c: UChar32) -> UBool; +} +extern "C" { + pub fn u_charDirection_67(c: UChar32) -> UCharDirection; +} +extern "C" { + pub fn u_isMirrored_67(c: UChar32) -> UBool; +} +extern "C" { + pub fn u_charMirror_67(c: UChar32) -> UChar32; +} +extern "C" { + pub fn u_getBidiPairedBracket_67(c: UChar32) -> UChar32; +} +extern "C" { + pub fn u_charType_67(c: UChar32) -> i8; +} +pub type UCharEnumTypeRange = ::std::option::Option< + unsafe extern "C" fn( + context: *const ::std::os::raw::c_void, + start: UChar32, + limit: UChar32, + type_: UCharCategory, + ) -> UBool, +>; +extern "C" { + pub fn u_enumCharTypes_67( + enumRange: UCharEnumTypeRange, + context: *const ::std::os::raw::c_void, ); } extern "C" { - pub fn udat_getContext_67( - fmt: *const UDateFormat, - type_: UDisplayContextType, - status: *mut UErrorCode, - ) -> UDisplayContext; + pub fn u_getCombiningClass_67(c: UChar32) -> u8; } extern "C" { - pub fn udat_toPatternRelativeDate_67( - fmt: *const UDateFormat, - result: *mut UChar, - resultLength: i32, - status: *mut UErrorCode, + pub fn u_charDigitValue_67(c: UChar32) -> i32; +} +extern "C" { + pub fn u_charName_67( + code: UChar32, + nameChoice: UCharNameChoice, + buffer: *mut ::std::os::raw::c_char, + bufferLength: i32, + pErrorCode: *mut UErrorCode, ) -> i32; } extern "C" { - pub fn udat_toPatternRelativeTime_67( - fmt: *const UDateFormat, - result: *mut UChar, - resultLength: i32, - status: *mut UErrorCode, + pub fn u_getISOComment_67( + c: UChar32, + dest: *mut ::std::os::raw::c_char, + destCapacity: i32, + pErrorCode: *mut UErrorCode, ) -> i32; } extern "C" { - pub fn udat_applyPatternRelative_67( - format: *mut UDateFormat, - datePattern: *const UChar, - datePatternLength: i32, - timePattern: *const UChar, - timePatternLength: i32, - status: *mut UErrorCode, - ); + pub fn u_charFromName_67( + nameChoice: UCharNameChoice, + name: *const ::std::os::raw::c_char, + pErrorCode: *mut UErrorCode, + ) -> UChar32; } -pub type UDateFormatOpener = ::std::option::Option< +pub type UEnumCharNamesFn = ::std::option::Option< unsafe extern "C" fn( - timeStyle: UDateFormatStyle, - dateStyle: UDateFormatStyle, - locale: *const ::std::os::raw::c_char, - tzID: *const UChar, - tzIDLength: i32, - pattern: *const UChar, - patternLength: i32, - status: *mut UErrorCode, - ) -> *mut UDateFormat, + context: *mut ::std::os::raw::c_void, + code: UChar32, + nameChoice: UCharNameChoice, + name: *const ::std::os::raw::c_char, + length: i32, + ) -> UBool, >; extern "C" { - pub fn udat_registerOpener_67(opener: UDateFormatOpener, status: *mut UErrorCode); + pub fn u_enumCharNames_67( + start: UChar32, + limit: UChar32, + fn_: UEnumCharNamesFn, + context: *mut ::std::os::raw::c_void, + nameChoice: UCharNameChoice, + pErrorCode: *mut UErrorCode, + ); } extern "C" { - pub fn udat_unregisterOpener_67( - opener: UDateFormatOpener, - status: *mut UErrorCode, - ) -> UDateFormatOpener; + pub fn u_getPropertyName_67( + property: UProperty, + nameChoice: UPropertyNameChoice, + ) -> *const ::std::os::raw::c_char; } -#[repr(C)] -#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, PartialEq)] -pub struct UDataInfo { - pub size: u16, - pub reservedWord: u16, - pub isBigEndian: u8, - pub charsetFamily: u8, - pub sizeofUChar: u8, - pub reservedByte: u8, - pub dataFormat: [u8; 4usize], - pub formatVersion: [u8; 4usize], - pub dataVersion: [u8; 4usize], +extern "C" { + pub fn u_getPropertyEnum_67(alias: *const ::std::os::raw::c_char) -> UProperty; } -#[test] -fn bindgen_test_layout_UDataInfo() { - assert_eq!( - ::std::mem::size_of::(), - 20usize, - concat!("Size of: ", stringify!(UDataInfo)) - ); - assert_eq!( - ::std::mem::align_of::(), - 2usize, - concat!("Alignment of ", stringify!(UDataInfo)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).size as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(UDataInfo), - "::", - stringify!(size) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).reservedWord as *const _ as usize }, - 2usize, - concat!( - "Offset of field: ", - stringify!(UDataInfo), - "::", - stringify!(reservedWord) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).isBigEndian as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(UDataInfo), - "::", - stringify!(isBigEndian) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).charsetFamily as *const _ as usize }, - 5usize, - concat!( - "Offset of field: ", - stringify!(UDataInfo), - "::", - stringify!(charsetFamily) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).sizeofUChar as *const _ as usize }, - 6usize, - concat!( - "Offset of field: ", - stringify!(UDataInfo), - "::", - stringify!(sizeofUChar) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).reservedByte as *const _ as usize }, - 7usize, - concat!( - "Offset of field: ", - stringify!(UDataInfo), - "::", - stringify!(reservedByte) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).dataFormat as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(UDataInfo), - "::", - stringify!(dataFormat) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).formatVersion as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(UDataInfo), - "::", - stringify!(formatVersion) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).dataVersion as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(UDataInfo), - "::", - stringify!(dataVersion) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct UDataMemory { - _unused: [u8; 0], -} -pub type UDataMemoryIsAcceptable = ::std::option::Option< - unsafe extern "C" fn( - context: *mut ::std::os::raw::c_void, - type_: *const ::std::os::raw::c_char, - name: *const ::std::os::raw::c_char, - pInfo: *const UDataInfo, - ) -> UBool, ->; extern "C" { - pub fn udata_open_67( - path: *const ::std::os::raw::c_char, - type_: *const ::std::os::raw::c_char, - name: *const ::std::os::raw::c_char, - pErrorCode: *mut UErrorCode, - ) -> *mut UDataMemory; + pub fn u_getPropertyValueName_67( + property: UProperty, + value: i32, + nameChoice: UPropertyNameChoice, + ) -> *const ::std::os::raw::c_char; } extern "C" { - pub fn udata_openChoice_67( - path: *const ::std::os::raw::c_char, - type_: *const ::std::os::raw::c_char, - name: *const ::std::os::raw::c_char, - isAcceptable: UDataMemoryIsAcceptable, - context: *mut ::std::os::raw::c_void, - pErrorCode: *mut UErrorCode, - ) -> *mut UDataMemory; + pub fn u_getPropertyValueEnum_67( + property: UProperty, + alias: *const ::std::os::raw::c_char, + ) -> i32; } extern "C" { - pub fn udata_close_67(pData: *mut UDataMemory); + pub fn u_isIDStart_67(c: UChar32) -> UBool; } extern "C" { - pub fn udata_getMemory_67(pData: *mut UDataMemory) -> *const ::std::os::raw::c_void; + pub fn u_isIDPart_67(c: UChar32) -> UBool; } extern "C" { - pub fn udata_getInfo_67(pData: *mut UDataMemory, pInfo: *mut UDataInfo); + pub fn u_isIDIgnorable_67(c: UChar32) -> UBool; } extern "C" { - pub fn udata_setCommonData_67(data: *const ::std::os::raw::c_void, err: *mut UErrorCode); + pub fn u_isJavaIDStart_67(c: UChar32) -> UBool; } extern "C" { - pub fn udata_setAppData_67( - packageName: *const ::std::os::raw::c_char, - data: *const ::std::os::raw::c_void, - err: *mut UErrorCode, - ); + pub fn u_isJavaIDPart_67(c: UChar32) -> UBool; } -impl UDataFileAccess { - pub const UDATA_DEFAULT_ACCESS: UDataFileAccess = UDataFileAccess::UDATA_FILES_FIRST; +extern "C" { + pub fn u_tolower_67(c: UChar32) -> UChar32; } -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UDataFileAccess { - UDATA_FILES_FIRST = 0, - UDATA_ONLY_PACKAGES = 1, - UDATA_PACKAGES_FIRST = 2, - UDATA_NO_FILES = 3, - UDATA_FILE_ACCESS_COUNT = 4, +extern "C" { + pub fn u_toupper_67(c: UChar32) -> UChar32; } extern "C" { - pub fn udata_setFileAccess_67(access: UDataFileAccess, status: *mut UErrorCode); + pub fn u_totitle_67(c: UChar32) -> UChar32; } extern "C" { - pub fn u_getDataDirectory_67() -> *const ::std::os::raw::c_char; + pub fn u_foldCase_67(c: UChar32, options: u32) -> UChar32; } extern "C" { - pub fn u_setDataDirectory_67(directory: *const ::std::os::raw::c_char); + pub fn u_digit_67(ch: UChar32, radix: i8) -> i32; } extern "C" { - pub fn u_getTimeZoneFilesDirectory_67(status: *mut UErrorCode) - -> *const ::std::os::raw::c_char; + pub fn u_forDigit_67(digit: i32, radix: i8) -> UChar32; } extern "C" { - pub fn u_setTimeZoneFilesDirectory_67( - path: *const ::std::os::raw::c_char, - status: *mut UErrorCode, - ); + pub fn u_charAge_67(c: UChar32, versionArray: *mut u8); } extern "C" { - pub fn u_charsToUChars_67(cs: *const ::std::os::raw::c_char, us: *mut UChar, length: i32); + pub fn u_getUnicodeVersion_67(versionArray: *mut u8); } extern "C" { - pub fn u_UCharsToChars_67(us: *const UChar, cs: *mut ::std::os::raw::c_char, length: i32); + pub fn u_getFC_NFKC_Closure_67( + c: UChar32, + dest: *mut UChar, + destCapacity: i32, + pErrorCode: *mut UErrorCode, + ) -> i32; } #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UCharIteratorOrigin { - UITER_START = 0, - UITER_CURRENT = 1, - UITER_LIMIT = 2, - UITER_ZERO = 3, - UITER_LENGTH = 4, +pub enum USetSpanCondition { + USET_SPAN_NOT_CONTAINED = 0, + USET_SPAN_CONTAINED = 1, + USET_SPAN_SIMPLE = 2, + USET_SPAN_CONDITION_COUNT = 3, } -pub type UCharIteratorGetIndex = ::std::option::Option< - unsafe extern "C" fn(iter: *mut UCharIterator, origin: UCharIteratorOrigin) -> i32, ->; -pub type UCharIteratorMove = ::std::option::Option< - unsafe extern "C" fn(iter: *mut UCharIterator, delta: i32, origin: UCharIteratorOrigin) -> i32, ->; -pub type UCharIteratorHasNext = - ::std::option::Option UBool>; -pub type UCharIteratorHasPrevious = - ::std::option::Option UBool>; -pub type UCharIteratorCurrent = - ::std::option::Option UChar32>; -pub type UCharIteratorNext = - ::std::option::Option UChar32>; -pub type UCharIteratorPrevious = - ::std::option::Option UChar32>; -pub type UCharIteratorReserved = - ::std::option::Option i32>; -pub type UCharIteratorGetState = - ::std::option::Option u32>; -pub type UCharIteratorSetState = ::std::option::Option< - unsafe extern "C" fn(iter: *mut UCharIterator, state: u32, pErrorCode: *mut UErrorCode), ->; #[repr(C)] -#[derive(Debug, Copy, Clone, Hash, PartialOrd, PartialEq)] -pub struct UCharIterator { - pub context: *const ::std::os::raw::c_void, - pub length: i32, - pub start: i32, - pub index: i32, - pub limit: i32, - pub reservedField: i32, - pub getIndex: UCharIteratorGetIndex, - pub move_: UCharIteratorMove, - pub hasNext: UCharIteratorHasNext, - pub hasPrevious: UCharIteratorHasPrevious, - pub current: UCharIteratorCurrent, - pub next: UCharIteratorNext, - pub previous: UCharIteratorPrevious, - pub reservedFn: UCharIteratorReserved, - pub getState: UCharIteratorGetState, - pub setState: UCharIteratorSetState, +#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, PartialEq)] +pub struct UParseError { + pub line: i32, + pub offset: i32, + pub preContext: [UChar; 16usize], + pub postContext: [UChar; 16usize], } #[test] -fn bindgen_test_layout_UCharIterator() { +fn bindgen_test_layout_UParseError() { assert_eq!( - ::std::mem::size_of::(), - 112usize, - concat!("Size of: ", stringify!(UCharIterator)) + ::std::mem::size_of::(), + 72usize, + concat!("Size of: ", stringify!(UParseError)) ); assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(UCharIterator)) + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(UParseError)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).context as *const _ as usize }, + unsafe { &(*(::std::ptr::null::())).line as *const _ as usize }, 0usize, concat!( "Offset of field: ", - stringify!(UCharIterator), + stringify!(UParseError), "::", - stringify!(context) + stringify!(line) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).length as *const _ as usize }, - 8usize, + unsafe { &(*(::std::ptr::null::())).offset as *const _ as usize }, + 4usize, concat!( "Offset of field: ", - stringify!(UCharIterator), + stringify!(UParseError), "::", - stringify!(length) + stringify!(offset) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).start as *const _ as usize }, - 12usize, + unsafe { &(*(::std::ptr::null::())).preContext as *const _ as usize }, + 8usize, concat!( "Offset of field: ", - stringify!(UCharIterator), + stringify!(UParseError), "::", - stringify!(start) + stringify!(preContext) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).index as *const _ as usize }, - 16usize, + unsafe { &(*(::std::ptr::null::())).postContext as *const _ as usize }, + 40usize, concat!( "Offset of field: ", - stringify!(UCharIterator), + stringify!(UParseError), "::", - stringify!(index) + stringify!(postContext) ) ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).limit as *const _ as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(UCharIterator), - "::", - stringify!(limit) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).reservedField as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(UCharIterator), - "::", - stringify!(reservedField) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).getIndex as *const _ as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(UCharIterator), - "::", - stringify!(getIndex) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).move_ as *const _ as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(UCharIterator), - "::", - stringify!(move_) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).hasNext as *const _ as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(UCharIterator), - "::", - stringify!(hasNext) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).hasPrevious as *const _ as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(UCharIterator), - "::", - stringify!(hasPrevious) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).current as *const _ as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(UCharIterator), - "::", - stringify!(current) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).next as *const _ as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(UCharIterator), - "::", - stringify!(next) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).previous as *const _ as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(UCharIterator), - "::", - stringify!(previous) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).reservedFn as *const _ as usize }, - 88usize, - concat!( - "Offset of field: ", - stringify!(UCharIterator), - "::", - stringify!(reservedFn) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).getState as *const _ as usize }, - 96usize, - concat!( - "Offset of field: ", - stringify!(UCharIterator), - "::", - stringify!(getState) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).setState as *const _ as usize }, - 104usize, - concat!( - "Offset of field: ", - stringify!(UCharIterator), - "::", - stringify!(setState) - ) - ); -} -impl Default for UCharIterator { - fn default() -> Self { - unsafe { ::std::mem::zeroed() } - } } #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct UBreakIterator { +pub struct UCollator { _unused: [u8; 0], } -extern "C" { - pub fn u_strlen_67(s: *const UChar) -> i32; +#[repr(i32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] +pub enum UCollationResult { + UCOL_EQUAL = 0, + UCOL_GREATER = 1, + UCOL_LESS = -1, } -extern "C" { - pub fn u_countChar32_67(s: *const UChar, length: i32) -> i32; +impl UColAttributeValue { + pub const UCOL_DEFAULT_STRENGTH: UColAttributeValue = UColAttributeValue::UCOL_TERTIARY; } -extern "C" { - pub fn u_strHasMoreChar32Than_67(s: *const UChar, length: i32, number: i32) -> UBool; +impl UColAttributeValue { + pub const UCOL_QUATERNARY: UColAttributeValue = UColAttributeValue::UCOL_CE_STRENGTH_LIMIT; } -extern "C" { - pub fn u_strcat_67(dst: *mut UChar, src: *const UChar) -> *mut UChar; +impl UColAttributeValue { + pub const UCOL_OFF: UColAttributeValue = UColAttributeValue::UCOL_STRENGTH_LIMIT; } -extern "C" { - pub fn u_strncat_67(dst: *mut UChar, src: *const UChar, n: i32) -> *mut UChar; +#[repr(i32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] +pub enum UColAttributeValue { + UCOL_DEFAULT = -1, + UCOL_PRIMARY = 0, + UCOL_SECONDARY = 1, + UCOL_TERTIARY = 2, + UCOL_CE_STRENGTH_LIMIT = 3, + UCOL_IDENTICAL = 15, + UCOL_STRENGTH_LIMIT = 16, + UCOL_ON = 17, + UCOL_SHIFTED = 20, + UCOL_NON_IGNORABLE = 21, + UCOL_LOWER_FIRST = 24, + UCOL_UPPER_FIRST = 25, + UCOL_ATTRIBUTE_VALUE_COUNT = 26, } -extern "C" { - pub fn u_strstr_67(s: *const UChar, substring: *const UChar) -> *mut UChar; +impl UColReorderCode { + pub const UCOL_REORDER_CODE_OTHERS: UColReorderCode = UColReorderCode::UCOL_REORDER_CODE_NONE; } -extern "C" { - pub fn u_strFindFirst_67( - s: *const UChar, - length: i32, - substring: *const UChar, - subLength: i32, - ) -> *mut UChar; +impl UColReorderCode { + pub const UCOL_REORDER_CODE_FIRST: UColReorderCode = UColReorderCode::UCOL_REORDER_CODE_SPACE; } -extern "C" { - pub fn u_strchr_67(s: *const UChar, c: UChar) -> *mut UChar; +#[repr(i32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] +pub enum UColReorderCode { + UCOL_REORDER_CODE_DEFAULT = -1, + UCOL_REORDER_CODE_NONE = 103, + UCOL_REORDER_CODE_SPACE = 4096, + UCOL_REORDER_CODE_PUNCTUATION = 4097, + UCOL_REORDER_CODE_SYMBOL = 4098, + UCOL_REORDER_CODE_CURRENCY = 4099, + UCOL_REORDER_CODE_DIGIT = 4100, + UCOL_REORDER_CODE_LIMIT = 4101, } -extern "C" { - pub fn u_strchr32_67(s: *const UChar, c: UChar32) -> *mut UChar; +pub use self::UColAttributeValue as UCollationStrength; +impl UColAttribute { + pub const UCOL_DECOMPOSITION_MODE: UColAttribute = UColAttribute::UCOL_NORMALIZATION_MODE; } -extern "C" { - pub fn u_strrstr_67(s: *const UChar, substring: *const UChar) -> *mut UChar; +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] +pub enum UColAttribute { + UCOL_FRENCH_COLLATION = 0, + UCOL_ALTERNATE_HANDLING = 1, + UCOL_CASE_FIRST = 2, + UCOL_CASE_LEVEL = 3, + UCOL_NORMALIZATION_MODE = 4, + UCOL_STRENGTH = 5, + UCOL_HIRAGANA_QUATERNARY_MODE = 6, + UCOL_NUMERIC_COLLATION = 7, + UCOL_ATTRIBUTE_COUNT = 8, +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] +pub enum UColRuleOption { + UCOL_TAILORING_ONLY = 0, + UCOL_FULL_RULES = 1, } extern "C" { - pub fn u_strFindLast_67( - s: *const UChar, - length: i32, - substring: *const UChar, - subLength: i32, - ) -> *mut UChar; + pub fn ucol_open_67( + loc: *const ::std::os::raw::c_char, + status: *mut UErrorCode, + ) -> *mut UCollator; } extern "C" { - pub fn u_strrchr_67(s: *const UChar, c: UChar) -> *mut UChar; + pub fn ucol_openRules_67( + rules: *const UChar, + rulesLength: i32, + normalizationMode: UColAttributeValue, + strength: UCollationStrength, + parseError: *mut UParseError, + status: *mut UErrorCode, + ) -> *mut UCollator; } extern "C" { - pub fn u_strrchr32_67(s: *const UChar, c: UChar32) -> *mut UChar; + pub fn ucol_openFromShortString_67( + definition: *const ::std::os::raw::c_char, + forceDefaults: UBool, + parseError: *mut UParseError, + status: *mut UErrorCode, + ) -> *mut UCollator; } extern "C" { - pub fn u_strpbrk_67(string: *const UChar, matchSet: *const UChar) -> *mut UChar; + pub fn ucol_getContractions_67( + coll: *const UCollator, + conts: *mut USet, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_strcspn_67(string: *const UChar, matchSet: *const UChar) -> i32; + pub fn ucol_getContractionsAndExpansions_67( + coll: *const UCollator, + contractions: *mut USet, + expansions: *mut USet, + addPrefixes: UBool, + status: *mut UErrorCode, + ); } extern "C" { - pub fn u_strspn_67(string: *const UChar, matchSet: *const UChar) -> i32; + pub fn ucol_close_67(coll: *mut UCollator); } extern "C" { - pub fn u_strtok_r_67( - src: *mut UChar, - delim: *const UChar, - saveState: *mut *mut UChar, - ) -> *mut UChar; + pub fn ucol_strcoll_67( + coll: *const UCollator, + source: *const UChar, + sourceLength: i32, + target: *const UChar, + targetLength: i32, + ) -> UCollationResult; } extern "C" { - pub fn u_strcmp_67(s1: *const UChar, s2: *const UChar) -> i32; + pub fn ucol_strcollUTF8_67( + coll: *const UCollator, + source: *const ::std::os::raw::c_char, + sourceLength: i32, + target: *const ::std::os::raw::c_char, + targetLength: i32, + status: *mut UErrorCode, + ) -> UCollationResult; } extern "C" { - pub fn u_strcmpCodePointOrder_67(s1: *const UChar, s2: *const UChar) -> i32; + pub fn ucol_greater_67( + coll: *const UCollator, + source: *const UChar, + sourceLength: i32, + target: *const UChar, + targetLength: i32, + ) -> UBool; } extern "C" { - pub fn u_strCompare_67( - s1: *const UChar, - length1: i32, - s2: *const UChar, - length2: i32, - codePointOrder: UBool, - ) -> i32; + pub fn ucol_greaterOrEqual_67( + coll: *const UCollator, + source: *const UChar, + sourceLength: i32, + target: *const UChar, + targetLength: i32, + ) -> UBool; } extern "C" { - pub fn u_strCompareIter_67( - iter1: *mut UCharIterator, - iter2: *mut UCharIterator, - codePointOrder: UBool, - ) -> i32; + pub fn ucol_equal_67( + coll: *const UCollator, + source: *const UChar, + sourceLength: i32, + target: *const UChar, + targetLength: i32, + ) -> UBool; } extern "C" { - pub fn u_strCaseCompare_67( - s1: *const UChar, - length1: i32, - s2: *const UChar, - length2: i32, - options: u32, - pErrorCode: *mut UErrorCode, - ) -> i32; + pub fn ucol_strcollIter_67( + coll: *const UCollator, + sIter: *mut UCharIterator, + tIter: *mut UCharIterator, + status: *mut UErrorCode, + ) -> UCollationResult; } extern "C" { - pub fn u_strncmp_67(ucs1: *const UChar, ucs2: *const UChar, n: i32) -> i32; + pub fn ucol_getStrength_67(coll: *const UCollator) -> UCollationStrength; } extern "C" { - pub fn u_strncmpCodePointOrder_67(s1: *const UChar, s2: *const UChar, n: i32) -> i32; + pub fn ucol_setStrength_67(coll: *mut UCollator, strength: UCollationStrength); } extern "C" { - pub fn u_strcasecmp_67(s1: *const UChar, s2: *const UChar, options: u32) -> i32; + pub fn ucol_getReorderCodes_67( + coll: *const UCollator, + dest: *mut i32, + destCapacity: i32, + pErrorCode: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_strncasecmp_67(s1: *const UChar, s2: *const UChar, n: i32, options: u32) -> i32; + pub fn ucol_setReorderCodes_67( + coll: *mut UCollator, + reorderCodes: *const i32, + reorderCodesLength: i32, + pErrorCode: *mut UErrorCode, + ); } extern "C" { - pub fn u_memcasecmp_67(s1: *const UChar, s2: *const UChar, length: i32, options: u32) -> i32; + pub fn ucol_getEquivalentReorderCodes_67( + reorderCode: i32, + dest: *mut i32, + destCapacity: i32, + pErrorCode: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_strcpy_67(dst: *mut UChar, src: *const UChar) -> *mut UChar; + pub fn ucol_getDisplayName_67( + objLoc: *const ::std::os::raw::c_char, + dispLoc: *const ::std::os::raw::c_char, + result: *mut UChar, + resultLength: i32, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_strncpy_67(dst: *mut UChar, src: *const UChar, n: i32) -> *mut UChar; + pub fn ucol_getAvailable_67(localeIndex: i32) -> *const ::std::os::raw::c_char; } extern "C" { - pub fn u_uastrcpy_67(dst: *mut UChar, src: *const ::std::os::raw::c_char) -> *mut UChar; + pub fn ucol_countAvailable_67() -> i32; } extern "C" { - pub fn u_uastrncpy_67( - dst: *mut UChar, - src: *const ::std::os::raw::c_char, - n: i32, - ) -> *mut UChar; + pub fn ucol_openAvailableLocales_67(status: *mut UErrorCode) -> *mut UEnumeration; } extern "C" { - pub fn u_austrcpy_67( - dst: *mut ::std::os::raw::c_char, - src: *const UChar, - ) -> *mut ::std::os::raw::c_char; + pub fn ucol_getKeywords_67(status: *mut UErrorCode) -> *mut UEnumeration; } extern "C" { - pub fn u_austrncpy_67( - dst: *mut ::std::os::raw::c_char, - src: *const UChar, - n: i32, - ) -> *mut ::std::os::raw::c_char; + pub fn ucol_getKeywordValues_67( + keyword: *const ::std::os::raw::c_char, + status: *mut UErrorCode, + ) -> *mut UEnumeration; } extern "C" { - pub fn u_memcpy_67(dest: *mut UChar, src: *const UChar, count: i32) -> *mut UChar; + pub fn ucol_getKeywordValuesForLocale_67( + key: *const ::std::os::raw::c_char, + locale: *const ::std::os::raw::c_char, + commonlyUsed: UBool, + status: *mut UErrorCode, + ) -> *mut UEnumeration; } extern "C" { - pub fn u_memmove_67(dest: *mut UChar, src: *const UChar, count: i32) -> *mut UChar; + pub fn ucol_getFunctionalEquivalent_67( + result: *mut ::std::os::raw::c_char, + resultCapacity: i32, + keyword: *const ::std::os::raw::c_char, + locale: *const ::std::os::raw::c_char, + isAvailable: *mut UBool, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_memset_67(dest: *mut UChar, c: UChar, count: i32) -> *mut UChar; + pub fn ucol_getRules_67(coll: *const UCollator, length: *mut i32) -> *const UChar; } extern "C" { - pub fn u_memcmp_67(buf1: *const UChar, buf2: *const UChar, count: i32) -> i32; + pub fn ucol_getShortDefinitionString_67( + coll: *const UCollator, + locale: *const ::std::os::raw::c_char, + buffer: *mut ::std::os::raw::c_char, + capacity: i32, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_memcmpCodePointOrder_67(s1: *const UChar, s2: *const UChar, count: i32) -> i32; + pub fn ucol_normalizeShortDefinitionString_67( + source: *const ::std::os::raw::c_char, + destination: *mut ::std::os::raw::c_char, + capacity: i32, + parseError: *mut UParseError, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_memchr_67(s: *const UChar, c: UChar, count: i32) -> *mut UChar; + pub fn ucol_getSortKey_67( + coll: *const UCollator, + source: *const UChar, + sourceLength: i32, + result: *mut u8, + resultLength: i32, + ) -> i32; } extern "C" { - pub fn u_memchr32_67(s: *const UChar, c: UChar32, count: i32) -> *mut UChar; + pub fn ucol_nextSortKeyPart_67( + coll: *const UCollator, + iter: *mut UCharIterator, + state: *mut u32, + dest: *mut u8, + count: i32, + status: *mut UErrorCode, + ) -> i32; +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] +pub enum UColBoundMode { + UCOL_BOUND_LOWER = 0, + UCOL_BOUND_UPPER = 1, + UCOL_BOUND_UPPER_LONG = 2, + UCOL_BOUND_VALUE_COUNT = 3, } extern "C" { - pub fn u_memrchr_67(s: *const UChar, c: UChar, count: i32) -> *mut UChar; + pub fn ucol_getBound_67( + source: *const u8, + sourceLength: i32, + boundType: UColBoundMode, + noOfLevels: u32, + result: *mut u8, + resultLength: i32, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_memrchr32_67(s: *const UChar, c: UChar32, count: i32) -> *mut UChar; + pub fn ucol_getVersion_67(coll: *const UCollator, info: *mut u8); } extern "C" { - pub fn u_unescape_67( - src: *const ::std::os::raw::c_char, - dest: *mut UChar, + pub fn ucol_getUCAVersion_67(coll: *const UCollator, info: *mut u8); +} +extern "C" { + pub fn ucol_mergeSortkeys_67( + src1: *const u8, + src1Length: i32, + src2: *const u8, + src2Length: i32, + dest: *mut u8, destCapacity: i32, ) -> i32; } -pub type UNESCAPE_CHAR_AT = ::std::option::Option< - unsafe extern "C" fn(offset: i32, context: *mut ::std::os::raw::c_void) -> UChar, ->; extern "C" { - pub fn u_unescapeAt_67( - charAt: UNESCAPE_CHAR_AT, - offset: *mut i32, - length: i32, - context: *mut ::std::os::raw::c_void, - ) -> UChar32; + pub fn ucol_setAttribute_67( + coll: *mut UCollator, + attr: UColAttribute, + value: UColAttributeValue, + status: *mut UErrorCode, + ); } extern "C" { - pub fn u_strToUpper_67( - dest: *mut UChar, - destCapacity: i32, - src: *const UChar, - srcLength: i32, - locale: *const ::std::os::raw::c_char, - pErrorCode: *mut UErrorCode, - ) -> i32; + pub fn ucol_getAttribute_67( + coll: *const UCollator, + attr: UColAttribute, + status: *mut UErrorCode, + ) -> UColAttributeValue; } extern "C" { - pub fn u_strToLower_67( - dest: *mut UChar, - destCapacity: i32, - src: *const UChar, - srcLength: i32, - locale: *const ::std::os::raw::c_char, + pub fn ucol_setMaxVariable_67( + coll: *mut UCollator, + group: UColReorderCode, pErrorCode: *mut UErrorCode, - ) -> i32; + ); } extern "C" { - pub fn u_strToTitle_67( - dest: *mut UChar, - destCapacity: i32, - src: *const UChar, - srcLength: i32, - titleIter: *mut UBreakIterator, - locale: *const ::std::os::raw::c_char, - pErrorCode: *mut UErrorCode, - ) -> i32; + pub fn ucol_getMaxVariable_67(coll: *const UCollator) -> UColReorderCode; } extern "C" { - pub fn u_strFoldCase_67( - dest: *mut UChar, - destCapacity: i32, - src: *const UChar, - srcLength: i32, - options: u32, - pErrorCode: *mut UErrorCode, - ) -> i32; + pub fn ucol_setVariableTop_67( + coll: *mut UCollator, + varTop: *const UChar, + len: i32, + status: *mut UErrorCode, + ) -> u32; } extern "C" { - pub fn u_strToWCS_67( - dest: *mut wchar_t, - destCapacity: i32, - pDestLength: *mut i32, - src: *const UChar, - srcLength: i32, - pErrorCode: *mut UErrorCode, - ) -> *mut wchar_t; + pub fn ucol_getVariableTop_67(coll: *const UCollator, status: *mut UErrorCode) -> u32; } extern "C" { - pub fn u_strFromWCS_67( - dest: *mut UChar, - destCapacity: i32, - pDestLength: *mut i32, - src: *const wchar_t, - srcLength: i32, - pErrorCode: *mut UErrorCode, - ) -> *mut UChar; + pub fn ucol_restoreVariableTop_67(coll: *mut UCollator, varTop: u32, status: *mut UErrorCode); } extern "C" { - pub fn u_strToUTF8_67( - dest: *mut ::std::os::raw::c_char, - destCapacity: i32, - pDestLength: *mut i32, - src: *const UChar, - srcLength: i32, - pErrorCode: *mut UErrorCode, - ) -> *mut ::std::os::raw::c_char; + pub fn ucol_safeClone_67( + coll: *const UCollator, + stackBuffer: *mut ::std::os::raw::c_void, + pBufferSize: *mut i32, + status: *mut UErrorCode, + ) -> *mut UCollator; } extern "C" { - pub fn u_strFromUTF8_67( - dest: *mut UChar, - destCapacity: i32, - pDestLength: *mut i32, - src: *const ::std::os::raw::c_char, - srcLength: i32, - pErrorCode: *mut UErrorCode, - ) -> *mut UChar; + pub fn ucol_getRulesEx_67( + coll: *const UCollator, + delta: UColRuleOption, + buffer: *mut UChar, + bufferLen: i32, + ) -> i32; } extern "C" { - pub fn u_strToUTF8WithSub_67( - dest: *mut ::std::os::raw::c_char, - destCapacity: i32, - pDestLength: *mut i32, - src: *const UChar, - srcLength: i32, - subchar: UChar32, - pNumSubstitutions: *mut i32, - pErrorCode: *mut UErrorCode, - ) -> *mut ::std::os::raw::c_char; + pub fn ucol_getLocale_67( + coll: *const UCollator, + type_: ULocDataLocaleType, + status: *mut UErrorCode, + ) -> *const ::std::os::raw::c_char; } extern "C" { - pub fn u_strFromUTF8WithSub_67( - dest: *mut UChar, - destCapacity: i32, - pDestLength: *mut i32, - src: *const ::std::os::raw::c_char, - srcLength: i32, - subchar: UChar32, - pNumSubstitutions: *mut i32, - pErrorCode: *mut UErrorCode, - ) -> *mut UChar; + pub fn ucol_getLocaleByType_67( + coll: *const UCollator, + type_: ULocDataLocaleType, + status: *mut UErrorCode, + ) -> *const ::std::os::raw::c_char; } extern "C" { - pub fn u_strFromUTF8Lenient_67( - dest: *mut UChar, - destCapacity: i32, - pDestLength: *mut i32, - src: *const ::std::os::raw::c_char, - srcLength: i32, - pErrorCode: *mut UErrorCode, - ) -> *mut UChar; + pub fn ucol_getTailoredSet_67(coll: *const UCollator, status: *mut UErrorCode) -> *mut USet; } extern "C" { - pub fn u_strToUTF32_67( - dest: *mut UChar32, - destCapacity: i32, - pDestLength: *mut i32, - src: *const UChar, - srcLength: i32, - pErrorCode: *mut UErrorCode, - ) -> *mut UChar32; + pub fn ucol_getUnsafeSet_67( + coll: *const UCollator, + unsafe_: *mut USet, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_strFromUTF32_67( - dest: *mut UChar, - destCapacity: i32, - pDestLength: *mut i32, - src: *const UChar32, - srcLength: i32, - pErrorCode: *mut UErrorCode, - ) -> *mut UChar; + pub fn ucol_prepareShortStringOpen_67( + definition: *const ::std::os::raw::c_char, + forceDefaults: UBool, + parseError: *mut UParseError, + status: *mut UErrorCode, + ); } extern "C" { - pub fn u_strToUTF32WithSub_67( - dest: *mut UChar32, - destCapacity: i32, - pDestLength: *mut i32, - src: *const UChar, - srcLength: i32, - subchar: UChar32, - pNumSubstitutions: *mut i32, - pErrorCode: *mut UErrorCode, - ) -> *mut UChar32; + pub fn ucol_cloneBinary_67( + coll: *const UCollator, + buffer: *mut u8, + capacity: i32, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_strFromUTF32WithSub_67( - dest: *mut UChar, - destCapacity: i32, - pDestLength: *mut i32, - src: *const UChar32, - srcLength: i32, - subchar: UChar32, - pNumSubstitutions: *mut i32, - pErrorCode: *mut UErrorCode, - ) -> *mut UChar; + pub fn ucol_openBinary_67( + bin: *const u8, + length: i32, + base: *const UCollator, + status: *mut UErrorCode, + ) -> *mut UCollator; } -extern "C" { - pub fn u_strToJavaModifiedUTF8_67( - dest: *mut ::std::os::raw::c_char, - destCapacity: i32, - pDestLength: *mut i32, - src: *const UChar, - srcLength: i32, - pErrorCode: *mut UErrorCode, - ) -> *mut ::std::os::raw::c_char; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, PartialEq)] +pub struct UFieldPosition { + pub field: i32, + pub beginIndex: i32, + pub endIndex: i32, } -extern "C" { - pub fn u_strFromJavaModifiedUTF8WithSub_67( - dest: *mut UChar, - destCapacity: i32, - pDestLength: *mut i32, - src: *const ::std::os::raw::c_char, - srcLength: i32, - subchar: UChar32, - pNumSubstitutions: *mut i32, - pErrorCode: *mut UErrorCode, - ) -> *mut UChar; +#[test] +fn bindgen_test_layout_UFieldPosition() { + assert_eq!( + ::std::mem::size_of::(), + 12usize, + concat!("Size of: ", stringify!(UFieldPosition)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(UFieldPosition)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).field as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(UFieldPosition), + "::", + stringify!(field) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).beginIndex as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(UFieldPosition), + "::", + stringify!(beginIndex) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).endIndex as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(UFieldPosition), + "::", + stringify!(endIndex) + ) + ); } -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct UCPMap { - _unused: [u8; 0], +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] +pub enum UDisplayContextType { + UDISPCTX_TYPE_DIALECT_HANDLING = 0, + UDISPCTX_TYPE_CAPITALIZATION = 1, + UDISPCTX_TYPE_DISPLAY_LENGTH = 2, + UDISPCTX_TYPE_SUBSTITUTE_HANDLING = 3, +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] +pub enum UDisplayContext { + UDISPCTX_STANDARD_NAMES = 0, + UDISPCTX_DIALECT_NAMES = 1, + UDISPCTX_CAPITALIZATION_NONE = 256, + UDISPCTX_CAPITALIZATION_FOR_MIDDLE_OF_SENTENCE = 257, + UDISPCTX_CAPITALIZATION_FOR_BEGINNING_OF_SENTENCE = 258, + UDISPCTX_CAPITALIZATION_FOR_UI_LIST_OR_MENU = 259, + UDISPCTX_CAPITALIZATION_FOR_STANDALONE = 260, + UDISPCTX_LENGTH_FULL = 512, + UDISPCTX_LENGTH_SHORT = 513, + UDISPCTX_SUBSTITUTE = 768, + UDISPCTX_NO_SUBSTITUTE = 769, } #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct USet { +pub struct UFieldPositionIterator { _unused: [u8; 0], } -impl UProperty { - pub const UCHAR_BINARY_START: UProperty = UProperty::UCHAR_ALPHABETIC; -} -impl UProperty { - pub const UCHAR_INT_START: UProperty = UProperty::UCHAR_BIDI_CLASS; -} -impl UProperty { - pub const UCHAR_MASK_START: UProperty = UProperty::UCHAR_GENERAL_CATEGORY_MASK; -} -impl UProperty { - pub const UCHAR_DOUBLE_START: UProperty = UProperty::UCHAR_NUMERIC_VALUE; +pub type UNumberFormat = *mut ::std::os::raw::c_void; +pub type UDateFormat = *mut ::std::os::raw::c_void; +impl UDateFormatStyle { + pub const UDAT_DEFAULT: UDateFormatStyle = UDateFormatStyle::UDAT_MEDIUM; } -impl UProperty { - pub const UCHAR_STRING_START: UProperty = UProperty::UCHAR_AGE; +impl UDateFormatStyle { + pub const UDAT_FULL_RELATIVE: UDateFormatStyle = UDateFormatStyle::UDAT_RELATIVE; } -impl UProperty { - pub const UCHAR_OTHER_PROPERTY_START: UProperty = UProperty::UCHAR_SCRIPT_EXTENSIONS; +impl UDateFormatStyle { + pub const UDAT_IGNORE: UDateFormatStyle = UDateFormatStyle::UDAT_PATTERN; } #[repr(i32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UProperty { - UCHAR_ALPHABETIC = 0, - UCHAR_ASCII_HEX_DIGIT = 1, - UCHAR_BIDI_CONTROL = 2, - UCHAR_BIDI_MIRRORED = 3, - UCHAR_DASH = 4, - UCHAR_DEFAULT_IGNORABLE_CODE_POINT = 5, - UCHAR_DEPRECATED = 6, - UCHAR_DIACRITIC = 7, - UCHAR_EXTENDER = 8, - UCHAR_FULL_COMPOSITION_EXCLUSION = 9, - UCHAR_GRAPHEME_BASE = 10, - UCHAR_GRAPHEME_EXTEND = 11, - UCHAR_GRAPHEME_LINK = 12, - UCHAR_HEX_DIGIT = 13, - UCHAR_HYPHEN = 14, - UCHAR_ID_CONTINUE = 15, - UCHAR_ID_START = 16, - UCHAR_IDEOGRAPHIC = 17, - UCHAR_IDS_BINARY_OPERATOR = 18, - UCHAR_IDS_TRINARY_OPERATOR = 19, - UCHAR_JOIN_CONTROL = 20, - UCHAR_LOGICAL_ORDER_EXCEPTION = 21, - UCHAR_LOWERCASE = 22, - UCHAR_MATH = 23, - UCHAR_NONCHARACTER_CODE_POINT = 24, - UCHAR_QUOTATION_MARK = 25, - UCHAR_RADICAL = 26, - UCHAR_SOFT_DOTTED = 27, - UCHAR_TERMINAL_PUNCTUATION = 28, - UCHAR_UNIFIED_IDEOGRAPH = 29, - UCHAR_UPPERCASE = 30, - UCHAR_WHITE_SPACE = 31, - UCHAR_XID_CONTINUE = 32, - UCHAR_XID_START = 33, - UCHAR_CASE_SENSITIVE = 34, - UCHAR_S_TERM = 35, - UCHAR_VARIATION_SELECTOR = 36, - UCHAR_NFD_INERT = 37, - UCHAR_NFKD_INERT = 38, - UCHAR_NFC_INERT = 39, - UCHAR_NFKC_INERT = 40, - UCHAR_SEGMENT_STARTER = 41, - UCHAR_PATTERN_SYNTAX = 42, - UCHAR_PATTERN_WHITE_SPACE = 43, - UCHAR_POSIX_ALNUM = 44, - UCHAR_POSIX_BLANK = 45, - UCHAR_POSIX_GRAPH = 46, - UCHAR_POSIX_PRINT = 47, - UCHAR_POSIX_XDIGIT = 48, - UCHAR_CASED = 49, - UCHAR_CASE_IGNORABLE = 50, - UCHAR_CHANGES_WHEN_LOWERCASED = 51, - UCHAR_CHANGES_WHEN_UPPERCASED = 52, - UCHAR_CHANGES_WHEN_TITLECASED = 53, - UCHAR_CHANGES_WHEN_CASEFOLDED = 54, - UCHAR_CHANGES_WHEN_CASEMAPPED = 55, - UCHAR_CHANGES_WHEN_NFKC_CASEFOLDED = 56, - UCHAR_EMOJI = 57, - UCHAR_EMOJI_PRESENTATION = 58, - UCHAR_EMOJI_MODIFIER = 59, - UCHAR_EMOJI_MODIFIER_BASE = 60, - UCHAR_EMOJI_COMPONENT = 61, - UCHAR_REGIONAL_INDICATOR = 62, - UCHAR_PREPENDED_CONCATENATION_MARK = 63, - UCHAR_EXTENDED_PICTOGRAPHIC = 64, - UCHAR_BINARY_LIMIT = 65, - UCHAR_BIDI_CLASS = 4096, - UCHAR_BLOCK = 4097, - UCHAR_CANONICAL_COMBINING_CLASS = 4098, - UCHAR_DECOMPOSITION_TYPE = 4099, - UCHAR_EAST_ASIAN_WIDTH = 4100, - UCHAR_GENERAL_CATEGORY = 4101, - UCHAR_JOINING_GROUP = 4102, - UCHAR_JOINING_TYPE = 4103, - UCHAR_LINE_BREAK = 4104, - UCHAR_NUMERIC_TYPE = 4105, - UCHAR_SCRIPT = 4106, - UCHAR_HANGUL_SYLLABLE_TYPE = 4107, - UCHAR_NFD_QUICK_CHECK = 4108, - UCHAR_NFKD_QUICK_CHECK = 4109, - UCHAR_NFC_QUICK_CHECK = 4110, - UCHAR_NFKC_QUICK_CHECK = 4111, - UCHAR_LEAD_CANONICAL_COMBINING_CLASS = 4112, - UCHAR_TRAIL_CANONICAL_COMBINING_CLASS = 4113, - UCHAR_GRAPHEME_CLUSTER_BREAK = 4114, - UCHAR_SENTENCE_BREAK = 4115, - UCHAR_WORD_BREAK = 4116, - UCHAR_BIDI_PAIRED_BRACKET_TYPE = 4117, - UCHAR_INDIC_POSITIONAL_CATEGORY = 4118, - UCHAR_INDIC_SYLLABIC_CATEGORY = 4119, - UCHAR_VERTICAL_ORIENTATION = 4120, - UCHAR_INT_LIMIT = 4121, - UCHAR_GENERAL_CATEGORY_MASK = 8192, - UCHAR_MASK_LIMIT = 8193, - UCHAR_NUMERIC_VALUE = 12288, - UCHAR_DOUBLE_LIMIT = 12289, - UCHAR_AGE = 16384, - UCHAR_BIDI_MIRRORING_GLYPH = 16385, - UCHAR_CASE_FOLDING = 16386, - UCHAR_ISO_COMMENT = 16387, - UCHAR_LOWERCASE_MAPPING = 16388, - UCHAR_NAME = 16389, - UCHAR_SIMPLE_CASE_FOLDING = 16390, - UCHAR_SIMPLE_LOWERCASE_MAPPING = 16391, - UCHAR_SIMPLE_TITLECASE_MAPPING = 16392, - UCHAR_SIMPLE_UPPERCASE_MAPPING = 16393, - UCHAR_TITLECASE_MAPPING = 16394, - UCHAR_UNICODE_1_NAME = 16395, - UCHAR_UPPERCASE_MAPPING = 16396, - UCHAR_BIDI_PAIRED_BRACKET = 16397, - UCHAR_STRING_LIMIT = 16398, - UCHAR_SCRIPT_EXTENSIONS = 28672, - UCHAR_OTHER_PROPERTY_LIMIT = 28673, - UCHAR_INVALID_CODE = -1, -} -impl UCharCategory { - pub const U_GENERAL_OTHER_TYPES: UCharCategory = UCharCategory::U_UNASSIGNED; +pub enum UDateFormatStyle { + UDAT_FULL = 0, + UDAT_LONG = 1, + UDAT_MEDIUM = 2, + UDAT_SHORT = 3, + UDAT_RELATIVE = 128, + UDAT_LONG_RELATIVE = 129, + UDAT_MEDIUM_RELATIVE = 130, + UDAT_SHORT_RELATIVE = 131, + UDAT_NONE = -1, + UDAT_PATTERN = -2, } #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UCharCategory { - U_UNASSIGNED = 0, - U_UPPERCASE_LETTER = 1, - U_LOWERCASE_LETTER = 2, - U_TITLECASE_LETTER = 3, - U_MODIFIER_LETTER = 4, - U_OTHER_LETTER = 5, - U_NON_SPACING_MARK = 6, - U_ENCLOSING_MARK = 7, - U_COMBINING_SPACING_MARK = 8, - U_DECIMAL_DIGIT_NUMBER = 9, - U_LETTER_NUMBER = 10, - U_OTHER_NUMBER = 11, - U_SPACE_SEPARATOR = 12, - U_LINE_SEPARATOR = 13, - U_PARAGRAPH_SEPARATOR = 14, - U_CONTROL_CHAR = 15, - U_FORMAT_CHAR = 16, - U_PRIVATE_USE_CHAR = 17, - U_SURROGATE = 18, - U_DASH_PUNCTUATION = 19, - U_START_PUNCTUATION = 20, - U_END_PUNCTUATION = 21, - U_CONNECTOR_PUNCTUATION = 22, - U_OTHER_PUNCTUATION = 23, - U_MATH_SYMBOL = 24, - U_CURRENCY_SYMBOL = 25, - U_MODIFIER_SYMBOL = 26, - U_OTHER_SYMBOL = 27, - U_INITIAL_PUNCTUATION = 28, - U_FINAL_PUNCTUATION = 29, - U_CHAR_CATEGORY_COUNT = 30, +pub enum UDateFormatField { + UDAT_ERA_FIELD = 0, + UDAT_YEAR_FIELD = 1, + UDAT_MONTH_FIELD = 2, + UDAT_DATE_FIELD = 3, + UDAT_HOUR_OF_DAY1_FIELD = 4, + UDAT_HOUR_OF_DAY0_FIELD = 5, + UDAT_MINUTE_FIELD = 6, + UDAT_SECOND_FIELD = 7, + UDAT_FRACTIONAL_SECOND_FIELD = 8, + UDAT_DAY_OF_WEEK_FIELD = 9, + UDAT_DAY_OF_YEAR_FIELD = 10, + UDAT_DAY_OF_WEEK_IN_MONTH_FIELD = 11, + UDAT_WEEK_OF_YEAR_FIELD = 12, + UDAT_WEEK_OF_MONTH_FIELD = 13, + UDAT_AM_PM_FIELD = 14, + UDAT_HOUR1_FIELD = 15, + UDAT_HOUR0_FIELD = 16, + UDAT_TIMEZONE_FIELD = 17, + UDAT_YEAR_WOY_FIELD = 18, + UDAT_DOW_LOCAL_FIELD = 19, + UDAT_EXTENDED_YEAR_FIELD = 20, + UDAT_JULIAN_DAY_FIELD = 21, + UDAT_MILLISECONDS_IN_DAY_FIELD = 22, + UDAT_TIMEZONE_RFC_FIELD = 23, + UDAT_TIMEZONE_GENERIC_FIELD = 24, + UDAT_STANDALONE_DAY_FIELD = 25, + UDAT_STANDALONE_MONTH_FIELD = 26, + UDAT_QUARTER_FIELD = 27, + UDAT_STANDALONE_QUARTER_FIELD = 28, + UDAT_TIMEZONE_SPECIAL_FIELD = 29, + UDAT_YEAR_NAME_FIELD = 30, + UDAT_TIMEZONE_LOCALIZED_GMT_OFFSET_FIELD = 31, + UDAT_TIMEZONE_ISO_FIELD = 32, + UDAT_TIMEZONE_ISO_LOCAL_FIELD = 33, + UDAT_RELATED_YEAR_FIELD = 34, + UDAT_AM_PM_MIDNIGHT_NOON_FIELD = 35, + UDAT_FLEXIBLE_DAY_PERIOD_FIELD = 36, + UDAT_TIME_SEPARATOR_FIELD = 37, + UDAT_FIELD_COUNT = 38, +} +extern "C" { + pub fn udat_toCalendarDateField_67(field: UDateFormatField) -> UCalendarDateFields; +} +extern "C" { + pub fn udat_open_67( + timeStyle: UDateFormatStyle, + dateStyle: UDateFormatStyle, + locale: *const ::std::os::raw::c_char, + tzID: *const UChar, + tzIDLength: i32, + pattern: *const UChar, + patternLength: i32, + status: *mut UErrorCode, + ) -> *mut UDateFormat; +} +extern "C" { + pub fn udat_close_67(format: *mut UDateFormat); } #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UCharDirection { - U_LEFT_TO_RIGHT = 0, - U_RIGHT_TO_LEFT = 1, - U_EUROPEAN_NUMBER = 2, - U_EUROPEAN_NUMBER_SEPARATOR = 3, - U_EUROPEAN_NUMBER_TERMINATOR = 4, - U_ARABIC_NUMBER = 5, - U_COMMON_NUMBER_SEPARATOR = 6, - U_BLOCK_SEPARATOR = 7, - U_SEGMENT_SEPARATOR = 8, - U_WHITE_SPACE_NEUTRAL = 9, - U_OTHER_NEUTRAL = 10, - U_LEFT_TO_RIGHT_EMBEDDING = 11, - U_LEFT_TO_RIGHT_OVERRIDE = 12, - U_RIGHT_TO_LEFT_ARABIC = 13, - U_RIGHT_TO_LEFT_EMBEDDING = 14, - U_RIGHT_TO_LEFT_OVERRIDE = 15, - U_POP_DIRECTIONAL_FORMAT = 16, - U_DIR_NON_SPACING_MARK = 17, - U_BOUNDARY_NEUTRAL = 18, - U_FIRST_STRONG_ISOLATE = 19, - U_LEFT_TO_RIGHT_ISOLATE = 20, - U_RIGHT_TO_LEFT_ISOLATE = 21, - U_POP_DIRECTIONAL_ISOLATE = 22, - U_CHAR_DIRECTION_COUNT = 23, +pub enum UDateFormatBooleanAttribute { + UDAT_PARSE_ALLOW_WHITESPACE = 0, + UDAT_PARSE_ALLOW_NUMERIC = 1, + UDAT_PARSE_PARTIAL_LITERAL_MATCH = 2, + UDAT_PARSE_MULTIPLE_PATTERNS_FOR_MATCH = 3, + UDAT_BOOLEAN_ATTRIBUTE_COUNT = 4, } -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UCharNameChoice { - U_UNICODE_CHAR_NAME = 0, - U_UNICODE_10_CHAR_NAME = 1, - U_EXTENDED_CHAR_NAME = 2, - U_CHAR_NAME_ALIAS = 3, - U_CHAR_NAME_CHOICE_COUNT = 4, +extern "C" { + pub fn udat_getBooleanAttribute_67( + fmt: *const UDateFormat, + attr: UDateFormatBooleanAttribute, + status: *mut UErrorCode, + ) -> UBool; +} +extern "C" { + pub fn udat_setBooleanAttribute_67( + fmt: *mut UDateFormat, + attr: UDateFormatBooleanAttribute, + newValue: UBool, + status: *mut UErrorCode, + ); } #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UPropertyNameChoice { - U_SHORT_PROPERTY_NAME = 0, - U_LONG_PROPERTY_NAME = 1, - U_PROPERTY_NAME_CHOICE_COUNT = 2, -} -extern "C" { - pub fn u_hasBinaryProperty_67(c: UChar32, which: UProperty) -> UBool; +pub enum UDateFormatHourCycle { + UDAT_HOUR_CYCLE_11 = 0, + UDAT_HOUR_CYCLE_12 = 1, + UDAT_HOUR_CYCLE_23 = 2, + UDAT_HOUR_CYCLE_24 = 3, } extern "C" { - pub fn u_getBinaryPropertySet_67( - property: UProperty, - pErrorCode: *mut UErrorCode, - ) -> *const USet; + pub fn udat_clone_67(fmt: *const UDateFormat, status: *mut UErrorCode) -> *mut UDateFormat; } extern "C" { - pub fn u_isUAlphabetic_67(c: UChar32) -> UBool; + pub fn udat_format_67( + format: *const UDateFormat, + dateToFormat: UDate, + result: *mut UChar, + resultLength: i32, + position: *mut UFieldPosition, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_isULowercase_67(c: UChar32) -> UBool; + pub fn udat_formatCalendar_67( + format: *const UDateFormat, + calendar: *mut UCalendar, + result: *mut UChar, + capacity: i32, + position: *mut UFieldPosition, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_isUUppercase_67(c: UChar32) -> UBool; + pub fn udat_formatForFields_67( + format: *const UDateFormat, + dateToFormat: UDate, + result: *mut UChar, + resultLength: i32, + fpositer: *mut UFieldPositionIterator, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_isUWhiteSpace_67(c: UChar32) -> UBool; + pub fn udat_formatCalendarForFields_67( + format: *const UDateFormat, + calendar: *mut UCalendar, + result: *mut UChar, + capacity: i32, + fpositer: *mut UFieldPositionIterator, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_getIntPropertyValue_67(c: UChar32, which: UProperty) -> i32; + pub fn udat_parse_67( + format: *const UDateFormat, + text: *const UChar, + textLength: i32, + parsePos: *mut i32, + status: *mut UErrorCode, + ) -> UDate; } extern "C" { - pub fn u_getIntPropertyMinValue_67(which: UProperty) -> i32; + pub fn udat_parseCalendar_67( + format: *const UDateFormat, + calendar: *mut UCalendar, + text: *const UChar, + textLength: i32, + parsePos: *mut i32, + status: *mut UErrorCode, + ); } extern "C" { - pub fn u_getIntPropertyMaxValue_67(which: UProperty) -> i32; + pub fn udat_isLenient_67(fmt: *const UDateFormat) -> UBool; } extern "C" { - pub fn u_getIntPropertyMap_67( - property: UProperty, - pErrorCode: *mut UErrorCode, - ) -> *const UCPMap; + pub fn udat_setLenient_67(fmt: *mut UDateFormat, isLenient: UBool); } extern "C" { - pub fn u_getNumericValue_67(c: UChar32) -> f64; + pub fn udat_getCalendar_67(fmt: *const UDateFormat) -> *const UCalendar; } extern "C" { - pub fn u_islower_67(c: UChar32) -> UBool; + pub fn udat_setCalendar_67(fmt: *mut UDateFormat, calendarToSet: *const UCalendar); } extern "C" { - pub fn u_isupper_67(c: UChar32) -> UBool; + pub fn udat_getNumberFormat_67(fmt: *const UDateFormat) -> *const UNumberFormat; } extern "C" { - pub fn u_istitle_67(c: UChar32) -> UBool; + pub fn udat_getNumberFormatForField_67( + fmt: *const UDateFormat, + field: UChar, + ) -> *const UNumberFormat; } extern "C" { - pub fn u_isdigit_67(c: UChar32) -> UBool; + pub fn udat_adoptNumberFormatForFields_67( + fmt: *mut UDateFormat, + fields: *const UChar, + numberFormatToSet: *mut UNumberFormat, + status: *mut UErrorCode, + ); } extern "C" { - pub fn u_isalpha_67(c: UChar32) -> UBool; + pub fn udat_setNumberFormat_67(fmt: *mut UDateFormat, numberFormatToSet: *const UNumberFormat); } extern "C" { - pub fn u_isalnum_67(c: UChar32) -> UBool; + pub fn udat_adoptNumberFormat_67( + fmt: *mut UDateFormat, + numberFormatToAdopt: *mut UNumberFormat, + ); } extern "C" { - pub fn u_isxdigit_67(c: UChar32) -> UBool; + pub fn udat_getAvailable_67(localeIndex: i32) -> *const ::std::os::raw::c_char; } extern "C" { - pub fn u_ispunct_67(c: UChar32) -> UBool; + pub fn udat_countAvailable_67() -> i32; } extern "C" { - pub fn u_isgraph_67(c: UChar32) -> UBool; + pub fn udat_get2DigitYearStart_67(fmt: *const UDateFormat, status: *mut UErrorCode) -> UDate; } extern "C" { - pub fn u_isblank_67(c: UChar32) -> UBool; + pub fn udat_set2DigitYearStart_67(fmt: *mut UDateFormat, d: UDate, status: *mut UErrorCode); } extern "C" { - pub fn u_isdefined_67(c: UChar32) -> UBool; + pub fn udat_toPattern_67( + fmt: *const UDateFormat, + localized: UBool, + result: *mut UChar, + resultLength: i32, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_isspace_67(c: UChar32) -> UBool; + pub fn udat_applyPattern_67( + format: *mut UDateFormat, + localized: UBool, + pattern: *const UChar, + patternLength: i32, + ); } -extern "C" { - pub fn u_isJavaSpaceChar_67(c: UChar32) -> UBool; +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] +pub enum UDateFormatSymbolType { + UDAT_ERAS = 0, + UDAT_MONTHS = 1, + UDAT_SHORT_MONTHS = 2, + UDAT_WEEKDAYS = 3, + UDAT_SHORT_WEEKDAYS = 4, + UDAT_AM_PMS = 5, + UDAT_LOCALIZED_CHARS = 6, + UDAT_ERA_NAMES = 7, + UDAT_NARROW_MONTHS = 8, + UDAT_NARROW_WEEKDAYS = 9, + UDAT_STANDALONE_MONTHS = 10, + UDAT_STANDALONE_SHORT_MONTHS = 11, + UDAT_STANDALONE_NARROW_MONTHS = 12, + UDAT_STANDALONE_WEEKDAYS = 13, + UDAT_STANDALONE_SHORT_WEEKDAYS = 14, + UDAT_STANDALONE_NARROW_WEEKDAYS = 15, + UDAT_QUARTERS = 16, + UDAT_SHORT_QUARTERS = 17, + UDAT_STANDALONE_QUARTERS = 18, + UDAT_STANDALONE_SHORT_QUARTERS = 19, + UDAT_SHORTER_WEEKDAYS = 20, + UDAT_STANDALONE_SHORTER_WEEKDAYS = 21, + UDAT_CYCLIC_YEARS_WIDE = 22, + UDAT_CYCLIC_YEARS_ABBREVIATED = 23, + UDAT_CYCLIC_YEARS_NARROW = 24, + UDAT_ZODIAC_NAMES_WIDE = 25, + UDAT_ZODIAC_NAMES_ABBREVIATED = 26, + UDAT_ZODIAC_NAMES_NARROW = 27, } -extern "C" { - pub fn u_isWhitespace_67(c: UChar32) -> UBool; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct UDateFormatSymbols { + _unused: [u8; 0], } extern "C" { - pub fn u_iscntrl_67(c: UChar32) -> UBool; + pub fn udat_getSymbols_67( + fmt: *const UDateFormat, + type_: UDateFormatSymbolType, + symbolIndex: i32, + result: *mut UChar, + resultLength: i32, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_isISOControl_67(c: UChar32) -> UBool; + pub fn udat_countSymbols_67(fmt: *const UDateFormat, type_: UDateFormatSymbolType) -> i32; } extern "C" { - pub fn u_isprint_67(c: UChar32) -> UBool; + pub fn udat_setSymbols_67( + format: *mut UDateFormat, + type_: UDateFormatSymbolType, + symbolIndex: i32, + value: *mut UChar, + valueLength: i32, + status: *mut UErrorCode, + ); } extern "C" { - pub fn u_isbase_67(c: UChar32) -> UBool; + pub fn udat_getLocaleByType_67( + fmt: *const UDateFormat, + type_: ULocDataLocaleType, + status: *mut UErrorCode, + ) -> *const ::std::os::raw::c_char; } extern "C" { - pub fn u_charDirection_67(c: UChar32) -> UCharDirection; + pub fn udat_setContext_67( + fmt: *mut UDateFormat, + value: UDisplayContext, + status: *mut UErrorCode, + ); } extern "C" { - pub fn u_isMirrored_67(c: UChar32) -> UBool; + pub fn udat_getContext_67( + fmt: *const UDateFormat, + type_: UDisplayContextType, + status: *mut UErrorCode, + ) -> UDisplayContext; } extern "C" { - pub fn u_charMirror_67(c: UChar32) -> UChar32; + pub fn udat_toPatternRelativeDate_67( + fmt: *const UDateFormat, + result: *mut UChar, + resultLength: i32, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_getBidiPairedBracket_67(c: UChar32) -> UChar32; + pub fn udat_toPatternRelativeTime_67( + fmt: *const UDateFormat, + result: *mut UChar, + resultLength: i32, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn u_charType_67(c: UChar32) -> i8; -} -pub type UCharEnumTypeRange = ::std::option::Option< - unsafe extern "C" fn( - context: *const ::std::os::raw::c_void, - start: UChar32, - limit: UChar32, - type_: UCharCategory, - ) -> UBool, ->; -extern "C" { - pub fn u_enumCharTypes_67( - enumRange: UCharEnumTypeRange, - context: *const ::std::os::raw::c_void, + pub fn udat_applyPatternRelative_67( + format: *mut UDateFormat, + datePattern: *const UChar, + datePatternLength: i32, + timePattern: *const UChar, + timePatternLength: i32, + status: *mut UErrorCode, ); } +pub type UDateFormatOpener = ::std::option::Option< + unsafe extern "C" fn( + timeStyle: UDateFormatStyle, + dateStyle: UDateFormatStyle, + locale: *const ::std::os::raw::c_char, + tzID: *const UChar, + tzIDLength: i32, + pattern: *const UChar, + patternLength: i32, + status: *mut UErrorCode, + ) -> *mut UDateFormat, +>; extern "C" { - pub fn u_getCombiningClass_67(c: UChar32) -> u8; + pub fn udat_registerOpener_67(opener: UDateFormatOpener, status: *mut UErrorCode); } extern "C" { - pub fn u_charDigitValue_67(c: UChar32) -> i32; + pub fn udat_unregisterOpener_67( + opener: UDateFormatOpener, + status: *mut UErrorCode, + ) -> UDateFormatOpener; } -extern "C" { - pub fn u_charName_67( - code: UChar32, - nameChoice: UCharNameChoice, - buffer: *mut ::std::os::raw::c_char, - bufferLength: i32, - pErrorCode: *mut UErrorCode, - ) -> i32; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, PartialEq)] +pub struct UDataInfo { + pub size: u16, + pub reservedWord: u16, + pub isBigEndian: u8, + pub charsetFamily: u8, + pub sizeofUChar: u8, + pub reservedByte: u8, + pub dataFormat: [u8; 4usize], + pub formatVersion: [u8; 4usize], + pub dataVersion: [u8; 4usize], } -extern "C" { - pub fn u_getISOComment_67( - c: UChar32, - dest: *mut ::std::os::raw::c_char, - destCapacity: i32, - pErrorCode: *mut UErrorCode, - ) -> i32; +#[test] +fn bindgen_test_layout_UDataInfo() { + assert_eq!( + ::std::mem::size_of::(), + 20usize, + concat!("Size of: ", stringify!(UDataInfo)) + ); + assert_eq!( + ::std::mem::align_of::(), + 2usize, + concat!("Alignment of ", stringify!(UDataInfo)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).size as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(UDataInfo), + "::", + stringify!(size) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).reservedWord as *const _ as usize }, + 2usize, + concat!( + "Offset of field: ", + stringify!(UDataInfo), + "::", + stringify!(reservedWord) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).isBigEndian as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(UDataInfo), + "::", + stringify!(isBigEndian) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).charsetFamily as *const _ as usize }, + 5usize, + concat!( + "Offset of field: ", + stringify!(UDataInfo), + "::", + stringify!(charsetFamily) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).sizeofUChar as *const _ as usize }, + 6usize, + concat!( + "Offset of field: ", + stringify!(UDataInfo), + "::", + stringify!(sizeofUChar) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).reservedByte as *const _ as usize }, + 7usize, + concat!( + "Offset of field: ", + stringify!(UDataInfo), + "::", + stringify!(reservedByte) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).dataFormat as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(UDataInfo), + "::", + stringify!(dataFormat) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).formatVersion as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(UDataInfo), + "::", + stringify!(formatVersion) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).dataVersion as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(UDataInfo), + "::", + stringify!(dataVersion) + ) + ); } -extern "C" { - pub fn u_charFromName_67( - nameChoice: UCharNameChoice, - name: *const ::std::os::raw::c_char, - pErrorCode: *mut UErrorCode, - ) -> UChar32; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct UDataMemory { + _unused: [u8; 0], } -pub type UEnumCharNamesFn = ::std::option::Option< +pub type UDataMemoryIsAcceptable = ::std::option::Option< unsafe extern "C" fn( context: *mut ::std::os::raw::c_void, - code: UChar32, - nameChoice: UCharNameChoice, + type_: *const ::std::os::raw::c_char, name: *const ::std::os::raw::c_char, - length: i32, + pInfo: *const UDataInfo, ) -> UBool, >; extern "C" { - pub fn u_enumCharNames_67( - start: UChar32, - limit: UChar32, - fn_: UEnumCharNamesFn, - context: *mut ::std::os::raw::c_void, - nameChoice: UCharNameChoice, + pub fn udata_open_67( + path: *const ::std::os::raw::c_char, + type_: *const ::std::os::raw::c_char, + name: *const ::std::os::raw::c_char, pErrorCode: *mut UErrorCode, - ); + ) -> *mut UDataMemory; } extern "C" { - pub fn u_getPropertyName_67( - property: UProperty, - nameChoice: UPropertyNameChoice, - ) -> *const ::std::os::raw::c_char; + pub fn udata_openChoice_67( + path: *const ::std::os::raw::c_char, + type_: *const ::std::os::raw::c_char, + name: *const ::std::os::raw::c_char, + isAcceptable: UDataMemoryIsAcceptable, + context: *mut ::std::os::raw::c_void, + pErrorCode: *mut UErrorCode, + ) -> *mut UDataMemory; } extern "C" { - pub fn u_getPropertyEnum_67(alias: *const ::std::os::raw::c_char) -> UProperty; + pub fn udata_close_67(pData: *mut UDataMemory); } extern "C" { - pub fn u_getPropertyValueName_67( - property: UProperty, - value: i32, - nameChoice: UPropertyNameChoice, - ) -> *const ::std::os::raw::c_char; + pub fn udata_getMemory_67(pData: *mut UDataMemory) -> *const ::std::os::raw::c_void; } extern "C" { - pub fn u_getPropertyValueEnum_67( - property: UProperty, - alias: *const ::std::os::raw::c_char, - ) -> i32; + pub fn udata_getInfo_67(pData: *mut UDataMemory, pInfo: *mut UDataInfo); } extern "C" { - pub fn u_isIDStart_67(c: UChar32) -> UBool; + pub fn udata_setCommonData_67(data: *const ::std::os::raw::c_void, err: *mut UErrorCode); } extern "C" { - pub fn u_isIDPart_67(c: UChar32) -> UBool; + pub fn udata_setAppData_67( + packageName: *const ::std::os::raw::c_char, + data: *const ::std::os::raw::c_void, + err: *mut UErrorCode, + ); } -extern "C" { - pub fn u_isIDIgnorable_67(c: UChar32) -> UBool; +impl UDataFileAccess { + pub const UDATA_DEFAULT_ACCESS: UDataFileAccess = UDataFileAccess::UDATA_FILES_FIRST; } -extern "C" { - pub fn u_isJavaIDStart_67(c: UChar32) -> UBool; +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] +pub enum UDataFileAccess { + UDATA_FILES_FIRST = 0, + UDATA_ONLY_PACKAGES = 1, + UDATA_PACKAGES_FIRST = 2, + UDATA_NO_FILES = 3, + UDATA_FILE_ACCESS_COUNT = 4, } extern "C" { - pub fn u_isJavaIDPart_67(c: UChar32) -> UBool; + pub fn udata_setFileAccess_67(access: UDataFileAccess, status: *mut UErrorCode); } -extern "C" { - pub fn u_tolower_67(c: UChar32) -> UChar32; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct UFormattedValue { + _unused: [u8; 0], } -extern "C" { - pub fn u_toupper_67(c: UChar32) -> UChar32; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct UListFormatter { + _unused: [u8; 0], } -extern "C" { - pub fn u_totitle_67(c: UChar32) -> UChar32; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct UFormattedList { + _unused: [u8; 0], } -extern "C" { - pub fn u_foldCase_67(c: UChar32, options: u32) -> UChar32; +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] +pub enum UListFormatterField { + ULISTFMT_LITERAL_FIELD = 0, + ULISTFMT_ELEMENT_FIELD = 1, +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] +pub enum UListFormatterType { + ULISTFMT_TYPE_AND = 0, + ULISTFMT_TYPE_OR = 1, + ULISTFMT_TYPE_UNITS = 2, +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] +pub enum UListFormatterWidth { + ULISTFMT_WIDTH_WIDE = 0, + ULISTFMT_WIDTH_SHORT = 1, + ULISTFMT_WIDTH_NARROW = 2, } extern "C" { - pub fn u_digit_67(ch: UChar32, radix: i8) -> i32; + pub fn ulistfmt_open_67( + locale: *const ::std::os::raw::c_char, + status: *mut UErrorCode, + ) -> *mut UListFormatter; } extern "C" { - pub fn u_forDigit_67(digit: i32, radix: i8) -> UChar32; + pub fn ulistfmt_openForType_67( + locale: *const ::std::os::raw::c_char, + type_: UListFormatterType, + width: UListFormatterWidth, + status: *mut UErrorCode, + ) -> *mut UListFormatter; } extern "C" { - pub fn u_charAge_67(c: UChar32, versionArray: *mut u8); + pub fn ulistfmt_close_67(listfmt: *mut UListFormatter); } extern "C" { - pub fn u_getUnicodeVersion_67(versionArray: *mut u8); + pub fn ulistfmt_openResult_67(ec: *mut UErrorCode) -> *mut UFormattedList; } extern "C" { - pub fn u_getFC_NFKC_Closure_67( - c: UChar32, - dest: *mut UChar, - destCapacity: i32, - pErrorCode: *mut UErrorCode, - ) -> i32; + pub fn ulistfmt_resultAsValue_67( + uresult: *const UFormattedList, + ec: *mut UErrorCode, + ) -> *const UFormattedValue; } extern "C" { - pub fn utext_close_67(ut: *mut UText) -> *mut UText; + pub fn ulistfmt_closeResult_67(uresult: *mut UFormattedList); } extern "C" { - pub fn utext_openUTF8_67( - ut: *mut UText, - s: *const ::std::os::raw::c_char, - length: i64, + pub fn ulistfmt_format_67( + listfmt: *const UListFormatter, + strings: *const *const UChar, + stringLengths: *const i32, + stringCount: i32, + result: *mut UChar, + resultCapacity: i32, status: *mut UErrorCode, - ) -> *mut UText; + ) -> i32; } extern "C" { - pub fn utext_openUChars_67( - ut: *mut UText, - s: *const UChar, - length: i64, + pub fn ulistfmt_formatStringsToResult_67( + listfmt: *const UListFormatter, + strings: *const *const UChar, + stringLengths: *const i32, + stringCount: i32, + uresult: *mut UFormattedList, status: *mut UErrorCode, - ) -> *mut UText; + ); } +pub type va_list = __builtin_va_list; extern "C" { - pub fn utext_clone_67( - dest: *mut UText, - src: *const UText, - deep: UBool, - readOnly: UBool, + pub fn u_formatMessage_67( + locale: *const ::std::os::raw::c_char, + pattern: *const UChar, + patternLength: i32, + result: *mut UChar, + resultLength: i32, status: *mut UErrorCode, - ) -> *mut UText; + ... + ) -> i32; } extern "C" { - pub fn utext_equals_67(a: *const UText, b: *const UText) -> UBool; + pub fn u_vformatMessage_67( + locale: *const ::std::os::raw::c_char, + pattern: *const UChar, + patternLength: i32, + result: *mut UChar, + resultLength: i32, + ap: *mut __va_list_tag, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn utext_nativeLength_67(ut: *mut UText) -> i64; + pub fn u_parseMessage_67( + locale: *const ::std::os::raw::c_char, + pattern: *const UChar, + patternLength: i32, + source: *const UChar, + sourceLength: i32, + status: *mut UErrorCode, + ... + ); } extern "C" { - pub fn utext_isLengthExpensive_67(ut: *const UText) -> UBool; + pub fn u_vparseMessage_67( + locale: *const ::std::os::raw::c_char, + pattern: *const UChar, + patternLength: i32, + source: *const UChar, + sourceLength: i32, + ap: *mut __va_list_tag, + status: *mut UErrorCode, + ); } extern "C" { - pub fn utext_char32At_67(ut: *mut UText, nativeIndex: i64) -> UChar32; + pub fn u_formatMessageWithError_67( + locale: *const ::std::os::raw::c_char, + pattern: *const UChar, + patternLength: i32, + result: *mut UChar, + resultLength: i32, + parseError: *mut UParseError, + status: *mut UErrorCode, + ... + ) -> i32; } extern "C" { - pub fn utext_current32_67(ut: *mut UText) -> UChar32; + pub fn u_vformatMessageWithError_67( + locale: *const ::std::os::raw::c_char, + pattern: *const UChar, + patternLength: i32, + result: *mut UChar, + resultLength: i32, + parseError: *mut UParseError, + ap: *mut __va_list_tag, + status: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn utext_next32_67(ut: *mut UText) -> UChar32; + pub fn u_parseMessageWithError_67( + locale: *const ::std::os::raw::c_char, + pattern: *const UChar, + patternLength: i32, + source: *const UChar, + sourceLength: i32, + parseError: *mut UParseError, + status: *mut UErrorCode, + ... + ); } extern "C" { - pub fn utext_previous32_67(ut: *mut UText) -> UChar32; + pub fn u_vparseMessageWithError_67( + locale: *const ::std::os::raw::c_char, + pattern: *const UChar, + patternLength: i32, + source: *const UChar, + sourceLength: i32, + ap: *mut __va_list_tag, + parseError: *mut UParseError, + status: *mut UErrorCode, + ); } +pub type UMessageFormat = *mut ::std::os::raw::c_void; extern "C" { - pub fn utext_next32From_67(ut: *mut UText, nativeIndex: i64) -> UChar32; + pub fn umsg_open_67( + pattern: *const UChar, + patternLength: i32, + locale: *const ::std::os::raw::c_char, + parseError: *mut UParseError, + status: *mut UErrorCode, + ) -> *mut UMessageFormat; } extern "C" { - pub fn utext_previous32From_67(ut: *mut UText, nativeIndex: i64) -> UChar32; + pub fn umsg_close_67(format: *mut UMessageFormat); } extern "C" { - pub fn utext_getNativeIndex_67(ut: *const UText) -> i64; + pub fn umsg_clone_67(fmt: *const UMessageFormat, status: *mut UErrorCode) -> UMessageFormat; } extern "C" { - pub fn utext_setNativeIndex_67(ut: *mut UText, nativeIndex: i64); + pub fn umsg_setLocale_67(fmt: *mut UMessageFormat, locale: *const ::std::os::raw::c_char); } extern "C" { - pub fn utext_moveIndex32_67(ut: *mut UText, delta: i32) -> UBool; + pub fn umsg_getLocale_67(fmt: *const UMessageFormat) -> *const ::std::os::raw::c_char; } extern "C" { - pub fn utext_getPreviousNativeIndex_67(ut: *mut UText) -> i64; + pub fn umsg_applyPattern_67( + fmt: *mut UMessageFormat, + pattern: *const UChar, + patternLength: i32, + parseError: *mut UParseError, + status: *mut UErrorCode, + ); } extern "C" { - pub fn utext_extract_67( - ut: *mut UText, - nativeStart: i64, - nativeLimit: i64, - dest: *mut UChar, - destCapacity: i32, + pub fn umsg_toPattern_67( + fmt: *const UMessageFormat, + result: *mut UChar, + resultLength: i32, status: *mut UErrorCode, ) -> i32; } extern "C" { - pub fn utext_isWritable_67(ut: *const UText) -> UBool; -} -extern "C" { - pub fn utext_hasMetaData_67(ut: *const UText) -> UBool; + pub fn umsg_format_67( + fmt: *const UMessageFormat, + result: *mut UChar, + resultLength: i32, + status: *mut UErrorCode, + ... + ) -> i32; } extern "C" { - pub fn utext_replace_67( - ut: *mut UText, - nativeStart: i64, - nativeLimit: i64, - replacementText: *const UChar, - replacementLength: i32, + pub fn umsg_vformat_67( + fmt: *const UMessageFormat, + result: *mut UChar, + resultLength: i32, + ap: *mut __va_list_tag, status: *mut UErrorCode, ) -> i32; } extern "C" { - pub fn utext_copy_67( - ut: *mut UText, - nativeStart: i64, - nativeLimit: i64, - destIndex: i64, - move_: UBool, + pub fn umsg_parse_67( + fmt: *const UMessageFormat, + source: *const UChar, + sourceLength: i32, + count: *mut i32, status: *mut UErrorCode, + ... ); } extern "C" { - pub fn utext_freeze_67(ut: *mut UText); -} -pub type UTextClone = ::std::option::Option< - unsafe extern "C" fn( - dest: *mut UText, - src: *const UText, - deep: UBool, + pub fn umsg_vparse_67( + fmt: *const UMessageFormat, + source: *const UChar, + sourceLength: i32, + count: *mut i32, + ap: *mut __va_list_tag, status: *mut UErrorCode, - ) -> *mut UText, ->; -pub type UTextNativeLength = ::std::option::Option i64>; -pub type UTextAccess = ::std::option::Option< - unsafe extern "C" fn(ut: *mut UText, nativeIndex: i64, forward: UBool) -> UBool, ->; -pub type UTextExtract = ::std::option::Option< - unsafe extern "C" fn( - ut: *mut UText, - nativeStart: i64, - nativeLimit: i64, + ); +} +extern "C" { + pub fn umsg_autoQuoteApostrophe_67( + pattern: *const UChar, + patternLength: i32, dest: *mut UChar, destCapacity: i32, + ec: *mut UErrorCode, + ) -> i32; +} +extern "C" { + pub fn u_getDataDirectory_67() -> *const ::std::os::raw::c_char; +} +extern "C" { + pub fn u_setDataDirectory_67(directory: *const ::std::os::raw::c_char); +} +extern "C" { + pub fn u_getTimeZoneFilesDirectory_67(status: *mut UErrorCode) + -> *const ::std::os::raw::c_char; +} +extern "C" { + pub fn u_setTimeZoneFilesDirectory_67( + path: *const ::std::os::raw::c_char, status: *mut UErrorCode, - ) -> i32, ->; -pub type UTextReplace = ::std::option::Option< - unsafe extern "C" fn( - ut: *mut UText, - nativeStart: i64, - nativeLimit: i64, - replacementText: *const UChar, - replacmentLength: i32, - status: *mut UErrorCode, - ) -> i32, ->; -pub type UTextCopy = ::std::option::Option< - unsafe extern "C" fn( - ut: *mut UText, - nativeStart: i64, - nativeLimit: i64, - nativeDest: i64, - move_: UBool, - status: *mut UErrorCode, - ), ->; -pub type UTextMapOffsetToNative = - ::std::option::Option i64>; -pub type UTextMapNativeIndexToUTF16 = - ::std::option::Option i32>; -pub type UTextClose = ::std::option::Option; -#[repr(C)] -#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, PartialEq)] -pub struct UTextFuncs { - pub tableSize: i32, - pub reserved1: i32, - pub reserved2: i32, - pub reserved3: i32, - pub clone: UTextClone, - pub nativeLength: UTextNativeLength, - pub access: UTextAccess, - pub extract: UTextExtract, - pub replace: UTextReplace, - pub copy: UTextCopy, - pub mapOffsetToNative: UTextMapOffsetToNative, - pub mapNativeIndexToUTF16: UTextMapNativeIndexToUTF16, - pub close: UTextClose, - pub spare1: UTextClose, - pub spare2: UTextClose, - pub spare3: UTextClose, -} -#[test] -fn bindgen_test_layout_UTextFuncs() { - assert_eq!( - ::std::mem::size_of::(), - 112usize, - concat!("Size of: ", stringify!(UTextFuncs)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(UTextFuncs)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).tableSize as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(UTextFuncs), - "::", - stringify!(tableSize) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).reserved1 as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(UTextFuncs), - "::", - stringify!(reserved1) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).reserved2 as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(UTextFuncs), - "::", - stringify!(reserved2) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).reserved3 as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(UTextFuncs), - "::", - stringify!(reserved3) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).clone as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(UTextFuncs), - "::", - stringify!(clone) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).nativeLength as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(UTextFuncs), - "::", - stringify!(nativeLength) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).access as *const _ as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(UTextFuncs), - "::", - stringify!(access) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).extract as *const _ as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(UTextFuncs), - "::", - stringify!(extract) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).replace as *const _ as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(UTextFuncs), - "::", - stringify!(replace) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).copy as *const _ as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(UTextFuncs), - "::", - stringify!(copy) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).mapOffsetToNative as *const _ as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(UTextFuncs), - "::", - stringify!(mapOffsetToNative) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).mapNativeIndexToUTF16 as *const _ as usize - }, - 72usize, - concat!( - "Offset of field: ", - stringify!(UTextFuncs), - "::", - stringify!(mapNativeIndexToUTF16) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).close as *const _ as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(UTextFuncs), - "::", - stringify!(close) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).spare1 as *const _ as usize }, - 88usize, - concat!( - "Offset of field: ", - stringify!(UTextFuncs), - "::", - stringify!(spare1) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).spare2 as *const _ as usize }, - 96usize, - concat!( - "Offset of field: ", - stringify!(UTextFuncs), - "::", - stringify!(spare2) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).spare3 as *const _ as usize }, - 104usize, - concat!( - "Offset of field: ", - stringify!(UTextFuncs), - "::", - stringify!(spare3) - ) ); } +extern "C" { + pub fn u_charsToUChars_67(cs: *const ::std::os::raw::c_char, us: *mut UChar, length: i32); +} +extern "C" { + pub fn u_UCharsToChars_67(us: *const UChar, cs: *mut ::std::os::raw::c_char, length: i32); +} #[repr(C)] -#[derive(Debug, Copy, Clone, Hash, PartialOrd, PartialEq)] -pub struct UText { - pub magic: u32, - pub flags: i32, - pub providerProperties: i32, - pub sizeOfStruct: i32, - pub chunkNativeLimit: i64, - pub extraSize: i32, - pub nativeIndexingLimit: i32, - pub chunkNativeStart: i64, - pub chunkOffset: i32, - pub chunkLength: i32, - pub chunkContents: *const UChar, - pub pFuncs: *const UTextFuncs, - pub pExtra: *mut ::std::os::raw::c_void, - pub context: *const ::std::os::raw::c_void, - pub p: *const ::std::os::raw::c_void, - pub q: *const ::std::os::raw::c_void, - pub r: *const ::std::os::raw::c_void, - pub privP: *mut ::std::os::raw::c_void, - pub a: i64, - pub b: i32, - pub c: i32, - pub privA: i64, - pub privB: i32, - pub privC: i32, +#[derive(Debug, Copy, Clone)] +pub struct UBreakIterator { + _unused: [u8; 0], } -#[test] -fn bindgen_test_layout_UText() { - assert_eq!( - ::std::mem::size_of::(), - 144usize, - concat!("Size of: ", stringify!(UText)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(UText)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).magic as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(magic) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).flags as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(flags) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).providerProperties as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(providerProperties) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).sizeOfStruct as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(sizeOfStruct) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).chunkNativeLimit as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(chunkNativeLimit) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).extraSize as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(extraSize) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).nativeIndexingLimit as *const _ as usize }, - 28usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(nativeIndexingLimit) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).chunkNativeStart as *const _ as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(chunkNativeStart) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).chunkOffset as *const _ as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(chunkOffset) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).chunkLength as *const _ as usize }, - 44usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(chunkLength) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).chunkContents as *const _ as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(chunkContents) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).pFuncs as *const _ as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(pFuncs) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).pExtra as *const _ as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(pExtra) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).context as *const _ as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(context) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).p as *const _ as usize }, - 80usize, - concat!("Offset of field: ", stringify!(UText), "::", stringify!(p)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).q as *const _ as usize }, - 88usize, - concat!("Offset of field: ", stringify!(UText), "::", stringify!(q)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).r as *const _ as usize }, - 96usize, - concat!("Offset of field: ", stringify!(UText), "::", stringify!(r)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).privP as *const _ as usize }, - 104usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(privP) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).a as *const _ as usize }, - 112usize, - concat!("Offset of field: ", stringify!(UText), "::", stringify!(a)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).b as *const _ as usize }, - 120usize, - concat!("Offset of field: ", stringify!(UText), "::", stringify!(b)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).c as *const _ as usize }, - 124usize, - concat!("Offset of field: ", stringify!(UText), "::", stringify!(c)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).privA as *const _ as usize }, - 128usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(privA) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).privB as *const _ as usize }, - 136usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(privB) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).privC as *const _ as usize }, - 140usize, - concat!( - "Offset of field: ", - stringify!(UText), - "::", - stringify!(privC) - ) - ); +extern "C" { + pub fn u_strlen_67(s: *const UChar) -> i32; } -impl Default for UText { - fn default() -> Self { - unsafe { ::std::mem::zeroed() } - } +extern "C" { + pub fn u_countChar32_67(s: *const UChar, length: i32) -> i32; } extern "C" { - pub fn utext_setup_67(ut: *mut UText, extraSpace: i32, status: *mut UErrorCode) -> *mut UText; + pub fn u_strHasMoreChar32Than_67(s: *const UChar, length: i32, number: i32) -> UBool; } extern "C" { - pub fn u_init_67(status: *mut UErrorCode); + pub fn u_strcat_67(dst: *mut UChar, src: *const UChar) -> *mut UChar; } extern "C" { - pub fn u_cleanup_67(); + pub fn u_strncat_67(dst: *mut UChar, src: *const UChar, n: i32) -> *mut UChar; } -pub type UMemAllocFn = ::std::option::Option< - unsafe extern "C" fn( - context: *const ::std::os::raw::c_void, - size: size_t, - ) -> *mut ::std::os::raw::c_void, ->; -pub type UMemReallocFn = ::std::option::Option< - unsafe extern "C" fn( - context: *const ::std::os::raw::c_void, - mem: *mut ::std::os::raw::c_void, - size: size_t, - ) -> *mut ::std::os::raw::c_void, ->; -pub type UMemFreeFn = ::std::option::Option< - unsafe extern "C" fn(context: *const ::std::os::raw::c_void, mem: *mut ::std::os::raw::c_void), ->; extern "C" { - pub fn u_setMemoryFunctions_67( - context: *const ::std::os::raw::c_void, - a: UMemAllocFn, - r: UMemReallocFn, - f: UMemFreeFn, - status: *mut UErrorCode, - ); + pub fn u_strstr_67(s: *const UChar, substring: *const UChar) -> *mut UChar; } -pub type UMTX = *mut ::std::os::raw::c_void; -pub type UMtxInitFn = ::std::option::Option< - unsafe extern "C" fn( - context: *const ::std::os::raw::c_void, - mutex: *mut UMTX, - status: *mut UErrorCode, - ), ->; -pub type UMtxFn = ::std::option::Option< - unsafe extern "C" fn(context: *const ::std::os::raw::c_void, mutex: *mut UMTX), ->; -extern "C" { - pub fn u_setMutexFunctions_67( - context: *const ::std::os::raw::c_void, - init: UMtxInitFn, - destroy: UMtxFn, - lock: UMtxFn, - unlock: UMtxFn, - status: *mut UErrorCode, - ); -} -pub type UMtxAtomicFn = ::std::option::Option< - unsafe extern "C" fn(context: *const ::std::os::raw::c_void, p: *mut i32) -> i32, ->; -extern "C" { - pub fn u_setAtomicIncDecFunctions_67( - context: *const ::std::os::raw::c_void, - inc: UMtxAtomicFn, - dec: UMtxAtomicFn, - status: *mut UErrorCode, - ); -} -pub type va_list = __builtin_va_list; extern "C" { - pub fn u_formatMessage_67( - locale: *const ::std::os::raw::c_char, - pattern: *const UChar, - patternLength: i32, - result: *mut UChar, - resultLength: i32, - status: *mut UErrorCode, - ... - ) -> i32; + pub fn u_strFindFirst_67( + s: *const UChar, + length: i32, + substring: *const UChar, + subLength: i32, + ) -> *mut UChar; } extern "C" { - pub fn u_vformatMessage_67( - locale: *const ::std::os::raw::c_char, - pattern: *const UChar, - patternLength: i32, - result: *mut UChar, - resultLength: i32, - ap: *mut __va_list_tag, - status: *mut UErrorCode, - ) -> i32; + pub fn u_strchr_67(s: *const UChar, c: UChar) -> *mut UChar; } extern "C" { - pub fn u_parseMessage_67( - locale: *const ::std::os::raw::c_char, - pattern: *const UChar, - patternLength: i32, - source: *const UChar, - sourceLength: i32, - status: *mut UErrorCode, - ... - ); + pub fn u_strchr32_67(s: *const UChar, c: UChar32) -> *mut UChar; } extern "C" { - pub fn u_vparseMessage_67( - locale: *const ::std::os::raw::c_char, - pattern: *const UChar, - patternLength: i32, - source: *const UChar, - sourceLength: i32, - ap: *mut __va_list_tag, - status: *mut UErrorCode, - ); + pub fn u_strrstr_67(s: *const UChar, substring: *const UChar) -> *mut UChar; } extern "C" { - pub fn u_formatMessageWithError_67( - locale: *const ::std::os::raw::c_char, - pattern: *const UChar, - patternLength: i32, - result: *mut UChar, - resultLength: i32, - parseError: *mut UParseError, - status: *mut UErrorCode, - ... - ) -> i32; + pub fn u_strFindLast_67( + s: *const UChar, + length: i32, + substring: *const UChar, + subLength: i32, + ) -> *mut UChar; } extern "C" { - pub fn u_vformatMessageWithError_67( - locale: *const ::std::os::raw::c_char, - pattern: *const UChar, - patternLength: i32, - result: *mut UChar, - resultLength: i32, - parseError: *mut UParseError, - ap: *mut __va_list_tag, - status: *mut UErrorCode, - ) -> i32; + pub fn u_strrchr_67(s: *const UChar, c: UChar) -> *mut UChar; } extern "C" { - pub fn u_parseMessageWithError_67( - locale: *const ::std::os::raw::c_char, - pattern: *const UChar, - patternLength: i32, - source: *const UChar, - sourceLength: i32, - parseError: *mut UParseError, - status: *mut UErrorCode, - ... - ); + pub fn u_strrchr32_67(s: *const UChar, c: UChar32) -> *mut UChar; } extern "C" { - pub fn u_vparseMessageWithError_67( - locale: *const ::std::os::raw::c_char, - pattern: *const UChar, - patternLength: i32, - source: *const UChar, - sourceLength: i32, - ap: *mut __va_list_tag, - parseError: *mut UParseError, - status: *mut UErrorCode, - ); + pub fn u_strpbrk_67(string: *const UChar, matchSet: *const UChar) -> *mut UChar; } -pub type UMessageFormat = *mut ::std::os::raw::c_void; extern "C" { - pub fn umsg_open_67( - pattern: *const UChar, - patternLength: i32, - locale: *const ::std::os::raw::c_char, - parseError: *mut UParseError, - status: *mut UErrorCode, - ) -> *mut UMessageFormat; + pub fn u_strcspn_67(string: *const UChar, matchSet: *const UChar) -> i32; } extern "C" { - pub fn umsg_close_67(format: *mut UMessageFormat); + pub fn u_strspn_67(string: *const UChar, matchSet: *const UChar) -> i32; } extern "C" { - pub fn umsg_clone_67(fmt: *const UMessageFormat, status: *mut UErrorCode) -> UMessageFormat; + pub fn u_strtok_r_67( + src: *mut UChar, + delim: *const UChar, + saveState: *mut *mut UChar, + ) -> *mut UChar; } extern "C" { - pub fn umsg_setLocale_67(fmt: *mut UMessageFormat, locale: *const ::std::os::raw::c_char); + pub fn u_strcmp_67(s1: *const UChar, s2: *const UChar) -> i32; } extern "C" { - pub fn umsg_getLocale_67(fmt: *const UMessageFormat) -> *const ::std::os::raw::c_char; + pub fn u_strcmpCodePointOrder_67(s1: *const UChar, s2: *const UChar) -> i32; } extern "C" { - pub fn umsg_applyPattern_67( - fmt: *mut UMessageFormat, - pattern: *const UChar, - patternLength: i32, - parseError: *mut UParseError, - status: *mut UErrorCode, - ); + pub fn u_strCompare_67( + s1: *const UChar, + length1: i32, + s2: *const UChar, + length2: i32, + codePointOrder: UBool, + ) -> i32; } extern "C" { - pub fn umsg_toPattern_67( - fmt: *const UMessageFormat, - result: *mut UChar, - resultLength: i32, - status: *mut UErrorCode, + pub fn u_strCompareIter_67( + iter1: *mut UCharIterator, + iter2: *mut UCharIterator, + codePointOrder: UBool, ) -> i32; } extern "C" { - pub fn umsg_format_67( - fmt: *const UMessageFormat, - result: *mut UChar, - resultLength: i32, - status: *mut UErrorCode, - ... + pub fn u_strCaseCompare_67( + s1: *const UChar, + length1: i32, + s2: *const UChar, + length2: i32, + options: u32, + pErrorCode: *mut UErrorCode, ) -> i32; } extern "C" { - pub fn umsg_vformat_67( - fmt: *const UMessageFormat, - result: *mut UChar, - resultLength: i32, - ap: *mut __va_list_tag, - status: *mut UErrorCode, - ) -> i32; + pub fn u_strncmp_67(ucs1: *const UChar, ucs2: *const UChar, n: i32) -> i32; } extern "C" { - pub fn umsg_parse_67( - fmt: *const UMessageFormat, - source: *const UChar, - sourceLength: i32, - count: *mut i32, - status: *mut UErrorCode, - ... - ); + pub fn u_strncmpCodePointOrder_67(s1: *const UChar, s2: *const UChar, n: i32) -> i32; } extern "C" { - pub fn umsg_vparse_67( - fmt: *const UMessageFormat, - source: *const UChar, - sourceLength: i32, - count: *mut i32, - ap: *mut __va_list_tag, - status: *mut UErrorCode, - ); + pub fn u_strcasecmp_67(s1: *const UChar, s2: *const UChar, options: u32) -> i32; } extern "C" { - pub fn umsg_autoQuoteApostrophe_67( - pattern: *const UChar, - patternLength: i32, - dest: *mut UChar, - destCapacity: i32, - ec: *mut UErrorCode, - ) -> i32; + pub fn u_strncasecmp_67(s1: *const UChar, s2: *const UChar, n: i32, options: u32) -> i32; } -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum USetSpanCondition { - USET_SPAN_NOT_CONTAINED = 0, - USET_SPAN_CONTAINED = 1, - USET_SPAN_SIMPLE = 2, - USET_SPAN_CONDITION_COUNT = 3, +extern "C" { + pub fn u_memcasecmp_67(s1: *const UChar, s2: *const UChar, length: i32, options: u32) -> i32; } -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct UCollator { - _unused: [u8; 0], +extern "C" { + pub fn u_strcpy_67(dst: *mut UChar, src: *const UChar) -> *mut UChar; } -#[repr(i32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UCollationResult { - UCOL_EQUAL = 0, - UCOL_GREATER = 1, - UCOL_LESS = -1, +extern "C" { + pub fn u_strncpy_67(dst: *mut UChar, src: *const UChar, n: i32) -> *mut UChar; } -impl UColAttributeValue { - pub const UCOL_DEFAULT_STRENGTH: UColAttributeValue = UColAttributeValue::UCOL_TERTIARY; +extern "C" { + pub fn u_uastrcpy_67(dst: *mut UChar, src: *const ::std::os::raw::c_char) -> *mut UChar; } -impl UColAttributeValue { - pub const UCOL_QUATERNARY: UColAttributeValue = UColAttributeValue::UCOL_CE_STRENGTH_LIMIT; +extern "C" { + pub fn u_uastrncpy_67( + dst: *mut UChar, + src: *const ::std::os::raw::c_char, + n: i32, + ) -> *mut UChar; } -impl UColAttributeValue { - pub const UCOL_OFF: UColAttributeValue = UColAttributeValue::UCOL_STRENGTH_LIMIT; -} -#[repr(i32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UColAttributeValue { - UCOL_DEFAULT = -1, - UCOL_PRIMARY = 0, - UCOL_SECONDARY = 1, - UCOL_TERTIARY = 2, - UCOL_CE_STRENGTH_LIMIT = 3, - UCOL_IDENTICAL = 15, - UCOL_STRENGTH_LIMIT = 16, - UCOL_ON = 17, - UCOL_SHIFTED = 20, - UCOL_NON_IGNORABLE = 21, - UCOL_LOWER_FIRST = 24, - UCOL_UPPER_FIRST = 25, - UCOL_ATTRIBUTE_VALUE_COUNT = 26, -} -impl UColReorderCode { - pub const UCOL_REORDER_CODE_OTHERS: UColReorderCode = UColReorderCode::UCOL_REORDER_CODE_NONE; -} -impl UColReorderCode { - pub const UCOL_REORDER_CODE_FIRST: UColReorderCode = UColReorderCode::UCOL_REORDER_CODE_SPACE; -} -#[repr(i32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UColReorderCode { - UCOL_REORDER_CODE_DEFAULT = -1, - UCOL_REORDER_CODE_NONE = 103, - UCOL_REORDER_CODE_SPACE = 4096, - UCOL_REORDER_CODE_PUNCTUATION = 4097, - UCOL_REORDER_CODE_SYMBOL = 4098, - UCOL_REORDER_CODE_CURRENCY = 4099, - UCOL_REORDER_CODE_DIGIT = 4100, - UCOL_REORDER_CODE_LIMIT = 4101, -} -pub use self::UColAttributeValue as UCollationStrength; -impl UColAttribute { - pub const UCOL_DECOMPOSITION_MODE: UColAttribute = UColAttribute::UCOL_NORMALIZATION_MODE; -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UColAttribute { - UCOL_FRENCH_COLLATION = 0, - UCOL_ALTERNATE_HANDLING = 1, - UCOL_CASE_FIRST = 2, - UCOL_CASE_LEVEL = 3, - UCOL_NORMALIZATION_MODE = 4, - UCOL_STRENGTH = 5, - UCOL_HIRAGANA_QUATERNARY_MODE = 6, - UCOL_NUMERIC_COLLATION = 7, - UCOL_ATTRIBUTE_COUNT = 8, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UColRuleOption { - UCOL_TAILORING_ONLY = 0, - UCOL_FULL_RULES = 1, -} -extern "C" { - pub fn ucol_open_67( - loc: *const ::std::os::raw::c_char, - status: *mut UErrorCode, - ) -> *mut UCollator; +extern "C" { + pub fn u_austrcpy_67( + dst: *mut ::std::os::raw::c_char, + src: *const UChar, + ) -> *mut ::std::os::raw::c_char; } extern "C" { - pub fn ucol_openRules_67( - rules: *const UChar, - rulesLength: i32, - normalizationMode: UColAttributeValue, - strength: UCollationStrength, - parseError: *mut UParseError, - status: *mut UErrorCode, - ) -> *mut UCollator; + pub fn u_austrncpy_67( + dst: *mut ::std::os::raw::c_char, + src: *const UChar, + n: i32, + ) -> *mut ::std::os::raw::c_char; } extern "C" { - pub fn ucol_openFromShortString_67( - definition: *const ::std::os::raw::c_char, - forceDefaults: UBool, - parseError: *mut UParseError, - status: *mut UErrorCode, - ) -> *mut UCollator; + pub fn u_memcpy_67(dest: *mut UChar, src: *const UChar, count: i32) -> *mut UChar; } extern "C" { - pub fn ucol_getContractions_67( - coll: *const UCollator, - conts: *mut USet, - status: *mut UErrorCode, - ) -> i32; + pub fn u_memmove_67(dest: *mut UChar, src: *const UChar, count: i32) -> *mut UChar; } extern "C" { - pub fn ucol_getContractionsAndExpansions_67( - coll: *const UCollator, - contractions: *mut USet, - expansions: *mut USet, - addPrefixes: UBool, - status: *mut UErrorCode, - ); + pub fn u_memset_67(dest: *mut UChar, c: UChar, count: i32) -> *mut UChar; } extern "C" { - pub fn ucol_close_67(coll: *mut UCollator); + pub fn u_memcmp_67(buf1: *const UChar, buf2: *const UChar, count: i32) -> i32; } extern "C" { - pub fn ucol_strcoll_67( - coll: *const UCollator, - source: *const UChar, - sourceLength: i32, - target: *const UChar, - targetLength: i32, - ) -> UCollationResult; + pub fn u_memcmpCodePointOrder_67(s1: *const UChar, s2: *const UChar, count: i32) -> i32; } extern "C" { - pub fn ucol_strcollUTF8_67( - coll: *const UCollator, - source: *const ::std::os::raw::c_char, - sourceLength: i32, - target: *const ::std::os::raw::c_char, - targetLength: i32, - status: *mut UErrorCode, - ) -> UCollationResult; + pub fn u_memchr_67(s: *const UChar, c: UChar, count: i32) -> *mut UChar; } extern "C" { - pub fn ucol_greater_67( - coll: *const UCollator, - source: *const UChar, - sourceLength: i32, - target: *const UChar, - targetLength: i32, - ) -> UBool; + pub fn u_memchr32_67(s: *const UChar, c: UChar32, count: i32) -> *mut UChar; } extern "C" { - pub fn ucol_greaterOrEqual_67( - coll: *const UCollator, - source: *const UChar, - sourceLength: i32, - target: *const UChar, - targetLength: i32, - ) -> UBool; + pub fn u_memrchr_67(s: *const UChar, c: UChar, count: i32) -> *mut UChar; } extern "C" { - pub fn ucol_equal_67( - coll: *const UCollator, - source: *const UChar, - sourceLength: i32, - target: *const UChar, - targetLength: i32, - ) -> UBool; + pub fn u_memrchr32_67(s: *const UChar, c: UChar32, count: i32) -> *mut UChar; } extern "C" { - pub fn ucol_strcollIter_67( - coll: *const UCollator, - sIter: *mut UCharIterator, - tIter: *mut UCharIterator, - status: *mut UErrorCode, - ) -> UCollationResult; + pub fn u_unescape_67( + src: *const ::std::os::raw::c_char, + dest: *mut UChar, + destCapacity: i32, + ) -> i32; } +pub type UNESCAPE_CHAR_AT = ::std::option::Option< + unsafe extern "C" fn(offset: i32, context: *mut ::std::os::raw::c_void) -> UChar, +>; extern "C" { - pub fn ucol_getStrength_67(coll: *const UCollator) -> UCollationStrength; + pub fn u_unescapeAt_67( + charAt: UNESCAPE_CHAR_AT, + offset: *mut i32, + length: i32, + context: *mut ::std::os::raw::c_void, + ) -> UChar32; } extern "C" { - pub fn ucol_setStrength_67(coll: *mut UCollator, strength: UCollationStrength); + pub fn u_strToUpper_67( + dest: *mut UChar, + destCapacity: i32, + src: *const UChar, + srcLength: i32, + locale: *const ::std::os::raw::c_char, + pErrorCode: *mut UErrorCode, + ) -> i32; } extern "C" { - pub fn ucol_getReorderCodes_67( - coll: *const UCollator, - dest: *mut i32, + pub fn u_strToLower_67( + dest: *mut UChar, destCapacity: i32, + src: *const UChar, + srcLength: i32, + locale: *const ::std::os::raw::c_char, pErrorCode: *mut UErrorCode, ) -> i32; } extern "C" { - pub fn ucol_setReorderCodes_67( - coll: *mut UCollator, - reorderCodes: *const i32, - reorderCodesLength: i32, + pub fn u_strToTitle_67( + dest: *mut UChar, + destCapacity: i32, + src: *const UChar, + srcLength: i32, + titleIter: *mut UBreakIterator, + locale: *const ::std::os::raw::c_char, pErrorCode: *mut UErrorCode, - ); + ) -> i32; } extern "C" { - pub fn ucol_getEquivalentReorderCodes_67( - reorderCode: i32, - dest: *mut i32, + pub fn u_strFoldCase_67( + dest: *mut UChar, destCapacity: i32, + src: *const UChar, + srcLength: i32, + options: u32, pErrorCode: *mut UErrorCode, ) -> i32; } extern "C" { - pub fn ucol_getDisplayName_67( - objLoc: *const ::std::os::raw::c_char, - dispLoc: *const ::std::os::raw::c_char, - result: *mut UChar, - resultLength: i32, - status: *mut UErrorCode, - ) -> i32; + pub fn u_strToWCS_67( + dest: *mut wchar_t, + destCapacity: i32, + pDestLength: *mut i32, + src: *const UChar, + srcLength: i32, + pErrorCode: *mut UErrorCode, + ) -> *mut wchar_t; } extern "C" { - pub fn ucol_getAvailable_67(localeIndex: i32) -> *const ::std::os::raw::c_char; + pub fn u_strFromWCS_67( + dest: *mut UChar, + destCapacity: i32, + pDestLength: *mut i32, + src: *const wchar_t, + srcLength: i32, + pErrorCode: *mut UErrorCode, + ) -> *mut UChar; } extern "C" { - pub fn ucol_countAvailable_67() -> i32; + pub fn u_strToUTF8_67( + dest: *mut ::std::os::raw::c_char, + destCapacity: i32, + pDestLength: *mut i32, + src: *const UChar, + srcLength: i32, + pErrorCode: *mut UErrorCode, + ) -> *mut ::std::os::raw::c_char; } extern "C" { - pub fn ucol_openAvailableLocales_67(status: *mut UErrorCode) -> *mut UEnumeration; + pub fn u_strFromUTF8_67( + dest: *mut UChar, + destCapacity: i32, + pDestLength: *mut i32, + src: *const ::std::os::raw::c_char, + srcLength: i32, + pErrorCode: *mut UErrorCode, + ) -> *mut UChar; } extern "C" { - pub fn ucol_getKeywords_67(status: *mut UErrorCode) -> *mut UEnumeration; + pub fn u_strToUTF8WithSub_67( + dest: *mut ::std::os::raw::c_char, + destCapacity: i32, + pDestLength: *mut i32, + src: *const UChar, + srcLength: i32, + subchar: UChar32, + pNumSubstitutions: *mut i32, + pErrorCode: *mut UErrorCode, + ) -> *mut ::std::os::raw::c_char; } extern "C" { - pub fn ucol_getKeywordValues_67( - keyword: *const ::std::os::raw::c_char, - status: *mut UErrorCode, - ) -> *mut UEnumeration; + pub fn u_strFromUTF8WithSub_67( + dest: *mut UChar, + destCapacity: i32, + pDestLength: *mut i32, + src: *const ::std::os::raw::c_char, + srcLength: i32, + subchar: UChar32, + pNumSubstitutions: *mut i32, + pErrorCode: *mut UErrorCode, + ) -> *mut UChar; } extern "C" { - pub fn ucol_getKeywordValuesForLocale_67( - key: *const ::std::os::raw::c_char, - locale: *const ::std::os::raw::c_char, - commonlyUsed: UBool, - status: *mut UErrorCode, - ) -> *mut UEnumeration; + pub fn u_strFromUTF8Lenient_67( + dest: *mut UChar, + destCapacity: i32, + pDestLength: *mut i32, + src: *const ::std::os::raw::c_char, + srcLength: i32, + pErrorCode: *mut UErrorCode, + ) -> *mut UChar; } extern "C" { - pub fn ucol_getFunctionalEquivalent_67( - result: *mut ::std::os::raw::c_char, - resultCapacity: i32, - keyword: *const ::std::os::raw::c_char, - locale: *const ::std::os::raw::c_char, - isAvailable: *mut UBool, - status: *mut UErrorCode, - ) -> i32; + pub fn u_strToUTF32_67( + dest: *mut UChar32, + destCapacity: i32, + pDestLength: *mut i32, + src: *const UChar, + srcLength: i32, + pErrorCode: *mut UErrorCode, + ) -> *mut UChar32; } extern "C" { - pub fn ucol_getRules_67(coll: *const UCollator, length: *mut i32) -> *const UChar; + pub fn u_strFromUTF32_67( + dest: *mut UChar, + destCapacity: i32, + pDestLength: *mut i32, + src: *const UChar32, + srcLength: i32, + pErrorCode: *mut UErrorCode, + ) -> *mut UChar; } extern "C" { - pub fn ucol_getShortDefinitionString_67( - coll: *const UCollator, - locale: *const ::std::os::raw::c_char, - buffer: *mut ::std::os::raw::c_char, - capacity: i32, - status: *mut UErrorCode, - ) -> i32; + pub fn u_strToUTF32WithSub_67( + dest: *mut UChar32, + destCapacity: i32, + pDestLength: *mut i32, + src: *const UChar, + srcLength: i32, + subchar: UChar32, + pNumSubstitutions: *mut i32, + pErrorCode: *mut UErrorCode, + ) -> *mut UChar32; } extern "C" { - pub fn ucol_normalizeShortDefinitionString_67( - source: *const ::std::os::raw::c_char, - destination: *mut ::std::os::raw::c_char, - capacity: i32, - parseError: *mut UParseError, + pub fn u_strFromUTF32WithSub_67( + dest: *mut UChar, + destCapacity: i32, + pDestLength: *mut i32, + src: *const UChar32, + srcLength: i32, + subchar: UChar32, + pNumSubstitutions: *mut i32, + pErrorCode: *mut UErrorCode, + ) -> *mut UChar; +} +extern "C" { + pub fn u_strToJavaModifiedUTF8_67( + dest: *mut ::std::os::raw::c_char, + destCapacity: i32, + pDestLength: *mut i32, + src: *const UChar, + srcLength: i32, + pErrorCode: *mut UErrorCode, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn u_strFromJavaModifiedUTF8WithSub_67( + dest: *mut UChar, + destCapacity: i32, + pDestLength: *mut i32, + src: *const ::std::os::raw::c_char, + srcLength: i32, + subchar: UChar32, + pNumSubstitutions: *mut i32, + pErrorCode: *mut UErrorCode, + ) -> *mut UChar; +} +extern "C" { + pub fn utext_close_67(ut: *mut UText) -> *mut UText; +} +extern "C" { + pub fn utext_openUTF8_67( + ut: *mut UText, + s: *const ::std::os::raw::c_char, + length: i64, status: *mut UErrorCode, - ) -> i32; + ) -> *mut UText; } extern "C" { - pub fn ucol_getSortKey_67( - coll: *const UCollator, - source: *const UChar, - sourceLength: i32, - result: *mut u8, - resultLength: i32, - ) -> i32; + pub fn utext_openUChars_67( + ut: *mut UText, + s: *const UChar, + length: i64, + status: *mut UErrorCode, + ) -> *mut UText; } extern "C" { - pub fn ucol_nextSortKeyPart_67( - coll: *const UCollator, - iter: *mut UCharIterator, - state: *mut u32, - dest: *mut u8, - count: i32, + pub fn utext_clone_67( + dest: *mut UText, + src: *const UText, + deep: UBool, + readOnly: UBool, status: *mut UErrorCode, - ) -> i32; + ) -> *mut UText; } -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd)] -pub enum UColBoundMode { - UCOL_BOUND_LOWER = 0, - UCOL_BOUND_UPPER = 1, - UCOL_BOUND_UPPER_LONG = 2, - UCOL_BOUND_VALUE_COUNT = 3, +extern "C" { + pub fn utext_equals_67(a: *const UText, b: *const UText) -> UBool; } extern "C" { - pub fn ucol_getBound_67( - source: *const u8, - sourceLength: i32, - boundType: UColBoundMode, - noOfLevels: u32, - result: *mut u8, - resultLength: i32, + pub fn utext_nativeLength_67(ut: *mut UText) -> i64; +} +extern "C" { + pub fn utext_isLengthExpensive_67(ut: *const UText) -> UBool; +} +extern "C" { + pub fn utext_char32At_67(ut: *mut UText, nativeIndex: i64) -> UChar32; +} +extern "C" { + pub fn utext_current32_67(ut: *mut UText) -> UChar32; +} +extern "C" { + pub fn utext_next32_67(ut: *mut UText) -> UChar32; +} +extern "C" { + pub fn utext_previous32_67(ut: *mut UText) -> UChar32; +} +extern "C" { + pub fn utext_next32From_67(ut: *mut UText, nativeIndex: i64) -> UChar32; +} +extern "C" { + pub fn utext_previous32From_67(ut: *mut UText, nativeIndex: i64) -> UChar32; +} +extern "C" { + pub fn utext_getNativeIndex_67(ut: *const UText) -> i64; +} +extern "C" { + pub fn utext_setNativeIndex_67(ut: *mut UText, nativeIndex: i64); +} +extern "C" { + pub fn utext_moveIndex32_67(ut: *mut UText, delta: i32) -> UBool; +} +extern "C" { + pub fn utext_getPreviousNativeIndex_67(ut: *mut UText) -> i64; +} +extern "C" { + pub fn utext_extract_67( + ut: *mut UText, + nativeStart: i64, + nativeLimit: i64, + dest: *mut UChar, + destCapacity: i32, status: *mut UErrorCode, ) -> i32; } extern "C" { - pub fn ucol_getVersion_67(coll: *const UCollator, info: *mut u8); + pub fn utext_isWritable_67(ut: *const UText) -> UBool; } extern "C" { - pub fn ucol_getUCAVersion_67(coll: *const UCollator, info: *mut u8); + pub fn utext_hasMetaData_67(ut: *const UText) -> UBool; } extern "C" { - pub fn ucol_mergeSortkeys_67( - src1: *const u8, - src1Length: i32, - src2: *const u8, - src2Length: i32, - dest: *mut u8, - destCapacity: i32, + pub fn utext_replace_67( + ut: *mut UText, + nativeStart: i64, + nativeLimit: i64, + replacementText: *const UChar, + replacementLength: i32, + status: *mut UErrorCode, ) -> i32; } extern "C" { - pub fn ucol_setAttribute_67( - coll: *mut UCollator, - attr: UColAttribute, - value: UColAttributeValue, + pub fn utext_copy_67( + ut: *mut UText, + nativeStart: i64, + nativeLimit: i64, + destIndex: i64, + move_: UBool, + status: *mut UErrorCode, + ); +} +extern "C" { + pub fn utext_freeze_67(ut: *mut UText); +} +pub type UTextClone = ::std::option::Option< + unsafe extern "C" fn( + dest: *mut UText, + src: *const UText, + deep: UBool, + status: *mut UErrorCode, + ) -> *mut UText, +>; +pub type UTextNativeLength = ::std::option::Option i64>; +pub type UTextAccess = ::std::option::Option< + unsafe extern "C" fn(ut: *mut UText, nativeIndex: i64, forward: UBool) -> UBool, +>; +pub type UTextExtract = ::std::option::Option< + unsafe extern "C" fn( + ut: *mut UText, + nativeStart: i64, + nativeLimit: i64, + dest: *mut UChar, + destCapacity: i32, status: *mut UErrorCode, + ) -> i32, +>; +pub type UTextReplace = ::std::option::Option< + unsafe extern "C" fn( + ut: *mut UText, + nativeStart: i64, + nativeLimit: i64, + replacementText: *const UChar, + replacmentLength: i32, + status: *mut UErrorCode, + ) -> i32, +>; +pub type UTextCopy = ::std::option::Option< + unsafe extern "C" fn( + ut: *mut UText, + nativeStart: i64, + nativeLimit: i64, + nativeDest: i64, + move_: UBool, + status: *mut UErrorCode, + ), +>; +pub type UTextMapOffsetToNative = + ::std::option::Option i64>; +pub type UTextMapNativeIndexToUTF16 = + ::std::option::Option i32>; +pub type UTextClose = ::std::option::Option; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, PartialEq)] +pub struct UTextFuncs { + pub tableSize: i32, + pub reserved1: i32, + pub reserved2: i32, + pub reserved3: i32, + pub clone: UTextClone, + pub nativeLength: UTextNativeLength, + pub access: UTextAccess, + pub extract: UTextExtract, + pub replace: UTextReplace, + pub copy: UTextCopy, + pub mapOffsetToNative: UTextMapOffsetToNative, + pub mapNativeIndexToUTF16: UTextMapNativeIndexToUTF16, + pub close: UTextClose, + pub spare1: UTextClose, + pub spare2: UTextClose, + pub spare3: UTextClose, +} +#[test] +fn bindgen_test_layout_UTextFuncs() { + assert_eq!( + ::std::mem::size_of::(), + 112usize, + concat!("Size of: ", stringify!(UTextFuncs)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(UTextFuncs)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tableSize as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(UTextFuncs), + "::", + stringify!(tableSize) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).reserved1 as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(UTextFuncs), + "::", + stringify!(reserved1) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).reserved2 as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(UTextFuncs), + "::", + stringify!(reserved2) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).reserved3 as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(UTextFuncs), + "::", + stringify!(reserved3) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).clone as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(UTextFuncs), + "::", + stringify!(clone) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).nativeLength as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(UTextFuncs), + "::", + stringify!(nativeLength) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).access as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(UTextFuncs), + "::", + stringify!(access) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).extract as *const _ as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(UTextFuncs), + "::", + stringify!(extract) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).replace as *const _ as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(UTextFuncs), + "::", + stringify!(replace) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).copy as *const _ as usize }, + 56usize, + concat!( + "Offset of field: ", + stringify!(UTextFuncs), + "::", + stringify!(copy) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).mapOffsetToNative as *const _ as usize }, + 64usize, + concat!( + "Offset of field: ", + stringify!(UTextFuncs), + "::", + stringify!(mapOffsetToNative) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).mapNativeIndexToUTF16 as *const _ as usize + }, + 72usize, + concat!( + "Offset of field: ", + stringify!(UTextFuncs), + "::", + stringify!(mapNativeIndexToUTF16) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).close as *const _ as usize }, + 80usize, + concat!( + "Offset of field: ", + stringify!(UTextFuncs), + "::", + stringify!(close) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).spare1 as *const _ as usize }, + 88usize, + concat!( + "Offset of field: ", + stringify!(UTextFuncs), + "::", + stringify!(spare1) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).spare2 as *const _ as usize }, + 96usize, + concat!( + "Offset of field: ", + stringify!(UTextFuncs), + "::", + stringify!(spare2) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).spare3 as *const _ as usize }, + 104usize, + concat!( + "Offset of field: ", + stringify!(UTextFuncs), + "::", + stringify!(spare3) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone, Hash, PartialOrd, PartialEq)] +pub struct UText { + pub magic: u32, + pub flags: i32, + pub providerProperties: i32, + pub sizeOfStruct: i32, + pub chunkNativeLimit: i64, + pub extraSize: i32, + pub nativeIndexingLimit: i32, + pub chunkNativeStart: i64, + pub chunkOffset: i32, + pub chunkLength: i32, + pub chunkContents: *const UChar, + pub pFuncs: *const UTextFuncs, + pub pExtra: *mut ::std::os::raw::c_void, + pub context: *const ::std::os::raw::c_void, + pub p: *const ::std::os::raw::c_void, + pub q: *const ::std::os::raw::c_void, + pub r: *const ::std::os::raw::c_void, + pub privP: *mut ::std::os::raw::c_void, + pub a: i64, + pub b: i32, + pub c: i32, + pub privA: i64, + pub privB: i32, + pub privC: i32, +} +#[test] +fn bindgen_test_layout_UText() { + assert_eq!( + ::std::mem::size_of::(), + 144usize, + concat!("Size of: ", stringify!(UText)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(UText)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).magic as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(magic) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).flags as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(flags) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).providerProperties as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(providerProperties) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).sizeOfStruct as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(sizeOfStruct) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).chunkNativeLimit as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(chunkNativeLimit) + ) ); -} -extern "C" { - pub fn ucol_getAttribute_67( - coll: *const UCollator, - attr: UColAttribute, - status: *mut UErrorCode, - ) -> UColAttributeValue; -} -extern "C" { - pub fn ucol_setMaxVariable_67( - coll: *mut UCollator, - group: UColReorderCode, - pErrorCode: *mut UErrorCode, + assert_eq!( + unsafe { &(*(::std::ptr::null::())).extraSize as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(extraSize) + ) ); -} -extern "C" { - pub fn ucol_getMaxVariable_67(coll: *const UCollator) -> UColReorderCode; -} -extern "C" { - pub fn ucol_setVariableTop_67( - coll: *mut UCollator, - varTop: *const UChar, - len: i32, - status: *mut UErrorCode, - ) -> u32; -} -extern "C" { - pub fn ucol_getVariableTop_67(coll: *const UCollator, status: *mut UErrorCode) -> u32; -} -extern "C" { - pub fn ucol_restoreVariableTop_67(coll: *mut UCollator, varTop: u32, status: *mut UErrorCode); -} -extern "C" { - pub fn ucol_safeClone_67( - coll: *const UCollator, - stackBuffer: *mut ::std::os::raw::c_void, - pBufferSize: *mut i32, - status: *mut UErrorCode, - ) -> *mut UCollator; -} -extern "C" { - pub fn ucol_getRulesEx_67( - coll: *const UCollator, - delta: UColRuleOption, - buffer: *mut UChar, - bufferLen: i32, - ) -> i32; -} -extern "C" { - pub fn ucol_getLocale_67( - coll: *const UCollator, - type_: ULocDataLocaleType, - status: *mut UErrorCode, - ) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn ucol_getLocaleByType_67( - coll: *const UCollator, - type_: ULocDataLocaleType, - status: *mut UErrorCode, - ) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn ucol_getTailoredSet_67(coll: *const UCollator, status: *mut UErrorCode) -> *mut USet; -} -extern "C" { - pub fn ucol_getUnsafeSet_67( - coll: *const UCollator, - unsafe_: *mut USet, - status: *mut UErrorCode, - ) -> i32; -} -extern "C" { - pub fn ucol_prepareShortStringOpen_67( - definition: *const ::std::os::raw::c_char, - forceDefaults: UBool, - parseError: *mut UParseError, - status: *mut UErrorCode, + assert_eq!( + unsafe { &(*(::std::ptr::null::())).nativeIndexingLimit as *const _ as usize }, + 28usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(nativeIndexingLimit) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).chunkNativeStart as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(chunkNativeStart) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).chunkOffset as *const _ as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(chunkOffset) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).chunkLength as *const _ as usize }, + 44usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(chunkLength) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).chunkContents as *const _ as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(chunkContents) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).pFuncs as *const _ as usize }, + 56usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(pFuncs) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).pExtra as *const _ as usize }, + 64usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(pExtra) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).context as *const _ as usize }, + 72usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(context) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).p as *const _ as usize }, + 80usize, + concat!("Offset of field: ", stringify!(UText), "::", stringify!(p)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).q as *const _ as usize }, + 88usize, + concat!("Offset of field: ", stringify!(UText), "::", stringify!(q)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).r as *const _ as usize }, + 96usize, + concat!("Offset of field: ", stringify!(UText), "::", stringify!(r)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).privP as *const _ as usize }, + 104usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(privP) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).a as *const _ as usize }, + 112usize, + concat!("Offset of field: ", stringify!(UText), "::", stringify!(a)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).b as *const _ as usize }, + 120usize, + concat!("Offset of field: ", stringify!(UText), "::", stringify!(b)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).c as *const _ as usize }, + 124usize, + concat!("Offset of field: ", stringify!(UText), "::", stringify!(c)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).privA as *const _ as usize }, + 128usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(privA) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).privB as *const _ as usize }, + 136usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(privB) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).privC as *const _ as usize }, + 140usize, + concat!( + "Offset of field: ", + stringify!(UText), + "::", + stringify!(privC) + ) ); } -extern "C" { - pub fn ucol_cloneBinary_67( - coll: *const UCollator, - buffer: *mut u8, - capacity: i32, - status: *mut UErrorCode, - ) -> i32; +impl Default for UText { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } } extern "C" { - pub fn ucol_openBinary_67( - bin: *const u8, - length: i32, - base: *const UCollator, - status: *mut UErrorCode, - ) -> *mut UCollator; + pub fn utext_setup_67(ut: *mut UText, extraSpace: i32, status: *mut UErrorCode) -> *mut UText; } pub type __builtin_va_list = [__va_list_tag; 1usize]; #[repr(C)] diff --git a/rust_icu_sys/bindgen/run_bindgen.sh b/rust_icu_sys/bindgen/run_bindgen.sh index f65ad75c..0c8ad801 100755 --- a/rust_icu_sys/bindgen/run_bindgen.sh +++ b/rust_icu_sys/bindgen/run_bindgen.sh @@ -34,15 +34,16 @@ OUTPUT_DIR=${OUTPUT_DIR:-.} # build.rs file. readonly BINDGEN_SOURCE_MODULES=( "ucal" + "uclean" + "ucol" "udat" "udata" "uenum" - "ustring" - "utext" - "uclean" + "ulistformatter" "umsg" - "ucol" "uset" + "ustring" + "utext" ) # Types for which to generate the bindings. Expand this list if you need more. @@ -53,18 +54,20 @@ readonly BINDGEN_ALLOWLIST_TYPES=( "UBool" "UCalendar.*" "UChar.*" + "UCol.*" + "UCollation.*" + "UCollator" "UData.*" "UDate.*" "UDateFormat.*" "UEnumeration.*" "UErrorCode" + "UFormattedList.*" + "UListFormatter.*" "UMessageFormat" "UParseError" - "UText" - "UCollator" - "UCollation.*" "USet" - "UCol.*" + "UText" ) # Functions for which to generate the bindings. Expand this list if you need @@ -73,13 +76,14 @@ readonly BINDGEN_ALLOWLIST_TYPES=( readonly BINDGEN_ALLOWLIST_FUNCTIONS=( "u_.*" "ucal_.*" - "udata_.*" + "ucol_.*" "udat_.*" + "udata_.*" "uenum_.*" + "ulistfmt_.*" "uloc_.*" - "utext_.*" "umsg_.*" - "ucol_.*" + "utext_.*" ) function check_requirements() { diff --git a/rust_icu_sys/build.rs b/rust_icu_sys/build.rs index 7758bc11..0331bb63 100644 --- a/rust_icu_sys/build.rs +++ b/rust_icu_sys/build.rs @@ -38,8 +38,17 @@ mod inner { // should be topologicaly sorted based on the inclusion relationship between the respective // headers. Any of these will fail if the required binaries are not present in $PATH. static ref BINDGEN_SOURCE_MODULES: Vec<&'static str> = vec![ - "ucal", "udat", "udata", "uenum", "ustring", "utext", "uclean", "umsg", - "ucol", "uset", + "ucal", + "uclean", + "ucol", + "udat", + "udata", + "uenum", + "ulistformatter", + "umsg", + "uset", + "ustring", + "utext", ]; // C functions that will be made available to rust code. Add more to this list if you want to @@ -47,13 +56,14 @@ mod inner { static ref BINDGEN_ALLOWLIST_FUNCTIONS: Vec<&'static str> = vec![ "u_.*", "ucal_.*", - "udata_.*", + "ucol_.*", "udat_.*", + "udata_.*", "uenum_.*", + "ulistfmt_.*", "uloc_.*", - "utext_.*", "umsg_.*", - "ucol_.*", + "utext_.*", ]; // C types that will be made available to rust code. Add more to this list if you want to @@ -63,18 +73,20 @@ mod inner { "UBool", "UCalendar.*", "UChar.*", + "UCol.*", + "UCollation.*", + "UCollator", "UData.*", "UDate.*", "UDateFormat.*", "UEnumeration.*", "UErrorCode", + "UFormattedList.*", + "UListFormatter.*", "UMessageFormat", "UParseError", - "UCollation.*", - "UCollator", "USet", "UText", - "UCol.*", ]; } diff --git a/rust_icu_ucal/Cargo.toml b/rust_icu_ucal/Cargo.toml index a061dc17..4274e3c1 100644 --- a/rust_icu_ucal/Cargo.toml +++ b/rust_icu_ucal/Cargo.toml @@ -55,6 +55,18 @@ icu_version_in_env = [ "rust_icu_uenum/icu_version_in_env", "rust_icu_ustring/icu_version_in_env", ] +icu_version_64_plus = [ + "rust_icu_common/icu_version_64_plus", + "rust_icu_sys/icu_version_64_plus", + "rust_icu_uenum/icu_version_64_plus", + "rust_icu_ustring/icu_version_64_plus", +] +icu_version_67_plus = [ + "rust_icu_common/icu_version_67_plus", + "rust_icu_sys/icu_version_67_plus", + "rust_icu_uenum/icu_version_67_plus", + "rust_icu_ustring/icu_version_67_plus", +] [badges] maintenance = { status = "actively-developed" } diff --git a/rust_icu_ucol/Cargo.toml b/rust_icu_ucol/Cargo.toml index 2e7ea28e..e40da5f5 100644 --- a/rust_icu_ucol/Cargo.toml +++ b/rust_icu_ucol/Cargo.toml @@ -55,8 +55,18 @@ icu_version_in_env = [ "rust_icu_uenum/icu_version_in_env", "rust_icu_ustring/icu_version_in_env", ] -icu_version_64_plus = [] -icu_version_67_plus = [] +icu_version_64_plus = [ + "rust_icu_common/icu_version_64_plus", + "rust_icu_sys/icu_version_64_plus", + "rust_icu_uenum/icu_version_64_plus", + "rust_icu_ustring/icu_version_64_plus", +] +icu_version_67_plus = [ + "rust_icu_common/icu_version_67_plus", + "rust_icu_sys/icu_version_67_plus", + "rust_icu_uenum/icu_version_67_plus", + "rust_icu_ustring/icu_version_67_plus", +] [badges] maintenance = { status = "actively-developed" } diff --git a/rust_icu_ucol/src/lib.rs b/rust_icu_ucol/src/lib.rs index 161ca772..20e5e202 100644 --- a/rust_icu_ucol/src/lib.rs +++ b/rust_icu_ucol/src/lib.rs @@ -25,7 +25,7 @@ //! reader can check out the [collation documentation on the ICU user //! guide](http://userguide.icu-project.org/collation). //! -//! Are you missing some features from this crate? Consider [reporting an +//! > Are you missing some features from this crate? Consider [reporting an //! issue](https://github.com/google/rust_icu/issues) or even [contributing the //! functionality](https://github.com/google/rust_icu/pulls). //! diff --git a/rust_icu_udat/Cargo.toml b/rust_icu_udat/Cargo.toml index 2b3c2d58..70feffe4 100644 --- a/rust_icu_udat/Cargo.toml +++ b/rust_icu_udat/Cargo.toml @@ -61,6 +61,22 @@ icu_version_in_env = [ "rust_icu_uloc/icu_version_in_env", "rust_icu_ustring/icu_version_in_env", ] +icu_version_64_plus = [ + "rust_icu_common/icu_version_64_plus", + "rust_icu_sys/icu_version_64_plus", + "rust_icu_ucal/icu_version_64_plus", + "rust_icu_uenum/icu_version_64_plus", + "rust_icu_uloc/icu_version_64_plus", + "rust_icu_ustring/icu_version_64_plus", +] +icu_version_67_plus = [ + "rust_icu_common/icu_version_67_plus", + "rust_icu_sys/icu_version_67_plus", + "rust_icu_ucal/icu_version_67_plus", + "rust_icu_uenum/icu_version_67_plus", + "rust_icu_uloc/icu_version_67_plus", + "rust_icu_ustring/icu_version_67_plus", +] [badges] maintenance = { status = "actively-developed" } diff --git a/rust_icu_udata/Cargo.toml b/rust_icu_udata/Cargo.toml index ed4b831f..7d27dab4 100644 --- a/rust_icu_udata/Cargo.toml +++ b/rust_icu_udata/Cargo.toml @@ -29,6 +29,14 @@ use-bindgen = ["rust_icu_sys/use-bindgen", "rust_icu_common/use-bindgen"] renaming = ["rust_icu_sys/renaming", "rust_icu_common/renaming"] icu_config = ["rust_icu_sys/icu_config", "rust_icu_common/icu_config"] icu_version_in_env = ["rust_icu_sys/icu_version_in_env", "rust_icu_common/icu_version_in_env"] +icu_version_64_plus = [ + "rust_icu_common/icu_version_64_plus", + "rust_icu_sys/icu_version_64_plus", +] +icu_version_67_plus = [ + "rust_icu_common/icu_version_67_plus", + "rust_icu_sys/icu_version_67_plus", +] [badges] maintenance = { status = "actively-developed" } diff --git a/rust_icu_uenum/Cargo.toml b/rust_icu_uenum/Cargo.toml index b7556935..bffac802 100644 --- a/rust_icu_uenum/Cargo.toml +++ b/rust_icu_uenum/Cargo.toml @@ -28,6 +28,14 @@ use-bindgen = ["rust_icu_sys/use-bindgen", "rust_icu_common/use-bindgen"] renaming = ["rust_icu_sys/renaming", "rust_icu_common/renaming"] icu_config = ["rust_icu_sys/icu_config", "rust_icu_common/icu_config"] icu_version_in_env = ["rust_icu_sys/icu_version_in_env", "rust_icu_common/icu_version_in_env"] +icu_version_64_plus = [ + "rust_icu_common/icu_version_64_plus", + "rust_icu_sys/icu_version_64_plus", +] +icu_version_67_plus = [ + "rust_icu_common/icu_version_67_plus", + "rust_icu_sys/icu_version_67_plus", +] [badges] maintenance = { status = "actively-developed" } diff --git a/rust_icu_ulistformatter/Cargo.toml b/rust_icu_ulistformatter/Cargo.toml new file mode 100644 index 00000000..c6633451 --- /dev/null +++ b/rust_icu_ulistformatter/Cargo.toml @@ -0,0 +1,69 @@ +[package] +authors = ["Google Inc."] +edition = "2018" +license = "Apache-2.0" +name = "rust_icu_ulistformatter" +readme = "README.md" +repository = "https://github.com/google/rust_icu" +version = "0.2.3" +default-features = false +keywords = ["icu", "unicode", "i18n", "l10n"] + +description = """ +Native bindings to the ICU4C library from Unicode. + +- ulistformatter.h: Collation support +""" + +[dependencies] +log = "0.4.6" +paste = "0.1.5" +rust_icu_common = { path = "../rust_icu_common", version = "0.2.3", default-features = false } +rust_icu_sys = { path = "../rust_icu_sys", version = "0.2.3", default-features = false } +#rust_icu_uenum = { path = "../rust_icu_uenum", version = "0.2.3", default-features = false } +rust_icu_ustring = { path = "../rust_icu_ustring", version = "0.2.3", default-features = false } +anyhow = "1.0.25" + +[dev-dependencies] +anyhow = "1.0.25" + +# See the feature description in ../rust_icu_sys/Cargo.toml for details. +[features] +default = ["use-bindgen", "renaming", "icu_config"] + +use-bindgen = [ + "rust_icu_common/use-bindgen", + "rust_icu_sys/use-bindgen", + "rust_icu_ustring/use-bindgen", +] +renaming = [ + "rust_icu_common/renaming", + "rust_icu_sys/renaming", + "rust_icu_ustring/renaming", +] +icu_config = [ + "rust_icu_common/icu_config", + "rust_icu_sys/icu_config", + "rust_icu_ustring/icu_config", +] +icu_version_in_env = [ + "rust_icu_common/icu_version_in_env", + "rust_icu_sys/icu_version_in_env", + "rust_icu_ustring/icu_version_in_env", +] +icu_version_64_plus = [ + "rust_icu_common/icu_version_64_plus", + "rust_icu_sys/icu_version_64_plus", + "rust_icu_ustring/icu_version_64_plus", +] +icu_version_67_plus = [ + "rust_icu_common/icu_version_67_plus", + "rust_icu_sys/icu_version_67_plus", + "rust_icu_ustring/icu_version_67_plus", +] + +[badges] +maintenance = { status = "actively-developed" } +is-it-maintained-issue-resolution = { repository = "google/rust_icu" } +is-it-maintained-open-issues = { repository = "google/rust_icu" } +travis-ci = { repository = "google/rust_icu", branch = "master" } diff --git a/rust_icu_ulistformatter/README.md b/rust_icu_ulistformatter/README.md new file mode 120000 index 00000000..32d46ee8 --- /dev/null +++ b/rust_icu_ulistformatter/README.md @@ -0,0 +1 @@ +../README.md \ No newline at end of file diff --git a/rust_icu_ulistformatter/src/lib.rs b/rust_icu_ulistformatter/src/lib.rs new file mode 100644 index 00000000..a94d996d --- /dev/null +++ b/rust_icu_ulistformatter/src/lib.rs @@ -0,0 +1,306 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! # ICU list formatting support for rust +//! +//! This crate provides locale-sensitive list formatting, based on the list +//! formatting as implemente by the ICU library. Specifically, the functionality +//! exposed through its C API, as available in the [header `ulisetformatter.h`][header]. +//! +//! [header]: https://unicode-org.github.io/icu-docs/apidoc/released/icu4c/ulistformatter_8h.html +//! +//! > Are you missing some features from this crate? Consider [reporting an +//! issue](https://github.com/google/rust_icu/issues) or even [contributing the +//! functionality](https://github.com/google/rust_icu/pulls). +//! +//! ## Examples +//! +//! > TBD + +use { + rust_icu_common as common, rust_icu_sys as sys, + rust_icu_sys::versioned_function, + rust_icu_sys::*, + rust_icu_ustring as ustring, + std::{convert::TryFrom, convert::TryInto, ffi, ptr}, +}; + +#[derive(Debug)] +pub struct UListFormatter { + rep: ptr::NonNull, +} + +impl Drop for UListFormatter { + /// Implements ulistfmt_close`. + fn drop(&mut self) { + unsafe { versioned_function!(ulistfmt_close)(self.rep.as_ptr()) }; + } +} + +impl UListFormatter { + /// Implements ulistfmt_open`. + pub fn try_new(locale: &str) -> Result { + let locale_cstr = ffi::CString::new(locale)?; + let mut status = common::Error::OK_CODE; + // Unsafety note: this is the way to create the formatter. We expect all + // the passed-in values to be well-formed. + let rep = unsafe { + assert!(common::Error::is_ok(status)); + versioned_function!(ulistfmt_open)(locale_cstr.as_ptr(), &mut status) + as *mut sys::UListFormatter + }; + common::Error::ok_or_warning(status)?; + Ok(UListFormatter { + rep: ptr::NonNull::new(rep).unwrap(), + }) + } + + /// Implements `ulistfmt_openForType`. Since ICU 67. + #[cfg(features = "icu_version_67_plus")] + pub fn try_new_styled( + locale: &str, + format_type: sys::UListFormatterType, + format_width: sys::UListFormatterWidth, + ) -> Result { + let locale_cstr = ffi::CString::new(locale)?; + let mut status = common::Error::OK_CODE; + // Unsafety note: this is the way to create the formatter. We expect all + // the passed-in values to be well-formed. + let rep = unsafe { + assert!(common::Error::is_ok(status)); + versioned_function!(ulistfmt_openForType)( + locale_cstr.as_ptr(), + format_type, + format_width, + &mut status, + ) as *mut sys::UListFormatter + }; + common::Error::ok_or_warning(status)?; + Ok(UListFormatter { + rep: ptr::NonNull::new(rep).unwrap(), + }) + } + + /// Implements `ulistfmt_format`. + pub fn format(&self, list: &[&str]) -> Result { + let result = self.format_uchar(list)?; + String::try_from(&result) + } + + /// Implements `ulistfmt_format`. + pub fn format_uchar(&self, list: &[&str]) -> Result { + let list_ustr = UCharArray::try_from(list)?; + const CAPACITY: usize = 200; + let (pointers, strlens, len) = unsafe { list_ustr.as_pascal_strings() }; + + // This is similar to buffered_string_method_with_retry, except the buffer + // consists of [sys::UChar]s. + let mut status = common::Error::OK_CODE; + let mut buf: Vec = vec![0; CAPACITY]; + + let full_len: i32 = unsafe { + assert!(common::Error::is_ok(status)); + versioned_function!(ulistfmt_format)( + self.rep.as_ptr(), + pointers as *const *const sys::UChar, + strlens as *const i32, + len as i32, + buf.as_mut_ptr(), + CAPACITY as i32, + &mut status, + ) + }; + if status == sys::UErrorCode::U_BUFFER_OVERFLOW_ERROR + || (common::Error::is_ok(status) + && full_len > CAPACITY.try_into().map_err(|e| common::Error::wrapper(e))?) + { + assert!(full_len > 0); + let full_len: usize = full_len.try_into().map_err(|e| common::Error::wrapper(e))?; + buf.resize(full_len, 0); + unsafe { + assert!(common::Error::is_ok(status)); + versioned_function!(ulistfmt_format)( + self.rep.as_ptr(), + pointers as *const *const sys::UChar, + strlens as *const i32, + len as i32, + buf.as_mut_ptr(), + buf.len() as i32, + &mut status, + ) + }; + } + common::Error::ok_or_warning(status)?; + if full_len >= 0 { + let full_len: usize = full_len.try_into().map_err(|e| common::Error::wrapper(e))?; + buf.resize(full_len, 0); + } + Ok(ustring::UChar::from(buf)) + } +} + +/// A helper array that deconstructs [ustring::UChar] into constituent raw parts +/// that can be passed into formatting functions that use array APIs for parameter-passing. +/// +/// Create with [UCharArray::try_from], and then use [UCharArray::as_pascal_strings] to get +/// the respective sizes. +#[derive(Debug)] +struct UCharArray { + // The elements of the array. + elements: Vec, + // Pointers to the respective elements. + pointers: Vec<*const sys::UChar>, + // The string lengths (in ustring::UChar units) of respective elements. + // These strlens are what `listfmt_format` expects, so can't be `usize` but + // *must* be `i32`. + strlens: Vec, +} + +impl TryFrom<&[T]> for UCharArray +where + T: AsRef, +{ + type Error = common::Error; + + /// Creates a new [UCharArray] from an array of string-like types. + fn try_from(list: &[T]) -> Result { + let mut elements: Vec = Vec::with_capacity(list.len()); + for element in list { + let uchar = ustring::UChar::try_from(element.as_ref())?; + elements.push(uchar); + } + let pointers = elements.iter().map(|e| e.as_c_ptr()).collect(); + let strlens = elements.iter().map(|e| e.len() as i32).collect(); + Ok(UCharArray { + elements, + pointers, + strlens, + }) + } +} + +impl AsRef> for UCharArray { + fn as_ref(&self) -> &Vec { + &self.elements + } +} + +impl UCharArray { + /// Returns the elements of the array decomposed as "pascal strings", i.e. + /// separating out the pointers, the sizes of each individual string included, + /// and the total size of the array. + pub unsafe fn as_pascal_strings(self) -> (*mut *mut sys::UChar, *mut *mut i32, usize) { + let pointers = self.pointers.as_ptr() as *mut *mut sys::UChar; + let strlens = self.strlens.as_ptr() as *mut *mut i32; + let len = self.elements.len(); + // Since 'self' was not moved anywhere in this method, we need to forget it before we + // return pointers to its content, else all the pointers will be invalidated. + std::mem::forget(self); + (pointers, strlens, len) + } + + /// Returns the number of elements in the array. + #[allow(dead_code)] // Not used in production code yet. + pub fn len(&self) -> usize { + self.elements.len() + } + + /// Assembles an [UCharArray] from parts (ostensibly, obtained through + /// [UCharArray::as_pascal_strings] above. Unsafe, as there is no guarantee + /// that the pointers are well-formed. + /// + /// Takes ownership away from the pointers and strlens. Requires that + /// `len` is equal to the capacities and lengths of the vectors described by + /// `pointers` and `strlens`. + #[allow(dead_code)] + pub unsafe fn from_raw_parts( + pointers: *mut *mut sys::UChar, + strlens: *mut *mut i32, + len: usize, + ) -> UCharArray { + let pointers_vec: Vec<*mut sys::UChar> = Vec::from_raw_parts(pointers, len, len); + let strlens_vec: Vec = Vec::from_raw_parts(strlens as *mut i32, len, len); + + let elements = pointers_vec.into_iter().zip(strlens_vec); + let elements = elements + .map(|(ptr, len): (*mut sys::UChar, i32)| { + assert!(len >= 0); + let len_i32 = len as usize; + let raw: Vec = Vec::from_raw_parts(ptr, len_i32, len_i32); + ustring::UChar::from(raw) + }) + .collect::>(); + let pointers = elements.iter().map(|e| e.as_c_ptr()).collect(); + let strlens = elements.iter().map(|e| e.len() as i32).collect(); + + UCharArray { + elements, + pointers, + strlens, + } + } +} + +#[cfg(test)] +mod testing { + use crate::*; + + #[test] + fn test_pascal_strings() { + let array = UCharArray::try_from(&["eenie", "meenie", "minie", "moe"][..]) + .expect("created with success"); + let array_len = array.len(); + println!("blah"); + let (strings, strlens, len) = unsafe { array.as_pascal_strings() }; + assert_eq!(len, array_len); + + let reconstructed = unsafe { UCharArray::from_raw_parts(strings, strlens, len) }; + let result = reconstructed + .as_ref() + .iter() + .map(|e| String::try_from(e).expect("conversion is a success")) + .collect::>(); + assert_eq!(vec!["eenie", "meenie", "minie", "moe"], result); + } + + #[test] + fn test_formatting() { + let array = ["eenie", "meenie", "minie", "moe"]; + let formatter = crate::UListFormatter::try_new("en-US").expect("has list format"); + let result = formatter.format(&array).expect("formatting succeeds"); + assert_eq!("eenie, meenie, minie, and moe", result); + } + + #[test] + fn test_formatting_sr() { + let array = ["Раја", "Гаја", "Влаја"]; // Huey, Dewey, and Louie. + let formatter = crate::UListFormatter::try_new("sr-RS").expect("has list format"); + let result = formatter.format(&array).expect("formatting succeeds"); + assert_eq!("Раја, Гаја и Влаја", result); + } + + #[cfg(features = "icu_version_67_plus")] + #[test] + fn test_formatting_styled() { + let array = ["Раја", "Гаја", "Влаја"]; // Hewey, Dewey, and Louie. + let formatter = crate::UListFormatter::try_new_styled( + "sr-RS", + sys: UListFormatterType::ULISTFMT_TYPE_OR, + sys::UListFormatterWidth::ULISTFMT_WIDTH_WIDE, + ) + .expect("has list format"); + let result = formatter.format(&array).expect("formatting succeeds"); + assert_eq!("Раја, Гаја или Влаја", result); + } +} diff --git a/rust_icu_uloc/Cargo.toml b/rust_icu_uloc/Cargo.toml index 7219c76e..7944a179 100644 --- a/rust_icu_uloc/Cargo.toml +++ b/rust_icu_uloc/Cargo.toml @@ -55,8 +55,18 @@ icu_version_in_env = [ "rust_icu_uenum/icu_version_in_env", "rust_icu_ustring/icu_version_in_env", ] -icu_version_64_plus = [] -icu_version_67_plus = [] +icu_version_64_plus = [ + "rust_icu_common/icu_version_64_plus", + "rust_icu_sys/icu_version_64_plus", + "rust_icu_uenum/icu_version_64_plus", + "rust_icu_ustring/icu_version_64_plus", +] +icu_version_67_plus = [ + "rust_icu_common/icu_version_67_plus", + "rust_icu_sys/icu_version_67_plus", + "rust_icu_uenum/icu_version_67_plus", + "rust_icu_ustring/icu_version_67_plus", +] [build-dependencies] anyhow = "1.0" diff --git a/rust_icu_umsg/Cargo.toml b/rust_icu_umsg/Cargo.toml index f800d564..4d88613a 100644 --- a/rust_icu_umsg/Cargo.toml +++ b/rust_icu_umsg/Cargo.toml @@ -32,10 +32,42 @@ rust_icu_ucal = { path = "../rust_icu_ucal", version = "0.2.3", default-features [features] default = ["use-bindgen", "renaming", "icu_config"] -use-bindgen = ["rust_icu_sys/use-bindgen", "rust_icu_common/use-bindgen"] -renaming = ["rust_icu_sys/renaming", "rust_icu_common/renaming"] -icu_config = ["rust_icu_sys/icu_config", "rust_icu_common/icu_config"] -icu_version_in_env = ["rust_icu_sys/icu_version_in_env", "rust_icu_common/icu_version_in_env"] +use-bindgen = [ + "rust_icu_common/use-bindgen", + "rust_icu_sys/use-bindgen", + "rust_icu_uloc/use-bindgen", + "rust_icu_ustring/use-bindgen", +] +renaming = [ + "rust_icu_common/renaming", + "rust_icu_sys/renaming", + "rust_icu_uloc/renaming", + "rust_icu_ustring/renaming", +] +icu_config = [ + "rust_icu_common/icu_config", + "rust_icu_sys/icu_config", + "rust_icu_uloc/icu_config", + "rust_icu_ustring/icu_config", +] +icu_version_in_env = [ + "rust_icu_common/icu_version_in_env", + "rust_icu_sys/icu_version_in_env", + "rust_icu_uloc/icu_version_in_env", + "rust_icu_ustring/icu_version_in_env", +] +icu_version_64_plus = [ + "rust_icu_common/icu_version_64_plus", + "rust_icu_sys/icu_version_64_plus", + "rust_icu_uloc/icu_version_64_plus", + "rust_icu_ustring/icu_version_64_plus", +] +icu_version_67_plus = [ + "rust_icu_common/icu_version_67_plus", + "rust_icu_sys/icu_version_67_plus", + "rust_icu_uloc/icu_version_67_plus", + "rust_icu_ustring/icu_version_67_plus", +] [badges] maintenance = { status = "actively-developed" } diff --git a/rust_icu_ustring/Cargo.toml b/rust_icu_ustring/Cargo.toml index 5bc3a54d..7d1501c3 100644 --- a/rust_icu_ustring/Cargo.toml +++ b/rust_icu_ustring/Cargo.toml @@ -29,4 +29,12 @@ use-bindgen = ["rust_icu_sys/use-bindgen", "rust_icu_common/use-bindgen"] renaming = ["rust_icu_sys/renaming", "rust_icu_common/renaming"] icu_config = ["rust_icu_sys/icu_config", "rust_icu_common/icu_config"] icu_version_in_env = ["rust_icu_sys/icu_version_in_env", "rust_icu_common/icu_version_in_env"] +icu_version_64_plus = [ + "rust_icu_common/icu_version_64_plus", + "rust_icu_sys/icu_version_64_plus", +] +icu_version_67_plus = [ + "rust_icu_common/icu_version_67_plus", + "rust_icu_sys/icu_version_67_plus", +] diff --git a/rust_icu_ustring/src/lib.rs b/rust_icu_ustring/src/lib.rs index bb304c36..e26b5ca3 100644 --- a/rust_icu_ustring/src/lib.rs +++ b/rust_icu_ustring/src/lib.rs @@ -155,6 +155,13 @@ impl TryFrom<&UChar> for String { } } +impl From> for crate::UChar { + /// Adopts a vector of [sys::UChar] into a string. + fn from(rep: Vec) -> crate::UChar { + crate::UChar { rep } + } +} + impl crate::UChar { /// Allocates a new UChar with given capacity. /// @@ -162,7 +169,7 @@ impl crate::UChar { /// low-level code. pub fn new_with_capacity(capacity: usize) -> crate::UChar { let rep: Vec = vec![0; capacity]; - crate::UChar { rep: rep } + crate::UChar::from(rep) } /// Converts into a zeroed-out string. diff --git a/rust_icu_utext/Cargo.toml b/rust_icu_utext/Cargo.toml index 37b90996..1f8357dc 100644 --- a/rust_icu_utext/Cargo.toml +++ b/rust_icu_utext/Cargo.toml @@ -28,6 +28,14 @@ use-bindgen = ["rust_icu_sys/use-bindgen", "rust_icu_common/use-bindgen"] renaming = ["rust_icu_sys/renaming", "rust_icu_common/renaming"] icu_config = ["rust_icu_sys/icu_config", "rust_icu_common/icu_config"] icu_version_in_env = ["rust_icu_sys/icu_version_in_env", "rust_icu_common/icu_version_in_env"] +icu_version_64_plus = [ + "rust_icu_common/icu_version_64_plus", + "rust_icu_sys/icu_version_64_plus", +] +icu_version_67_plus = [ + "rust_icu_common/icu_version_67_plus", + "rust_icu_sys/icu_version_67_plus", +] [badges] maintenance = { status = "actively-developed" }