From 579d52c29165654b8fc50e212bae36a61c119163 Mon Sep 17 00:00:00 2001 From: Ryo Yamashita Date: Thu, 5 Dec 2024 03:55:53 +0900 Subject: [PATCH] fix(ci)!: bump Rust, bump bindgen to v0.70.1, and drop `macos-12` (#33) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: qryxip Refs: actions/runner-images#10721 --- .github/workflows/test.yml | 4 +- crates/open_jtalk-sys/Cargo.toml | 2 +- crates/open_jtalk-sys/build.rs | 4 +- .../src/generated/android/aarch64/bindings.rs | 2396 +++++--------- .../src/generated/android/x86_64/bindings.rs | 2396 +++++--------- .../src/generated/ios/aarch64/bindings.rs | 2704 +++++----------- .../src/generated/linux/aarch64/bindings.rs | 2793 +++++------------ .../src/generated/linux/x86_64/bindings.rs | 2793 +++++------------ .../src/generated/macos/aarch64/bindings.rs | 2704 +++++----------- .../src/generated/macos/x86_64/bindings.rs | 2704 +++++----------- .../src/generated/windows/x86/bindings.rs | 2429 +++++--------- .../src/generated/windows/x86_64/bindings.rs | 2429 +++++--------- crates/open_jtalk/src/text2mecab.rs | 4 +- 13 files changed, 7159 insertions(+), 16203 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9876de1..09b54ef 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,8 +17,8 @@ jobs: include: - os: windows-2019 - os: windows-2022 - - os: macos-11 - - os: macos-12 + - os: macos-13 + - os: macos-14 - os: ubuntu-20.04 - os: ubuntu-22.04 runs-on: ${{ matrix.os }} diff --git a/crates/open_jtalk-sys/Cargo.toml b/crates/open_jtalk-sys/Cargo.toml index bb2d45a..cf36969 100644 --- a/crates/open_jtalk-sys/Cargo.toml +++ b/crates/open_jtalk-sys/Cargo.toml @@ -9,7 +9,7 @@ generate-bindings = [] [build-dependencies] cmake = "0.1.48" -bindgen = "0.62.0" +bindgen = "0.70.1" [dependencies] link-cplusplus = "1.0.6" diff --git a/crates/open_jtalk-sys/build.rs b/crates/open_jtalk-sys/build.rs index a201e7f..3f1b971 100644 --- a/crates/open_jtalk-sys/build.rs +++ b/crates/open_jtalk-sys/build.rs @@ -92,9 +92,9 @@ fn generate_bindings( .header("wrapper.hpp") .allowlist_recursively(true) .clang_args(clang_args) - .parse_callbacks(Box::new(bindgen::CargoCallbacks)) + .parse_callbacks(Box::new(bindgen::CargoCallbacks::new())) .size_t_is_usize(true) - .rustfmt_bindings(true) + .formatter(bindgen::Formatter::Prettyplease) .rustified_enum(".*"); let paths = std::fs::read_dir(include_dir).unwrap(); for path in paths { diff --git a/crates/open_jtalk-sys/src/generated/android/aarch64/bindings.rs b/crates/open_jtalk-sys/src/generated/android/aarch64/bindings.rs index 6ecbdf9..3d8030d 100644 --- a/crates/open_jtalk-sys/src/generated/android/aarch64/bindings.rs +++ b/crates/open_jtalk-sys/src/generated/android/aarch64/bindings.rs @@ -1,542 +1,263 @@ -/* automatically generated by rust-bindgen 0.62.0 */ +/* automatically generated by rust-bindgen 0.70.1 */ pub const TRUE: u32 = 1; pub const FALSE: u32 = 0; -#[doc = " DictionaryInfo structure"] +/// DictionaryInfo structure #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct mecab_dictionary_info_t { - #[doc = " filename of dictionary"] - #[doc = " On Windows, filename is stored in UTF-8 encoding"] + /** filename of dictionary + On Windows, filename is stored in UTF-8 encoding*/ pub filename: *const ::std::os::raw::c_char, - #[doc = " character set of the dictionary. e.g., \"SHIFT-JIS\", \"UTF-8\""] + /// character set of the dictionary. e.g., "SHIFT-JIS", "UTF-8" pub charset: *const ::std::os::raw::c_char, - #[doc = " How many words are registered in this dictionary."] + /// How many words are registered in this dictionary. pub size: ::std::os::raw::c_uint, - #[doc = " dictionary type"] - #[doc = " this value should be MECAB_USR_DIC, MECAB_SYS_DIC, or MECAB_UNK_DIC."] + /** dictionary type + this value should be MECAB_USR_DIC, MECAB_SYS_DIC, or MECAB_UNK_DIC.*/ pub type_: ::std::os::raw::c_int, - #[doc = " left attributes size"] + /// left attributes size pub lsize: ::std::os::raw::c_uint, - #[doc = " right attributes size"] + /// right attributes size pub rsize: ::std::os::raw::c_uint, - #[doc = " version of this dictionary"] + /// version of this dictionary pub version: ::std::os::raw::c_ushort, - #[doc = " pointer to the next dictionary info."] + /// pointer to the next dictionary info. pub next: *mut mecab_dictionary_info_t, } -#[test] -fn bindgen_test_layout_mecab_dictionary_info_t() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 48usize, - concat!("Size of: ", stringify!(mecab_dictionary_info_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(mecab_dictionary_info_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).filename) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(mecab_dictionary_info_t), - "::", - stringify!(filename) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).charset) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(mecab_dictionary_info_t), - "::", - stringify!(charset) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(mecab_dictionary_info_t), - "::", - stringify!(size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(mecab_dictionary_info_t), - "::", - stringify!(type_) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lsize) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(mecab_dictionary_info_t), - "::", - stringify!(lsize) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rsize) as usize - ptr as usize }, - 28usize, - concat!( - "Offset of field: ", - stringify!(mecab_dictionary_info_t), - "::", - stringify!(rsize) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).version) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(mecab_dictionary_info_t), - "::", - stringify!(version) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(mecab_dictionary_info_t), - "::", - stringify!(next) - ) - ); -} -#[doc = " Path structure"] +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + [ + "Size of mecab_dictionary_info_t", + ][::std::mem::size_of::() - 48usize]; + [ + "Alignment of mecab_dictionary_info_t", + ][::std::mem::align_of::() - 8usize]; + [ + "Offset of field: mecab_dictionary_info_t::filename", + ][::std::mem::offset_of!(mecab_dictionary_info_t, filename) - 0usize]; + [ + "Offset of field: mecab_dictionary_info_t::charset", + ][::std::mem::offset_of!(mecab_dictionary_info_t, charset) - 8usize]; + [ + "Offset of field: mecab_dictionary_info_t::size", + ][::std::mem::offset_of!(mecab_dictionary_info_t, size) - 16usize]; + [ + "Offset of field: mecab_dictionary_info_t::type_", + ][::std::mem::offset_of!(mecab_dictionary_info_t, type_) - 20usize]; + [ + "Offset of field: mecab_dictionary_info_t::lsize", + ][::std::mem::offset_of!(mecab_dictionary_info_t, lsize) - 24usize]; + [ + "Offset of field: mecab_dictionary_info_t::rsize", + ][::std::mem::offset_of!(mecab_dictionary_info_t, rsize) - 28usize]; + [ + "Offset of field: mecab_dictionary_info_t::version", + ][::std::mem::offset_of!(mecab_dictionary_info_t, version) - 32usize]; + [ + "Offset of field: mecab_dictionary_info_t::next", + ][::std::mem::offset_of!(mecab_dictionary_info_t, next) - 40usize]; +}; +/// Path structure #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct mecab_path_t { - #[doc = " pointer to the right node"] + /// pointer to the right node pub rnode: *mut mecab_node_t, - #[doc = " pointer to the next right path"] + /// pointer to the next right path pub rnext: *mut mecab_path_t, - #[doc = " pointer to the left node"] + /// pointer to the left node pub lnode: *mut mecab_node_t, - #[doc = " pointer to the next left path"] + /// pointer to the next left path pub lnext: *mut mecab_path_t, - #[doc = " local cost"] + /// local cost pub cost: ::std::os::raw::c_int, - #[doc = " marginal probability"] + /// marginal probability pub prob: f32, } -#[test] -fn bindgen_test_layout_mecab_path_t() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 40usize, - concat!("Size of: ", stringify!(mecab_path_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(mecab_path_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rnode) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(mecab_path_t), - "::", - stringify!(rnode) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rnext) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(mecab_path_t), - "::", - stringify!(rnext) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lnode) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(mecab_path_t), - "::", - stringify!(lnode) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lnext) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(mecab_path_t), - "::", - stringify!(lnext) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cost) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(mecab_path_t), - "::", - stringify!(cost) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prob) as usize - ptr as usize }, - 36usize, - concat!( - "Offset of field: ", - stringify!(mecab_path_t), - "::", - stringify!(prob) - ) - ); -} -#[doc = " Node structure"] +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of mecab_path_t"][::std::mem::size_of::() - 40usize]; + ["Alignment of mecab_path_t"][::std::mem::align_of::() - 8usize]; + [ + "Offset of field: mecab_path_t::rnode", + ][::std::mem::offset_of!(mecab_path_t, rnode) - 0usize]; + [ + "Offset of field: mecab_path_t::rnext", + ][::std::mem::offset_of!(mecab_path_t, rnext) - 8usize]; + [ + "Offset of field: mecab_path_t::lnode", + ][::std::mem::offset_of!(mecab_path_t, lnode) - 16usize]; + [ + "Offset of field: mecab_path_t::lnext", + ][::std::mem::offset_of!(mecab_path_t, lnext) - 24usize]; + [ + "Offset of field: mecab_path_t::cost", + ][::std::mem::offset_of!(mecab_path_t, cost) - 32usize]; + [ + "Offset of field: mecab_path_t::prob", + ][::std::mem::offset_of!(mecab_path_t, prob) - 36usize]; +}; +/// Node structure #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct mecab_node_t { - #[doc = " pointer to the previous node."] + /// pointer to the previous node. pub prev: *mut mecab_node_t, - #[doc = " pointer to the next node."] + /// pointer to the next node. pub next: *mut mecab_node_t, - #[doc = " pointer to the node which ends at the same position."] + /// pointer to the node which ends at the same position. pub enext: *mut mecab_node_t, - #[doc = " pointer to the node which starts at the same position."] + /// pointer to the node which starts at the same position. pub bnext: *mut mecab_node_t, - #[doc = " pointer to the right path."] - #[doc = " this value is NULL if MECAB_ONE_BEST mode."] + /** pointer to the right path. + this value is NULL if MECAB_ONE_BEST mode.*/ pub rpath: *mut mecab_path_t, - #[doc = " pointer to the right path."] - #[doc = " this value is NULL if MECAB_ONE_BEST mode."] + /** pointer to the right path. + this value is NULL if MECAB_ONE_BEST mode.*/ pub lpath: *mut mecab_path_t, - #[doc = " surface string."] - #[doc = " this value is not 0 terminated."] - #[doc = " You can get the length with length/rlength members."] + /** surface string. + this value is not 0 terminated. + You can get the length with length/rlength members.*/ pub surface: *const ::std::os::raw::c_char, - #[doc = " feature string"] + /// feature string pub feature: *const ::std::os::raw::c_char, - #[doc = " unique node id"] + /// unique node id pub id: ::std::os::raw::c_uint, - #[doc = " length of the surface form."] + /// length of the surface form. pub length: ::std::os::raw::c_ushort, - #[doc = " length of the surface form including white space before the morph."] + /// length of the surface form including white space before the morph. pub rlength: ::std::os::raw::c_ushort, - #[doc = " right attribute id"] + /// right attribute id pub rcAttr: ::std::os::raw::c_ushort, - #[doc = " left attribute id"] + /// left attribute id pub lcAttr: ::std::os::raw::c_ushort, - #[doc = " unique part of speech id. This value is defined in \"pos.def\" file."] + /// unique part of speech id. This value is defined in "pos.def" file. pub posid: ::std::os::raw::c_ushort, - #[doc = " character type"] + /// character type pub char_type: ::std::os::raw::c_uchar, - #[doc = " status of this model."] - #[doc = " This value is MECAB_NOR_NODE, MECAB_UNK_NODE, MECAB_BOS_NODE, MECAB_EOS_NODE, or MECAB_EON_NODE."] + /** status of this model. + This value is MECAB_NOR_NODE, MECAB_UNK_NODE, MECAB_BOS_NODE, MECAB_EOS_NODE, or MECAB_EON_NODE.*/ pub stat: ::std::os::raw::c_uchar, - #[doc = " set 1 if this node is best node."] + /// set 1 if this node is best node. pub isbest: ::std::os::raw::c_uchar, - #[doc = " forward accumulative log summation."] - #[doc = " This value is only available when MECAB_MARGINAL_PROB is passed."] + /** forward accumulative log summation. + This value is only available when MECAB_MARGINAL_PROB is passed.*/ pub alpha: f32, - #[doc = " backward accumulative log summation."] - #[doc = " This value is only available when MECAB_MARGINAL_PROB is passed."] + /** backward accumulative log summation. + This value is only available when MECAB_MARGINAL_PROB is passed.*/ pub beta: f32, - #[doc = " marginal probability."] - #[doc = " This value is only available when MECAB_MARGINAL_PROB is passed."] + /** marginal probability. + This value is only available when MECAB_MARGINAL_PROB is passed.*/ pub prob: f32, - #[doc = " word cost."] + /// word cost. pub wcost: ::std::os::raw::c_short, - #[doc = " best accumulative cost from bos node to this node."] + /// best accumulative cost from bos node to this node. pub cost: ::std::os::raw::c_long, } -#[test] -fn bindgen_test_layout_mecab_node_t() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 112usize, - concat!("Size of: ", stringify!(mecab_node_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(mecab_node_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(prev) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(next) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).enext) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(enext) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).bnext) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(bnext) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rpath) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(rpath) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lpath) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(lpath) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).surface) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(surface) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).feature) as usize - ptr as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(feature) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).id) as usize - ptr as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(id) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).length) as usize - ptr as usize }, - 68usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(length) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rlength) as usize - ptr as usize }, - 70usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(rlength) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rcAttr) as usize - ptr as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(rcAttr) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lcAttr) as usize - ptr as usize }, - 74usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(lcAttr) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).posid) as usize - ptr as usize }, - 76usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(posid) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).char_type) as usize - ptr as usize }, - 78usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(char_type) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).stat) as usize - ptr as usize }, - 79usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(stat) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).isbest) as usize - ptr as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(isbest) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).alpha) as usize - ptr as usize }, - 84usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(alpha) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).beta) as usize - ptr as usize }, - 88usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(beta) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prob) as usize - ptr as usize }, - 92usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(prob) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).wcost) as usize - ptr as usize }, - 96usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(wcost) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cost) as usize - ptr as usize }, - 104usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(cost) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of mecab_node_t"][::std::mem::size_of::() - 112usize]; + ["Alignment of mecab_node_t"][::std::mem::align_of::() - 8usize]; + [ + "Offset of field: mecab_node_t::prev", + ][::std::mem::offset_of!(mecab_node_t, prev) - 0usize]; + [ + "Offset of field: mecab_node_t::next", + ][::std::mem::offset_of!(mecab_node_t, next) - 8usize]; + [ + "Offset of field: mecab_node_t::enext", + ][::std::mem::offset_of!(mecab_node_t, enext) - 16usize]; + [ + "Offset of field: mecab_node_t::bnext", + ][::std::mem::offset_of!(mecab_node_t, bnext) - 24usize]; + [ + "Offset of field: mecab_node_t::rpath", + ][::std::mem::offset_of!(mecab_node_t, rpath) - 32usize]; + [ + "Offset of field: mecab_node_t::lpath", + ][::std::mem::offset_of!(mecab_node_t, lpath) - 40usize]; + [ + "Offset of field: mecab_node_t::surface", + ][::std::mem::offset_of!(mecab_node_t, surface) - 48usize]; + [ + "Offset of field: mecab_node_t::feature", + ][::std::mem::offset_of!(mecab_node_t, feature) - 56usize]; + [ + "Offset of field: mecab_node_t::id", + ][::std::mem::offset_of!(mecab_node_t, id) - 64usize]; + [ + "Offset of field: mecab_node_t::length", + ][::std::mem::offset_of!(mecab_node_t, length) - 68usize]; + [ + "Offset of field: mecab_node_t::rlength", + ][::std::mem::offset_of!(mecab_node_t, rlength) - 70usize]; + [ + "Offset of field: mecab_node_t::rcAttr", + ][::std::mem::offset_of!(mecab_node_t, rcAttr) - 72usize]; + [ + "Offset of field: mecab_node_t::lcAttr", + ][::std::mem::offset_of!(mecab_node_t, lcAttr) - 74usize]; + [ + "Offset of field: mecab_node_t::posid", + ][::std::mem::offset_of!(mecab_node_t, posid) - 76usize]; + [ + "Offset of field: mecab_node_t::char_type", + ][::std::mem::offset_of!(mecab_node_t, char_type) - 78usize]; + [ + "Offset of field: mecab_node_t::stat", + ][::std::mem::offset_of!(mecab_node_t, stat) - 79usize]; + [ + "Offset of field: mecab_node_t::isbest", + ][::std::mem::offset_of!(mecab_node_t, isbest) - 80usize]; + [ + "Offset of field: mecab_node_t::alpha", + ][::std::mem::offset_of!(mecab_node_t, alpha) - 84usize]; + [ + "Offset of field: mecab_node_t::beta", + ][::std::mem::offset_of!(mecab_node_t, beta) - 88usize]; + [ + "Offset of field: mecab_node_t::prob", + ][::std::mem::offset_of!(mecab_node_t, prob) - 92usize]; + [ + "Offset of field: mecab_node_t::wcost", + ][::std::mem::offset_of!(mecab_node_t, wcost) - 96usize]; + [ + "Offset of field: mecab_node_t::cost", + ][::std::mem::offset_of!(mecab_node_t, cost) - 104usize]; +}; pub const MECAB_NOR_NODE: _bindgen_ty_1 = _bindgen_ty_1::MECAB_NOR_NODE; pub const MECAB_UNK_NODE: _bindgen_ty_1 = _bindgen_ty_1::MECAB_UNK_NODE; pub const MECAB_BOS_NODE: _bindgen_ty_1 = _bindgen_ty_1::MECAB_BOS_NODE; pub const MECAB_EOS_NODE: _bindgen_ty_1 = _bindgen_ty_1::MECAB_EOS_NODE; pub const MECAB_EON_NODE: _bindgen_ty_1 = _bindgen_ty_1::MECAB_EON_NODE; #[repr(u32)] -#[doc = " Parameters for MeCab::Node::stat"] +/// Parameters for MeCab::Node::stat #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum _bindgen_ty_1 { - #[doc = " Normal node defined in the dictionary."] + /// Normal node defined in the dictionary. MECAB_NOR_NODE = 0, - #[doc = " Unknown node not defined in the dictionary."] + /// Unknown node not defined in the dictionary. MECAB_UNK_NODE = 1, - #[doc = " Virtual node representing a beginning of the sentence."] + /// Virtual node representing a beginning of the sentence. MECAB_BOS_NODE = 2, - #[doc = " Virtual node representing a end of the sentence."] + /// Virtual node representing a end of the sentence. MECAB_EOS_NODE = 3, - #[doc = " Virtual node representing a end of the N-best enumeration."] + /// Virtual node representing a end of the N-best enumeration. MECAB_EON_NODE = 4, } pub const MECAB_SYS_DIC: _bindgen_ty_2 = _bindgen_ty_2::MECAB_SYS_DIC; pub const MECAB_USR_DIC: _bindgen_ty_2 = _bindgen_ty_2::MECAB_USR_DIC; pub const MECAB_UNK_DIC: _bindgen_ty_2 = _bindgen_ty_2::MECAB_UNK_DIC; #[repr(u32)] -#[doc = " Parameters for MeCab::DictionaryInfo::type"] +/// Parameters for MeCab::DictionaryInfo::type #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum _bindgen_ty_2 { - #[doc = " This is a system dictionary."] + /// This is a system dictionary. MECAB_SYS_DIC = 0, - #[doc = " This is a user dictionary."] + /// This is a user dictionary. MECAB_USR_DIC = 1, - #[doc = " This is a unknown word dictionary."] + /// This is a unknown word dictionary. MECAB_UNK_DIC = 2, } pub const MECAB_ONE_BEST: _bindgen_ty_3 = _bindgen_ty_3::MECAB_ONE_BEST; @@ -547,43 +268,43 @@ pub const MECAB_ALTERNATIVE: _bindgen_ty_3 = _bindgen_ty_3::MECAB_ALTERNATIVE; pub const MECAB_ALL_MORPHS: _bindgen_ty_3 = _bindgen_ty_3::MECAB_ALL_MORPHS; pub const MECAB_ALLOCATE_SENTENCE: _bindgen_ty_3 = _bindgen_ty_3::MECAB_ALLOCATE_SENTENCE; #[repr(u32)] -#[doc = " Parameters for MeCab::Lattice::request_type"] +/// Parameters for MeCab::Lattice::request_type #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum _bindgen_ty_3 { - #[doc = " One best result is obtained (default mode)"] + /// One best result is obtained (default mode) MECAB_ONE_BEST = 1, - #[doc = " Set this flag if you want to obtain N best results."] + /// Set this flag if you want to obtain N best results. MECAB_NBEST = 2, - #[doc = " Set this flag if you want to enable a partial parsing mode."] - #[doc = " When this flag is set, the input |sentence| needs to be written"] - #[doc = " in partial parsing format."] + /** Set this flag if you want to enable a partial parsing mode. + When this flag is set, the input |sentence| needs to be written + in partial parsing format.*/ MECAB_PARTIAL = 4, - #[doc = " Set this flag if you want to obtain marginal probabilities."] - #[doc = " Marginal probability is set in MeCab::Node::prob."] - #[doc = " The parsing speed will get 3-5 times slower than the default mode."] + /** Set this flag if you want to obtain marginal probabilities. + Marginal probability is set in MeCab::Node::prob. + The parsing speed will get 3-5 times slower than the default mode.*/ MECAB_MARGINAL_PROB = 8, - #[doc = " Set this flag if you want to obtain alternative results."] - #[doc = " Not implemented."] + /** Set this flag if you want to obtain alternative results. + Not implemented.*/ MECAB_ALTERNATIVE = 16, - #[doc = " When this flag is set, the result linked-list (Node::next/prev)"] - #[doc = " traverses all nodes in the lattice."] + /** When this flag is set, the result linked-list (Node::next/prev) + traverses all nodes in the lattice.*/ MECAB_ALL_MORPHS = 32, - #[doc = " When this flag is set, tagger internally copies the body of passed"] - #[doc = " sentence into internal buffer."] + /** When this flag is set, tagger internally copies the body of passed + sentence into internal buffer.*/ MECAB_ALLOCATE_SENTENCE = 64, } pub const MECAB_ANY_BOUNDARY: _bindgen_ty_4 = _bindgen_ty_4::MECAB_ANY_BOUNDARY; pub const MECAB_TOKEN_BOUNDARY: _bindgen_ty_4 = _bindgen_ty_4::MECAB_TOKEN_BOUNDARY; pub const MECAB_INSIDE_TOKEN: _bindgen_ty_4 = _bindgen_ty_4::MECAB_INSIDE_TOKEN; #[repr(u32)] -#[doc = " Parameters for MeCab::Lattice::boundary_constraint_type"] +/// Parameters for MeCab::Lattice::boundary_constraint_type #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum _bindgen_ty_4 { - #[doc = " The token boundary is not specified."] + /// The token boundary is not specified. MECAB_ANY_BOUNDARY = 0, - #[doc = " The position is a strong token boundary."] + /// The position is a strong token boundary. MECAB_TOKEN_BOUNDARY = 1, - #[doc = " The position is not a token boundary."] + /// The position is not a token boundary. MECAB_INSIDE_TOKEN = 2, } #[repr(C)] @@ -608,76 +329,76 @@ pub struct mecab_lattice_t { _unused: [u8; 0], } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::create(argc, argv)"] + /// C wrapper of MeCab::Tagger::create(argc, argv) pub fn mecab_new( argc: ::std::os::raw::c_int, argv: *mut *mut ::std::os::raw::c_char, ) -> *mut mecab_t; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::create(arg)"] + /// C wrapper of MeCab::Tagger::create(arg) pub fn mecab_new2(arg: *const ::std::os::raw::c_char) -> *mut mecab_t; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::version()"] + /// C wrapper of MeCab::Tagger::version() pub fn mecab_version() -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::getLastError()"] + /// C wrapper of MeCab::getLastError() pub fn mecab_strerror(mecab: *mut mecab_t) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::deleteTagger(tagger)"] + /// C wrapper of MeCab::deleteTagger(tagger) pub fn mecab_destroy(mecab: *mut mecab_t); } extern "C" { - #[doc = " C wrapper of MeCab::Tagger:set_partial()"] + /// C wrapper of MeCab::Tagger:set_partial() pub fn mecab_get_partial(mecab: *mut mecab_t) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::partial()"] + /// C wrapper of MeCab::Tagger::partial() pub fn mecab_set_partial(mecab: *mut mecab_t, partial: ::std::os::raw::c_int); } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::theta()"] + /// C wrapper of MeCab::Tagger::theta() pub fn mecab_get_theta(mecab: *mut mecab_t) -> f32; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::set_theta()"] + /// C wrapper of MeCab::Tagger::set_theta() pub fn mecab_set_theta(mecab: *mut mecab_t, theta: f32); } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::lattice_level()"] + /// C wrapper of MeCab::Tagger::lattice_level() pub fn mecab_get_lattice_level(mecab: *mut mecab_t) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::set_lattice_level()"] + /// C wrapper of MeCab::Tagger::set_lattice_level() pub fn mecab_set_lattice_level(mecab: *mut mecab_t, level: ::std::os::raw::c_int); } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::all_morphs()"] + /// C wrapper of MeCab::Tagger::all_morphs() pub fn mecab_get_all_morphs(mecab: *mut mecab_t) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::set_all_moprhs()"] + /// C wrapper of MeCab::Tagger::set_all_moprhs() pub fn mecab_set_all_morphs(mecab: *mut mecab_t, all_morphs: ::std::os::raw::c_int); } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parse(MeCab::Lattice *lattice)"] + /// C wrapper of MeCab::Tagger::parse(MeCab::Lattice *lattice) pub fn mecab_parse_lattice( mecab: *mut mecab_t, lattice: *mut mecab_lattice_t, ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parse(const char *str)"] + /// C wrapper of MeCab::Tagger::parse(const char *str) pub fn mecab_sparse_tostr( mecab: *mut mecab_t, str_: *const ::std::os::raw::c_char, ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parse(const char *str, size_t len)"] + /// C wrapper of MeCab::Tagger::parse(const char *str, size_t len) pub fn mecab_sparse_tostr2( mecab: *mut mecab_t, str_: *const ::std::os::raw::c_char, @@ -685,7 +406,7 @@ extern "C" { ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parse(const char *str, char *ostr, size_t olen)"] + /// C wrapper of MeCab::Tagger::parse(const char *str, char *ostr, size_t olen) pub fn mecab_sparse_tostr3( mecab: *mut mecab_t, str_: *const ::std::os::raw::c_char, @@ -695,14 +416,14 @@ extern "C" { ) -> *mut ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parseToNode(const char *str)"] + /// C wrapper of MeCab::Tagger::parseToNode(const char *str) pub fn mecab_sparse_tonode( mecab: *mut mecab_t, arg1: *const ::std::os::raw::c_char, ) -> *const mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parseToNode(const char *str, size_t len)"] + /// C wrapper of MeCab::Tagger::parseToNode(const char *str, size_t len) pub fn mecab_sparse_tonode2( mecab: *mut mecab_t, arg1: *const ::std::os::raw::c_char, @@ -710,7 +431,7 @@ extern "C" { ) -> *const mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parseNBest(size_t N, const char *str)"] + /// C wrapper of MeCab::Tagger::parseNBest(size_t N, const char *str) pub fn mecab_nbest_sparse_tostr( mecab: *mut mecab_t, N: usize, @@ -718,7 +439,7 @@ extern "C" { ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parseNBest(size_t N, const char *str, size_t len)"] + /// C wrapper of MeCab::Tagger::parseNBest(size_t N, const char *str, size_t len) pub fn mecab_nbest_sparse_tostr2( mecab: *mut mecab_t, N: usize, @@ -727,7 +448,7 @@ extern "C" { ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parseNBest(size_t N, const char *str, char *ostr, size_t olen)"] + /// C wrapper of MeCab::Tagger::parseNBest(size_t N, const char *str, char *ostr, size_t olen) pub fn mecab_nbest_sparse_tostr3( mecab: *mut mecab_t, N: usize, @@ -738,14 +459,14 @@ extern "C" { ) -> *mut ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parseNBestInit(const char *str)"] + /// C wrapper of MeCab::Tagger::parseNBestInit(const char *str) pub fn mecab_nbest_init( mecab: *mut mecab_t, str_: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parseNBestInit(const char *str, size_t len)"] + /// C wrapper of MeCab::Tagger::parseNBestInit(const char *str, size_t len) pub fn mecab_nbest_init2( mecab: *mut mecab_t, str_: *const ::std::os::raw::c_char, @@ -753,11 +474,11 @@ extern "C" { ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::next()"] + /// C wrapper of MeCab::Tagger::next() pub fn mecab_nbest_next_tostr(mecab: *mut mecab_t) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::next(char *ostr, size_t olen)"] + /// C wrapper of MeCab::Tagger::next(char *ostr, size_t olen) pub fn mecab_nbest_next_tostr2( mecab: *mut mecab_t, ostr: *mut ::std::os::raw::c_char, @@ -765,84 +486,91 @@ extern "C" { ) -> *mut ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::nextNode()"] + /// C wrapper of MeCab::Tagger::nextNode() pub fn mecab_nbest_next_tonode(mecab: *mut mecab_t) -> *const mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::formatNode(const Node *node)"] + /// C wrapper of MeCab::Tagger::formatNode(const Node *node) pub fn mecab_format_node( mecab: *mut mecab_t, node: *const mecab_node_t, ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::dictionary_info()"] + /// C wrapper of MeCab::Tagger::dictionary_info() pub fn mecab_dictionary_info(mecab: *mut mecab_t) -> *const mecab_dictionary_info_t; } extern "C" { - #[doc = " C wrapper of MeCab::createLattice()"] + /// C wrapper of MeCab::createLattice() pub fn mecab_lattice_new() -> *mut mecab_lattice_t; } extern "C" { - #[doc = " C wrapper of MeCab::deleteLattice(lattice)"] + /// C wrapper of MeCab::deleteLattice(lattice) pub fn mecab_lattice_destroy(lattice: *mut mecab_lattice_t); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::clear()"] + /// C wrapper of MeCab::Lattice::clear() pub fn mecab_lattice_clear(lattice: *mut mecab_lattice_t); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::is_available()"] - pub fn mecab_lattice_is_available(lattice: *mut mecab_lattice_t) -> ::std::os::raw::c_int; + /// C wrapper of MeCab::Lattice::is_available() + pub fn mecab_lattice_is_available( + lattice: *mut mecab_lattice_t, + ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::bos_node()"] - pub fn mecab_lattice_get_bos_node(lattice: *mut mecab_lattice_t) -> *mut mecab_node_t; + /// C wrapper of MeCab::Lattice::bos_node() + pub fn mecab_lattice_get_bos_node( + lattice: *mut mecab_lattice_t, + ) -> *mut mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::eos_node()"] - pub fn mecab_lattice_get_eos_node(lattice: *mut mecab_lattice_t) -> *mut mecab_node_t; + /// C wrapper of MeCab::Lattice::eos_node() + pub fn mecab_lattice_get_eos_node( + lattice: *mut mecab_lattice_t, + ) -> *mut mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::begin_nodes()"] + /// C wrapper of MeCab::Lattice::begin_nodes() pub fn mecab_lattice_get_all_begin_nodes( lattice: *mut mecab_lattice_t, ) -> *mut *mut mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::end_nodes()"] - pub fn mecab_lattice_get_all_end_nodes(lattice: *mut mecab_lattice_t) - -> *mut *mut mecab_node_t; + /// C wrapper of MeCab::Lattice::end_nodes() + pub fn mecab_lattice_get_all_end_nodes( + lattice: *mut mecab_lattice_t, + ) -> *mut *mut mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::begin_nodes(pos)"] + /// C wrapper of MeCab::Lattice::begin_nodes(pos) pub fn mecab_lattice_get_begin_nodes( lattice: *mut mecab_lattice_t, pos: usize, ) -> *mut mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::end_nodes(pos)"] + /// C wrapper of MeCab::Lattice::end_nodes(pos) pub fn mecab_lattice_get_end_nodes( lattice: *mut mecab_lattice_t, pos: usize, ) -> *mut mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::sentence()"] + /// C wrapper of MeCab::Lattice::sentence() pub fn mecab_lattice_get_sentence( lattice: *mut mecab_lattice_t, ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::set_sentence(sentence)"] + /// C wrapper of MeCab::Lattice::set_sentence(sentence) pub fn mecab_lattice_set_sentence( lattice: *mut mecab_lattice_t, sentence: *const ::std::os::raw::c_char, ); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::set_sentence(sentence, len)"] + /// C wrapper of MeCab::Lattice::set_sentence(sentence, len) pub fn mecab_lattice_set_sentence2( lattice: *mut mecab_lattice_t, sentence: *const ::std::os::raw::c_char, @@ -850,71 +578,75 @@ extern "C" { ); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::size()"] + /// C wrapper of MeCab::Lattice::size() pub fn mecab_lattice_get_size(lattice: *mut mecab_lattice_t) -> usize; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::Z()"] + /// C wrapper of MeCab::Lattice::Z() pub fn mecab_lattice_get_z(lattice: *mut mecab_lattice_t) -> f64; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::set_Z()"] + /// C wrapper of MeCab::Lattice::set_Z() pub fn mecab_lattice_set_z(lattice: *mut mecab_lattice_t, Z: f64); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::theta()"] + /// C wrapper of MeCab::Lattice::theta() pub fn mecab_lattice_get_theta(lattice: *mut mecab_lattice_t) -> f64; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::set_theta()"] + /// C wrapper of MeCab::Lattice::set_theta() pub fn mecab_lattice_set_theta(lattice: *mut mecab_lattice_t, theta: f64); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::next()"] + /// C wrapper of MeCab::Lattice::next() pub fn mecab_lattice_next(lattice: *mut mecab_lattice_t) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::request_type()"] - pub fn mecab_lattice_get_request_type(lattice: *mut mecab_lattice_t) -> ::std::os::raw::c_int; + /// C wrapper of MeCab::Lattice::request_type() + pub fn mecab_lattice_get_request_type( + lattice: *mut mecab_lattice_t, + ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::has_request_type()"] + /// C wrapper of MeCab::Lattice::has_request_type() pub fn mecab_lattice_has_request_type( lattice: *mut mecab_lattice_t, request_type: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::set_request_type()"] + /// C wrapper of MeCab::Lattice::set_request_type() pub fn mecab_lattice_set_request_type( lattice: *mut mecab_lattice_t, request_type: ::std::os::raw::c_int, ); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::add_request_type()"] + /// C wrapper of MeCab::Lattice::add_request_type() pub fn mecab_lattice_add_request_type( lattice: *mut mecab_lattice_t, request_type: ::std::os::raw::c_int, ); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::remove_request_type()"] + /// C wrapper of MeCab::Lattice::remove_request_type() pub fn mecab_lattice_remove_request_type( lattice: *mut mecab_lattice_t, request_type: ::std::os::raw::c_int, ); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::newNode();"] + /// C wrapper of MeCab::Lattice::newNode(); pub fn mecab_lattice_new_node(lattice: *mut mecab_lattice_t) -> *mut mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::toString()"] - pub fn mecab_lattice_tostr(lattice: *mut mecab_lattice_t) -> *const ::std::os::raw::c_char; + /// C wrapper of MeCab::Lattice::toString() + pub fn mecab_lattice_tostr( + lattice: *mut mecab_lattice_t, + ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::toString(buf, size)"] + /// C wrapper of MeCab::Lattice::toString(buf, size) pub fn mecab_lattice_tostr2( lattice: *mut mecab_lattice_t, buf: *mut ::std::os::raw::c_char, @@ -922,14 +654,14 @@ extern "C" { ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::enumNBestAsString(N)"] + /// C wrapper of MeCab::Lattice::enumNBestAsString(N) pub fn mecab_lattice_nbest_tostr( lattice: *mut mecab_lattice_t, N: usize, ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::enumNBestAsString(N, buf, size)"] + /// C wrapper of MeCab::Lattice::enumNBestAsString(N, buf, size) pub fn mecab_lattice_nbest_tostr2( lattice: *mut mecab_lattice_t, N: usize, @@ -938,25 +670,27 @@ extern "C" { ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::has_constraint()"] - pub fn mecab_lattice_has_constraint(lattice: *mut mecab_lattice_t) -> ::std::os::raw::c_int; + /// C wrapper of MeCab::Lattice::has_constraint() + pub fn mecab_lattice_has_constraint( + lattice: *mut mecab_lattice_t, + ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::boundary_constraint(pos)"] + /// C wrapper of MeCab::Lattice::boundary_constraint(pos) pub fn mecab_lattice_get_boundary_constraint( lattice: *mut mecab_lattice_t, pos: usize, ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::feature_constraint(pos)"] + /// C wrapper of MeCab::Lattice::feature_constraint(pos) pub fn mecab_lattice_get_feature_constraint( lattice: *mut mecab_lattice_t, pos: usize, ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::boundary_constraint(pos, type)"] + /// C wrapper of MeCab::Lattice::boundary_constraint(pos, type) pub fn mecab_lattice_set_boundary_constraint( lattice: *mut mecab_lattice_t, pos: usize, @@ -964,7 +698,7 @@ extern "C" { ); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::set_feature_constraint(begin_pos, end_pos, feature)"] + /// C wrapper of MeCab::Lattice::set_feature_constraint(begin_pos, end_pos, feature) pub fn mecab_lattice_set_feature_constraint( lattice: *mut mecab_lattice_t, begin_pos: usize, @@ -973,53 +707,56 @@ extern "C" { ); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::set_result(result);"] + /// C wrapper of MeCab::Lattice::set_result(result); pub fn mecab_lattice_set_result( lattice: *mut mecab_lattice_t, result: *const ::std::os::raw::c_char, ); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::what()"] - pub fn mecab_lattice_strerror(lattice: *mut mecab_lattice_t) -> *const ::std::os::raw::c_char; + /// C wrapper of MeCab::Lattice::what() + pub fn mecab_lattice_strerror( + lattice: *mut mecab_lattice_t, + ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wapper of MeCab::Model::create(argc, argv)"] + /// C wapper of MeCab::Model::create(argc, argv) pub fn mecab_model_new( argc: ::std::os::raw::c_int, argv: *mut *mut ::std::os::raw::c_char, ) -> *mut mecab_model_t; } extern "C" { - #[doc = " C wapper of MeCab::Model::create(arg)"] + /// C wapper of MeCab::Model::create(arg) pub fn mecab_model_new2(arg: *const ::std::os::raw::c_char) -> *mut mecab_model_t; } extern "C" { - #[doc = " C wapper of MeCab::deleteModel(model)"] + /// C wapper of MeCab::deleteModel(model) pub fn mecab_model_destroy(model: *mut mecab_model_t); } extern "C" { - #[doc = " C wapper of MeCab::Model::createTagger()"] + /// C wapper of MeCab::Model::createTagger() pub fn mecab_model_new_tagger(model: *mut mecab_model_t) -> *mut mecab_t; } extern "C" { - #[doc = " C wapper of MeCab::Model::createLattice()"] + /// C wapper of MeCab::Model::createLattice() pub fn mecab_model_new_lattice(model: *mut mecab_model_t) -> *mut mecab_lattice_t; } extern "C" { - #[doc = " C wrapper of MeCab::Model::swap()"] + /// C wrapper of MeCab::Model::swap() pub fn mecab_model_swap( model: *mut mecab_model_t, new_model: *mut mecab_model_t, ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wapper of MeCab::Model::dictionary_info()"] - pub fn mecab_model_dictionary_info(model: *mut mecab_model_t) - -> *const mecab_dictionary_info_t; + /// C wapper of MeCab::Model::dictionary_info() + pub fn mecab_model_dictionary_info( + model: *mut mecab_model_t, + ) -> *const mecab_dictionary_info_t; } extern "C" { - #[doc = " C wrapper of MeCab::Model::transition_cost()"] + /// C wrapper of MeCab::Model::transition_cost() pub fn mecab_model_transition_cost( model: *mut mecab_model_t, rcAttr: ::std::os::raw::c_ushort, @@ -1027,7 +764,7 @@ extern "C" { ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Model::lookup()"] + /// C wrapper of MeCab::Model::lookup() pub fn mecab_model_lookup( model: *mut mecab_model_t, begin: *const ::std::os::raw::c_char, @@ -1071,11 +808,11 @@ extern "C" { argv: *mut *mut ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } -#[doc = " DictionaryInfo structure"] +/// DictionaryInfo structure pub type MeCab_DictionaryInfo = mecab_dictionary_info_t; -#[doc = " Path structure"] +/// Path structure pub type MeCab_Path = mecab_path_t; -#[doc = " Node structure"] +/// Node structure pub type MeCab_Node = mecab_node_t; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -1084,71 +821,55 @@ pub struct MeCab_Allocator { } #[repr(C)] pub struct MeCab_Lattice__bindgen_vtable(::std::os::raw::c_void); -#[doc = " Lattice class"] +/// Lattice class #[repr(C)] #[derive(Debug)] pub struct MeCab_Lattice { pub vtable_: *const MeCab_Lattice__bindgen_vtable, } -#[test] -fn bindgen_test_layout_MeCab_Lattice() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(MeCab_Lattice)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(MeCab_Lattice)) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of MeCab_Lattice"][::std::mem::size_of::() - 8usize]; + ["Alignment of MeCab_Lattice"][::std::mem::align_of::() - 8usize]; +}; extern "C" { - #[doc = " Create new Lattice object"] - #[doc = " @return new Lattice object"] + /** Create new Lattice object + @return new Lattice object*/ #[link_name = "\u{1}_ZN5MeCab7Lattice6createEv"] pub fn MeCab_Lattice_create() -> *mut MeCab_Lattice; } impl MeCab_Lattice { #[inline] pub unsafe fn create() -> *mut MeCab_Lattice { - unsafe { MeCab_Lattice_create() } + MeCab_Lattice_create() } } #[repr(C)] pub struct MeCab_Model__bindgen_vtable(::std::os::raw::c_void); -#[doc = " Model class"] +/// Model class #[repr(C)] #[derive(Debug)] pub struct MeCab_Model { pub vtable_: *const MeCab_Model__bindgen_vtable, } -#[test] -fn bindgen_test_layout_MeCab_Model() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(MeCab_Model)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(MeCab_Model)) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of MeCab_Model"][::std::mem::size_of::() - 8usize]; + ["Alignment of MeCab_Model"][::std::mem::align_of::() - 8usize]; +}; extern "C" { - #[doc = " Return a version string"] - #[doc = " @return version string"] + /** Return a version string + @return version string*/ #[link_name = "\u{1}_ZN5MeCab5Model7versionEv"] pub fn MeCab_Model_version() -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " Factory method to create a new Model with a specified main's argc/argv-style parameters."] - #[doc = " Return NULL if new model cannot be initialized. Use MeCab::getLastError() to obtain the"] - #[doc = " cause of the errors."] - #[doc = " @return new Model object"] - #[doc = " @param argc number of parameters"] - #[doc = " @param argv parameter list"] + /** Factory method to create a new Model with a specified main's argc/argv-style parameters. + Return NULL if new model cannot be initialized. Use MeCab::getLastError() to obtain the + cause of the errors. + @return new Model object + @param argc number of parameters + @param argv parameter list*/ #[link_name = "\u{1}_ZN5MeCab5Model6createEiPPc"] pub fn MeCab_Model_create( argc: ::std::os::raw::c_int, @@ -1156,74 +877,69 @@ extern "C" { ) -> *mut MeCab_Model; } extern "C" { - #[doc = " Factory method to create a new Model with a string parameter representation, i.e.,"] - #[doc = " \"-d /user/local/mecab/dic/ipadic -Ochasen\"."] - #[doc = " Return NULL if new model cannot be initialized. Use MeCab::getLastError() to obtain the"] - #[doc = " cause of the errors."] - #[doc = " @return new Model object"] - #[doc = " @param arg single string representation of the argment."] + /** Factory method to create a new Model with a string parameter representation, i.e., + "-d /user/local/mecab/dic/ipadic -Ochasen". + Return NULL if new model cannot be initialized. Use MeCab::getLastError() to obtain the + cause of the errors. + @return new Model object + @param arg single string representation of the argment.*/ #[link_name = "\u{1}_ZN5MeCab5Model6createEPKc"] pub fn MeCab_Model_create1(arg: *const ::std::os::raw::c_char) -> *mut MeCab_Model; } impl MeCab_Model { #[inline] pub unsafe fn version() -> *const ::std::os::raw::c_char { - unsafe { MeCab_Model_version() } + MeCab_Model_version() } #[inline] pub unsafe fn create( argc: ::std::os::raw::c_int, argv: *mut *mut ::std::os::raw::c_char, ) -> *mut MeCab_Model { - unsafe { MeCab_Model_create(argc, argv) } + MeCab_Model_create(argc, argv) } #[inline] pub unsafe fn create1(arg: *const ::std::os::raw::c_char) -> *mut MeCab_Model { - unsafe { MeCab_Model_create1(arg) } + MeCab_Model_create1(arg) } } #[repr(C)] pub struct MeCab_Tagger__bindgen_vtable(::std::os::raw::c_void); -#[doc = " Tagger class"] +/// Tagger class #[repr(C)] #[derive(Debug)] pub struct MeCab_Tagger { pub vtable_: *const MeCab_Tagger__bindgen_vtable, } -#[test] -fn bindgen_test_layout_MeCab_Tagger() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(MeCab_Tagger)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(MeCab_Tagger)) - ); -} -extern "C" { - #[doc = " Handy static method."] - #[doc = " Return true if lattice is parsed successfully."] - #[doc = " This function is equivalent to"] - #[doc = " {"] - #[doc = " Tagger *tagger = model.createModel();"] - #[doc = " cosnt bool result = tagger->parse(lattice);"] - #[doc = " delete tagger;"] - #[doc = " return result;"] - #[doc = " }"] - #[doc = " @return boolean"] +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of MeCab_Tagger"][::std::mem::size_of::() - 8usize]; + ["Alignment of MeCab_Tagger"][::std::mem::align_of::() - 8usize]; +}; +extern "C" { + /** Handy static method. + Return true if lattice is parsed successfully. + This function is equivalent to + { + Tagger *tagger = model.createModel(); + cosnt bool result = tagger->parse(lattice); + delete tagger; + return result; + } + @return boolean*/ #[link_name = "\u{1}_ZN5MeCab6Tagger5parseERKNS_5ModelEPNS_7LatticeE"] - pub fn MeCab_Tagger_parse(model: *const MeCab_Model, lattice: *mut MeCab_Lattice) -> bool; -} -extern "C" { - #[doc = " Factory method to create a new Tagger with a specified main's argc/argv-style parameters."] - #[doc = " Return NULL if new model cannot be initialized. Use MeCab::getLastError() to obtain the"] - #[doc = " cause of the errors."] - #[doc = " @return new Tagger object"] - #[doc = " @param argc number of parameters"] - #[doc = " @param argv parameter list"] + pub fn MeCab_Tagger_parse( + model: *const MeCab_Model, + lattice: *mut MeCab_Lattice, + ) -> bool; +} +extern "C" { + /** Factory method to create a new Tagger with a specified main's argc/argv-style parameters. + Return NULL if new model cannot be initialized. Use MeCab::getLastError() to obtain the + cause of the errors. + @return new Tagger object + @param argc number of parameters + @param argv parameter list*/ #[link_name = "\u{1}_ZN5MeCab6Tagger6createEiPPc"] pub fn MeCab_Tagger_create( argc: ::std::os::raw::c_int, @@ -1231,49 +947,49 @@ extern "C" { ) -> *mut MeCab_Tagger; } extern "C" { - #[doc = " Factory method to create a new Tagger with a string parameter representation, i.e.,"] - #[doc = " \"-d /user/local/mecab/dic/ipadic -Ochasen\"."] - #[doc = " Return NULL if new model cannot be initialized. Use MeCab::getLastError() to obtain the"] - #[doc = " cause of the errors."] - #[doc = " @return new Model object"] - #[doc = " @param arg single string representation of the argment."] + /** Factory method to create a new Tagger with a string parameter representation, i.e., + "-d /user/local/mecab/dic/ipadic -Ochasen". + Return NULL if new model cannot be initialized. Use MeCab::getLastError() to obtain the + cause of the errors. + @return new Model object + @param arg single string representation of the argment.*/ #[link_name = "\u{1}_ZN5MeCab6Tagger6createEPKc"] pub fn MeCab_Tagger_create1(arg: *const ::std::os::raw::c_char) -> *mut MeCab_Tagger; } extern "C" { - #[doc = " Return a version string"] - #[doc = " @return version string"] + /** Return a version string + @return version string*/ #[link_name = "\u{1}_ZN5MeCab6Tagger7versionEv"] pub fn MeCab_Tagger_version() -> *const ::std::os::raw::c_char; } impl MeCab_Tagger { #[inline] pub unsafe fn parse(model: *const MeCab_Model, lattice: *mut MeCab_Lattice) -> bool { - unsafe { MeCab_Tagger_parse(model, lattice) } + MeCab_Tagger_parse(model, lattice) } #[inline] pub unsafe fn create( argc: ::std::os::raw::c_int, argv: *mut *mut ::std::os::raw::c_char, ) -> *mut MeCab_Tagger { - unsafe { MeCab_Tagger_create(argc, argv) } + MeCab_Tagger_create(argc, argv) } #[inline] pub unsafe fn create1(arg: *const ::std::os::raw::c_char) -> *mut MeCab_Tagger { - unsafe { MeCab_Tagger_create1(arg) } + MeCab_Tagger_create1(arg) } #[inline] pub unsafe fn version() -> *const ::std::os::raw::c_char { - unsafe { MeCab_Tagger_version() } + MeCab_Tagger_version() } } extern "C" { - #[doc = " Alias of Lattice::create()"] + /// Alias of Lattice::create() #[link_name = "\u{1}_ZN5MeCab13createLatticeEv"] pub fn MeCab_createLattice() -> *mut MeCab_Lattice; } extern "C" { - #[doc = " Alias of Mode::create(argc, argv)"] + /// Alias of Mode::create(argc, argv) #[link_name = "\u{1}_ZN5MeCab11createModelEiPPc"] pub fn MeCab_createModel( argc: ::std::os::raw::c_int, @@ -1281,12 +997,12 @@ extern "C" { ) -> *mut MeCab_Model; } extern "C" { - #[doc = " Alias of Mode::create(arg)"] + /// Alias of Mode::create(arg) #[link_name = "\u{1}_ZN5MeCab11createModelEPKc"] pub fn MeCab_createModel1(arg: *const ::std::os::raw::c_char) -> *mut MeCab_Model; } extern "C" { - #[doc = " Alias of Tagger::create(argc, argv)"] + /// Alias of Tagger::create(argc, argv) #[link_name = "\u{1}_ZN5MeCab12createTaggerEiPPc"] pub fn MeCab_createTagger( argc: ::std::os::raw::c_int, @@ -1294,44 +1010,44 @@ extern "C" { ) -> *mut MeCab_Tagger; } extern "C" { - #[doc = " Alias of Tagger::create(arg)"] + /// Alias of Tagger::create(arg) #[link_name = "\u{1}_ZN5MeCab12createTaggerEPKc"] pub fn MeCab_createTagger1(arg: *const ::std::os::raw::c_char) -> *mut MeCab_Tagger; } extern "C" { - #[doc = " delete Lattice object."] - #[doc = " This method calles \"delete lattice\"."] - #[doc = " In some environment, e.g., MS-Windows, an object allocated inside a DLL must be deleted in the same DLL too."] - #[doc = " @param lattice lattice object"] + /** delete Lattice object. + This method calles "delete lattice". + In some environment, e.g., MS-Windows, an object allocated inside a DLL must be deleted in the same DLL too. + @param lattice lattice object*/ #[link_name = "\u{1}_ZN5MeCab13deleteLatticeEPNS_7LatticeE"] pub fn MeCab_deleteLattice(lattice: *mut MeCab_Lattice); } extern "C" { - #[doc = " delete Model object."] - #[doc = " This method calles \"delete model\"."] - #[doc = " In some environment, e.g., MS-Windows, an object allocated inside a DLL must be deleted in the same DLL too."] - #[doc = " @param model model object"] + /** delete Model object. + This method calles "delete model". + In some environment, e.g., MS-Windows, an object allocated inside a DLL must be deleted in the same DLL too. + @param model model object*/ #[link_name = "\u{1}_ZN5MeCab11deleteModelEPNS_5ModelE"] pub fn MeCab_deleteModel(model: *mut MeCab_Model); } extern "C" { - #[doc = " delete Tagger object."] - #[doc = " This method calles \"delete tagger\"."] - #[doc = " In some environment, e.g., MS-Windows, an object allocated inside a DLL must be deleted in the same DLL too."] - #[doc = " @param tagger tagger object"] + /** delete Tagger object. + This method calles "delete tagger". + In some environment, e.g., MS-Windows, an object allocated inside a DLL must be deleted in the same DLL too. + @param tagger tagger object*/ #[link_name = "\u{1}_ZN5MeCab12deleteTaggerEPNS_6TaggerE"] pub fn MeCab_deleteTagger(tagger: *mut MeCab_Tagger); } extern "C" { - #[doc = " Return last error string."] - #[doc = " @return error string"] + /** Return last error string. + @return error string*/ #[link_name = "\u{1}_ZN5MeCab12getLastErrorEv"] pub fn MeCab_getLastError() -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " An alias of getLastError."] - #[doc = " It is kept for backward compatibility."] - #[doc = " @return error string"] + /** An alias of getLastError. + It is kept for backward compatibility. + @return error string*/ #[link_name = "\u{1}_ZN5MeCab14getTaggerErrorEv"] pub fn MeCab_getTaggerError() -> *const ::std::os::raw::c_char; } @@ -1344,71 +1060,22 @@ pub struct _Mecab { pub tagger: *mut ::std::os::raw::c_void, pub lattice: *mut ::std::os::raw::c_void, } -#[test] -fn bindgen_test_layout__Mecab() { - const UNINIT: ::std::mem::MaybeUninit<_Mecab> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_Mecab>(), - 40usize, - concat!("Size of: ", stringify!(_Mecab)) - ); - assert_eq!( - ::std::mem::align_of::<_Mecab>(), - 8usize, - concat!("Alignment of ", stringify!(_Mecab)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).feature) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_Mecab), - "::", - stringify!(feature) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_Mecab), - "::", - stringify!(size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).model) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_Mecab), - "::", - stringify!(model) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tagger) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_Mecab), - "::", - stringify!(tagger) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lattice) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_Mecab), - "::", - stringify!(lattice) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _Mecab"][::std::mem::size_of::<_Mecab>() - 40usize]; + ["Alignment of _Mecab"][::std::mem::align_of::<_Mecab>() - 8usize]; + [ + "Offset of field: _Mecab::feature", + ][::std::mem::offset_of!(_Mecab, feature) - 0usize]; + ["Offset of field: _Mecab::size"][::std::mem::offset_of!(_Mecab, size) - 8usize]; + ["Offset of field: _Mecab::model"][::std::mem::offset_of!(_Mecab, model) - 16usize]; + [ + "Offset of field: _Mecab::tagger", + ][::std::mem::offset_of!(_Mecab, tagger) - 24usize]; + [ + "Offset of field: _Mecab::lattice", + ][::std::mem::offset_of!(_Mecab, lattice) - 32usize]; +}; pub type Mecab = _Mecab; extern "C" { pub fn Mecab_initialize(m: *mut Mecab) -> ::std::os::raw::c_int; @@ -1467,181 +1134,55 @@ pub struct _NJDNode { pub prev: *mut _NJDNode, pub next: *mut _NJDNode, } -#[test] -fn bindgen_test_layout__NJDNode() { - const UNINIT: ::std::mem::MaybeUninit<_NJDNode> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_NJDNode>(), - 120usize, - concat!("Size of: ", stringify!(_NJDNode)) - ); - assert_eq!( - ::std::mem::align_of::<_NJDNode>(), - 8usize, - concat!("Alignment of ", stringify!(_NJDNode)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).string) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(string) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pos) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(pos) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pos_group1) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(pos_group1) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pos_group2) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(pos_group2) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pos_group3) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(pos_group3) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ctype) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(ctype) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cform) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(cform) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).orig) as usize - ptr as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(orig) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).read) as usize - ptr as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(read) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pron) as usize - ptr as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(pron) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).acc) as usize - ptr as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(acc) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mora_size) as usize - ptr as usize }, - 84usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(mora_size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).chain_rule) as usize - ptr as usize }, - 88usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(chain_rule) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).chain_flag) as usize - ptr as usize }, - 96usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(chain_flag) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize }, - 104usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(prev) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 112usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(next) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _NJDNode"][::std::mem::size_of::<_NJDNode>() - 120usize]; + ["Alignment of _NJDNode"][::std::mem::align_of::<_NJDNode>() - 8usize]; + [ + "Offset of field: _NJDNode::string", + ][::std::mem::offset_of!(_NJDNode, string) - 0usize]; + ["Offset of field: _NJDNode::pos"][::std::mem::offset_of!(_NJDNode, pos) - 8usize]; + [ + "Offset of field: _NJDNode::pos_group1", + ][::std::mem::offset_of!(_NJDNode, pos_group1) - 16usize]; + [ + "Offset of field: _NJDNode::pos_group2", + ][::std::mem::offset_of!(_NJDNode, pos_group2) - 24usize]; + [ + "Offset of field: _NJDNode::pos_group3", + ][::std::mem::offset_of!(_NJDNode, pos_group3) - 32usize]; + [ + "Offset of field: _NJDNode::ctype", + ][::std::mem::offset_of!(_NJDNode, ctype) - 40usize]; + [ + "Offset of field: _NJDNode::cform", + ][::std::mem::offset_of!(_NJDNode, cform) - 48usize]; + [ + "Offset of field: _NJDNode::orig", + ][::std::mem::offset_of!(_NJDNode, orig) - 56usize]; + [ + "Offset of field: _NJDNode::read", + ][::std::mem::offset_of!(_NJDNode, read) - 64usize]; + [ + "Offset of field: _NJDNode::pron", + ][::std::mem::offset_of!(_NJDNode, pron) - 72usize]; + ["Offset of field: _NJDNode::acc"][::std::mem::offset_of!(_NJDNode, acc) - 80usize]; + [ + "Offset of field: _NJDNode::mora_size", + ][::std::mem::offset_of!(_NJDNode, mora_size) - 84usize]; + [ + "Offset of field: _NJDNode::chain_rule", + ][::std::mem::offset_of!(_NJDNode, chain_rule) - 88usize]; + [ + "Offset of field: _NJDNode::chain_flag", + ][::std::mem::offset_of!(_NJDNode, chain_flag) - 96usize]; + [ + "Offset of field: _NJDNode::prev", + ][::std::mem::offset_of!(_NJDNode, prev) - 104usize]; + [ + "Offset of field: _NJDNode::next", + ][::std::mem::offset_of!(_NJDNode, next) - 112usize]; +}; pub type NJDNode = _NJDNode; extern "C" { pub fn NJDNode_initialize(node: *mut NJDNode); @@ -1653,13 +1194,22 @@ extern "C" { pub fn NJDNode_set_pos(node: *mut NJDNode, str_: *const ::std::os::raw::c_char); } extern "C" { - pub fn NJDNode_set_pos_group1(node: *mut NJDNode, str_: *const ::std::os::raw::c_char); + pub fn NJDNode_set_pos_group1( + node: *mut NJDNode, + str_: *const ::std::os::raw::c_char, + ); } extern "C" { - pub fn NJDNode_set_pos_group2(node: *mut NJDNode, str_: *const ::std::os::raw::c_char); + pub fn NJDNode_set_pos_group2( + node: *mut NJDNode, + str_: *const ::std::os::raw::c_char, + ); } extern "C" { - pub fn NJDNode_set_pos_group3(node: *mut NJDNode, str_: *const ::std::os::raw::c_char); + pub fn NJDNode_set_pos_group3( + node: *mut NJDNode, + str_: *const ::std::os::raw::c_char, + ); } extern "C" { pub fn NJDNode_set_ctype(node: *mut NJDNode, str_: *const ::std::os::raw::c_char); @@ -1683,7 +1233,10 @@ extern "C" { pub fn NJDNode_set_mora_size(node: *mut NJDNode, size: ::std::os::raw::c_int); } extern "C" { - pub fn NJDNode_set_chain_rule(node: *mut NJDNode, str_: *const ::std::os::raw::c_char); + pub fn NJDNode_set_chain_rule( + node: *mut NJDNode, + str_: *const ::std::os::raw::c_char, + ); } extern "C" { pub fn NJDNode_set_chain_flag(node: *mut NJDNode, flag: ::std::os::raw::c_int); @@ -1783,41 +1336,13 @@ pub struct _NJD { pub head: *mut NJDNode, pub tail: *mut NJDNode, } -#[test] -fn bindgen_test_layout__NJD() { - const UNINIT: ::std::mem::MaybeUninit<_NJD> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_NJD>(), - 16usize, - concat!("Size of: ", stringify!(_NJD)) - ); - assert_eq!( - ::std::mem::align_of::<_NJD>(), - 8usize, - concat!("Alignment of ", stringify!(_NJD)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).head) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_NJD), - "::", - stringify!(head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tail) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_NJD), - "::", - stringify!(tail) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _NJD"][::std::mem::size_of::<_NJD>() - 16usize]; + ["Alignment of _NJD"][::std::mem::align_of::<_NJD>() - 8usize]; + ["Offset of field: _NJD::head"][::std::mem::offset_of!(_NJD, head) - 0usize]; + ["Offset of field: _NJD::tail"][::std::mem::offset_of!(_NJD, tail) - 8usize]; +}; pub type NJD = _NJD; extern "C" { pub fn NJD_initialize(njd: *mut NJD); @@ -1867,62 +1392,27 @@ pub struct _JPCommonLabelPhoneme { pub next: *mut _JPCommonLabelPhoneme, pub up: *mut _JPCommonLabelMora, } -#[test] -fn bindgen_test_layout__JPCommonLabelPhoneme() { - const UNINIT: ::std::mem::MaybeUninit<_JPCommonLabelPhoneme> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_JPCommonLabelPhoneme>(), - 32usize, - concat!("Size of: ", stringify!(_JPCommonLabelPhoneme)) - ); - assert_eq!( - ::std::mem::align_of::<_JPCommonLabelPhoneme>(), - 8usize, - concat!("Alignment of ", stringify!(_JPCommonLabelPhoneme)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).phoneme) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelPhoneme), - "::", - stringify!(phoneme) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelPhoneme), - "::", - stringify!(prev) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelPhoneme), - "::", - stringify!(next) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).up) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelPhoneme), - "::", - stringify!(up) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + [ + "Size of _JPCommonLabelPhoneme", + ][::std::mem::size_of::<_JPCommonLabelPhoneme>() - 32usize]; + [ + "Alignment of _JPCommonLabelPhoneme", + ][::std::mem::align_of::<_JPCommonLabelPhoneme>() - 8usize]; + [ + "Offset of field: _JPCommonLabelPhoneme::phoneme", + ][::std::mem::offset_of!(_JPCommonLabelPhoneme, phoneme) - 0usize]; + [ + "Offset of field: _JPCommonLabelPhoneme::prev", + ][::std::mem::offset_of!(_JPCommonLabelPhoneme, prev) - 8usize]; + [ + "Offset of field: _JPCommonLabelPhoneme::next", + ][::std::mem::offset_of!(_JPCommonLabelPhoneme, next) - 16usize]; + [ + "Offset of field: _JPCommonLabelPhoneme::up", + ][::std::mem::offset_of!(_JPCommonLabelPhoneme, up) - 24usize]; +}; pub type JPCommonLabelPhoneme = _JPCommonLabelPhoneme; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -1934,81 +1424,33 @@ pub struct _JPCommonLabelMora { pub next: *mut _JPCommonLabelMora, pub up: *mut _JPCommonLabelWord, } -#[test] -fn bindgen_test_layout__JPCommonLabelMora() { - const UNINIT: ::std::mem::MaybeUninit<_JPCommonLabelMora> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_JPCommonLabelMora>(), - 48usize, - concat!("Size of: ", stringify!(_JPCommonLabelMora)) - ); - assert_eq!( - ::std::mem::align_of::<_JPCommonLabelMora>(), - 8usize, - concat!("Alignment of ", stringify!(_JPCommonLabelMora)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mora) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelMora), - "::", - stringify!(mora) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).head) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelMora), - "::", - stringify!(head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tail) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelMora), - "::", - stringify!(tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelMora), - "::", - stringify!(prev) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelMora), - "::", - stringify!(next) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).up) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelMora), - "::", - stringify!(up) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + [ + "Size of _JPCommonLabelMora", + ][::std::mem::size_of::<_JPCommonLabelMora>() - 48usize]; + [ + "Alignment of _JPCommonLabelMora", + ][::std::mem::align_of::<_JPCommonLabelMora>() - 8usize]; + [ + "Offset of field: _JPCommonLabelMora::mora", + ][::std::mem::offset_of!(_JPCommonLabelMora, mora) - 0usize]; + [ + "Offset of field: _JPCommonLabelMora::head", + ][::std::mem::offset_of!(_JPCommonLabelMora, head) - 8usize]; + [ + "Offset of field: _JPCommonLabelMora::tail", + ][::std::mem::offset_of!(_JPCommonLabelMora, tail) - 16usize]; + [ + "Offset of field: _JPCommonLabelMora::prev", + ][::std::mem::offset_of!(_JPCommonLabelMora, prev) - 24usize]; + [ + "Offset of field: _JPCommonLabelMora::next", + ][::std::mem::offset_of!(_JPCommonLabelMora, next) - 32usize]; + [ + "Offset of field: _JPCommonLabelMora::up", + ][::std::mem::offset_of!(_JPCommonLabelMora, up) - 40usize]; +}; pub type JPCommonLabelMora = _JPCommonLabelMora; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -2023,111 +1465,42 @@ pub struct _JPCommonLabelWord { pub next: *mut _JPCommonLabelWord, pub up: *mut _JPCommonLabelAccentPhrase, } -#[test] -fn bindgen_test_layout__JPCommonLabelWord() { - const UNINIT: ::std::mem::MaybeUninit<_JPCommonLabelWord> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_JPCommonLabelWord>(), - 72usize, - concat!("Size of: ", stringify!(_JPCommonLabelWord)) - ); - assert_eq!( - ::std::mem::align_of::<_JPCommonLabelWord>(), - 8usize, - concat!("Alignment of ", stringify!(_JPCommonLabelWord)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pron) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(pron) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pos) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(pos) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ctype) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(ctype) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cform) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(cform) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).head) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tail) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(prev) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(next) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).up) as usize - ptr as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(up) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + [ + "Size of _JPCommonLabelWord", + ][::std::mem::size_of::<_JPCommonLabelWord>() - 72usize]; + [ + "Alignment of _JPCommonLabelWord", + ][::std::mem::align_of::<_JPCommonLabelWord>() - 8usize]; + [ + "Offset of field: _JPCommonLabelWord::pron", + ][::std::mem::offset_of!(_JPCommonLabelWord, pron) - 0usize]; + [ + "Offset of field: _JPCommonLabelWord::pos", + ][::std::mem::offset_of!(_JPCommonLabelWord, pos) - 8usize]; + [ + "Offset of field: _JPCommonLabelWord::ctype", + ][::std::mem::offset_of!(_JPCommonLabelWord, ctype) - 16usize]; + [ + "Offset of field: _JPCommonLabelWord::cform", + ][::std::mem::offset_of!(_JPCommonLabelWord, cform) - 24usize]; + [ + "Offset of field: _JPCommonLabelWord::head", + ][::std::mem::offset_of!(_JPCommonLabelWord, head) - 32usize]; + [ + "Offset of field: _JPCommonLabelWord::tail", + ][::std::mem::offset_of!(_JPCommonLabelWord, tail) - 40usize]; + [ + "Offset of field: _JPCommonLabelWord::prev", + ][::std::mem::offset_of!(_JPCommonLabelWord, prev) - 48usize]; + [ + "Offset of field: _JPCommonLabelWord::next", + ][::std::mem::offset_of!(_JPCommonLabelWord, next) - 56usize]; + [ + "Offset of field: _JPCommonLabelWord::up", + ][::std::mem::offset_of!(_JPCommonLabelWord, up) - 64usize]; +}; pub type JPCommonLabelWord = _JPCommonLabelWord; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -2140,92 +1513,36 @@ pub struct _JPCommonLabelAccentPhrase { pub next: *mut _JPCommonLabelAccentPhrase, pub up: *mut _JPCommonLabelBreathGroup, } -#[test] -fn bindgen_test_layout__JPCommonLabelAccentPhrase() { - const UNINIT: ::std::mem::MaybeUninit<_JPCommonLabelAccentPhrase> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_JPCommonLabelAccentPhrase>(), - 56usize, - concat!("Size of: ", stringify!(_JPCommonLabelAccentPhrase)) - ); - assert_eq!( - ::std::mem::align_of::<_JPCommonLabelAccentPhrase>(), - 8usize, - concat!("Alignment of ", stringify!(_JPCommonLabelAccentPhrase)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).accent) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelAccentPhrase), - "::", - stringify!(accent) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).emotion) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelAccentPhrase), - "::", - stringify!(emotion) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).head) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelAccentPhrase), - "::", - stringify!(head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tail) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelAccentPhrase), - "::", - stringify!(tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelAccentPhrase), - "::", - stringify!(prev) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelAccentPhrase), - "::", - stringify!(next) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).up) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelAccentPhrase), - "::", - stringify!(up) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + [ + "Size of _JPCommonLabelAccentPhrase", + ][::std::mem::size_of::<_JPCommonLabelAccentPhrase>() - 56usize]; + [ + "Alignment of _JPCommonLabelAccentPhrase", + ][::std::mem::align_of::<_JPCommonLabelAccentPhrase>() - 8usize]; + [ + "Offset of field: _JPCommonLabelAccentPhrase::accent", + ][::std::mem::offset_of!(_JPCommonLabelAccentPhrase, accent) - 0usize]; + [ + "Offset of field: _JPCommonLabelAccentPhrase::emotion", + ][::std::mem::offset_of!(_JPCommonLabelAccentPhrase, emotion) - 8usize]; + [ + "Offset of field: _JPCommonLabelAccentPhrase::head", + ][::std::mem::offset_of!(_JPCommonLabelAccentPhrase, head) - 16usize]; + [ + "Offset of field: _JPCommonLabelAccentPhrase::tail", + ][::std::mem::offset_of!(_JPCommonLabelAccentPhrase, tail) - 24usize]; + [ + "Offset of field: _JPCommonLabelAccentPhrase::prev", + ][::std::mem::offset_of!(_JPCommonLabelAccentPhrase, prev) - 32usize]; + [ + "Offset of field: _JPCommonLabelAccentPhrase::next", + ][::std::mem::offset_of!(_JPCommonLabelAccentPhrase, next) - 40usize]; + [ + "Offset of field: _JPCommonLabelAccentPhrase::up", + ][::std::mem::offset_of!(_JPCommonLabelAccentPhrase, up) - 48usize]; +}; pub type JPCommonLabelAccentPhrase = _JPCommonLabelAccentPhrase; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -2235,62 +1552,27 @@ pub struct _JPCommonLabelBreathGroup { pub prev: *mut _JPCommonLabelBreathGroup, pub next: *mut _JPCommonLabelBreathGroup, } -#[test] -fn bindgen_test_layout__JPCommonLabelBreathGroup() { - const UNINIT: ::std::mem::MaybeUninit<_JPCommonLabelBreathGroup> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_JPCommonLabelBreathGroup>(), - 32usize, - concat!("Size of: ", stringify!(_JPCommonLabelBreathGroup)) - ); - assert_eq!( - ::std::mem::align_of::<_JPCommonLabelBreathGroup>(), - 8usize, - concat!("Alignment of ", stringify!(_JPCommonLabelBreathGroup)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).head) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelBreathGroup), - "::", - stringify!(head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tail) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelBreathGroup), - "::", - stringify!(tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelBreathGroup), - "::", - stringify!(prev) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelBreathGroup), - "::", - stringify!(next) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + [ + "Size of _JPCommonLabelBreathGroup", + ][::std::mem::size_of::<_JPCommonLabelBreathGroup>() - 32usize]; + [ + "Alignment of _JPCommonLabelBreathGroup", + ][::std::mem::align_of::<_JPCommonLabelBreathGroup>() - 8usize]; + [ + "Offset of field: _JPCommonLabelBreathGroup::head", + ][::std::mem::offset_of!(_JPCommonLabelBreathGroup, head) - 0usize]; + [ + "Offset of field: _JPCommonLabelBreathGroup::tail", + ][::std::mem::offset_of!(_JPCommonLabelBreathGroup, tail) - 8usize]; + [ + "Offset of field: _JPCommonLabelBreathGroup::prev", + ][::std::mem::offset_of!(_JPCommonLabelBreathGroup, prev) - 16usize]; + [ + "Offset of field: _JPCommonLabelBreathGroup::next", + ][::std::mem::offset_of!(_JPCommonLabelBreathGroup, next) - 24usize]; +}; pub type JPCommonLabelBreathGroup = _JPCommonLabelBreathGroup; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -2309,151 +1591,50 @@ pub struct _JPCommonLabel { pub phoneme_tail: *mut JPCommonLabelPhoneme, pub short_pause_flag: ::std::os::raw::c_int, } -#[test] -fn bindgen_test_layout__JPCommonLabel() { - const UNINIT: ::std::mem::MaybeUninit<_JPCommonLabel> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_JPCommonLabel>(), - 104usize, - concat!("Size of: ", stringify!(_JPCommonLabel)) - ); - assert_eq!( - ::std::mem::align_of::<_JPCommonLabel>(), - 8usize, - concat!("Alignment of ", stringify!(_JPCommonLabel)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).feature) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(feature) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).breath_head) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(breath_head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).breath_tail) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(breath_tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).accent_head) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(accent_head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).accent_tail) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(accent_tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).word_head) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(word_head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).word_tail) as usize - ptr as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(word_tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mora_head) as usize - ptr as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(mora_head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mora_tail) as usize - ptr as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(mora_tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).phoneme_head) as usize - ptr as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(phoneme_head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).phoneme_tail) as usize - ptr as usize }, - 88usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(phoneme_tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).short_pause_flag) as usize - ptr as usize }, - 96usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(short_pause_flag) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _JPCommonLabel"][::std::mem::size_of::<_JPCommonLabel>() - 104usize]; + ["Alignment of _JPCommonLabel"][::std::mem::align_of::<_JPCommonLabel>() - 8usize]; + [ + "Offset of field: _JPCommonLabel::size", + ][::std::mem::offset_of!(_JPCommonLabel, size) - 0usize]; + [ + "Offset of field: _JPCommonLabel::feature", + ][::std::mem::offset_of!(_JPCommonLabel, feature) - 8usize]; + [ + "Offset of field: _JPCommonLabel::breath_head", + ][::std::mem::offset_of!(_JPCommonLabel, breath_head) - 16usize]; + [ + "Offset of field: _JPCommonLabel::breath_tail", + ][::std::mem::offset_of!(_JPCommonLabel, breath_tail) - 24usize]; + [ + "Offset of field: _JPCommonLabel::accent_head", + ][::std::mem::offset_of!(_JPCommonLabel, accent_head) - 32usize]; + [ + "Offset of field: _JPCommonLabel::accent_tail", + ][::std::mem::offset_of!(_JPCommonLabel, accent_tail) - 40usize]; + [ + "Offset of field: _JPCommonLabel::word_head", + ][::std::mem::offset_of!(_JPCommonLabel, word_head) - 48usize]; + [ + "Offset of field: _JPCommonLabel::word_tail", + ][::std::mem::offset_of!(_JPCommonLabel, word_tail) - 56usize]; + [ + "Offset of field: _JPCommonLabel::mora_head", + ][::std::mem::offset_of!(_JPCommonLabel, mora_head) - 64usize]; + [ + "Offset of field: _JPCommonLabel::mora_tail", + ][::std::mem::offset_of!(_JPCommonLabel, mora_tail) - 72usize]; + [ + "Offset of field: _JPCommonLabel::phoneme_head", + ][::std::mem::offset_of!(_JPCommonLabel, phoneme_head) - 80usize]; + [ + "Offset of field: _JPCommonLabel::phoneme_tail", + ][::std::mem::offset_of!(_JPCommonLabel, phoneme_tail) - 88usize]; + [ + "Offset of field: _JPCommonLabel::short_pause_flag", + ][::std::mem::offset_of!(_JPCommonLabel, short_pause_flag) - 96usize]; +}; pub type JPCommonLabel = _JPCommonLabel; extern "C" { pub fn JPCommonLabel_initialize(label: *mut JPCommonLabel); @@ -2476,8 +1657,9 @@ extern "C" { pub fn JPCommonLabel_get_size(label: *mut JPCommonLabel) -> ::std::os::raw::c_int; } extern "C" { - pub fn JPCommonLabel_get_feature(label: *mut JPCommonLabel) - -> *mut *mut ::std::os::raw::c_char; + pub fn JPCommonLabel_get_feature( + label: *mut JPCommonLabel, + ) -> *mut *mut ::std::os::raw::c_char; } extern "C" { pub fn JPCommonLabel_print(label: *mut JPCommonLabel); @@ -2500,134 +1682,91 @@ pub struct _JPCommonNode { pub prev: *mut _JPCommonNode, pub next: *mut _JPCommonNode, } -#[test] -fn bindgen_test_layout__JPCommonNode() { - const UNINIT: ::std::mem::MaybeUninit<_JPCommonNode> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_JPCommonNode>(), - 56usize, - concat!("Size of: ", stringify!(_JPCommonNode)) - ); - assert_eq!( - ::std::mem::align_of::<_JPCommonNode>(), - 8usize, - concat!("Alignment of ", stringify!(_JPCommonNode)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pron) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonNode), - "::", - stringify!(pron) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pos) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonNode), - "::", - stringify!(pos) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ctype) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonNode), - "::", - stringify!(ctype) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cform) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonNode), - "::", - stringify!(cform) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).acc) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonNode), - "::", - stringify!(acc) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).chain_flag) as usize - ptr as usize }, - 36usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonNode), - "::", - stringify!(chain_flag) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonNode), - "::", - stringify!(prev) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonNode), - "::", - stringify!(next) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _JPCommonNode"][::std::mem::size_of::<_JPCommonNode>() - 56usize]; + ["Alignment of _JPCommonNode"][::std::mem::align_of::<_JPCommonNode>() - 8usize]; + [ + "Offset of field: _JPCommonNode::pron", + ][::std::mem::offset_of!(_JPCommonNode, pron) - 0usize]; + [ + "Offset of field: _JPCommonNode::pos", + ][::std::mem::offset_of!(_JPCommonNode, pos) - 8usize]; + [ + "Offset of field: _JPCommonNode::ctype", + ][::std::mem::offset_of!(_JPCommonNode, ctype) - 16usize]; + [ + "Offset of field: _JPCommonNode::cform", + ][::std::mem::offset_of!(_JPCommonNode, cform) - 24usize]; + [ + "Offset of field: _JPCommonNode::acc", + ][::std::mem::offset_of!(_JPCommonNode, acc) - 32usize]; + [ + "Offset of field: _JPCommonNode::chain_flag", + ][::std::mem::offset_of!(_JPCommonNode, chain_flag) - 36usize]; + [ + "Offset of field: _JPCommonNode::prev", + ][::std::mem::offset_of!(_JPCommonNode, prev) - 40usize]; + [ + "Offset of field: _JPCommonNode::next", + ][::std::mem::offset_of!(_JPCommonNode, next) - 48usize]; +}; pub type JPCommonNode = _JPCommonNode; extern "C" { pub fn JPCommonNode_initialize(node: *mut JPCommonNode); } extern "C" { - pub fn JPCommonNode_set_pron(node: *mut JPCommonNode, str_: *const ::std::os::raw::c_char); + pub fn JPCommonNode_set_pron( + node: *mut JPCommonNode, + str_: *const ::std::os::raw::c_char, + ); } extern "C" { - pub fn JPCommonNode_set_pos(node: *mut JPCommonNode, str_: *const ::std::os::raw::c_char); + pub fn JPCommonNode_set_pos( + node: *mut JPCommonNode, + str_: *const ::std::os::raw::c_char, + ); } extern "C" { - pub fn JPCommonNode_set_ctype(node: *mut JPCommonNode, str_: *const ::std::os::raw::c_char); + pub fn JPCommonNode_set_ctype( + node: *mut JPCommonNode, + str_: *const ::std::os::raw::c_char, + ); } extern "C" { - pub fn JPCommonNode_set_cform(node: *mut JPCommonNode, str_: *const ::std::os::raw::c_char); + pub fn JPCommonNode_set_cform( + node: *mut JPCommonNode, + str_: *const ::std::os::raw::c_char, + ); } extern "C" { pub fn JPCommonNode_set_acc(node: *mut JPCommonNode, acc: ::std::os::raw::c_int); } extern "C" { - pub fn JPCommonNode_set_chain_flag(node: *mut JPCommonNode, flag: ::std::os::raw::c_int); + pub fn JPCommonNode_set_chain_flag( + node: *mut JPCommonNode, + flag: ::std::os::raw::c_int, + ); } extern "C" { - pub fn JPCommonNode_get_pron(node: *mut JPCommonNode) -> *const ::std::os::raw::c_char; + pub fn JPCommonNode_get_pron( + node: *mut JPCommonNode, + ) -> *const ::std::os::raw::c_char; } extern "C" { - pub fn JPCommonNode_get_pos(node: *mut JPCommonNode) -> *const ::std::os::raw::c_char; + pub fn JPCommonNode_get_pos( + node: *mut JPCommonNode, + ) -> *const ::std::os::raw::c_char; } extern "C" { - pub fn JPCommonNode_get_ctype(node: *mut JPCommonNode) -> *const ::std::os::raw::c_char; + pub fn JPCommonNode_get_ctype( + node: *mut JPCommonNode, + ) -> *const ::std::os::raw::c_char; } extern "C" { - pub fn JPCommonNode_get_cform(node: *mut JPCommonNode) -> *const ::std::os::raw::c_char; + pub fn JPCommonNode_get_cform( + node: *mut JPCommonNode, + ) -> *const ::std::os::raw::c_char; } extern "C" { pub fn JPCommonNode_get_acc(node: *mut JPCommonNode) -> ::std::os::raw::c_int; @@ -2651,51 +1790,20 @@ pub struct _JPCommon { pub tail: *mut JPCommonNode, pub label: *mut JPCommonLabel, } -#[test] -fn bindgen_test_layout__JPCommon() { - const UNINIT: ::std::mem::MaybeUninit<_JPCommon> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_JPCommon>(), - 24usize, - concat!("Size of: ", stringify!(_JPCommon)) - ); - assert_eq!( - ::std::mem::align_of::<_JPCommon>(), - 8usize, - concat!("Alignment of ", stringify!(_JPCommon)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).head) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_JPCommon), - "::", - stringify!(head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tail) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_JPCommon), - "::", - stringify!(tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).label) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_JPCommon), - "::", - stringify!(label) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _JPCommon"][::std::mem::size_of::<_JPCommon>() - 24usize]; + ["Alignment of _JPCommon"][::std::mem::align_of::<_JPCommon>() - 8usize]; + [ + "Offset of field: _JPCommon::head", + ][::std::mem::offset_of!(_JPCommon, head) - 0usize]; + [ + "Offset of field: _JPCommon::tail", + ][::std::mem::offset_of!(_JPCommon, tail) - 8usize]; + [ + "Offset of field: _JPCommon::label", + ][::std::mem::offset_of!(_JPCommon, label) - 16usize]; +}; pub type JPCommon = _JPCommon; extern "C" { pub fn JPCommon_initialize(jpcommon: *mut JPCommon); @@ -2710,7 +1818,9 @@ extern "C" { pub fn JPCommon_get_label_size(jpcommon: *mut JPCommon) -> ::std::os::raw::c_int; } extern "C" { - pub fn JPCommon_get_label_feature(jpcommon: *mut JPCommon) -> *mut *mut ::std::os::raw::c_char; + pub fn JPCommon_get_label_feature( + jpcommon: *mut JPCommon, + ) -> *mut *mut ::std::os::raw::c_char; } extern "C" { pub fn JPCommon_print(jpcommon: *mut JPCommon); diff --git a/crates/open_jtalk-sys/src/generated/android/x86_64/bindings.rs b/crates/open_jtalk-sys/src/generated/android/x86_64/bindings.rs index 6ecbdf9..3d8030d 100644 --- a/crates/open_jtalk-sys/src/generated/android/x86_64/bindings.rs +++ b/crates/open_jtalk-sys/src/generated/android/x86_64/bindings.rs @@ -1,542 +1,263 @@ -/* automatically generated by rust-bindgen 0.62.0 */ +/* automatically generated by rust-bindgen 0.70.1 */ pub const TRUE: u32 = 1; pub const FALSE: u32 = 0; -#[doc = " DictionaryInfo structure"] +/// DictionaryInfo structure #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct mecab_dictionary_info_t { - #[doc = " filename of dictionary"] - #[doc = " On Windows, filename is stored in UTF-8 encoding"] + /** filename of dictionary + On Windows, filename is stored in UTF-8 encoding*/ pub filename: *const ::std::os::raw::c_char, - #[doc = " character set of the dictionary. e.g., \"SHIFT-JIS\", \"UTF-8\""] + /// character set of the dictionary. e.g., "SHIFT-JIS", "UTF-8" pub charset: *const ::std::os::raw::c_char, - #[doc = " How many words are registered in this dictionary."] + /// How many words are registered in this dictionary. pub size: ::std::os::raw::c_uint, - #[doc = " dictionary type"] - #[doc = " this value should be MECAB_USR_DIC, MECAB_SYS_DIC, or MECAB_UNK_DIC."] + /** dictionary type + this value should be MECAB_USR_DIC, MECAB_SYS_DIC, or MECAB_UNK_DIC.*/ pub type_: ::std::os::raw::c_int, - #[doc = " left attributes size"] + /// left attributes size pub lsize: ::std::os::raw::c_uint, - #[doc = " right attributes size"] + /// right attributes size pub rsize: ::std::os::raw::c_uint, - #[doc = " version of this dictionary"] + /// version of this dictionary pub version: ::std::os::raw::c_ushort, - #[doc = " pointer to the next dictionary info."] + /// pointer to the next dictionary info. pub next: *mut mecab_dictionary_info_t, } -#[test] -fn bindgen_test_layout_mecab_dictionary_info_t() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 48usize, - concat!("Size of: ", stringify!(mecab_dictionary_info_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(mecab_dictionary_info_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).filename) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(mecab_dictionary_info_t), - "::", - stringify!(filename) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).charset) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(mecab_dictionary_info_t), - "::", - stringify!(charset) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(mecab_dictionary_info_t), - "::", - stringify!(size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(mecab_dictionary_info_t), - "::", - stringify!(type_) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lsize) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(mecab_dictionary_info_t), - "::", - stringify!(lsize) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rsize) as usize - ptr as usize }, - 28usize, - concat!( - "Offset of field: ", - stringify!(mecab_dictionary_info_t), - "::", - stringify!(rsize) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).version) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(mecab_dictionary_info_t), - "::", - stringify!(version) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(mecab_dictionary_info_t), - "::", - stringify!(next) - ) - ); -} -#[doc = " Path structure"] +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + [ + "Size of mecab_dictionary_info_t", + ][::std::mem::size_of::() - 48usize]; + [ + "Alignment of mecab_dictionary_info_t", + ][::std::mem::align_of::() - 8usize]; + [ + "Offset of field: mecab_dictionary_info_t::filename", + ][::std::mem::offset_of!(mecab_dictionary_info_t, filename) - 0usize]; + [ + "Offset of field: mecab_dictionary_info_t::charset", + ][::std::mem::offset_of!(mecab_dictionary_info_t, charset) - 8usize]; + [ + "Offset of field: mecab_dictionary_info_t::size", + ][::std::mem::offset_of!(mecab_dictionary_info_t, size) - 16usize]; + [ + "Offset of field: mecab_dictionary_info_t::type_", + ][::std::mem::offset_of!(mecab_dictionary_info_t, type_) - 20usize]; + [ + "Offset of field: mecab_dictionary_info_t::lsize", + ][::std::mem::offset_of!(mecab_dictionary_info_t, lsize) - 24usize]; + [ + "Offset of field: mecab_dictionary_info_t::rsize", + ][::std::mem::offset_of!(mecab_dictionary_info_t, rsize) - 28usize]; + [ + "Offset of field: mecab_dictionary_info_t::version", + ][::std::mem::offset_of!(mecab_dictionary_info_t, version) - 32usize]; + [ + "Offset of field: mecab_dictionary_info_t::next", + ][::std::mem::offset_of!(mecab_dictionary_info_t, next) - 40usize]; +}; +/// Path structure #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct mecab_path_t { - #[doc = " pointer to the right node"] + /// pointer to the right node pub rnode: *mut mecab_node_t, - #[doc = " pointer to the next right path"] + /// pointer to the next right path pub rnext: *mut mecab_path_t, - #[doc = " pointer to the left node"] + /// pointer to the left node pub lnode: *mut mecab_node_t, - #[doc = " pointer to the next left path"] + /// pointer to the next left path pub lnext: *mut mecab_path_t, - #[doc = " local cost"] + /// local cost pub cost: ::std::os::raw::c_int, - #[doc = " marginal probability"] + /// marginal probability pub prob: f32, } -#[test] -fn bindgen_test_layout_mecab_path_t() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 40usize, - concat!("Size of: ", stringify!(mecab_path_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(mecab_path_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rnode) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(mecab_path_t), - "::", - stringify!(rnode) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rnext) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(mecab_path_t), - "::", - stringify!(rnext) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lnode) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(mecab_path_t), - "::", - stringify!(lnode) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lnext) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(mecab_path_t), - "::", - stringify!(lnext) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cost) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(mecab_path_t), - "::", - stringify!(cost) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prob) as usize - ptr as usize }, - 36usize, - concat!( - "Offset of field: ", - stringify!(mecab_path_t), - "::", - stringify!(prob) - ) - ); -} -#[doc = " Node structure"] +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of mecab_path_t"][::std::mem::size_of::() - 40usize]; + ["Alignment of mecab_path_t"][::std::mem::align_of::() - 8usize]; + [ + "Offset of field: mecab_path_t::rnode", + ][::std::mem::offset_of!(mecab_path_t, rnode) - 0usize]; + [ + "Offset of field: mecab_path_t::rnext", + ][::std::mem::offset_of!(mecab_path_t, rnext) - 8usize]; + [ + "Offset of field: mecab_path_t::lnode", + ][::std::mem::offset_of!(mecab_path_t, lnode) - 16usize]; + [ + "Offset of field: mecab_path_t::lnext", + ][::std::mem::offset_of!(mecab_path_t, lnext) - 24usize]; + [ + "Offset of field: mecab_path_t::cost", + ][::std::mem::offset_of!(mecab_path_t, cost) - 32usize]; + [ + "Offset of field: mecab_path_t::prob", + ][::std::mem::offset_of!(mecab_path_t, prob) - 36usize]; +}; +/// Node structure #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct mecab_node_t { - #[doc = " pointer to the previous node."] + /// pointer to the previous node. pub prev: *mut mecab_node_t, - #[doc = " pointer to the next node."] + /// pointer to the next node. pub next: *mut mecab_node_t, - #[doc = " pointer to the node which ends at the same position."] + /// pointer to the node which ends at the same position. pub enext: *mut mecab_node_t, - #[doc = " pointer to the node which starts at the same position."] + /// pointer to the node which starts at the same position. pub bnext: *mut mecab_node_t, - #[doc = " pointer to the right path."] - #[doc = " this value is NULL if MECAB_ONE_BEST mode."] + /** pointer to the right path. + this value is NULL if MECAB_ONE_BEST mode.*/ pub rpath: *mut mecab_path_t, - #[doc = " pointer to the right path."] - #[doc = " this value is NULL if MECAB_ONE_BEST mode."] + /** pointer to the right path. + this value is NULL if MECAB_ONE_BEST mode.*/ pub lpath: *mut mecab_path_t, - #[doc = " surface string."] - #[doc = " this value is not 0 terminated."] - #[doc = " You can get the length with length/rlength members."] + /** surface string. + this value is not 0 terminated. + You can get the length with length/rlength members.*/ pub surface: *const ::std::os::raw::c_char, - #[doc = " feature string"] + /// feature string pub feature: *const ::std::os::raw::c_char, - #[doc = " unique node id"] + /// unique node id pub id: ::std::os::raw::c_uint, - #[doc = " length of the surface form."] + /// length of the surface form. pub length: ::std::os::raw::c_ushort, - #[doc = " length of the surface form including white space before the morph."] + /// length of the surface form including white space before the morph. pub rlength: ::std::os::raw::c_ushort, - #[doc = " right attribute id"] + /// right attribute id pub rcAttr: ::std::os::raw::c_ushort, - #[doc = " left attribute id"] + /// left attribute id pub lcAttr: ::std::os::raw::c_ushort, - #[doc = " unique part of speech id. This value is defined in \"pos.def\" file."] + /// unique part of speech id. This value is defined in "pos.def" file. pub posid: ::std::os::raw::c_ushort, - #[doc = " character type"] + /// character type pub char_type: ::std::os::raw::c_uchar, - #[doc = " status of this model."] - #[doc = " This value is MECAB_NOR_NODE, MECAB_UNK_NODE, MECAB_BOS_NODE, MECAB_EOS_NODE, or MECAB_EON_NODE."] + /** status of this model. + This value is MECAB_NOR_NODE, MECAB_UNK_NODE, MECAB_BOS_NODE, MECAB_EOS_NODE, or MECAB_EON_NODE.*/ pub stat: ::std::os::raw::c_uchar, - #[doc = " set 1 if this node is best node."] + /// set 1 if this node is best node. pub isbest: ::std::os::raw::c_uchar, - #[doc = " forward accumulative log summation."] - #[doc = " This value is only available when MECAB_MARGINAL_PROB is passed."] + /** forward accumulative log summation. + This value is only available when MECAB_MARGINAL_PROB is passed.*/ pub alpha: f32, - #[doc = " backward accumulative log summation."] - #[doc = " This value is only available when MECAB_MARGINAL_PROB is passed."] + /** backward accumulative log summation. + This value is only available when MECAB_MARGINAL_PROB is passed.*/ pub beta: f32, - #[doc = " marginal probability."] - #[doc = " This value is only available when MECAB_MARGINAL_PROB is passed."] + /** marginal probability. + This value is only available when MECAB_MARGINAL_PROB is passed.*/ pub prob: f32, - #[doc = " word cost."] + /// word cost. pub wcost: ::std::os::raw::c_short, - #[doc = " best accumulative cost from bos node to this node."] + /// best accumulative cost from bos node to this node. pub cost: ::std::os::raw::c_long, } -#[test] -fn bindgen_test_layout_mecab_node_t() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 112usize, - concat!("Size of: ", stringify!(mecab_node_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(mecab_node_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(prev) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(next) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).enext) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(enext) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).bnext) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(bnext) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rpath) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(rpath) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lpath) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(lpath) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).surface) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(surface) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).feature) as usize - ptr as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(feature) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).id) as usize - ptr as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(id) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).length) as usize - ptr as usize }, - 68usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(length) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rlength) as usize - ptr as usize }, - 70usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(rlength) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rcAttr) as usize - ptr as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(rcAttr) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lcAttr) as usize - ptr as usize }, - 74usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(lcAttr) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).posid) as usize - ptr as usize }, - 76usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(posid) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).char_type) as usize - ptr as usize }, - 78usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(char_type) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).stat) as usize - ptr as usize }, - 79usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(stat) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).isbest) as usize - ptr as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(isbest) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).alpha) as usize - ptr as usize }, - 84usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(alpha) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).beta) as usize - ptr as usize }, - 88usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(beta) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prob) as usize - ptr as usize }, - 92usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(prob) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).wcost) as usize - ptr as usize }, - 96usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(wcost) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cost) as usize - ptr as usize }, - 104usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(cost) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of mecab_node_t"][::std::mem::size_of::() - 112usize]; + ["Alignment of mecab_node_t"][::std::mem::align_of::() - 8usize]; + [ + "Offset of field: mecab_node_t::prev", + ][::std::mem::offset_of!(mecab_node_t, prev) - 0usize]; + [ + "Offset of field: mecab_node_t::next", + ][::std::mem::offset_of!(mecab_node_t, next) - 8usize]; + [ + "Offset of field: mecab_node_t::enext", + ][::std::mem::offset_of!(mecab_node_t, enext) - 16usize]; + [ + "Offset of field: mecab_node_t::bnext", + ][::std::mem::offset_of!(mecab_node_t, bnext) - 24usize]; + [ + "Offset of field: mecab_node_t::rpath", + ][::std::mem::offset_of!(mecab_node_t, rpath) - 32usize]; + [ + "Offset of field: mecab_node_t::lpath", + ][::std::mem::offset_of!(mecab_node_t, lpath) - 40usize]; + [ + "Offset of field: mecab_node_t::surface", + ][::std::mem::offset_of!(mecab_node_t, surface) - 48usize]; + [ + "Offset of field: mecab_node_t::feature", + ][::std::mem::offset_of!(mecab_node_t, feature) - 56usize]; + [ + "Offset of field: mecab_node_t::id", + ][::std::mem::offset_of!(mecab_node_t, id) - 64usize]; + [ + "Offset of field: mecab_node_t::length", + ][::std::mem::offset_of!(mecab_node_t, length) - 68usize]; + [ + "Offset of field: mecab_node_t::rlength", + ][::std::mem::offset_of!(mecab_node_t, rlength) - 70usize]; + [ + "Offset of field: mecab_node_t::rcAttr", + ][::std::mem::offset_of!(mecab_node_t, rcAttr) - 72usize]; + [ + "Offset of field: mecab_node_t::lcAttr", + ][::std::mem::offset_of!(mecab_node_t, lcAttr) - 74usize]; + [ + "Offset of field: mecab_node_t::posid", + ][::std::mem::offset_of!(mecab_node_t, posid) - 76usize]; + [ + "Offset of field: mecab_node_t::char_type", + ][::std::mem::offset_of!(mecab_node_t, char_type) - 78usize]; + [ + "Offset of field: mecab_node_t::stat", + ][::std::mem::offset_of!(mecab_node_t, stat) - 79usize]; + [ + "Offset of field: mecab_node_t::isbest", + ][::std::mem::offset_of!(mecab_node_t, isbest) - 80usize]; + [ + "Offset of field: mecab_node_t::alpha", + ][::std::mem::offset_of!(mecab_node_t, alpha) - 84usize]; + [ + "Offset of field: mecab_node_t::beta", + ][::std::mem::offset_of!(mecab_node_t, beta) - 88usize]; + [ + "Offset of field: mecab_node_t::prob", + ][::std::mem::offset_of!(mecab_node_t, prob) - 92usize]; + [ + "Offset of field: mecab_node_t::wcost", + ][::std::mem::offset_of!(mecab_node_t, wcost) - 96usize]; + [ + "Offset of field: mecab_node_t::cost", + ][::std::mem::offset_of!(mecab_node_t, cost) - 104usize]; +}; pub const MECAB_NOR_NODE: _bindgen_ty_1 = _bindgen_ty_1::MECAB_NOR_NODE; pub const MECAB_UNK_NODE: _bindgen_ty_1 = _bindgen_ty_1::MECAB_UNK_NODE; pub const MECAB_BOS_NODE: _bindgen_ty_1 = _bindgen_ty_1::MECAB_BOS_NODE; pub const MECAB_EOS_NODE: _bindgen_ty_1 = _bindgen_ty_1::MECAB_EOS_NODE; pub const MECAB_EON_NODE: _bindgen_ty_1 = _bindgen_ty_1::MECAB_EON_NODE; #[repr(u32)] -#[doc = " Parameters for MeCab::Node::stat"] +/// Parameters for MeCab::Node::stat #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum _bindgen_ty_1 { - #[doc = " Normal node defined in the dictionary."] + /// Normal node defined in the dictionary. MECAB_NOR_NODE = 0, - #[doc = " Unknown node not defined in the dictionary."] + /// Unknown node not defined in the dictionary. MECAB_UNK_NODE = 1, - #[doc = " Virtual node representing a beginning of the sentence."] + /// Virtual node representing a beginning of the sentence. MECAB_BOS_NODE = 2, - #[doc = " Virtual node representing a end of the sentence."] + /// Virtual node representing a end of the sentence. MECAB_EOS_NODE = 3, - #[doc = " Virtual node representing a end of the N-best enumeration."] + /// Virtual node representing a end of the N-best enumeration. MECAB_EON_NODE = 4, } pub const MECAB_SYS_DIC: _bindgen_ty_2 = _bindgen_ty_2::MECAB_SYS_DIC; pub const MECAB_USR_DIC: _bindgen_ty_2 = _bindgen_ty_2::MECAB_USR_DIC; pub const MECAB_UNK_DIC: _bindgen_ty_2 = _bindgen_ty_2::MECAB_UNK_DIC; #[repr(u32)] -#[doc = " Parameters for MeCab::DictionaryInfo::type"] +/// Parameters for MeCab::DictionaryInfo::type #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum _bindgen_ty_2 { - #[doc = " This is a system dictionary."] + /// This is a system dictionary. MECAB_SYS_DIC = 0, - #[doc = " This is a user dictionary."] + /// This is a user dictionary. MECAB_USR_DIC = 1, - #[doc = " This is a unknown word dictionary."] + /// This is a unknown word dictionary. MECAB_UNK_DIC = 2, } pub const MECAB_ONE_BEST: _bindgen_ty_3 = _bindgen_ty_3::MECAB_ONE_BEST; @@ -547,43 +268,43 @@ pub const MECAB_ALTERNATIVE: _bindgen_ty_3 = _bindgen_ty_3::MECAB_ALTERNATIVE; pub const MECAB_ALL_MORPHS: _bindgen_ty_3 = _bindgen_ty_3::MECAB_ALL_MORPHS; pub const MECAB_ALLOCATE_SENTENCE: _bindgen_ty_3 = _bindgen_ty_3::MECAB_ALLOCATE_SENTENCE; #[repr(u32)] -#[doc = " Parameters for MeCab::Lattice::request_type"] +/// Parameters for MeCab::Lattice::request_type #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum _bindgen_ty_3 { - #[doc = " One best result is obtained (default mode)"] + /// One best result is obtained (default mode) MECAB_ONE_BEST = 1, - #[doc = " Set this flag if you want to obtain N best results."] + /// Set this flag if you want to obtain N best results. MECAB_NBEST = 2, - #[doc = " Set this flag if you want to enable a partial parsing mode."] - #[doc = " When this flag is set, the input |sentence| needs to be written"] - #[doc = " in partial parsing format."] + /** Set this flag if you want to enable a partial parsing mode. + When this flag is set, the input |sentence| needs to be written + in partial parsing format.*/ MECAB_PARTIAL = 4, - #[doc = " Set this flag if you want to obtain marginal probabilities."] - #[doc = " Marginal probability is set in MeCab::Node::prob."] - #[doc = " The parsing speed will get 3-5 times slower than the default mode."] + /** Set this flag if you want to obtain marginal probabilities. + Marginal probability is set in MeCab::Node::prob. + The parsing speed will get 3-5 times slower than the default mode.*/ MECAB_MARGINAL_PROB = 8, - #[doc = " Set this flag if you want to obtain alternative results."] - #[doc = " Not implemented."] + /** Set this flag if you want to obtain alternative results. + Not implemented.*/ MECAB_ALTERNATIVE = 16, - #[doc = " When this flag is set, the result linked-list (Node::next/prev)"] - #[doc = " traverses all nodes in the lattice."] + /** When this flag is set, the result linked-list (Node::next/prev) + traverses all nodes in the lattice.*/ MECAB_ALL_MORPHS = 32, - #[doc = " When this flag is set, tagger internally copies the body of passed"] - #[doc = " sentence into internal buffer."] + /** When this flag is set, tagger internally copies the body of passed + sentence into internal buffer.*/ MECAB_ALLOCATE_SENTENCE = 64, } pub const MECAB_ANY_BOUNDARY: _bindgen_ty_4 = _bindgen_ty_4::MECAB_ANY_BOUNDARY; pub const MECAB_TOKEN_BOUNDARY: _bindgen_ty_4 = _bindgen_ty_4::MECAB_TOKEN_BOUNDARY; pub const MECAB_INSIDE_TOKEN: _bindgen_ty_4 = _bindgen_ty_4::MECAB_INSIDE_TOKEN; #[repr(u32)] -#[doc = " Parameters for MeCab::Lattice::boundary_constraint_type"] +/// Parameters for MeCab::Lattice::boundary_constraint_type #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum _bindgen_ty_4 { - #[doc = " The token boundary is not specified."] + /// The token boundary is not specified. MECAB_ANY_BOUNDARY = 0, - #[doc = " The position is a strong token boundary."] + /// The position is a strong token boundary. MECAB_TOKEN_BOUNDARY = 1, - #[doc = " The position is not a token boundary."] + /// The position is not a token boundary. MECAB_INSIDE_TOKEN = 2, } #[repr(C)] @@ -608,76 +329,76 @@ pub struct mecab_lattice_t { _unused: [u8; 0], } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::create(argc, argv)"] + /// C wrapper of MeCab::Tagger::create(argc, argv) pub fn mecab_new( argc: ::std::os::raw::c_int, argv: *mut *mut ::std::os::raw::c_char, ) -> *mut mecab_t; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::create(arg)"] + /// C wrapper of MeCab::Tagger::create(arg) pub fn mecab_new2(arg: *const ::std::os::raw::c_char) -> *mut mecab_t; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::version()"] + /// C wrapper of MeCab::Tagger::version() pub fn mecab_version() -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::getLastError()"] + /// C wrapper of MeCab::getLastError() pub fn mecab_strerror(mecab: *mut mecab_t) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::deleteTagger(tagger)"] + /// C wrapper of MeCab::deleteTagger(tagger) pub fn mecab_destroy(mecab: *mut mecab_t); } extern "C" { - #[doc = " C wrapper of MeCab::Tagger:set_partial()"] + /// C wrapper of MeCab::Tagger:set_partial() pub fn mecab_get_partial(mecab: *mut mecab_t) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::partial()"] + /// C wrapper of MeCab::Tagger::partial() pub fn mecab_set_partial(mecab: *mut mecab_t, partial: ::std::os::raw::c_int); } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::theta()"] + /// C wrapper of MeCab::Tagger::theta() pub fn mecab_get_theta(mecab: *mut mecab_t) -> f32; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::set_theta()"] + /// C wrapper of MeCab::Tagger::set_theta() pub fn mecab_set_theta(mecab: *mut mecab_t, theta: f32); } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::lattice_level()"] + /// C wrapper of MeCab::Tagger::lattice_level() pub fn mecab_get_lattice_level(mecab: *mut mecab_t) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::set_lattice_level()"] + /// C wrapper of MeCab::Tagger::set_lattice_level() pub fn mecab_set_lattice_level(mecab: *mut mecab_t, level: ::std::os::raw::c_int); } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::all_morphs()"] + /// C wrapper of MeCab::Tagger::all_morphs() pub fn mecab_get_all_morphs(mecab: *mut mecab_t) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::set_all_moprhs()"] + /// C wrapper of MeCab::Tagger::set_all_moprhs() pub fn mecab_set_all_morphs(mecab: *mut mecab_t, all_morphs: ::std::os::raw::c_int); } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parse(MeCab::Lattice *lattice)"] + /// C wrapper of MeCab::Tagger::parse(MeCab::Lattice *lattice) pub fn mecab_parse_lattice( mecab: *mut mecab_t, lattice: *mut mecab_lattice_t, ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parse(const char *str)"] + /// C wrapper of MeCab::Tagger::parse(const char *str) pub fn mecab_sparse_tostr( mecab: *mut mecab_t, str_: *const ::std::os::raw::c_char, ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parse(const char *str, size_t len)"] + /// C wrapper of MeCab::Tagger::parse(const char *str, size_t len) pub fn mecab_sparse_tostr2( mecab: *mut mecab_t, str_: *const ::std::os::raw::c_char, @@ -685,7 +406,7 @@ extern "C" { ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parse(const char *str, char *ostr, size_t olen)"] + /// C wrapper of MeCab::Tagger::parse(const char *str, char *ostr, size_t olen) pub fn mecab_sparse_tostr3( mecab: *mut mecab_t, str_: *const ::std::os::raw::c_char, @@ -695,14 +416,14 @@ extern "C" { ) -> *mut ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parseToNode(const char *str)"] + /// C wrapper of MeCab::Tagger::parseToNode(const char *str) pub fn mecab_sparse_tonode( mecab: *mut mecab_t, arg1: *const ::std::os::raw::c_char, ) -> *const mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parseToNode(const char *str, size_t len)"] + /// C wrapper of MeCab::Tagger::parseToNode(const char *str, size_t len) pub fn mecab_sparse_tonode2( mecab: *mut mecab_t, arg1: *const ::std::os::raw::c_char, @@ -710,7 +431,7 @@ extern "C" { ) -> *const mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parseNBest(size_t N, const char *str)"] + /// C wrapper of MeCab::Tagger::parseNBest(size_t N, const char *str) pub fn mecab_nbest_sparse_tostr( mecab: *mut mecab_t, N: usize, @@ -718,7 +439,7 @@ extern "C" { ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parseNBest(size_t N, const char *str, size_t len)"] + /// C wrapper of MeCab::Tagger::parseNBest(size_t N, const char *str, size_t len) pub fn mecab_nbest_sparse_tostr2( mecab: *mut mecab_t, N: usize, @@ -727,7 +448,7 @@ extern "C" { ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parseNBest(size_t N, const char *str, char *ostr, size_t olen)"] + /// C wrapper of MeCab::Tagger::parseNBest(size_t N, const char *str, char *ostr, size_t olen) pub fn mecab_nbest_sparse_tostr3( mecab: *mut mecab_t, N: usize, @@ -738,14 +459,14 @@ extern "C" { ) -> *mut ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parseNBestInit(const char *str)"] + /// C wrapper of MeCab::Tagger::parseNBestInit(const char *str) pub fn mecab_nbest_init( mecab: *mut mecab_t, str_: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parseNBestInit(const char *str, size_t len)"] + /// C wrapper of MeCab::Tagger::parseNBestInit(const char *str, size_t len) pub fn mecab_nbest_init2( mecab: *mut mecab_t, str_: *const ::std::os::raw::c_char, @@ -753,11 +474,11 @@ extern "C" { ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::next()"] + /// C wrapper of MeCab::Tagger::next() pub fn mecab_nbest_next_tostr(mecab: *mut mecab_t) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::next(char *ostr, size_t olen)"] + /// C wrapper of MeCab::Tagger::next(char *ostr, size_t olen) pub fn mecab_nbest_next_tostr2( mecab: *mut mecab_t, ostr: *mut ::std::os::raw::c_char, @@ -765,84 +486,91 @@ extern "C" { ) -> *mut ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::nextNode()"] + /// C wrapper of MeCab::Tagger::nextNode() pub fn mecab_nbest_next_tonode(mecab: *mut mecab_t) -> *const mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::formatNode(const Node *node)"] + /// C wrapper of MeCab::Tagger::formatNode(const Node *node) pub fn mecab_format_node( mecab: *mut mecab_t, node: *const mecab_node_t, ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::dictionary_info()"] + /// C wrapper of MeCab::Tagger::dictionary_info() pub fn mecab_dictionary_info(mecab: *mut mecab_t) -> *const mecab_dictionary_info_t; } extern "C" { - #[doc = " C wrapper of MeCab::createLattice()"] + /// C wrapper of MeCab::createLattice() pub fn mecab_lattice_new() -> *mut mecab_lattice_t; } extern "C" { - #[doc = " C wrapper of MeCab::deleteLattice(lattice)"] + /// C wrapper of MeCab::deleteLattice(lattice) pub fn mecab_lattice_destroy(lattice: *mut mecab_lattice_t); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::clear()"] + /// C wrapper of MeCab::Lattice::clear() pub fn mecab_lattice_clear(lattice: *mut mecab_lattice_t); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::is_available()"] - pub fn mecab_lattice_is_available(lattice: *mut mecab_lattice_t) -> ::std::os::raw::c_int; + /// C wrapper of MeCab::Lattice::is_available() + pub fn mecab_lattice_is_available( + lattice: *mut mecab_lattice_t, + ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::bos_node()"] - pub fn mecab_lattice_get_bos_node(lattice: *mut mecab_lattice_t) -> *mut mecab_node_t; + /// C wrapper of MeCab::Lattice::bos_node() + pub fn mecab_lattice_get_bos_node( + lattice: *mut mecab_lattice_t, + ) -> *mut mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::eos_node()"] - pub fn mecab_lattice_get_eos_node(lattice: *mut mecab_lattice_t) -> *mut mecab_node_t; + /// C wrapper of MeCab::Lattice::eos_node() + pub fn mecab_lattice_get_eos_node( + lattice: *mut mecab_lattice_t, + ) -> *mut mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::begin_nodes()"] + /// C wrapper of MeCab::Lattice::begin_nodes() pub fn mecab_lattice_get_all_begin_nodes( lattice: *mut mecab_lattice_t, ) -> *mut *mut mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::end_nodes()"] - pub fn mecab_lattice_get_all_end_nodes(lattice: *mut mecab_lattice_t) - -> *mut *mut mecab_node_t; + /// C wrapper of MeCab::Lattice::end_nodes() + pub fn mecab_lattice_get_all_end_nodes( + lattice: *mut mecab_lattice_t, + ) -> *mut *mut mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::begin_nodes(pos)"] + /// C wrapper of MeCab::Lattice::begin_nodes(pos) pub fn mecab_lattice_get_begin_nodes( lattice: *mut mecab_lattice_t, pos: usize, ) -> *mut mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::end_nodes(pos)"] + /// C wrapper of MeCab::Lattice::end_nodes(pos) pub fn mecab_lattice_get_end_nodes( lattice: *mut mecab_lattice_t, pos: usize, ) -> *mut mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::sentence()"] + /// C wrapper of MeCab::Lattice::sentence() pub fn mecab_lattice_get_sentence( lattice: *mut mecab_lattice_t, ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::set_sentence(sentence)"] + /// C wrapper of MeCab::Lattice::set_sentence(sentence) pub fn mecab_lattice_set_sentence( lattice: *mut mecab_lattice_t, sentence: *const ::std::os::raw::c_char, ); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::set_sentence(sentence, len)"] + /// C wrapper of MeCab::Lattice::set_sentence(sentence, len) pub fn mecab_lattice_set_sentence2( lattice: *mut mecab_lattice_t, sentence: *const ::std::os::raw::c_char, @@ -850,71 +578,75 @@ extern "C" { ); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::size()"] + /// C wrapper of MeCab::Lattice::size() pub fn mecab_lattice_get_size(lattice: *mut mecab_lattice_t) -> usize; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::Z()"] + /// C wrapper of MeCab::Lattice::Z() pub fn mecab_lattice_get_z(lattice: *mut mecab_lattice_t) -> f64; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::set_Z()"] + /// C wrapper of MeCab::Lattice::set_Z() pub fn mecab_lattice_set_z(lattice: *mut mecab_lattice_t, Z: f64); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::theta()"] + /// C wrapper of MeCab::Lattice::theta() pub fn mecab_lattice_get_theta(lattice: *mut mecab_lattice_t) -> f64; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::set_theta()"] + /// C wrapper of MeCab::Lattice::set_theta() pub fn mecab_lattice_set_theta(lattice: *mut mecab_lattice_t, theta: f64); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::next()"] + /// C wrapper of MeCab::Lattice::next() pub fn mecab_lattice_next(lattice: *mut mecab_lattice_t) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::request_type()"] - pub fn mecab_lattice_get_request_type(lattice: *mut mecab_lattice_t) -> ::std::os::raw::c_int; + /// C wrapper of MeCab::Lattice::request_type() + pub fn mecab_lattice_get_request_type( + lattice: *mut mecab_lattice_t, + ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::has_request_type()"] + /// C wrapper of MeCab::Lattice::has_request_type() pub fn mecab_lattice_has_request_type( lattice: *mut mecab_lattice_t, request_type: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::set_request_type()"] + /// C wrapper of MeCab::Lattice::set_request_type() pub fn mecab_lattice_set_request_type( lattice: *mut mecab_lattice_t, request_type: ::std::os::raw::c_int, ); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::add_request_type()"] + /// C wrapper of MeCab::Lattice::add_request_type() pub fn mecab_lattice_add_request_type( lattice: *mut mecab_lattice_t, request_type: ::std::os::raw::c_int, ); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::remove_request_type()"] + /// C wrapper of MeCab::Lattice::remove_request_type() pub fn mecab_lattice_remove_request_type( lattice: *mut mecab_lattice_t, request_type: ::std::os::raw::c_int, ); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::newNode();"] + /// C wrapper of MeCab::Lattice::newNode(); pub fn mecab_lattice_new_node(lattice: *mut mecab_lattice_t) -> *mut mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::toString()"] - pub fn mecab_lattice_tostr(lattice: *mut mecab_lattice_t) -> *const ::std::os::raw::c_char; + /// C wrapper of MeCab::Lattice::toString() + pub fn mecab_lattice_tostr( + lattice: *mut mecab_lattice_t, + ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::toString(buf, size)"] + /// C wrapper of MeCab::Lattice::toString(buf, size) pub fn mecab_lattice_tostr2( lattice: *mut mecab_lattice_t, buf: *mut ::std::os::raw::c_char, @@ -922,14 +654,14 @@ extern "C" { ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::enumNBestAsString(N)"] + /// C wrapper of MeCab::Lattice::enumNBestAsString(N) pub fn mecab_lattice_nbest_tostr( lattice: *mut mecab_lattice_t, N: usize, ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::enumNBestAsString(N, buf, size)"] + /// C wrapper of MeCab::Lattice::enumNBestAsString(N, buf, size) pub fn mecab_lattice_nbest_tostr2( lattice: *mut mecab_lattice_t, N: usize, @@ -938,25 +670,27 @@ extern "C" { ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::has_constraint()"] - pub fn mecab_lattice_has_constraint(lattice: *mut mecab_lattice_t) -> ::std::os::raw::c_int; + /// C wrapper of MeCab::Lattice::has_constraint() + pub fn mecab_lattice_has_constraint( + lattice: *mut mecab_lattice_t, + ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::boundary_constraint(pos)"] + /// C wrapper of MeCab::Lattice::boundary_constraint(pos) pub fn mecab_lattice_get_boundary_constraint( lattice: *mut mecab_lattice_t, pos: usize, ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::feature_constraint(pos)"] + /// C wrapper of MeCab::Lattice::feature_constraint(pos) pub fn mecab_lattice_get_feature_constraint( lattice: *mut mecab_lattice_t, pos: usize, ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::boundary_constraint(pos, type)"] + /// C wrapper of MeCab::Lattice::boundary_constraint(pos, type) pub fn mecab_lattice_set_boundary_constraint( lattice: *mut mecab_lattice_t, pos: usize, @@ -964,7 +698,7 @@ extern "C" { ); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::set_feature_constraint(begin_pos, end_pos, feature)"] + /// C wrapper of MeCab::Lattice::set_feature_constraint(begin_pos, end_pos, feature) pub fn mecab_lattice_set_feature_constraint( lattice: *mut mecab_lattice_t, begin_pos: usize, @@ -973,53 +707,56 @@ extern "C" { ); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::set_result(result);"] + /// C wrapper of MeCab::Lattice::set_result(result); pub fn mecab_lattice_set_result( lattice: *mut mecab_lattice_t, result: *const ::std::os::raw::c_char, ); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::what()"] - pub fn mecab_lattice_strerror(lattice: *mut mecab_lattice_t) -> *const ::std::os::raw::c_char; + /// C wrapper of MeCab::Lattice::what() + pub fn mecab_lattice_strerror( + lattice: *mut mecab_lattice_t, + ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wapper of MeCab::Model::create(argc, argv)"] + /// C wapper of MeCab::Model::create(argc, argv) pub fn mecab_model_new( argc: ::std::os::raw::c_int, argv: *mut *mut ::std::os::raw::c_char, ) -> *mut mecab_model_t; } extern "C" { - #[doc = " C wapper of MeCab::Model::create(arg)"] + /// C wapper of MeCab::Model::create(arg) pub fn mecab_model_new2(arg: *const ::std::os::raw::c_char) -> *mut mecab_model_t; } extern "C" { - #[doc = " C wapper of MeCab::deleteModel(model)"] + /// C wapper of MeCab::deleteModel(model) pub fn mecab_model_destroy(model: *mut mecab_model_t); } extern "C" { - #[doc = " C wapper of MeCab::Model::createTagger()"] + /// C wapper of MeCab::Model::createTagger() pub fn mecab_model_new_tagger(model: *mut mecab_model_t) -> *mut mecab_t; } extern "C" { - #[doc = " C wapper of MeCab::Model::createLattice()"] + /// C wapper of MeCab::Model::createLattice() pub fn mecab_model_new_lattice(model: *mut mecab_model_t) -> *mut mecab_lattice_t; } extern "C" { - #[doc = " C wrapper of MeCab::Model::swap()"] + /// C wrapper of MeCab::Model::swap() pub fn mecab_model_swap( model: *mut mecab_model_t, new_model: *mut mecab_model_t, ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wapper of MeCab::Model::dictionary_info()"] - pub fn mecab_model_dictionary_info(model: *mut mecab_model_t) - -> *const mecab_dictionary_info_t; + /// C wapper of MeCab::Model::dictionary_info() + pub fn mecab_model_dictionary_info( + model: *mut mecab_model_t, + ) -> *const mecab_dictionary_info_t; } extern "C" { - #[doc = " C wrapper of MeCab::Model::transition_cost()"] + /// C wrapper of MeCab::Model::transition_cost() pub fn mecab_model_transition_cost( model: *mut mecab_model_t, rcAttr: ::std::os::raw::c_ushort, @@ -1027,7 +764,7 @@ extern "C" { ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Model::lookup()"] + /// C wrapper of MeCab::Model::lookup() pub fn mecab_model_lookup( model: *mut mecab_model_t, begin: *const ::std::os::raw::c_char, @@ -1071,11 +808,11 @@ extern "C" { argv: *mut *mut ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } -#[doc = " DictionaryInfo structure"] +/// DictionaryInfo structure pub type MeCab_DictionaryInfo = mecab_dictionary_info_t; -#[doc = " Path structure"] +/// Path structure pub type MeCab_Path = mecab_path_t; -#[doc = " Node structure"] +/// Node structure pub type MeCab_Node = mecab_node_t; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -1084,71 +821,55 @@ pub struct MeCab_Allocator { } #[repr(C)] pub struct MeCab_Lattice__bindgen_vtable(::std::os::raw::c_void); -#[doc = " Lattice class"] +/// Lattice class #[repr(C)] #[derive(Debug)] pub struct MeCab_Lattice { pub vtable_: *const MeCab_Lattice__bindgen_vtable, } -#[test] -fn bindgen_test_layout_MeCab_Lattice() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(MeCab_Lattice)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(MeCab_Lattice)) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of MeCab_Lattice"][::std::mem::size_of::() - 8usize]; + ["Alignment of MeCab_Lattice"][::std::mem::align_of::() - 8usize]; +}; extern "C" { - #[doc = " Create new Lattice object"] - #[doc = " @return new Lattice object"] + /** Create new Lattice object + @return new Lattice object*/ #[link_name = "\u{1}_ZN5MeCab7Lattice6createEv"] pub fn MeCab_Lattice_create() -> *mut MeCab_Lattice; } impl MeCab_Lattice { #[inline] pub unsafe fn create() -> *mut MeCab_Lattice { - unsafe { MeCab_Lattice_create() } + MeCab_Lattice_create() } } #[repr(C)] pub struct MeCab_Model__bindgen_vtable(::std::os::raw::c_void); -#[doc = " Model class"] +/// Model class #[repr(C)] #[derive(Debug)] pub struct MeCab_Model { pub vtable_: *const MeCab_Model__bindgen_vtable, } -#[test] -fn bindgen_test_layout_MeCab_Model() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(MeCab_Model)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(MeCab_Model)) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of MeCab_Model"][::std::mem::size_of::() - 8usize]; + ["Alignment of MeCab_Model"][::std::mem::align_of::() - 8usize]; +}; extern "C" { - #[doc = " Return a version string"] - #[doc = " @return version string"] + /** Return a version string + @return version string*/ #[link_name = "\u{1}_ZN5MeCab5Model7versionEv"] pub fn MeCab_Model_version() -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " Factory method to create a new Model with a specified main's argc/argv-style parameters."] - #[doc = " Return NULL if new model cannot be initialized. Use MeCab::getLastError() to obtain the"] - #[doc = " cause of the errors."] - #[doc = " @return new Model object"] - #[doc = " @param argc number of parameters"] - #[doc = " @param argv parameter list"] + /** Factory method to create a new Model with a specified main's argc/argv-style parameters. + Return NULL if new model cannot be initialized. Use MeCab::getLastError() to obtain the + cause of the errors. + @return new Model object + @param argc number of parameters + @param argv parameter list*/ #[link_name = "\u{1}_ZN5MeCab5Model6createEiPPc"] pub fn MeCab_Model_create( argc: ::std::os::raw::c_int, @@ -1156,74 +877,69 @@ extern "C" { ) -> *mut MeCab_Model; } extern "C" { - #[doc = " Factory method to create a new Model with a string parameter representation, i.e.,"] - #[doc = " \"-d /user/local/mecab/dic/ipadic -Ochasen\"."] - #[doc = " Return NULL if new model cannot be initialized. Use MeCab::getLastError() to obtain the"] - #[doc = " cause of the errors."] - #[doc = " @return new Model object"] - #[doc = " @param arg single string representation of the argment."] + /** Factory method to create a new Model with a string parameter representation, i.e., + "-d /user/local/mecab/dic/ipadic -Ochasen". + Return NULL if new model cannot be initialized. Use MeCab::getLastError() to obtain the + cause of the errors. + @return new Model object + @param arg single string representation of the argment.*/ #[link_name = "\u{1}_ZN5MeCab5Model6createEPKc"] pub fn MeCab_Model_create1(arg: *const ::std::os::raw::c_char) -> *mut MeCab_Model; } impl MeCab_Model { #[inline] pub unsafe fn version() -> *const ::std::os::raw::c_char { - unsafe { MeCab_Model_version() } + MeCab_Model_version() } #[inline] pub unsafe fn create( argc: ::std::os::raw::c_int, argv: *mut *mut ::std::os::raw::c_char, ) -> *mut MeCab_Model { - unsafe { MeCab_Model_create(argc, argv) } + MeCab_Model_create(argc, argv) } #[inline] pub unsafe fn create1(arg: *const ::std::os::raw::c_char) -> *mut MeCab_Model { - unsafe { MeCab_Model_create1(arg) } + MeCab_Model_create1(arg) } } #[repr(C)] pub struct MeCab_Tagger__bindgen_vtable(::std::os::raw::c_void); -#[doc = " Tagger class"] +/// Tagger class #[repr(C)] #[derive(Debug)] pub struct MeCab_Tagger { pub vtable_: *const MeCab_Tagger__bindgen_vtable, } -#[test] -fn bindgen_test_layout_MeCab_Tagger() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(MeCab_Tagger)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(MeCab_Tagger)) - ); -} -extern "C" { - #[doc = " Handy static method."] - #[doc = " Return true if lattice is parsed successfully."] - #[doc = " This function is equivalent to"] - #[doc = " {"] - #[doc = " Tagger *tagger = model.createModel();"] - #[doc = " cosnt bool result = tagger->parse(lattice);"] - #[doc = " delete tagger;"] - #[doc = " return result;"] - #[doc = " }"] - #[doc = " @return boolean"] +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of MeCab_Tagger"][::std::mem::size_of::() - 8usize]; + ["Alignment of MeCab_Tagger"][::std::mem::align_of::() - 8usize]; +}; +extern "C" { + /** Handy static method. + Return true if lattice is parsed successfully. + This function is equivalent to + { + Tagger *tagger = model.createModel(); + cosnt bool result = tagger->parse(lattice); + delete tagger; + return result; + } + @return boolean*/ #[link_name = "\u{1}_ZN5MeCab6Tagger5parseERKNS_5ModelEPNS_7LatticeE"] - pub fn MeCab_Tagger_parse(model: *const MeCab_Model, lattice: *mut MeCab_Lattice) -> bool; -} -extern "C" { - #[doc = " Factory method to create a new Tagger with a specified main's argc/argv-style parameters."] - #[doc = " Return NULL if new model cannot be initialized. Use MeCab::getLastError() to obtain the"] - #[doc = " cause of the errors."] - #[doc = " @return new Tagger object"] - #[doc = " @param argc number of parameters"] - #[doc = " @param argv parameter list"] + pub fn MeCab_Tagger_parse( + model: *const MeCab_Model, + lattice: *mut MeCab_Lattice, + ) -> bool; +} +extern "C" { + /** Factory method to create a new Tagger with a specified main's argc/argv-style parameters. + Return NULL if new model cannot be initialized. Use MeCab::getLastError() to obtain the + cause of the errors. + @return new Tagger object + @param argc number of parameters + @param argv parameter list*/ #[link_name = "\u{1}_ZN5MeCab6Tagger6createEiPPc"] pub fn MeCab_Tagger_create( argc: ::std::os::raw::c_int, @@ -1231,49 +947,49 @@ extern "C" { ) -> *mut MeCab_Tagger; } extern "C" { - #[doc = " Factory method to create a new Tagger with a string parameter representation, i.e.,"] - #[doc = " \"-d /user/local/mecab/dic/ipadic -Ochasen\"."] - #[doc = " Return NULL if new model cannot be initialized. Use MeCab::getLastError() to obtain the"] - #[doc = " cause of the errors."] - #[doc = " @return new Model object"] - #[doc = " @param arg single string representation of the argment."] + /** Factory method to create a new Tagger with a string parameter representation, i.e., + "-d /user/local/mecab/dic/ipadic -Ochasen". + Return NULL if new model cannot be initialized. Use MeCab::getLastError() to obtain the + cause of the errors. + @return new Model object + @param arg single string representation of the argment.*/ #[link_name = "\u{1}_ZN5MeCab6Tagger6createEPKc"] pub fn MeCab_Tagger_create1(arg: *const ::std::os::raw::c_char) -> *mut MeCab_Tagger; } extern "C" { - #[doc = " Return a version string"] - #[doc = " @return version string"] + /** Return a version string + @return version string*/ #[link_name = "\u{1}_ZN5MeCab6Tagger7versionEv"] pub fn MeCab_Tagger_version() -> *const ::std::os::raw::c_char; } impl MeCab_Tagger { #[inline] pub unsafe fn parse(model: *const MeCab_Model, lattice: *mut MeCab_Lattice) -> bool { - unsafe { MeCab_Tagger_parse(model, lattice) } + MeCab_Tagger_parse(model, lattice) } #[inline] pub unsafe fn create( argc: ::std::os::raw::c_int, argv: *mut *mut ::std::os::raw::c_char, ) -> *mut MeCab_Tagger { - unsafe { MeCab_Tagger_create(argc, argv) } + MeCab_Tagger_create(argc, argv) } #[inline] pub unsafe fn create1(arg: *const ::std::os::raw::c_char) -> *mut MeCab_Tagger { - unsafe { MeCab_Tagger_create1(arg) } + MeCab_Tagger_create1(arg) } #[inline] pub unsafe fn version() -> *const ::std::os::raw::c_char { - unsafe { MeCab_Tagger_version() } + MeCab_Tagger_version() } } extern "C" { - #[doc = " Alias of Lattice::create()"] + /// Alias of Lattice::create() #[link_name = "\u{1}_ZN5MeCab13createLatticeEv"] pub fn MeCab_createLattice() -> *mut MeCab_Lattice; } extern "C" { - #[doc = " Alias of Mode::create(argc, argv)"] + /// Alias of Mode::create(argc, argv) #[link_name = "\u{1}_ZN5MeCab11createModelEiPPc"] pub fn MeCab_createModel( argc: ::std::os::raw::c_int, @@ -1281,12 +997,12 @@ extern "C" { ) -> *mut MeCab_Model; } extern "C" { - #[doc = " Alias of Mode::create(arg)"] + /// Alias of Mode::create(arg) #[link_name = "\u{1}_ZN5MeCab11createModelEPKc"] pub fn MeCab_createModel1(arg: *const ::std::os::raw::c_char) -> *mut MeCab_Model; } extern "C" { - #[doc = " Alias of Tagger::create(argc, argv)"] + /// Alias of Tagger::create(argc, argv) #[link_name = "\u{1}_ZN5MeCab12createTaggerEiPPc"] pub fn MeCab_createTagger( argc: ::std::os::raw::c_int, @@ -1294,44 +1010,44 @@ extern "C" { ) -> *mut MeCab_Tagger; } extern "C" { - #[doc = " Alias of Tagger::create(arg)"] + /// Alias of Tagger::create(arg) #[link_name = "\u{1}_ZN5MeCab12createTaggerEPKc"] pub fn MeCab_createTagger1(arg: *const ::std::os::raw::c_char) -> *mut MeCab_Tagger; } extern "C" { - #[doc = " delete Lattice object."] - #[doc = " This method calles \"delete lattice\"."] - #[doc = " In some environment, e.g., MS-Windows, an object allocated inside a DLL must be deleted in the same DLL too."] - #[doc = " @param lattice lattice object"] + /** delete Lattice object. + This method calles "delete lattice". + In some environment, e.g., MS-Windows, an object allocated inside a DLL must be deleted in the same DLL too. + @param lattice lattice object*/ #[link_name = "\u{1}_ZN5MeCab13deleteLatticeEPNS_7LatticeE"] pub fn MeCab_deleteLattice(lattice: *mut MeCab_Lattice); } extern "C" { - #[doc = " delete Model object."] - #[doc = " This method calles \"delete model\"."] - #[doc = " In some environment, e.g., MS-Windows, an object allocated inside a DLL must be deleted in the same DLL too."] - #[doc = " @param model model object"] + /** delete Model object. + This method calles "delete model". + In some environment, e.g., MS-Windows, an object allocated inside a DLL must be deleted in the same DLL too. + @param model model object*/ #[link_name = "\u{1}_ZN5MeCab11deleteModelEPNS_5ModelE"] pub fn MeCab_deleteModel(model: *mut MeCab_Model); } extern "C" { - #[doc = " delete Tagger object."] - #[doc = " This method calles \"delete tagger\"."] - #[doc = " In some environment, e.g., MS-Windows, an object allocated inside a DLL must be deleted in the same DLL too."] - #[doc = " @param tagger tagger object"] + /** delete Tagger object. + This method calles "delete tagger". + In some environment, e.g., MS-Windows, an object allocated inside a DLL must be deleted in the same DLL too. + @param tagger tagger object*/ #[link_name = "\u{1}_ZN5MeCab12deleteTaggerEPNS_6TaggerE"] pub fn MeCab_deleteTagger(tagger: *mut MeCab_Tagger); } extern "C" { - #[doc = " Return last error string."] - #[doc = " @return error string"] + /** Return last error string. + @return error string*/ #[link_name = "\u{1}_ZN5MeCab12getLastErrorEv"] pub fn MeCab_getLastError() -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " An alias of getLastError."] - #[doc = " It is kept for backward compatibility."] - #[doc = " @return error string"] + /** An alias of getLastError. + It is kept for backward compatibility. + @return error string*/ #[link_name = "\u{1}_ZN5MeCab14getTaggerErrorEv"] pub fn MeCab_getTaggerError() -> *const ::std::os::raw::c_char; } @@ -1344,71 +1060,22 @@ pub struct _Mecab { pub tagger: *mut ::std::os::raw::c_void, pub lattice: *mut ::std::os::raw::c_void, } -#[test] -fn bindgen_test_layout__Mecab() { - const UNINIT: ::std::mem::MaybeUninit<_Mecab> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_Mecab>(), - 40usize, - concat!("Size of: ", stringify!(_Mecab)) - ); - assert_eq!( - ::std::mem::align_of::<_Mecab>(), - 8usize, - concat!("Alignment of ", stringify!(_Mecab)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).feature) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_Mecab), - "::", - stringify!(feature) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_Mecab), - "::", - stringify!(size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).model) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_Mecab), - "::", - stringify!(model) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tagger) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_Mecab), - "::", - stringify!(tagger) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lattice) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_Mecab), - "::", - stringify!(lattice) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _Mecab"][::std::mem::size_of::<_Mecab>() - 40usize]; + ["Alignment of _Mecab"][::std::mem::align_of::<_Mecab>() - 8usize]; + [ + "Offset of field: _Mecab::feature", + ][::std::mem::offset_of!(_Mecab, feature) - 0usize]; + ["Offset of field: _Mecab::size"][::std::mem::offset_of!(_Mecab, size) - 8usize]; + ["Offset of field: _Mecab::model"][::std::mem::offset_of!(_Mecab, model) - 16usize]; + [ + "Offset of field: _Mecab::tagger", + ][::std::mem::offset_of!(_Mecab, tagger) - 24usize]; + [ + "Offset of field: _Mecab::lattice", + ][::std::mem::offset_of!(_Mecab, lattice) - 32usize]; +}; pub type Mecab = _Mecab; extern "C" { pub fn Mecab_initialize(m: *mut Mecab) -> ::std::os::raw::c_int; @@ -1467,181 +1134,55 @@ pub struct _NJDNode { pub prev: *mut _NJDNode, pub next: *mut _NJDNode, } -#[test] -fn bindgen_test_layout__NJDNode() { - const UNINIT: ::std::mem::MaybeUninit<_NJDNode> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_NJDNode>(), - 120usize, - concat!("Size of: ", stringify!(_NJDNode)) - ); - assert_eq!( - ::std::mem::align_of::<_NJDNode>(), - 8usize, - concat!("Alignment of ", stringify!(_NJDNode)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).string) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(string) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pos) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(pos) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pos_group1) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(pos_group1) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pos_group2) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(pos_group2) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pos_group3) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(pos_group3) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ctype) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(ctype) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cform) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(cform) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).orig) as usize - ptr as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(orig) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).read) as usize - ptr as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(read) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pron) as usize - ptr as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(pron) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).acc) as usize - ptr as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(acc) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mora_size) as usize - ptr as usize }, - 84usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(mora_size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).chain_rule) as usize - ptr as usize }, - 88usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(chain_rule) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).chain_flag) as usize - ptr as usize }, - 96usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(chain_flag) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize }, - 104usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(prev) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 112usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(next) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _NJDNode"][::std::mem::size_of::<_NJDNode>() - 120usize]; + ["Alignment of _NJDNode"][::std::mem::align_of::<_NJDNode>() - 8usize]; + [ + "Offset of field: _NJDNode::string", + ][::std::mem::offset_of!(_NJDNode, string) - 0usize]; + ["Offset of field: _NJDNode::pos"][::std::mem::offset_of!(_NJDNode, pos) - 8usize]; + [ + "Offset of field: _NJDNode::pos_group1", + ][::std::mem::offset_of!(_NJDNode, pos_group1) - 16usize]; + [ + "Offset of field: _NJDNode::pos_group2", + ][::std::mem::offset_of!(_NJDNode, pos_group2) - 24usize]; + [ + "Offset of field: _NJDNode::pos_group3", + ][::std::mem::offset_of!(_NJDNode, pos_group3) - 32usize]; + [ + "Offset of field: _NJDNode::ctype", + ][::std::mem::offset_of!(_NJDNode, ctype) - 40usize]; + [ + "Offset of field: _NJDNode::cform", + ][::std::mem::offset_of!(_NJDNode, cform) - 48usize]; + [ + "Offset of field: _NJDNode::orig", + ][::std::mem::offset_of!(_NJDNode, orig) - 56usize]; + [ + "Offset of field: _NJDNode::read", + ][::std::mem::offset_of!(_NJDNode, read) - 64usize]; + [ + "Offset of field: _NJDNode::pron", + ][::std::mem::offset_of!(_NJDNode, pron) - 72usize]; + ["Offset of field: _NJDNode::acc"][::std::mem::offset_of!(_NJDNode, acc) - 80usize]; + [ + "Offset of field: _NJDNode::mora_size", + ][::std::mem::offset_of!(_NJDNode, mora_size) - 84usize]; + [ + "Offset of field: _NJDNode::chain_rule", + ][::std::mem::offset_of!(_NJDNode, chain_rule) - 88usize]; + [ + "Offset of field: _NJDNode::chain_flag", + ][::std::mem::offset_of!(_NJDNode, chain_flag) - 96usize]; + [ + "Offset of field: _NJDNode::prev", + ][::std::mem::offset_of!(_NJDNode, prev) - 104usize]; + [ + "Offset of field: _NJDNode::next", + ][::std::mem::offset_of!(_NJDNode, next) - 112usize]; +}; pub type NJDNode = _NJDNode; extern "C" { pub fn NJDNode_initialize(node: *mut NJDNode); @@ -1653,13 +1194,22 @@ extern "C" { pub fn NJDNode_set_pos(node: *mut NJDNode, str_: *const ::std::os::raw::c_char); } extern "C" { - pub fn NJDNode_set_pos_group1(node: *mut NJDNode, str_: *const ::std::os::raw::c_char); + pub fn NJDNode_set_pos_group1( + node: *mut NJDNode, + str_: *const ::std::os::raw::c_char, + ); } extern "C" { - pub fn NJDNode_set_pos_group2(node: *mut NJDNode, str_: *const ::std::os::raw::c_char); + pub fn NJDNode_set_pos_group2( + node: *mut NJDNode, + str_: *const ::std::os::raw::c_char, + ); } extern "C" { - pub fn NJDNode_set_pos_group3(node: *mut NJDNode, str_: *const ::std::os::raw::c_char); + pub fn NJDNode_set_pos_group3( + node: *mut NJDNode, + str_: *const ::std::os::raw::c_char, + ); } extern "C" { pub fn NJDNode_set_ctype(node: *mut NJDNode, str_: *const ::std::os::raw::c_char); @@ -1683,7 +1233,10 @@ extern "C" { pub fn NJDNode_set_mora_size(node: *mut NJDNode, size: ::std::os::raw::c_int); } extern "C" { - pub fn NJDNode_set_chain_rule(node: *mut NJDNode, str_: *const ::std::os::raw::c_char); + pub fn NJDNode_set_chain_rule( + node: *mut NJDNode, + str_: *const ::std::os::raw::c_char, + ); } extern "C" { pub fn NJDNode_set_chain_flag(node: *mut NJDNode, flag: ::std::os::raw::c_int); @@ -1783,41 +1336,13 @@ pub struct _NJD { pub head: *mut NJDNode, pub tail: *mut NJDNode, } -#[test] -fn bindgen_test_layout__NJD() { - const UNINIT: ::std::mem::MaybeUninit<_NJD> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_NJD>(), - 16usize, - concat!("Size of: ", stringify!(_NJD)) - ); - assert_eq!( - ::std::mem::align_of::<_NJD>(), - 8usize, - concat!("Alignment of ", stringify!(_NJD)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).head) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_NJD), - "::", - stringify!(head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tail) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_NJD), - "::", - stringify!(tail) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _NJD"][::std::mem::size_of::<_NJD>() - 16usize]; + ["Alignment of _NJD"][::std::mem::align_of::<_NJD>() - 8usize]; + ["Offset of field: _NJD::head"][::std::mem::offset_of!(_NJD, head) - 0usize]; + ["Offset of field: _NJD::tail"][::std::mem::offset_of!(_NJD, tail) - 8usize]; +}; pub type NJD = _NJD; extern "C" { pub fn NJD_initialize(njd: *mut NJD); @@ -1867,62 +1392,27 @@ pub struct _JPCommonLabelPhoneme { pub next: *mut _JPCommonLabelPhoneme, pub up: *mut _JPCommonLabelMora, } -#[test] -fn bindgen_test_layout__JPCommonLabelPhoneme() { - const UNINIT: ::std::mem::MaybeUninit<_JPCommonLabelPhoneme> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_JPCommonLabelPhoneme>(), - 32usize, - concat!("Size of: ", stringify!(_JPCommonLabelPhoneme)) - ); - assert_eq!( - ::std::mem::align_of::<_JPCommonLabelPhoneme>(), - 8usize, - concat!("Alignment of ", stringify!(_JPCommonLabelPhoneme)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).phoneme) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelPhoneme), - "::", - stringify!(phoneme) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelPhoneme), - "::", - stringify!(prev) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelPhoneme), - "::", - stringify!(next) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).up) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelPhoneme), - "::", - stringify!(up) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + [ + "Size of _JPCommonLabelPhoneme", + ][::std::mem::size_of::<_JPCommonLabelPhoneme>() - 32usize]; + [ + "Alignment of _JPCommonLabelPhoneme", + ][::std::mem::align_of::<_JPCommonLabelPhoneme>() - 8usize]; + [ + "Offset of field: _JPCommonLabelPhoneme::phoneme", + ][::std::mem::offset_of!(_JPCommonLabelPhoneme, phoneme) - 0usize]; + [ + "Offset of field: _JPCommonLabelPhoneme::prev", + ][::std::mem::offset_of!(_JPCommonLabelPhoneme, prev) - 8usize]; + [ + "Offset of field: _JPCommonLabelPhoneme::next", + ][::std::mem::offset_of!(_JPCommonLabelPhoneme, next) - 16usize]; + [ + "Offset of field: _JPCommonLabelPhoneme::up", + ][::std::mem::offset_of!(_JPCommonLabelPhoneme, up) - 24usize]; +}; pub type JPCommonLabelPhoneme = _JPCommonLabelPhoneme; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -1934,81 +1424,33 @@ pub struct _JPCommonLabelMora { pub next: *mut _JPCommonLabelMora, pub up: *mut _JPCommonLabelWord, } -#[test] -fn bindgen_test_layout__JPCommonLabelMora() { - const UNINIT: ::std::mem::MaybeUninit<_JPCommonLabelMora> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_JPCommonLabelMora>(), - 48usize, - concat!("Size of: ", stringify!(_JPCommonLabelMora)) - ); - assert_eq!( - ::std::mem::align_of::<_JPCommonLabelMora>(), - 8usize, - concat!("Alignment of ", stringify!(_JPCommonLabelMora)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mora) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelMora), - "::", - stringify!(mora) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).head) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelMora), - "::", - stringify!(head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tail) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelMora), - "::", - stringify!(tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelMora), - "::", - stringify!(prev) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelMora), - "::", - stringify!(next) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).up) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelMora), - "::", - stringify!(up) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + [ + "Size of _JPCommonLabelMora", + ][::std::mem::size_of::<_JPCommonLabelMora>() - 48usize]; + [ + "Alignment of _JPCommonLabelMora", + ][::std::mem::align_of::<_JPCommonLabelMora>() - 8usize]; + [ + "Offset of field: _JPCommonLabelMora::mora", + ][::std::mem::offset_of!(_JPCommonLabelMora, mora) - 0usize]; + [ + "Offset of field: _JPCommonLabelMora::head", + ][::std::mem::offset_of!(_JPCommonLabelMora, head) - 8usize]; + [ + "Offset of field: _JPCommonLabelMora::tail", + ][::std::mem::offset_of!(_JPCommonLabelMora, tail) - 16usize]; + [ + "Offset of field: _JPCommonLabelMora::prev", + ][::std::mem::offset_of!(_JPCommonLabelMora, prev) - 24usize]; + [ + "Offset of field: _JPCommonLabelMora::next", + ][::std::mem::offset_of!(_JPCommonLabelMora, next) - 32usize]; + [ + "Offset of field: _JPCommonLabelMora::up", + ][::std::mem::offset_of!(_JPCommonLabelMora, up) - 40usize]; +}; pub type JPCommonLabelMora = _JPCommonLabelMora; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -2023,111 +1465,42 @@ pub struct _JPCommonLabelWord { pub next: *mut _JPCommonLabelWord, pub up: *mut _JPCommonLabelAccentPhrase, } -#[test] -fn bindgen_test_layout__JPCommonLabelWord() { - const UNINIT: ::std::mem::MaybeUninit<_JPCommonLabelWord> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_JPCommonLabelWord>(), - 72usize, - concat!("Size of: ", stringify!(_JPCommonLabelWord)) - ); - assert_eq!( - ::std::mem::align_of::<_JPCommonLabelWord>(), - 8usize, - concat!("Alignment of ", stringify!(_JPCommonLabelWord)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pron) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(pron) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pos) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(pos) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ctype) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(ctype) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cform) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(cform) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).head) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tail) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(prev) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(next) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).up) as usize - ptr as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(up) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + [ + "Size of _JPCommonLabelWord", + ][::std::mem::size_of::<_JPCommonLabelWord>() - 72usize]; + [ + "Alignment of _JPCommonLabelWord", + ][::std::mem::align_of::<_JPCommonLabelWord>() - 8usize]; + [ + "Offset of field: _JPCommonLabelWord::pron", + ][::std::mem::offset_of!(_JPCommonLabelWord, pron) - 0usize]; + [ + "Offset of field: _JPCommonLabelWord::pos", + ][::std::mem::offset_of!(_JPCommonLabelWord, pos) - 8usize]; + [ + "Offset of field: _JPCommonLabelWord::ctype", + ][::std::mem::offset_of!(_JPCommonLabelWord, ctype) - 16usize]; + [ + "Offset of field: _JPCommonLabelWord::cform", + ][::std::mem::offset_of!(_JPCommonLabelWord, cform) - 24usize]; + [ + "Offset of field: _JPCommonLabelWord::head", + ][::std::mem::offset_of!(_JPCommonLabelWord, head) - 32usize]; + [ + "Offset of field: _JPCommonLabelWord::tail", + ][::std::mem::offset_of!(_JPCommonLabelWord, tail) - 40usize]; + [ + "Offset of field: _JPCommonLabelWord::prev", + ][::std::mem::offset_of!(_JPCommonLabelWord, prev) - 48usize]; + [ + "Offset of field: _JPCommonLabelWord::next", + ][::std::mem::offset_of!(_JPCommonLabelWord, next) - 56usize]; + [ + "Offset of field: _JPCommonLabelWord::up", + ][::std::mem::offset_of!(_JPCommonLabelWord, up) - 64usize]; +}; pub type JPCommonLabelWord = _JPCommonLabelWord; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -2140,92 +1513,36 @@ pub struct _JPCommonLabelAccentPhrase { pub next: *mut _JPCommonLabelAccentPhrase, pub up: *mut _JPCommonLabelBreathGroup, } -#[test] -fn bindgen_test_layout__JPCommonLabelAccentPhrase() { - const UNINIT: ::std::mem::MaybeUninit<_JPCommonLabelAccentPhrase> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_JPCommonLabelAccentPhrase>(), - 56usize, - concat!("Size of: ", stringify!(_JPCommonLabelAccentPhrase)) - ); - assert_eq!( - ::std::mem::align_of::<_JPCommonLabelAccentPhrase>(), - 8usize, - concat!("Alignment of ", stringify!(_JPCommonLabelAccentPhrase)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).accent) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelAccentPhrase), - "::", - stringify!(accent) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).emotion) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelAccentPhrase), - "::", - stringify!(emotion) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).head) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelAccentPhrase), - "::", - stringify!(head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tail) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelAccentPhrase), - "::", - stringify!(tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelAccentPhrase), - "::", - stringify!(prev) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelAccentPhrase), - "::", - stringify!(next) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).up) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelAccentPhrase), - "::", - stringify!(up) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + [ + "Size of _JPCommonLabelAccentPhrase", + ][::std::mem::size_of::<_JPCommonLabelAccentPhrase>() - 56usize]; + [ + "Alignment of _JPCommonLabelAccentPhrase", + ][::std::mem::align_of::<_JPCommonLabelAccentPhrase>() - 8usize]; + [ + "Offset of field: _JPCommonLabelAccentPhrase::accent", + ][::std::mem::offset_of!(_JPCommonLabelAccentPhrase, accent) - 0usize]; + [ + "Offset of field: _JPCommonLabelAccentPhrase::emotion", + ][::std::mem::offset_of!(_JPCommonLabelAccentPhrase, emotion) - 8usize]; + [ + "Offset of field: _JPCommonLabelAccentPhrase::head", + ][::std::mem::offset_of!(_JPCommonLabelAccentPhrase, head) - 16usize]; + [ + "Offset of field: _JPCommonLabelAccentPhrase::tail", + ][::std::mem::offset_of!(_JPCommonLabelAccentPhrase, tail) - 24usize]; + [ + "Offset of field: _JPCommonLabelAccentPhrase::prev", + ][::std::mem::offset_of!(_JPCommonLabelAccentPhrase, prev) - 32usize]; + [ + "Offset of field: _JPCommonLabelAccentPhrase::next", + ][::std::mem::offset_of!(_JPCommonLabelAccentPhrase, next) - 40usize]; + [ + "Offset of field: _JPCommonLabelAccentPhrase::up", + ][::std::mem::offset_of!(_JPCommonLabelAccentPhrase, up) - 48usize]; +}; pub type JPCommonLabelAccentPhrase = _JPCommonLabelAccentPhrase; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -2235,62 +1552,27 @@ pub struct _JPCommonLabelBreathGroup { pub prev: *mut _JPCommonLabelBreathGroup, pub next: *mut _JPCommonLabelBreathGroup, } -#[test] -fn bindgen_test_layout__JPCommonLabelBreathGroup() { - const UNINIT: ::std::mem::MaybeUninit<_JPCommonLabelBreathGroup> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_JPCommonLabelBreathGroup>(), - 32usize, - concat!("Size of: ", stringify!(_JPCommonLabelBreathGroup)) - ); - assert_eq!( - ::std::mem::align_of::<_JPCommonLabelBreathGroup>(), - 8usize, - concat!("Alignment of ", stringify!(_JPCommonLabelBreathGroup)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).head) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelBreathGroup), - "::", - stringify!(head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tail) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelBreathGroup), - "::", - stringify!(tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelBreathGroup), - "::", - stringify!(prev) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelBreathGroup), - "::", - stringify!(next) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + [ + "Size of _JPCommonLabelBreathGroup", + ][::std::mem::size_of::<_JPCommonLabelBreathGroup>() - 32usize]; + [ + "Alignment of _JPCommonLabelBreathGroup", + ][::std::mem::align_of::<_JPCommonLabelBreathGroup>() - 8usize]; + [ + "Offset of field: _JPCommonLabelBreathGroup::head", + ][::std::mem::offset_of!(_JPCommonLabelBreathGroup, head) - 0usize]; + [ + "Offset of field: _JPCommonLabelBreathGroup::tail", + ][::std::mem::offset_of!(_JPCommonLabelBreathGroup, tail) - 8usize]; + [ + "Offset of field: _JPCommonLabelBreathGroup::prev", + ][::std::mem::offset_of!(_JPCommonLabelBreathGroup, prev) - 16usize]; + [ + "Offset of field: _JPCommonLabelBreathGroup::next", + ][::std::mem::offset_of!(_JPCommonLabelBreathGroup, next) - 24usize]; +}; pub type JPCommonLabelBreathGroup = _JPCommonLabelBreathGroup; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -2309,151 +1591,50 @@ pub struct _JPCommonLabel { pub phoneme_tail: *mut JPCommonLabelPhoneme, pub short_pause_flag: ::std::os::raw::c_int, } -#[test] -fn bindgen_test_layout__JPCommonLabel() { - const UNINIT: ::std::mem::MaybeUninit<_JPCommonLabel> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_JPCommonLabel>(), - 104usize, - concat!("Size of: ", stringify!(_JPCommonLabel)) - ); - assert_eq!( - ::std::mem::align_of::<_JPCommonLabel>(), - 8usize, - concat!("Alignment of ", stringify!(_JPCommonLabel)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).feature) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(feature) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).breath_head) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(breath_head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).breath_tail) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(breath_tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).accent_head) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(accent_head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).accent_tail) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(accent_tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).word_head) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(word_head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).word_tail) as usize - ptr as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(word_tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mora_head) as usize - ptr as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(mora_head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mora_tail) as usize - ptr as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(mora_tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).phoneme_head) as usize - ptr as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(phoneme_head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).phoneme_tail) as usize - ptr as usize }, - 88usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(phoneme_tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).short_pause_flag) as usize - ptr as usize }, - 96usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(short_pause_flag) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _JPCommonLabel"][::std::mem::size_of::<_JPCommonLabel>() - 104usize]; + ["Alignment of _JPCommonLabel"][::std::mem::align_of::<_JPCommonLabel>() - 8usize]; + [ + "Offset of field: _JPCommonLabel::size", + ][::std::mem::offset_of!(_JPCommonLabel, size) - 0usize]; + [ + "Offset of field: _JPCommonLabel::feature", + ][::std::mem::offset_of!(_JPCommonLabel, feature) - 8usize]; + [ + "Offset of field: _JPCommonLabel::breath_head", + ][::std::mem::offset_of!(_JPCommonLabel, breath_head) - 16usize]; + [ + "Offset of field: _JPCommonLabel::breath_tail", + ][::std::mem::offset_of!(_JPCommonLabel, breath_tail) - 24usize]; + [ + "Offset of field: _JPCommonLabel::accent_head", + ][::std::mem::offset_of!(_JPCommonLabel, accent_head) - 32usize]; + [ + "Offset of field: _JPCommonLabel::accent_tail", + ][::std::mem::offset_of!(_JPCommonLabel, accent_tail) - 40usize]; + [ + "Offset of field: _JPCommonLabel::word_head", + ][::std::mem::offset_of!(_JPCommonLabel, word_head) - 48usize]; + [ + "Offset of field: _JPCommonLabel::word_tail", + ][::std::mem::offset_of!(_JPCommonLabel, word_tail) - 56usize]; + [ + "Offset of field: _JPCommonLabel::mora_head", + ][::std::mem::offset_of!(_JPCommonLabel, mora_head) - 64usize]; + [ + "Offset of field: _JPCommonLabel::mora_tail", + ][::std::mem::offset_of!(_JPCommonLabel, mora_tail) - 72usize]; + [ + "Offset of field: _JPCommonLabel::phoneme_head", + ][::std::mem::offset_of!(_JPCommonLabel, phoneme_head) - 80usize]; + [ + "Offset of field: _JPCommonLabel::phoneme_tail", + ][::std::mem::offset_of!(_JPCommonLabel, phoneme_tail) - 88usize]; + [ + "Offset of field: _JPCommonLabel::short_pause_flag", + ][::std::mem::offset_of!(_JPCommonLabel, short_pause_flag) - 96usize]; +}; pub type JPCommonLabel = _JPCommonLabel; extern "C" { pub fn JPCommonLabel_initialize(label: *mut JPCommonLabel); @@ -2476,8 +1657,9 @@ extern "C" { pub fn JPCommonLabel_get_size(label: *mut JPCommonLabel) -> ::std::os::raw::c_int; } extern "C" { - pub fn JPCommonLabel_get_feature(label: *mut JPCommonLabel) - -> *mut *mut ::std::os::raw::c_char; + pub fn JPCommonLabel_get_feature( + label: *mut JPCommonLabel, + ) -> *mut *mut ::std::os::raw::c_char; } extern "C" { pub fn JPCommonLabel_print(label: *mut JPCommonLabel); @@ -2500,134 +1682,91 @@ pub struct _JPCommonNode { pub prev: *mut _JPCommonNode, pub next: *mut _JPCommonNode, } -#[test] -fn bindgen_test_layout__JPCommonNode() { - const UNINIT: ::std::mem::MaybeUninit<_JPCommonNode> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_JPCommonNode>(), - 56usize, - concat!("Size of: ", stringify!(_JPCommonNode)) - ); - assert_eq!( - ::std::mem::align_of::<_JPCommonNode>(), - 8usize, - concat!("Alignment of ", stringify!(_JPCommonNode)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pron) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonNode), - "::", - stringify!(pron) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pos) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonNode), - "::", - stringify!(pos) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ctype) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonNode), - "::", - stringify!(ctype) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cform) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonNode), - "::", - stringify!(cform) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).acc) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonNode), - "::", - stringify!(acc) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).chain_flag) as usize - ptr as usize }, - 36usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonNode), - "::", - stringify!(chain_flag) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonNode), - "::", - stringify!(prev) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonNode), - "::", - stringify!(next) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _JPCommonNode"][::std::mem::size_of::<_JPCommonNode>() - 56usize]; + ["Alignment of _JPCommonNode"][::std::mem::align_of::<_JPCommonNode>() - 8usize]; + [ + "Offset of field: _JPCommonNode::pron", + ][::std::mem::offset_of!(_JPCommonNode, pron) - 0usize]; + [ + "Offset of field: _JPCommonNode::pos", + ][::std::mem::offset_of!(_JPCommonNode, pos) - 8usize]; + [ + "Offset of field: _JPCommonNode::ctype", + ][::std::mem::offset_of!(_JPCommonNode, ctype) - 16usize]; + [ + "Offset of field: _JPCommonNode::cform", + ][::std::mem::offset_of!(_JPCommonNode, cform) - 24usize]; + [ + "Offset of field: _JPCommonNode::acc", + ][::std::mem::offset_of!(_JPCommonNode, acc) - 32usize]; + [ + "Offset of field: _JPCommonNode::chain_flag", + ][::std::mem::offset_of!(_JPCommonNode, chain_flag) - 36usize]; + [ + "Offset of field: _JPCommonNode::prev", + ][::std::mem::offset_of!(_JPCommonNode, prev) - 40usize]; + [ + "Offset of field: _JPCommonNode::next", + ][::std::mem::offset_of!(_JPCommonNode, next) - 48usize]; +}; pub type JPCommonNode = _JPCommonNode; extern "C" { pub fn JPCommonNode_initialize(node: *mut JPCommonNode); } extern "C" { - pub fn JPCommonNode_set_pron(node: *mut JPCommonNode, str_: *const ::std::os::raw::c_char); + pub fn JPCommonNode_set_pron( + node: *mut JPCommonNode, + str_: *const ::std::os::raw::c_char, + ); } extern "C" { - pub fn JPCommonNode_set_pos(node: *mut JPCommonNode, str_: *const ::std::os::raw::c_char); + pub fn JPCommonNode_set_pos( + node: *mut JPCommonNode, + str_: *const ::std::os::raw::c_char, + ); } extern "C" { - pub fn JPCommonNode_set_ctype(node: *mut JPCommonNode, str_: *const ::std::os::raw::c_char); + pub fn JPCommonNode_set_ctype( + node: *mut JPCommonNode, + str_: *const ::std::os::raw::c_char, + ); } extern "C" { - pub fn JPCommonNode_set_cform(node: *mut JPCommonNode, str_: *const ::std::os::raw::c_char); + pub fn JPCommonNode_set_cform( + node: *mut JPCommonNode, + str_: *const ::std::os::raw::c_char, + ); } extern "C" { pub fn JPCommonNode_set_acc(node: *mut JPCommonNode, acc: ::std::os::raw::c_int); } extern "C" { - pub fn JPCommonNode_set_chain_flag(node: *mut JPCommonNode, flag: ::std::os::raw::c_int); + pub fn JPCommonNode_set_chain_flag( + node: *mut JPCommonNode, + flag: ::std::os::raw::c_int, + ); } extern "C" { - pub fn JPCommonNode_get_pron(node: *mut JPCommonNode) -> *const ::std::os::raw::c_char; + pub fn JPCommonNode_get_pron( + node: *mut JPCommonNode, + ) -> *const ::std::os::raw::c_char; } extern "C" { - pub fn JPCommonNode_get_pos(node: *mut JPCommonNode) -> *const ::std::os::raw::c_char; + pub fn JPCommonNode_get_pos( + node: *mut JPCommonNode, + ) -> *const ::std::os::raw::c_char; } extern "C" { - pub fn JPCommonNode_get_ctype(node: *mut JPCommonNode) -> *const ::std::os::raw::c_char; + pub fn JPCommonNode_get_ctype( + node: *mut JPCommonNode, + ) -> *const ::std::os::raw::c_char; } extern "C" { - pub fn JPCommonNode_get_cform(node: *mut JPCommonNode) -> *const ::std::os::raw::c_char; + pub fn JPCommonNode_get_cform( + node: *mut JPCommonNode, + ) -> *const ::std::os::raw::c_char; } extern "C" { pub fn JPCommonNode_get_acc(node: *mut JPCommonNode) -> ::std::os::raw::c_int; @@ -2651,51 +1790,20 @@ pub struct _JPCommon { pub tail: *mut JPCommonNode, pub label: *mut JPCommonLabel, } -#[test] -fn bindgen_test_layout__JPCommon() { - const UNINIT: ::std::mem::MaybeUninit<_JPCommon> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_JPCommon>(), - 24usize, - concat!("Size of: ", stringify!(_JPCommon)) - ); - assert_eq!( - ::std::mem::align_of::<_JPCommon>(), - 8usize, - concat!("Alignment of ", stringify!(_JPCommon)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).head) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_JPCommon), - "::", - stringify!(head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tail) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_JPCommon), - "::", - stringify!(tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).label) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_JPCommon), - "::", - stringify!(label) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _JPCommon"][::std::mem::size_of::<_JPCommon>() - 24usize]; + ["Alignment of _JPCommon"][::std::mem::align_of::<_JPCommon>() - 8usize]; + [ + "Offset of field: _JPCommon::head", + ][::std::mem::offset_of!(_JPCommon, head) - 0usize]; + [ + "Offset of field: _JPCommon::tail", + ][::std::mem::offset_of!(_JPCommon, tail) - 8usize]; + [ + "Offset of field: _JPCommon::label", + ][::std::mem::offset_of!(_JPCommon, label) - 16usize]; +}; pub type JPCommon = _JPCommon; extern "C" { pub fn JPCommon_initialize(jpcommon: *mut JPCommon); @@ -2710,7 +1818,9 @@ extern "C" { pub fn JPCommon_get_label_size(jpcommon: *mut JPCommon) -> ::std::os::raw::c_int; } extern "C" { - pub fn JPCommon_get_label_feature(jpcommon: *mut JPCommon) -> *mut *mut ::std::os::raw::c_char; + pub fn JPCommon_get_label_feature( + jpcommon: *mut JPCommon, + ) -> *mut *mut ::std::os::raw::c_char; } extern "C" { pub fn JPCommon_print(jpcommon: *mut JPCommon); diff --git a/crates/open_jtalk-sys/src/generated/ios/aarch64/bindings.rs b/crates/open_jtalk-sys/src/generated/ios/aarch64/bindings.rs index 8486cb8..ee16937 100644 --- a/crates/open_jtalk-sys/src/generated/ios/aarch64/bindings.rs +++ b/crates/open_jtalk-sys/src/generated/ios/aarch64/bindings.rs @@ -1,542 +1,263 @@ -/* automatically generated by rust-bindgen 0.62.0 */ +/* automatically generated by rust-bindgen 0.70.1 */ pub const TRUE: u32 = 1; pub const FALSE: u32 = 0; -#[doc = " DictionaryInfo structure"] +/// DictionaryInfo structure #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct mecab_dictionary_info_t { - #[doc = " filename of dictionary"] - #[doc = " On Windows, filename is stored in UTF-8 encoding"] + /** filename of dictionary + On Windows, filename is stored in UTF-8 encoding*/ pub filename: *const ::std::os::raw::c_char, - #[doc = " character set of the dictionary. e.g., \"SHIFT-JIS\", \"UTF-8\""] + /// character set of the dictionary. e.g., "SHIFT-JIS", "UTF-8" pub charset: *const ::std::os::raw::c_char, - #[doc = " How many words are registered in this dictionary."] + /// How many words are registered in this dictionary. pub size: ::std::os::raw::c_uint, - #[doc = " dictionary type"] - #[doc = " this value should be MECAB_USR_DIC, MECAB_SYS_DIC, or MECAB_UNK_DIC."] + /** dictionary type + this value should be MECAB_USR_DIC, MECAB_SYS_DIC, or MECAB_UNK_DIC.*/ pub type_: ::std::os::raw::c_int, - #[doc = " left attributes size"] + /// left attributes size pub lsize: ::std::os::raw::c_uint, - #[doc = " right attributes size"] + /// right attributes size pub rsize: ::std::os::raw::c_uint, - #[doc = " version of this dictionary"] + /// version of this dictionary pub version: ::std::os::raw::c_ushort, - #[doc = " pointer to the next dictionary info."] + /// pointer to the next dictionary info. pub next: *mut mecab_dictionary_info_t, } -#[test] -fn bindgen_test_layout_mecab_dictionary_info_t() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 48usize, - concat!("Size of: ", stringify!(mecab_dictionary_info_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(mecab_dictionary_info_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).filename) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(mecab_dictionary_info_t), - "::", - stringify!(filename) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).charset) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(mecab_dictionary_info_t), - "::", - stringify!(charset) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(mecab_dictionary_info_t), - "::", - stringify!(size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(mecab_dictionary_info_t), - "::", - stringify!(type_) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lsize) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(mecab_dictionary_info_t), - "::", - stringify!(lsize) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rsize) as usize - ptr as usize }, - 28usize, - concat!( - "Offset of field: ", - stringify!(mecab_dictionary_info_t), - "::", - stringify!(rsize) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).version) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(mecab_dictionary_info_t), - "::", - stringify!(version) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(mecab_dictionary_info_t), - "::", - stringify!(next) - ) - ); -} -#[doc = " Path structure"] +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + [ + "Size of mecab_dictionary_info_t", + ][::std::mem::size_of::() - 48usize]; + [ + "Alignment of mecab_dictionary_info_t", + ][::std::mem::align_of::() - 8usize]; + [ + "Offset of field: mecab_dictionary_info_t::filename", + ][::std::mem::offset_of!(mecab_dictionary_info_t, filename) - 0usize]; + [ + "Offset of field: mecab_dictionary_info_t::charset", + ][::std::mem::offset_of!(mecab_dictionary_info_t, charset) - 8usize]; + [ + "Offset of field: mecab_dictionary_info_t::size", + ][::std::mem::offset_of!(mecab_dictionary_info_t, size) - 16usize]; + [ + "Offset of field: mecab_dictionary_info_t::type_", + ][::std::mem::offset_of!(mecab_dictionary_info_t, type_) - 20usize]; + [ + "Offset of field: mecab_dictionary_info_t::lsize", + ][::std::mem::offset_of!(mecab_dictionary_info_t, lsize) - 24usize]; + [ + "Offset of field: mecab_dictionary_info_t::rsize", + ][::std::mem::offset_of!(mecab_dictionary_info_t, rsize) - 28usize]; + [ + "Offset of field: mecab_dictionary_info_t::version", + ][::std::mem::offset_of!(mecab_dictionary_info_t, version) - 32usize]; + [ + "Offset of field: mecab_dictionary_info_t::next", + ][::std::mem::offset_of!(mecab_dictionary_info_t, next) - 40usize]; +}; +/// Path structure #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct mecab_path_t { - #[doc = " pointer to the right node"] + /// pointer to the right node pub rnode: *mut mecab_node_t, - #[doc = " pointer to the next right path"] + /// pointer to the next right path pub rnext: *mut mecab_path_t, - #[doc = " pointer to the left node"] + /// pointer to the left node pub lnode: *mut mecab_node_t, - #[doc = " pointer to the next left path"] + /// pointer to the next left path pub lnext: *mut mecab_path_t, - #[doc = " local cost"] + /// local cost pub cost: ::std::os::raw::c_int, - #[doc = " marginal probability"] + /// marginal probability pub prob: f32, } -#[test] -fn bindgen_test_layout_mecab_path_t() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 40usize, - concat!("Size of: ", stringify!(mecab_path_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(mecab_path_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rnode) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(mecab_path_t), - "::", - stringify!(rnode) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rnext) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(mecab_path_t), - "::", - stringify!(rnext) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lnode) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(mecab_path_t), - "::", - stringify!(lnode) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lnext) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(mecab_path_t), - "::", - stringify!(lnext) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cost) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(mecab_path_t), - "::", - stringify!(cost) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prob) as usize - ptr as usize }, - 36usize, - concat!( - "Offset of field: ", - stringify!(mecab_path_t), - "::", - stringify!(prob) - ) - ); -} -#[doc = " Node structure"] +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of mecab_path_t"][::std::mem::size_of::() - 40usize]; + ["Alignment of mecab_path_t"][::std::mem::align_of::() - 8usize]; + [ + "Offset of field: mecab_path_t::rnode", + ][::std::mem::offset_of!(mecab_path_t, rnode) - 0usize]; + [ + "Offset of field: mecab_path_t::rnext", + ][::std::mem::offset_of!(mecab_path_t, rnext) - 8usize]; + [ + "Offset of field: mecab_path_t::lnode", + ][::std::mem::offset_of!(mecab_path_t, lnode) - 16usize]; + [ + "Offset of field: mecab_path_t::lnext", + ][::std::mem::offset_of!(mecab_path_t, lnext) - 24usize]; + [ + "Offset of field: mecab_path_t::cost", + ][::std::mem::offset_of!(mecab_path_t, cost) - 32usize]; + [ + "Offset of field: mecab_path_t::prob", + ][::std::mem::offset_of!(mecab_path_t, prob) - 36usize]; +}; +/// Node structure #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct mecab_node_t { - #[doc = " pointer to the previous node."] + /// pointer to the previous node. pub prev: *mut mecab_node_t, - #[doc = " pointer to the next node."] + /// pointer to the next node. pub next: *mut mecab_node_t, - #[doc = " pointer to the node which ends at the same position."] + /// pointer to the node which ends at the same position. pub enext: *mut mecab_node_t, - #[doc = " pointer to the node which starts at the same position."] + /// pointer to the node which starts at the same position. pub bnext: *mut mecab_node_t, - #[doc = " pointer to the right path."] - #[doc = " this value is NULL if MECAB_ONE_BEST mode."] + /** pointer to the right path. + this value is NULL if MECAB_ONE_BEST mode.*/ pub rpath: *mut mecab_path_t, - #[doc = " pointer to the right path."] - #[doc = " this value is NULL if MECAB_ONE_BEST mode."] + /** pointer to the right path. + this value is NULL if MECAB_ONE_BEST mode.*/ pub lpath: *mut mecab_path_t, - #[doc = " surface string."] - #[doc = " this value is not 0 terminated."] - #[doc = " You can get the length with length/rlength members."] + /** surface string. + this value is not 0 terminated. + You can get the length with length/rlength members.*/ pub surface: *const ::std::os::raw::c_char, - #[doc = " feature string"] + /// feature string pub feature: *const ::std::os::raw::c_char, - #[doc = " unique node id"] + /// unique node id pub id: ::std::os::raw::c_uint, - #[doc = " length of the surface form."] + /// length of the surface form. pub length: ::std::os::raw::c_ushort, - #[doc = " length of the surface form including white space before the morph."] + /// length of the surface form including white space before the morph. pub rlength: ::std::os::raw::c_ushort, - #[doc = " right attribute id"] + /// right attribute id pub rcAttr: ::std::os::raw::c_ushort, - #[doc = " left attribute id"] + /// left attribute id pub lcAttr: ::std::os::raw::c_ushort, - #[doc = " unique part of speech id. This value is defined in \"pos.def\" file."] + /// unique part of speech id. This value is defined in "pos.def" file. pub posid: ::std::os::raw::c_ushort, - #[doc = " character type"] + /// character type pub char_type: ::std::os::raw::c_uchar, - #[doc = " status of this model."] - #[doc = " This value is MECAB_NOR_NODE, MECAB_UNK_NODE, MECAB_BOS_NODE, MECAB_EOS_NODE, or MECAB_EON_NODE."] + /** status of this model. + This value is MECAB_NOR_NODE, MECAB_UNK_NODE, MECAB_BOS_NODE, MECAB_EOS_NODE, or MECAB_EON_NODE.*/ pub stat: ::std::os::raw::c_uchar, - #[doc = " set 1 if this node is best node."] + /// set 1 if this node is best node. pub isbest: ::std::os::raw::c_uchar, - #[doc = " forward accumulative log summation."] - #[doc = " This value is only available when MECAB_MARGINAL_PROB is passed."] + /** forward accumulative log summation. + This value is only available when MECAB_MARGINAL_PROB is passed.*/ pub alpha: f32, - #[doc = " backward accumulative log summation."] - #[doc = " This value is only available when MECAB_MARGINAL_PROB is passed."] + /** backward accumulative log summation. + This value is only available when MECAB_MARGINAL_PROB is passed.*/ pub beta: f32, - #[doc = " marginal probability."] - #[doc = " This value is only available when MECAB_MARGINAL_PROB is passed."] + /** marginal probability. + This value is only available when MECAB_MARGINAL_PROB is passed.*/ pub prob: f32, - #[doc = " word cost."] + /// word cost. pub wcost: ::std::os::raw::c_short, - #[doc = " best accumulative cost from bos node to this node."] + /// best accumulative cost from bos node to this node. pub cost: ::std::os::raw::c_long, } -#[test] -fn bindgen_test_layout_mecab_node_t() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 112usize, - concat!("Size of: ", stringify!(mecab_node_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(mecab_node_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(prev) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(next) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).enext) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(enext) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).bnext) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(bnext) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rpath) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(rpath) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lpath) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(lpath) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).surface) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(surface) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).feature) as usize - ptr as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(feature) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).id) as usize - ptr as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(id) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).length) as usize - ptr as usize }, - 68usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(length) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rlength) as usize - ptr as usize }, - 70usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(rlength) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rcAttr) as usize - ptr as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(rcAttr) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lcAttr) as usize - ptr as usize }, - 74usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(lcAttr) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).posid) as usize - ptr as usize }, - 76usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(posid) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).char_type) as usize - ptr as usize }, - 78usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(char_type) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).stat) as usize - ptr as usize }, - 79usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(stat) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).isbest) as usize - ptr as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(isbest) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).alpha) as usize - ptr as usize }, - 84usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(alpha) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).beta) as usize - ptr as usize }, - 88usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(beta) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prob) as usize - ptr as usize }, - 92usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(prob) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).wcost) as usize - ptr as usize }, - 96usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(wcost) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cost) as usize - ptr as usize }, - 104usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(cost) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of mecab_node_t"][::std::mem::size_of::() - 112usize]; + ["Alignment of mecab_node_t"][::std::mem::align_of::() - 8usize]; + [ + "Offset of field: mecab_node_t::prev", + ][::std::mem::offset_of!(mecab_node_t, prev) - 0usize]; + [ + "Offset of field: mecab_node_t::next", + ][::std::mem::offset_of!(mecab_node_t, next) - 8usize]; + [ + "Offset of field: mecab_node_t::enext", + ][::std::mem::offset_of!(mecab_node_t, enext) - 16usize]; + [ + "Offset of field: mecab_node_t::bnext", + ][::std::mem::offset_of!(mecab_node_t, bnext) - 24usize]; + [ + "Offset of field: mecab_node_t::rpath", + ][::std::mem::offset_of!(mecab_node_t, rpath) - 32usize]; + [ + "Offset of field: mecab_node_t::lpath", + ][::std::mem::offset_of!(mecab_node_t, lpath) - 40usize]; + [ + "Offset of field: mecab_node_t::surface", + ][::std::mem::offset_of!(mecab_node_t, surface) - 48usize]; + [ + "Offset of field: mecab_node_t::feature", + ][::std::mem::offset_of!(mecab_node_t, feature) - 56usize]; + [ + "Offset of field: mecab_node_t::id", + ][::std::mem::offset_of!(mecab_node_t, id) - 64usize]; + [ + "Offset of field: mecab_node_t::length", + ][::std::mem::offset_of!(mecab_node_t, length) - 68usize]; + [ + "Offset of field: mecab_node_t::rlength", + ][::std::mem::offset_of!(mecab_node_t, rlength) - 70usize]; + [ + "Offset of field: mecab_node_t::rcAttr", + ][::std::mem::offset_of!(mecab_node_t, rcAttr) - 72usize]; + [ + "Offset of field: mecab_node_t::lcAttr", + ][::std::mem::offset_of!(mecab_node_t, lcAttr) - 74usize]; + [ + "Offset of field: mecab_node_t::posid", + ][::std::mem::offset_of!(mecab_node_t, posid) - 76usize]; + [ + "Offset of field: mecab_node_t::char_type", + ][::std::mem::offset_of!(mecab_node_t, char_type) - 78usize]; + [ + "Offset of field: mecab_node_t::stat", + ][::std::mem::offset_of!(mecab_node_t, stat) - 79usize]; + [ + "Offset of field: mecab_node_t::isbest", + ][::std::mem::offset_of!(mecab_node_t, isbest) - 80usize]; + [ + "Offset of field: mecab_node_t::alpha", + ][::std::mem::offset_of!(mecab_node_t, alpha) - 84usize]; + [ + "Offset of field: mecab_node_t::beta", + ][::std::mem::offset_of!(mecab_node_t, beta) - 88usize]; + [ + "Offset of field: mecab_node_t::prob", + ][::std::mem::offset_of!(mecab_node_t, prob) - 92usize]; + [ + "Offset of field: mecab_node_t::wcost", + ][::std::mem::offset_of!(mecab_node_t, wcost) - 96usize]; + [ + "Offset of field: mecab_node_t::cost", + ][::std::mem::offset_of!(mecab_node_t, cost) - 104usize]; +}; pub const MECAB_NOR_NODE: _bindgen_ty_1 = _bindgen_ty_1::MECAB_NOR_NODE; pub const MECAB_UNK_NODE: _bindgen_ty_1 = _bindgen_ty_1::MECAB_UNK_NODE; pub const MECAB_BOS_NODE: _bindgen_ty_1 = _bindgen_ty_1::MECAB_BOS_NODE; pub const MECAB_EOS_NODE: _bindgen_ty_1 = _bindgen_ty_1::MECAB_EOS_NODE; pub const MECAB_EON_NODE: _bindgen_ty_1 = _bindgen_ty_1::MECAB_EON_NODE; #[repr(u32)] -#[doc = " Parameters for MeCab::Node::stat"] +/// Parameters for MeCab::Node::stat #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum _bindgen_ty_1 { - #[doc = " Normal node defined in the dictionary."] + /// Normal node defined in the dictionary. MECAB_NOR_NODE = 0, - #[doc = " Unknown node not defined in the dictionary."] + /// Unknown node not defined in the dictionary. MECAB_UNK_NODE = 1, - #[doc = " Virtual node representing a beginning of the sentence."] + /// Virtual node representing a beginning of the sentence. MECAB_BOS_NODE = 2, - #[doc = " Virtual node representing a end of the sentence."] + /// Virtual node representing a end of the sentence. MECAB_EOS_NODE = 3, - #[doc = " Virtual node representing a end of the N-best enumeration."] + /// Virtual node representing a end of the N-best enumeration. MECAB_EON_NODE = 4, } pub const MECAB_SYS_DIC: _bindgen_ty_2 = _bindgen_ty_2::MECAB_SYS_DIC; pub const MECAB_USR_DIC: _bindgen_ty_2 = _bindgen_ty_2::MECAB_USR_DIC; pub const MECAB_UNK_DIC: _bindgen_ty_2 = _bindgen_ty_2::MECAB_UNK_DIC; #[repr(u32)] -#[doc = " Parameters for MeCab::DictionaryInfo::type"] +/// Parameters for MeCab::DictionaryInfo::type #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum _bindgen_ty_2 { - #[doc = " This is a system dictionary."] + /// This is a system dictionary. MECAB_SYS_DIC = 0, - #[doc = " This is a user dictionary."] + /// This is a user dictionary. MECAB_USR_DIC = 1, - #[doc = " This is a unknown word dictionary."] + /// This is a unknown word dictionary. MECAB_UNK_DIC = 2, } pub const MECAB_ONE_BEST: _bindgen_ty_3 = _bindgen_ty_3::MECAB_ONE_BEST; @@ -547,43 +268,43 @@ pub const MECAB_ALTERNATIVE: _bindgen_ty_3 = _bindgen_ty_3::MECAB_ALTERNATIVE; pub const MECAB_ALL_MORPHS: _bindgen_ty_3 = _bindgen_ty_3::MECAB_ALL_MORPHS; pub const MECAB_ALLOCATE_SENTENCE: _bindgen_ty_3 = _bindgen_ty_3::MECAB_ALLOCATE_SENTENCE; #[repr(u32)] -#[doc = " Parameters for MeCab::Lattice::request_type"] +/// Parameters for MeCab::Lattice::request_type #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum _bindgen_ty_3 { - #[doc = " One best result is obtained (default mode)"] + /// One best result is obtained (default mode) MECAB_ONE_BEST = 1, - #[doc = " Set this flag if you want to obtain N best results."] + /// Set this flag if you want to obtain N best results. MECAB_NBEST = 2, - #[doc = " Set this flag if you want to enable a partial parsing mode."] - #[doc = " When this flag is set, the input |sentence| needs to be written"] - #[doc = " in partial parsing format."] + /** Set this flag if you want to enable a partial parsing mode. + When this flag is set, the input |sentence| needs to be written + in partial parsing format.*/ MECAB_PARTIAL = 4, - #[doc = " Set this flag if you want to obtain marginal probabilities."] - #[doc = " Marginal probability is set in MeCab::Node::prob."] - #[doc = " The parsing speed will get 3-5 times slower than the default mode."] + /** Set this flag if you want to obtain marginal probabilities. + Marginal probability is set in MeCab::Node::prob. + The parsing speed will get 3-5 times slower than the default mode.*/ MECAB_MARGINAL_PROB = 8, - #[doc = " Set this flag if you want to obtain alternative results."] - #[doc = " Not implemented."] + /** Set this flag if you want to obtain alternative results. + Not implemented.*/ MECAB_ALTERNATIVE = 16, - #[doc = " When this flag is set, the result linked-list (Node::next/prev)"] - #[doc = " traverses all nodes in the lattice."] + /** When this flag is set, the result linked-list (Node::next/prev) + traverses all nodes in the lattice.*/ MECAB_ALL_MORPHS = 32, - #[doc = " When this flag is set, tagger internally copies the body of passed"] - #[doc = " sentence into internal buffer."] + /** When this flag is set, tagger internally copies the body of passed + sentence into internal buffer.*/ MECAB_ALLOCATE_SENTENCE = 64, } pub const MECAB_ANY_BOUNDARY: _bindgen_ty_4 = _bindgen_ty_4::MECAB_ANY_BOUNDARY; pub const MECAB_TOKEN_BOUNDARY: _bindgen_ty_4 = _bindgen_ty_4::MECAB_TOKEN_BOUNDARY; pub const MECAB_INSIDE_TOKEN: _bindgen_ty_4 = _bindgen_ty_4::MECAB_INSIDE_TOKEN; #[repr(u32)] -#[doc = " Parameters for MeCab::Lattice::boundary_constraint_type"] +/// Parameters for MeCab::Lattice::boundary_constraint_type #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum _bindgen_ty_4 { - #[doc = " The token boundary is not specified."] + /// The token boundary is not specified. MECAB_ANY_BOUNDARY = 0, - #[doc = " The position is a strong token boundary."] + /// The position is a strong token boundary. MECAB_TOKEN_BOUNDARY = 1, - #[doc = " The position is not a token boundary."] + /// The position is not a token boundary. MECAB_INSIDE_TOKEN = 2, } pub type __int64_t = ::std::os::raw::c_longlong; @@ -595,41 +316,13 @@ pub struct __sbuf { pub _base: *mut ::std::os::raw::c_uchar, pub _size: ::std::os::raw::c_int, } -#[test] -fn bindgen_test_layout___sbuf() { - const UNINIT: ::std::mem::MaybeUninit<__sbuf> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__sbuf>(), - 16usize, - concat!("Size of: ", stringify!(__sbuf)) - ); - assert_eq!( - ::std::mem::align_of::<__sbuf>(), - 8usize, - concat!("Alignment of ", stringify!(__sbuf)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._base) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__sbuf), - "::", - stringify!(_base) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._size) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(__sbuf), - "::", - stringify!(_size) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __sbuf"][::std::mem::size_of::<__sbuf>() - 16usize]; + ["Alignment of __sbuf"][::std::mem::align_of::<__sbuf>() - 8usize]; + ["Offset of field: __sbuf::_base"][::std::mem::offset_of!(__sbuf, _base) - 0usize]; + ["Offset of field: __sbuf::_size"][::std::mem::offset_of!(__sbuf, _size) - 8usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct __sFILEX { @@ -679,221 +372,57 @@ pub struct __sFILE { pub _blksize: ::std::os::raw::c_int, pub _offset: fpos_t, } -#[test] -fn bindgen_test_layout___sFILE() { - const UNINIT: ::std::mem::MaybeUninit<__sFILE> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__sFILE>(), - 152usize, - concat!("Size of: ", stringify!(__sFILE)) - ); - assert_eq!( - ::std::mem::align_of::<__sFILE>(), - 8usize, - concat!("Alignment of ", stringify!(__sFILE)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._p) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__sFILE), - "::", - stringify!(_p) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._r) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(__sFILE), - "::", - stringify!(_r) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._w) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(__sFILE), - "::", - stringify!(_w) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._flags) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(__sFILE), - "::", - stringify!(_flags) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._file) as usize - ptr as usize }, - 18usize, - concat!( - "Offset of field: ", - stringify!(__sFILE), - "::", - stringify!(_file) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._bf) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(__sFILE), - "::", - stringify!(_bf) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._lbfsize) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(__sFILE), - "::", - stringify!(_lbfsize) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._cookie) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(__sFILE), - "::", - stringify!(_cookie) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._close) as usize - ptr as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(__sFILE), - "::", - stringify!(_close) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._read) as usize - ptr as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(__sFILE), - "::", - stringify!(_read) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._seek) as usize - ptr as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(__sFILE), - "::", - stringify!(_seek) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._write) as usize - ptr as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(__sFILE), - "::", - stringify!(_write) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._ub) as usize - ptr as usize }, - 88usize, - concat!( - "Offset of field: ", - stringify!(__sFILE), - "::", - stringify!(_ub) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._extra) as usize - ptr as usize }, - 104usize, - concat!( - "Offset of field: ", - stringify!(__sFILE), - "::", - stringify!(_extra) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._ur) as usize - ptr as usize }, - 112usize, - concat!( - "Offset of field: ", - stringify!(__sFILE), - "::", - stringify!(_ur) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._ubuf) as usize - ptr as usize }, - 116usize, - concat!( - "Offset of field: ", - stringify!(__sFILE), - "::", - stringify!(_ubuf) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._nbuf) as usize - ptr as usize }, - 119usize, - concat!( - "Offset of field: ", - stringify!(__sFILE), - "::", - stringify!(_nbuf) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._lb) as usize - ptr as usize }, - 120usize, - concat!( - "Offset of field: ", - stringify!(__sFILE), - "::", - stringify!(_lb) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._blksize) as usize - ptr as usize }, - 136usize, - concat!( - "Offset of field: ", - stringify!(__sFILE), - "::", - stringify!(_blksize) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._offset) as usize - ptr as usize }, - 144usize, - concat!( - "Offset of field: ", - stringify!(__sFILE), - "::", - stringify!(_offset) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __sFILE"][::std::mem::size_of::<__sFILE>() - 152usize]; + ["Alignment of __sFILE"][::std::mem::align_of::<__sFILE>() - 8usize]; + ["Offset of field: __sFILE::_p"][::std::mem::offset_of!(__sFILE, _p) - 0usize]; + ["Offset of field: __sFILE::_r"][::std::mem::offset_of!(__sFILE, _r) - 8usize]; + ["Offset of field: __sFILE::_w"][::std::mem::offset_of!(__sFILE, _w) - 12usize]; + [ + "Offset of field: __sFILE::_flags", + ][::std::mem::offset_of!(__sFILE, _flags) - 16usize]; + [ + "Offset of field: __sFILE::_file", + ][::std::mem::offset_of!(__sFILE, _file) - 18usize]; + ["Offset of field: __sFILE::_bf"][::std::mem::offset_of!(__sFILE, _bf) - 24usize]; + [ + "Offset of field: __sFILE::_lbfsize", + ][::std::mem::offset_of!(__sFILE, _lbfsize) - 40usize]; + [ + "Offset of field: __sFILE::_cookie", + ][::std::mem::offset_of!(__sFILE, _cookie) - 48usize]; + [ + "Offset of field: __sFILE::_close", + ][::std::mem::offset_of!(__sFILE, _close) - 56usize]; + [ + "Offset of field: __sFILE::_read", + ][::std::mem::offset_of!(__sFILE, _read) - 64usize]; + [ + "Offset of field: __sFILE::_seek", + ][::std::mem::offset_of!(__sFILE, _seek) - 72usize]; + [ + "Offset of field: __sFILE::_write", + ][::std::mem::offset_of!(__sFILE, _write) - 80usize]; + ["Offset of field: __sFILE::_ub"][::std::mem::offset_of!(__sFILE, _ub) - 88usize]; + [ + "Offset of field: __sFILE::_extra", + ][::std::mem::offset_of!(__sFILE, _extra) - 104usize]; + ["Offset of field: __sFILE::_ur"][::std::mem::offset_of!(__sFILE, _ur) - 112usize]; + [ + "Offset of field: __sFILE::_ubuf", + ][::std::mem::offset_of!(__sFILE, _ubuf) - 116usize]; + [ + "Offset of field: __sFILE::_nbuf", + ][::std::mem::offset_of!(__sFILE, _nbuf) - 119usize]; + ["Offset of field: __sFILE::_lb"][::std::mem::offset_of!(__sFILE, _lb) - 120usize]; + [ + "Offset of field: __sFILE::_blksize", + ][::std::mem::offset_of!(__sFILE, _blksize) - 136usize]; + [ + "Offset of field: __sFILE::_offset", + ][::std::mem::offset_of!(__sFILE, _offset) - 144usize]; +}; pub type FILE = __sFILE; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -911,76 +440,76 @@ pub struct mecab_lattice_t { _unused: [u8; 0], } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::create(argc, argv)"] + /// C wrapper of MeCab::Tagger::create(argc, argv) pub fn mecab_new( argc: ::std::os::raw::c_int, argv: *mut *mut ::std::os::raw::c_char, ) -> *mut mecab_t; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::create(arg)"] + /// C wrapper of MeCab::Tagger::create(arg) pub fn mecab_new2(arg: *const ::std::os::raw::c_char) -> *mut mecab_t; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::version()"] + /// C wrapper of MeCab::Tagger::version() pub fn mecab_version() -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::getLastError()"] + /// C wrapper of MeCab::getLastError() pub fn mecab_strerror(mecab: *mut mecab_t) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::deleteTagger(tagger)"] + /// C wrapper of MeCab::deleteTagger(tagger) pub fn mecab_destroy(mecab: *mut mecab_t); } extern "C" { - #[doc = " C wrapper of MeCab::Tagger:set_partial()"] + /// C wrapper of MeCab::Tagger:set_partial() pub fn mecab_get_partial(mecab: *mut mecab_t) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::partial()"] + /// C wrapper of MeCab::Tagger::partial() pub fn mecab_set_partial(mecab: *mut mecab_t, partial: ::std::os::raw::c_int); } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::theta()"] + /// C wrapper of MeCab::Tagger::theta() pub fn mecab_get_theta(mecab: *mut mecab_t) -> f32; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::set_theta()"] + /// C wrapper of MeCab::Tagger::set_theta() pub fn mecab_set_theta(mecab: *mut mecab_t, theta: f32); } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::lattice_level()"] + /// C wrapper of MeCab::Tagger::lattice_level() pub fn mecab_get_lattice_level(mecab: *mut mecab_t) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::set_lattice_level()"] + /// C wrapper of MeCab::Tagger::set_lattice_level() pub fn mecab_set_lattice_level(mecab: *mut mecab_t, level: ::std::os::raw::c_int); } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::all_morphs()"] + /// C wrapper of MeCab::Tagger::all_morphs() pub fn mecab_get_all_morphs(mecab: *mut mecab_t) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::set_all_moprhs()"] + /// C wrapper of MeCab::Tagger::set_all_moprhs() pub fn mecab_set_all_morphs(mecab: *mut mecab_t, all_morphs: ::std::os::raw::c_int); } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parse(MeCab::Lattice *lattice)"] + /// C wrapper of MeCab::Tagger::parse(MeCab::Lattice *lattice) pub fn mecab_parse_lattice( mecab: *mut mecab_t, lattice: *mut mecab_lattice_t, ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parse(const char *str)"] + /// C wrapper of MeCab::Tagger::parse(const char *str) pub fn mecab_sparse_tostr( mecab: *mut mecab_t, str_: *const ::std::os::raw::c_char, ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parse(const char *str, size_t len)"] + /// C wrapper of MeCab::Tagger::parse(const char *str, size_t len) pub fn mecab_sparse_tostr2( mecab: *mut mecab_t, str_: *const ::std::os::raw::c_char, @@ -988,7 +517,7 @@ extern "C" { ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parse(const char *str, char *ostr, size_t olen)"] + /// C wrapper of MeCab::Tagger::parse(const char *str, char *ostr, size_t olen) pub fn mecab_sparse_tostr3( mecab: *mut mecab_t, str_: *const ::std::os::raw::c_char, @@ -998,14 +527,14 @@ extern "C" { ) -> *mut ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parseToNode(const char *str)"] + /// C wrapper of MeCab::Tagger::parseToNode(const char *str) pub fn mecab_sparse_tonode( mecab: *mut mecab_t, arg1: *const ::std::os::raw::c_char, ) -> *const mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parseToNode(const char *str, size_t len)"] + /// C wrapper of MeCab::Tagger::parseToNode(const char *str, size_t len) pub fn mecab_sparse_tonode2( mecab: *mut mecab_t, arg1: *const ::std::os::raw::c_char, @@ -1013,7 +542,7 @@ extern "C" { ) -> *const mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parseNBest(size_t N, const char *str)"] + /// C wrapper of MeCab::Tagger::parseNBest(size_t N, const char *str) pub fn mecab_nbest_sparse_tostr( mecab: *mut mecab_t, N: usize, @@ -1021,7 +550,7 @@ extern "C" { ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parseNBest(size_t N, const char *str, size_t len)"] + /// C wrapper of MeCab::Tagger::parseNBest(size_t N, const char *str, size_t len) pub fn mecab_nbest_sparse_tostr2( mecab: *mut mecab_t, N: usize, @@ -1030,7 +559,7 @@ extern "C" { ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parseNBest(size_t N, const char *str, char *ostr, size_t olen)"] + /// C wrapper of MeCab::Tagger::parseNBest(size_t N, const char *str, char *ostr, size_t olen) pub fn mecab_nbest_sparse_tostr3( mecab: *mut mecab_t, N: usize, @@ -1041,14 +570,14 @@ extern "C" { ) -> *mut ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parseNBestInit(const char *str)"] + /// C wrapper of MeCab::Tagger::parseNBestInit(const char *str) pub fn mecab_nbest_init( mecab: *mut mecab_t, str_: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parseNBestInit(const char *str, size_t len)"] + /// C wrapper of MeCab::Tagger::parseNBestInit(const char *str, size_t len) pub fn mecab_nbest_init2( mecab: *mut mecab_t, str_: *const ::std::os::raw::c_char, @@ -1056,11 +585,11 @@ extern "C" { ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::next()"] + /// C wrapper of MeCab::Tagger::next() pub fn mecab_nbest_next_tostr(mecab: *mut mecab_t) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::next(char *ostr, size_t olen)"] + /// C wrapper of MeCab::Tagger::next(char *ostr, size_t olen) pub fn mecab_nbest_next_tostr2( mecab: *mut mecab_t, ostr: *mut ::std::os::raw::c_char, @@ -1068,84 +597,91 @@ extern "C" { ) -> *mut ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::nextNode()"] + /// C wrapper of MeCab::Tagger::nextNode() pub fn mecab_nbest_next_tonode(mecab: *mut mecab_t) -> *const mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::formatNode(const Node *node)"] + /// C wrapper of MeCab::Tagger::formatNode(const Node *node) pub fn mecab_format_node( mecab: *mut mecab_t, node: *const mecab_node_t, ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::dictionary_info()"] + /// C wrapper of MeCab::Tagger::dictionary_info() pub fn mecab_dictionary_info(mecab: *mut mecab_t) -> *const mecab_dictionary_info_t; } extern "C" { - #[doc = " C wrapper of MeCab::createLattice()"] + /// C wrapper of MeCab::createLattice() pub fn mecab_lattice_new() -> *mut mecab_lattice_t; } extern "C" { - #[doc = " C wrapper of MeCab::deleteLattice(lattice)"] + /// C wrapper of MeCab::deleteLattice(lattice) pub fn mecab_lattice_destroy(lattice: *mut mecab_lattice_t); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::clear()"] + /// C wrapper of MeCab::Lattice::clear() pub fn mecab_lattice_clear(lattice: *mut mecab_lattice_t); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::is_available()"] - pub fn mecab_lattice_is_available(lattice: *mut mecab_lattice_t) -> ::std::os::raw::c_int; + /// C wrapper of MeCab::Lattice::is_available() + pub fn mecab_lattice_is_available( + lattice: *mut mecab_lattice_t, + ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::bos_node()"] - pub fn mecab_lattice_get_bos_node(lattice: *mut mecab_lattice_t) -> *mut mecab_node_t; + /// C wrapper of MeCab::Lattice::bos_node() + pub fn mecab_lattice_get_bos_node( + lattice: *mut mecab_lattice_t, + ) -> *mut mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::eos_node()"] - pub fn mecab_lattice_get_eos_node(lattice: *mut mecab_lattice_t) -> *mut mecab_node_t; + /// C wrapper of MeCab::Lattice::eos_node() + pub fn mecab_lattice_get_eos_node( + lattice: *mut mecab_lattice_t, + ) -> *mut mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::begin_nodes()"] + /// C wrapper of MeCab::Lattice::begin_nodes() pub fn mecab_lattice_get_all_begin_nodes( lattice: *mut mecab_lattice_t, ) -> *mut *mut mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::end_nodes()"] - pub fn mecab_lattice_get_all_end_nodes(lattice: *mut mecab_lattice_t) - -> *mut *mut mecab_node_t; + /// C wrapper of MeCab::Lattice::end_nodes() + pub fn mecab_lattice_get_all_end_nodes( + lattice: *mut mecab_lattice_t, + ) -> *mut *mut mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::begin_nodes(pos)"] + /// C wrapper of MeCab::Lattice::begin_nodes(pos) pub fn mecab_lattice_get_begin_nodes( lattice: *mut mecab_lattice_t, pos: usize, ) -> *mut mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::end_nodes(pos)"] + /// C wrapper of MeCab::Lattice::end_nodes(pos) pub fn mecab_lattice_get_end_nodes( lattice: *mut mecab_lattice_t, pos: usize, ) -> *mut mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::sentence()"] + /// C wrapper of MeCab::Lattice::sentence() pub fn mecab_lattice_get_sentence( lattice: *mut mecab_lattice_t, ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::set_sentence(sentence)"] + /// C wrapper of MeCab::Lattice::set_sentence(sentence) pub fn mecab_lattice_set_sentence( lattice: *mut mecab_lattice_t, sentence: *const ::std::os::raw::c_char, ); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::set_sentence(sentence, len)"] + /// C wrapper of MeCab::Lattice::set_sentence(sentence, len) pub fn mecab_lattice_set_sentence2( lattice: *mut mecab_lattice_t, sentence: *const ::std::os::raw::c_char, @@ -1153,71 +689,75 @@ extern "C" { ); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::size()"] + /// C wrapper of MeCab::Lattice::size() pub fn mecab_lattice_get_size(lattice: *mut mecab_lattice_t) -> usize; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::Z()"] + /// C wrapper of MeCab::Lattice::Z() pub fn mecab_lattice_get_z(lattice: *mut mecab_lattice_t) -> f64; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::set_Z()"] + /// C wrapper of MeCab::Lattice::set_Z() pub fn mecab_lattice_set_z(lattice: *mut mecab_lattice_t, Z: f64); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::theta()"] + /// C wrapper of MeCab::Lattice::theta() pub fn mecab_lattice_get_theta(lattice: *mut mecab_lattice_t) -> f64; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::set_theta()"] + /// C wrapper of MeCab::Lattice::set_theta() pub fn mecab_lattice_set_theta(lattice: *mut mecab_lattice_t, theta: f64); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::next()"] + /// C wrapper of MeCab::Lattice::next() pub fn mecab_lattice_next(lattice: *mut mecab_lattice_t) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::request_type()"] - pub fn mecab_lattice_get_request_type(lattice: *mut mecab_lattice_t) -> ::std::os::raw::c_int; + /// C wrapper of MeCab::Lattice::request_type() + pub fn mecab_lattice_get_request_type( + lattice: *mut mecab_lattice_t, + ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::has_request_type()"] + /// C wrapper of MeCab::Lattice::has_request_type() pub fn mecab_lattice_has_request_type( lattice: *mut mecab_lattice_t, request_type: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::set_request_type()"] + /// C wrapper of MeCab::Lattice::set_request_type() pub fn mecab_lattice_set_request_type( lattice: *mut mecab_lattice_t, request_type: ::std::os::raw::c_int, ); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::add_request_type()"] + /// C wrapper of MeCab::Lattice::add_request_type() pub fn mecab_lattice_add_request_type( lattice: *mut mecab_lattice_t, request_type: ::std::os::raw::c_int, ); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::remove_request_type()"] + /// C wrapper of MeCab::Lattice::remove_request_type() pub fn mecab_lattice_remove_request_type( lattice: *mut mecab_lattice_t, request_type: ::std::os::raw::c_int, ); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::newNode();"] + /// C wrapper of MeCab::Lattice::newNode(); pub fn mecab_lattice_new_node(lattice: *mut mecab_lattice_t) -> *mut mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::toString()"] - pub fn mecab_lattice_tostr(lattice: *mut mecab_lattice_t) -> *const ::std::os::raw::c_char; + /// C wrapper of MeCab::Lattice::toString() + pub fn mecab_lattice_tostr( + lattice: *mut mecab_lattice_t, + ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::toString(buf, size)"] + /// C wrapper of MeCab::Lattice::toString(buf, size) pub fn mecab_lattice_tostr2( lattice: *mut mecab_lattice_t, buf: *mut ::std::os::raw::c_char, @@ -1225,14 +765,14 @@ extern "C" { ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::enumNBestAsString(N)"] + /// C wrapper of MeCab::Lattice::enumNBestAsString(N) pub fn mecab_lattice_nbest_tostr( lattice: *mut mecab_lattice_t, N: usize, ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::enumNBestAsString(N, buf, size)"] + /// C wrapper of MeCab::Lattice::enumNBestAsString(N, buf, size) pub fn mecab_lattice_nbest_tostr2( lattice: *mut mecab_lattice_t, N: usize, @@ -1241,25 +781,27 @@ extern "C" { ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::has_constraint()"] - pub fn mecab_lattice_has_constraint(lattice: *mut mecab_lattice_t) -> ::std::os::raw::c_int; + /// C wrapper of MeCab::Lattice::has_constraint() + pub fn mecab_lattice_has_constraint( + lattice: *mut mecab_lattice_t, + ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::boundary_constraint(pos)"] + /// C wrapper of MeCab::Lattice::boundary_constraint(pos) pub fn mecab_lattice_get_boundary_constraint( lattice: *mut mecab_lattice_t, pos: usize, ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::feature_constraint(pos)"] + /// C wrapper of MeCab::Lattice::feature_constraint(pos) pub fn mecab_lattice_get_feature_constraint( lattice: *mut mecab_lattice_t, pos: usize, ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::boundary_constraint(pos, type)"] + /// C wrapper of MeCab::Lattice::boundary_constraint(pos, type) pub fn mecab_lattice_set_boundary_constraint( lattice: *mut mecab_lattice_t, pos: usize, @@ -1267,7 +809,7 @@ extern "C" { ); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::set_feature_constraint(begin_pos, end_pos, feature)"] + /// C wrapper of MeCab::Lattice::set_feature_constraint(begin_pos, end_pos, feature) pub fn mecab_lattice_set_feature_constraint( lattice: *mut mecab_lattice_t, begin_pos: usize, @@ -1276,53 +818,56 @@ extern "C" { ); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::set_result(result);"] + /// C wrapper of MeCab::Lattice::set_result(result); pub fn mecab_lattice_set_result( lattice: *mut mecab_lattice_t, result: *const ::std::os::raw::c_char, ); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::what()"] - pub fn mecab_lattice_strerror(lattice: *mut mecab_lattice_t) -> *const ::std::os::raw::c_char; + /// C wrapper of MeCab::Lattice::what() + pub fn mecab_lattice_strerror( + lattice: *mut mecab_lattice_t, + ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wapper of MeCab::Model::create(argc, argv)"] + /// C wapper of MeCab::Model::create(argc, argv) pub fn mecab_model_new( argc: ::std::os::raw::c_int, argv: *mut *mut ::std::os::raw::c_char, ) -> *mut mecab_model_t; } extern "C" { - #[doc = " C wapper of MeCab::Model::create(arg)"] + /// C wapper of MeCab::Model::create(arg) pub fn mecab_model_new2(arg: *const ::std::os::raw::c_char) -> *mut mecab_model_t; } extern "C" { - #[doc = " C wapper of MeCab::deleteModel(model)"] + /// C wapper of MeCab::deleteModel(model) pub fn mecab_model_destroy(model: *mut mecab_model_t); } extern "C" { - #[doc = " C wapper of MeCab::Model::createTagger()"] + /// C wapper of MeCab::Model::createTagger() pub fn mecab_model_new_tagger(model: *mut mecab_model_t) -> *mut mecab_t; } extern "C" { - #[doc = " C wapper of MeCab::Model::createLattice()"] + /// C wapper of MeCab::Model::createLattice() pub fn mecab_model_new_lattice(model: *mut mecab_model_t) -> *mut mecab_lattice_t; } extern "C" { - #[doc = " C wrapper of MeCab::Model::swap()"] + /// C wrapper of MeCab::Model::swap() pub fn mecab_model_swap( model: *mut mecab_model_t, new_model: *mut mecab_model_t, ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wapper of MeCab::Model::dictionary_info()"] - pub fn mecab_model_dictionary_info(model: *mut mecab_model_t) - -> *const mecab_dictionary_info_t; + /// C wapper of MeCab::Model::dictionary_info() + pub fn mecab_model_dictionary_info( + model: *mut mecab_model_t, + ) -> *const mecab_dictionary_info_t; } extern "C" { - #[doc = " C wrapper of MeCab::Model::transition_cost()"] + /// C wrapper of MeCab::Model::transition_cost() pub fn mecab_model_transition_cost( model: *mut mecab_model_t, rcAttr: ::std::os::raw::c_ushort, @@ -1330,7 +875,7 @@ extern "C" { ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Model::lookup()"] + /// C wrapper of MeCab::Model::lookup() pub fn mecab_model_lookup( model: *mut mecab_model_t, begin: *const ::std::os::raw::c_char, @@ -1374,11 +919,11 @@ extern "C" { argv: *mut *mut ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } -#[doc = " DictionaryInfo structure"] +/// DictionaryInfo structure pub type MeCab_DictionaryInfo = mecab_dictionary_info_t; -#[doc = " Path structure"] +/// Path structure pub type MeCab_Path = mecab_path_t; -#[doc = " Node structure"] +/// Node structure pub type MeCab_Node = mecab_node_t; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -1387,71 +932,55 @@ pub struct MeCab_Allocator { } #[repr(C)] pub struct MeCab_Lattice__bindgen_vtable(::std::os::raw::c_void); -#[doc = " Lattice class"] +/// Lattice class #[repr(C)] #[derive(Debug)] pub struct MeCab_Lattice { pub vtable_: *const MeCab_Lattice__bindgen_vtable, } -#[test] -fn bindgen_test_layout_MeCab_Lattice() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(MeCab_Lattice)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(MeCab_Lattice)) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of MeCab_Lattice"][::std::mem::size_of::() - 8usize]; + ["Alignment of MeCab_Lattice"][::std::mem::align_of::() - 8usize]; +}; extern "C" { - #[doc = " Create new Lattice object"] - #[doc = " @return new Lattice object"] + /** Create new Lattice object + @return new Lattice object*/ #[link_name = "\u{1}__ZN5MeCab7Lattice6createEv"] pub fn MeCab_Lattice_create() -> *mut MeCab_Lattice; } impl MeCab_Lattice { #[inline] pub unsafe fn create() -> *mut MeCab_Lattice { - unsafe { MeCab_Lattice_create() } + MeCab_Lattice_create() } } #[repr(C)] pub struct MeCab_Model__bindgen_vtable(::std::os::raw::c_void); -#[doc = " Model class"] +/// Model class #[repr(C)] #[derive(Debug)] pub struct MeCab_Model { pub vtable_: *const MeCab_Model__bindgen_vtable, } -#[test] -fn bindgen_test_layout_MeCab_Model() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(MeCab_Model)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(MeCab_Model)) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of MeCab_Model"][::std::mem::size_of::() - 8usize]; + ["Alignment of MeCab_Model"][::std::mem::align_of::() - 8usize]; +}; extern "C" { - #[doc = " Return a version string"] - #[doc = " @return version string"] + /** Return a version string + @return version string*/ #[link_name = "\u{1}__ZN5MeCab5Model7versionEv"] pub fn MeCab_Model_version() -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " Factory method to create a new Model with a specified main's argc/argv-style parameters."] - #[doc = " Return NULL if new model cannot be initialized. Use MeCab::getLastError() to obtain the"] - #[doc = " cause of the errors."] - #[doc = " @return new Model object"] - #[doc = " @param argc number of parameters"] - #[doc = " @param argv parameter list"] + /** Factory method to create a new Model with a specified main's argc/argv-style parameters. + Return NULL if new model cannot be initialized. Use MeCab::getLastError() to obtain the + cause of the errors. + @return new Model object + @param argc number of parameters + @param argv parameter list*/ #[link_name = "\u{1}__ZN5MeCab5Model6createEiPPc"] pub fn MeCab_Model_create( argc: ::std::os::raw::c_int, @@ -1459,74 +988,69 @@ extern "C" { ) -> *mut MeCab_Model; } extern "C" { - #[doc = " Factory method to create a new Model with a string parameter representation, i.e.,"] - #[doc = " \"-d /user/local/mecab/dic/ipadic -Ochasen\"."] - #[doc = " Return NULL if new model cannot be initialized. Use MeCab::getLastError() to obtain the"] - #[doc = " cause of the errors."] - #[doc = " @return new Model object"] - #[doc = " @param arg single string representation of the argment."] + /** Factory method to create a new Model with a string parameter representation, i.e., + "-d /user/local/mecab/dic/ipadic -Ochasen". + Return NULL if new model cannot be initialized. Use MeCab::getLastError() to obtain the + cause of the errors. + @return new Model object + @param arg single string representation of the argment.*/ #[link_name = "\u{1}__ZN5MeCab5Model6createEPKc"] pub fn MeCab_Model_create1(arg: *const ::std::os::raw::c_char) -> *mut MeCab_Model; } impl MeCab_Model { #[inline] pub unsafe fn version() -> *const ::std::os::raw::c_char { - unsafe { MeCab_Model_version() } + MeCab_Model_version() } #[inline] pub unsafe fn create( argc: ::std::os::raw::c_int, argv: *mut *mut ::std::os::raw::c_char, ) -> *mut MeCab_Model { - unsafe { MeCab_Model_create(argc, argv) } + MeCab_Model_create(argc, argv) } #[inline] pub unsafe fn create1(arg: *const ::std::os::raw::c_char) -> *mut MeCab_Model { - unsafe { MeCab_Model_create1(arg) } + MeCab_Model_create1(arg) } } #[repr(C)] pub struct MeCab_Tagger__bindgen_vtable(::std::os::raw::c_void); -#[doc = " Tagger class"] +/// Tagger class #[repr(C)] #[derive(Debug)] pub struct MeCab_Tagger { pub vtable_: *const MeCab_Tagger__bindgen_vtable, } -#[test] -fn bindgen_test_layout_MeCab_Tagger() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(MeCab_Tagger)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(MeCab_Tagger)) - ); -} -extern "C" { - #[doc = " Handy static method."] - #[doc = " Return true if lattice is parsed successfully."] - #[doc = " This function is equivalent to"] - #[doc = " {"] - #[doc = " Tagger *tagger = model.createModel();"] - #[doc = " cosnt bool result = tagger->parse(lattice);"] - #[doc = " delete tagger;"] - #[doc = " return result;"] - #[doc = " }"] - #[doc = " @return boolean"] +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of MeCab_Tagger"][::std::mem::size_of::() - 8usize]; + ["Alignment of MeCab_Tagger"][::std::mem::align_of::() - 8usize]; +}; +extern "C" { + /** Handy static method. + Return true if lattice is parsed successfully. + This function is equivalent to + { + Tagger *tagger = model.createModel(); + cosnt bool result = tagger->parse(lattice); + delete tagger; + return result; + } + @return boolean*/ #[link_name = "\u{1}__ZN5MeCab6Tagger5parseERKNS_5ModelEPNS_7LatticeE"] - pub fn MeCab_Tagger_parse(model: *const MeCab_Model, lattice: *mut MeCab_Lattice) -> bool; -} -extern "C" { - #[doc = " Factory method to create a new Tagger with a specified main's argc/argv-style parameters."] - #[doc = " Return NULL if new model cannot be initialized. Use MeCab::getLastError() to obtain the"] - #[doc = " cause of the errors."] - #[doc = " @return new Tagger object"] - #[doc = " @param argc number of parameters"] - #[doc = " @param argv parameter list"] + pub fn MeCab_Tagger_parse( + model: *const MeCab_Model, + lattice: *mut MeCab_Lattice, + ) -> bool; +} +extern "C" { + /** Factory method to create a new Tagger with a specified main's argc/argv-style parameters. + Return NULL if new model cannot be initialized. Use MeCab::getLastError() to obtain the + cause of the errors. + @return new Tagger object + @param argc number of parameters + @param argv parameter list*/ #[link_name = "\u{1}__ZN5MeCab6Tagger6createEiPPc"] pub fn MeCab_Tagger_create( argc: ::std::os::raw::c_int, @@ -1534,49 +1058,49 @@ extern "C" { ) -> *mut MeCab_Tagger; } extern "C" { - #[doc = " Factory method to create a new Tagger with a string parameter representation, i.e.,"] - #[doc = " \"-d /user/local/mecab/dic/ipadic -Ochasen\"."] - #[doc = " Return NULL if new model cannot be initialized. Use MeCab::getLastError() to obtain the"] - #[doc = " cause of the errors."] - #[doc = " @return new Model object"] - #[doc = " @param arg single string representation of the argment."] + /** Factory method to create a new Tagger with a string parameter representation, i.e., + "-d /user/local/mecab/dic/ipadic -Ochasen". + Return NULL if new model cannot be initialized. Use MeCab::getLastError() to obtain the + cause of the errors. + @return new Model object + @param arg single string representation of the argment.*/ #[link_name = "\u{1}__ZN5MeCab6Tagger6createEPKc"] pub fn MeCab_Tagger_create1(arg: *const ::std::os::raw::c_char) -> *mut MeCab_Tagger; } extern "C" { - #[doc = " Return a version string"] - #[doc = " @return version string"] + /** Return a version string + @return version string*/ #[link_name = "\u{1}__ZN5MeCab6Tagger7versionEv"] pub fn MeCab_Tagger_version() -> *const ::std::os::raw::c_char; } impl MeCab_Tagger { #[inline] pub unsafe fn parse(model: *const MeCab_Model, lattice: *mut MeCab_Lattice) -> bool { - unsafe { MeCab_Tagger_parse(model, lattice) } + MeCab_Tagger_parse(model, lattice) } #[inline] pub unsafe fn create( argc: ::std::os::raw::c_int, argv: *mut *mut ::std::os::raw::c_char, ) -> *mut MeCab_Tagger { - unsafe { MeCab_Tagger_create(argc, argv) } + MeCab_Tagger_create(argc, argv) } #[inline] pub unsafe fn create1(arg: *const ::std::os::raw::c_char) -> *mut MeCab_Tagger { - unsafe { MeCab_Tagger_create1(arg) } + MeCab_Tagger_create1(arg) } #[inline] pub unsafe fn version() -> *const ::std::os::raw::c_char { - unsafe { MeCab_Tagger_version() } + MeCab_Tagger_version() } } extern "C" { - #[doc = " Alias of Lattice::create()"] + /// Alias of Lattice::create() #[link_name = "\u{1}__ZN5MeCab13createLatticeEv"] pub fn MeCab_createLattice() -> *mut MeCab_Lattice; } extern "C" { - #[doc = " Alias of Mode::create(argc, argv)"] + /// Alias of Mode::create(argc, argv) #[link_name = "\u{1}__ZN5MeCab11createModelEiPPc"] pub fn MeCab_createModel( argc: ::std::os::raw::c_int, @@ -1584,12 +1108,12 @@ extern "C" { ) -> *mut MeCab_Model; } extern "C" { - #[doc = " Alias of Mode::create(arg)"] + /// Alias of Mode::create(arg) #[link_name = "\u{1}__ZN5MeCab11createModelEPKc"] pub fn MeCab_createModel1(arg: *const ::std::os::raw::c_char) -> *mut MeCab_Model; } extern "C" { - #[doc = " Alias of Tagger::create(argc, argv)"] + /// Alias of Tagger::create(argc, argv) #[link_name = "\u{1}__ZN5MeCab12createTaggerEiPPc"] pub fn MeCab_createTagger( argc: ::std::os::raw::c_int, @@ -1597,44 +1121,44 @@ extern "C" { ) -> *mut MeCab_Tagger; } extern "C" { - #[doc = " Alias of Tagger::create(arg)"] + /// Alias of Tagger::create(arg) #[link_name = "\u{1}__ZN5MeCab12createTaggerEPKc"] pub fn MeCab_createTagger1(arg: *const ::std::os::raw::c_char) -> *mut MeCab_Tagger; } extern "C" { - #[doc = " delete Lattice object."] - #[doc = " This method calles \"delete lattice\"."] - #[doc = " In some environment, e.g., MS-Windows, an object allocated inside a DLL must be deleted in the same DLL too."] - #[doc = " @param lattice lattice object"] + /** delete Lattice object. + This method calles "delete lattice". + In some environment, e.g., MS-Windows, an object allocated inside a DLL must be deleted in the same DLL too. + @param lattice lattice object*/ #[link_name = "\u{1}__ZN5MeCab13deleteLatticeEPNS_7LatticeE"] pub fn MeCab_deleteLattice(lattice: *mut MeCab_Lattice); } extern "C" { - #[doc = " delete Model object."] - #[doc = " This method calles \"delete model\"."] - #[doc = " In some environment, e.g., MS-Windows, an object allocated inside a DLL must be deleted in the same DLL too."] - #[doc = " @param model model object"] + /** delete Model object. + This method calles "delete model". + In some environment, e.g., MS-Windows, an object allocated inside a DLL must be deleted in the same DLL too. + @param model model object*/ #[link_name = "\u{1}__ZN5MeCab11deleteModelEPNS_5ModelE"] pub fn MeCab_deleteModel(model: *mut MeCab_Model); } extern "C" { - #[doc = " delete Tagger object."] - #[doc = " This method calles \"delete tagger\"."] - #[doc = " In some environment, e.g., MS-Windows, an object allocated inside a DLL must be deleted in the same DLL too."] - #[doc = " @param tagger tagger object"] + /** delete Tagger object. + This method calles "delete tagger". + In some environment, e.g., MS-Windows, an object allocated inside a DLL must be deleted in the same DLL too. + @param tagger tagger object*/ #[link_name = "\u{1}__ZN5MeCab12deleteTaggerEPNS_6TaggerE"] pub fn MeCab_deleteTagger(tagger: *mut MeCab_Tagger); } extern "C" { - #[doc = " Return last error string."] - #[doc = " @return error string"] + /** Return last error string. + @return error string*/ #[link_name = "\u{1}__ZN5MeCab12getLastErrorEv"] pub fn MeCab_getLastError() -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " An alias of getLastError."] - #[doc = " It is kept for backward compatibility."] - #[doc = " @return error string"] + /** An alias of getLastError. + It is kept for backward compatibility. + @return error string*/ #[link_name = "\u{1}__ZN5MeCab14getTaggerErrorEv"] pub fn MeCab_getTaggerError() -> *const ::std::os::raw::c_char; } @@ -1647,71 +1171,22 @@ pub struct _Mecab { pub tagger: *mut ::std::os::raw::c_void, pub lattice: *mut ::std::os::raw::c_void, } -#[test] -fn bindgen_test_layout__Mecab() { - const UNINIT: ::std::mem::MaybeUninit<_Mecab> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_Mecab>(), - 40usize, - concat!("Size of: ", stringify!(_Mecab)) - ); - assert_eq!( - ::std::mem::align_of::<_Mecab>(), - 8usize, - concat!("Alignment of ", stringify!(_Mecab)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).feature) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_Mecab), - "::", - stringify!(feature) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_Mecab), - "::", - stringify!(size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).model) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_Mecab), - "::", - stringify!(model) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tagger) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_Mecab), - "::", - stringify!(tagger) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lattice) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_Mecab), - "::", - stringify!(lattice) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _Mecab"][::std::mem::size_of::<_Mecab>() - 40usize]; + ["Alignment of _Mecab"][::std::mem::align_of::<_Mecab>() - 8usize]; + [ + "Offset of field: _Mecab::feature", + ][::std::mem::offset_of!(_Mecab, feature) - 0usize]; + ["Offset of field: _Mecab::size"][::std::mem::offset_of!(_Mecab, size) - 8usize]; + ["Offset of field: _Mecab::model"][::std::mem::offset_of!(_Mecab, model) - 16usize]; + [ + "Offset of field: _Mecab::tagger", + ][::std::mem::offset_of!(_Mecab, tagger) - 24usize]; + [ + "Offset of field: _Mecab::lattice", + ][::std::mem::offset_of!(_Mecab, lattice) - 32usize]; +}; pub type Mecab = _Mecab; extern "C" { pub fn Mecab_initialize(m: *mut Mecab) -> ::std::os::raw::c_int; @@ -1770,181 +1245,55 @@ pub struct _NJDNode { pub prev: *mut _NJDNode, pub next: *mut _NJDNode, } -#[test] -fn bindgen_test_layout__NJDNode() { - const UNINIT: ::std::mem::MaybeUninit<_NJDNode> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_NJDNode>(), - 120usize, - concat!("Size of: ", stringify!(_NJDNode)) - ); - assert_eq!( - ::std::mem::align_of::<_NJDNode>(), - 8usize, - concat!("Alignment of ", stringify!(_NJDNode)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).string) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(string) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pos) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(pos) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pos_group1) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(pos_group1) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pos_group2) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(pos_group2) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pos_group3) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(pos_group3) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ctype) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(ctype) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cform) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(cform) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).orig) as usize - ptr as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(orig) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).read) as usize - ptr as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(read) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pron) as usize - ptr as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(pron) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).acc) as usize - ptr as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(acc) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mora_size) as usize - ptr as usize }, - 84usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(mora_size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).chain_rule) as usize - ptr as usize }, - 88usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(chain_rule) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).chain_flag) as usize - ptr as usize }, - 96usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(chain_flag) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize }, - 104usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(prev) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 112usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(next) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _NJDNode"][::std::mem::size_of::<_NJDNode>() - 120usize]; + ["Alignment of _NJDNode"][::std::mem::align_of::<_NJDNode>() - 8usize]; + [ + "Offset of field: _NJDNode::string", + ][::std::mem::offset_of!(_NJDNode, string) - 0usize]; + ["Offset of field: _NJDNode::pos"][::std::mem::offset_of!(_NJDNode, pos) - 8usize]; + [ + "Offset of field: _NJDNode::pos_group1", + ][::std::mem::offset_of!(_NJDNode, pos_group1) - 16usize]; + [ + "Offset of field: _NJDNode::pos_group2", + ][::std::mem::offset_of!(_NJDNode, pos_group2) - 24usize]; + [ + "Offset of field: _NJDNode::pos_group3", + ][::std::mem::offset_of!(_NJDNode, pos_group3) - 32usize]; + [ + "Offset of field: _NJDNode::ctype", + ][::std::mem::offset_of!(_NJDNode, ctype) - 40usize]; + [ + "Offset of field: _NJDNode::cform", + ][::std::mem::offset_of!(_NJDNode, cform) - 48usize]; + [ + "Offset of field: _NJDNode::orig", + ][::std::mem::offset_of!(_NJDNode, orig) - 56usize]; + [ + "Offset of field: _NJDNode::read", + ][::std::mem::offset_of!(_NJDNode, read) - 64usize]; + [ + "Offset of field: _NJDNode::pron", + ][::std::mem::offset_of!(_NJDNode, pron) - 72usize]; + ["Offset of field: _NJDNode::acc"][::std::mem::offset_of!(_NJDNode, acc) - 80usize]; + [ + "Offset of field: _NJDNode::mora_size", + ][::std::mem::offset_of!(_NJDNode, mora_size) - 84usize]; + [ + "Offset of field: _NJDNode::chain_rule", + ][::std::mem::offset_of!(_NJDNode, chain_rule) - 88usize]; + [ + "Offset of field: _NJDNode::chain_flag", + ][::std::mem::offset_of!(_NJDNode, chain_flag) - 96usize]; + [ + "Offset of field: _NJDNode::prev", + ][::std::mem::offset_of!(_NJDNode, prev) - 104usize]; + [ + "Offset of field: _NJDNode::next", + ][::std::mem::offset_of!(_NJDNode, next) - 112usize]; +}; pub type NJDNode = _NJDNode; extern "C" { pub fn NJDNode_initialize(node: *mut NJDNode); @@ -1956,13 +1305,22 @@ extern "C" { pub fn NJDNode_set_pos(node: *mut NJDNode, str_: *const ::std::os::raw::c_char); } extern "C" { - pub fn NJDNode_set_pos_group1(node: *mut NJDNode, str_: *const ::std::os::raw::c_char); + pub fn NJDNode_set_pos_group1( + node: *mut NJDNode, + str_: *const ::std::os::raw::c_char, + ); } extern "C" { - pub fn NJDNode_set_pos_group2(node: *mut NJDNode, str_: *const ::std::os::raw::c_char); + pub fn NJDNode_set_pos_group2( + node: *mut NJDNode, + str_: *const ::std::os::raw::c_char, + ); } extern "C" { - pub fn NJDNode_set_pos_group3(node: *mut NJDNode, str_: *const ::std::os::raw::c_char); + pub fn NJDNode_set_pos_group3( + node: *mut NJDNode, + str_: *const ::std::os::raw::c_char, + ); } extern "C" { pub fn NJDNode_set_ctype(node: *mut NJDNode, str_: *const ::std::os::raw::c_char); @@ -1986,7 +1344,10 @@ extern "C" { pub fn NJDNode_set_mora_size(node: *mut NJDNode, size: ::std::os::raw::c_int); } extern "C" { - pub fn NJDNode_set_chain_rule(node: *mut NJDNode, str_: *const ::std::os::raw::c_char); + pub fn NJDNode_set_chain_rule( + node: *mut NJDNode, + str_: *const ::std::os::raw::c_char, + ); } extern "C" { pub fn NJDNode_set_chain_flag(node: *mut NJDNode, flag: ::std::os::raw::c_int); @@ -2086,41 +1447,13 @@ pub struct _NJD { pub head: *mut NJDNode, pub tail: *mut NJDNode, } -#[test] -fn bindgen_test_layout__NJD() { - const UNINIT: ::std::mem::MaybeUninit<_NJD> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_NJD>(), - 16usize, - concat!("Size of: ", stringify!(_NJD)) - ); - assert_eq!( - ::std::mem::align_of::<_NJD>(), - 8usize, - concat!("Alignment of ", stringify!(_NJD)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).head) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_NJD), - "::", - stringify!(head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tail) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_NJD), - "::", - stringify!(tail) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _NJD"][::std::mem::size_of::<_NJD>() - 16usize]; + ["Alignment of _NJD"][::std::mem::align_of::<_NJD>() - 8usize]; + ["Offset of field: _NJD::head"][::std::mem::offset_of!(_NJD, head) - 0usize]; + ["Offset of field: _NJD::tail"][::std::mem::offset_of!(_NJD, tail) - 8usize]; +}; pub type NJD = _NJD; extern "C" { pub fn NJD_initialize(njd: *mut NJD); @@ -2170,62 +1503,27 @@ pub struct _JPCommonLabelPhoneme { pub next: *mut _JPCommonLabelPhoneme, pub up: *mut _JPCommonLabelMora, } -#[test] -fn bindgen_test_layout__JPCommonLabelPhoneme() { - const UNINIT: ::std::mem::MaybeUninit<_JPCommonLabelPhoneme> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_JPCommonLabelPhoneme>(), - 32usize, - concat!("Size of: ", stringify!(_JPCommonLabelPhoneme)) - ); - assert_eq!( - ::std::mem::align_of::<_JPCommonLabelPhoneme>(), - 8usize, - concat!("Alignment of ", stringify!(_JPCommonLabelPhoneme)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).phoneme) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelPhoneme), - "::", - stringify!(phoneme) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelPhoneme), - "::", - stringify!(prev) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelPhoneme), - "::", - stringify!(next) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).up) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelPhoneme), - "::", - stringify!(up) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + [ + "Size of _JPCommonLabelPhoneme", + ][::std::mem::size_of::<_JPCommonLabelPhoneme>() - 32usize]; + [ + "Alignment of _JPCommonLabelPhoneme", + ][::std::mem::align_of::<_JPCommonLabelPhoneme>() - 8usize]; + [ + "Offset of field: _JPCommonLabelPhoneme::phoneme", + ][::std::mem::offset_of!(_JPCommonLabelPhoneme, phoneme) - 0usize]; + [ + "Offset of field: _JPCommonLabelPhoneme::prev", + ][::std::mem::offset_of!(_JPCommonLabelPhoneme, prev) - 8usize]; + [ + "Offset of field: _JPCommonLabelPhoneme::next", + ][::std::mem::offset_of!(_JPCommonLabelPhoneme, next) - 16usize]; + [ + "Offset of field: _JPCommonLabelPhoneme::up", + ][::std::mem::offset_of!(_JPCommonLabelPhoneme, up) - 24usize]; +}; pub type JPCommonLabelPhoneme = _JPCommonLabelPhoneme; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -2237,81 +1535,33 @@ pub struct _JPCommonLabelMora { pub next: *mut _JPCommonLabelMora, pub up: *mut _JPCommonLabelWord, } -#[test] -fn bindgen_test_layout__JPCommonLabelMora() { - const UNINIT: ::std::mem::MaybeUninit<_JPCommonLabelMora> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_JPCommonLabelMora>(), - 48usize, - concat!("Size of: ", stringify!(_JPCommonLabelMora)) - ); - assert_eq!( - ::std::mem::align_of::<_JPCommonLabelMora>(), - 8usize, - concat!("Alignment of ", stringify!(_JPCommonLabelMora)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mora) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelMora), - "::", - stringify!(mora) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).head) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelMora), - "::", - stringify!(head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tail) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelMora), - "::", - stringify!(tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelMora), - "::", - stringify!(prev) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelMora), - "::", - stringify!(next) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).up) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelMora), - "::", - stringify!(up) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + [ + "Size of _JPCommonLabelMora", + ][::std::mem::size_of::<_JPCommonLabelMora>() - 48usize]; + [ + "Alignment of _JPCommonLabelMora", + ][::std::mem::align_of::<_JPCommonLabelMora>() - 8usize]; + [ + "Offset of field: _JPCommonLabelMora::mora", + ][::std::mem::offset_of!(_JPCommonLabelMora, mora) - 0usize]; + [ + "Offset of field: _JPCommonLabelMora::head", + ][::std::mem::offset_of!(_JPCommonLabelMora, head) - 8usize]; + [ + "Offset of field: _JPCommonLabelMora::tail", + ][::std::mem::offset_of!(_JPCommonLabelMora, tail) - 16usize]; + [ + "Offset of field: _JPCommonLabelMora::prev", + ][::std::mem::offset_of!(_JPCommonLabelMora, prev) - 24usize]; + [ + "Offset of field: _JPCommonLabelMora::next", + ][::std::mem::offset_of!(_JPCommonLabelMora, next) - 32usize]; + [ + "Offset of field: _JPCommonLabelMora::up", + ][::std::mem::offset_of!(_JPCommonLabelMora, up) - 40usize]; +}; pub type JPCommonLabelMora = _JPCommonLabelMora; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -2326,111 +1576,42 @@ pub struct _JPCommonLabelWord { pub next: *mut _JPCommonLabelWord, pub up: *mut _JPCommonLabelAccentPhrase, } -#[test] -fn bindgen_test_layout__JPCommonLabelWord() { - const UNINIT: ::std::mem::MaybeUninit<_JPCommonLabelWord> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_JPCommonLabelWord>(), - 72usize, - concat!("Size of: ", stringify!(_JPCommonLabelWord)) - ); - assert_eq!( - ::std::mem::align_of::<_JPCommonLabelWord>(), - 8usize, - concat!("Alignment of ", stringify!(_JPCommonLabelWord)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pron) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(pron) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pos) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(pos) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ctype) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(ctype) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cform) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(cform) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).head) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tail) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(prev) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(next) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).up) as usize - ptr as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(up) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + [ + "Size of _JPCommonLabelWord", + ][::std::mem::size_of::<_JPCommonLabelWord>() - 72usize]; + [ + "Alignment of _JPCommonLabelWord", + ][::std::mem::align_of::<_JPCommonLabelWord>() - 8usize]; + [ + "Offset of field: _JPCommonLabelWord::pron", + ][::std::mem::offset_of!(_JPCommonLabelWord, pron) - 0usize]; + [ + "Offset of field: _JPCommonLabelWord::pos", + ][::std::mem::offset_of!(_JPCommonLabelWord, pos) - 8usize]; + [ + "Offset of field: _JPCommonLabelWord::ctype", + ][::std::mem::offset_of!(_JPCommonLabelWord, ctype) - 16usize]; + [ + "Offset of field: _JPCommonLabelWord::cform", + ][::std::mem::offset_of!(_JPCommonLabelWord, cform) - 24usize]; + [ + "Offset of field: _JPCommonLabelWord::head", + ][::std::mem::offset_of!(_JPCommonLabelWord, head) - 32usize]; + [ + "Offset of field: _JPCommonLabelWord::tail", + ][::std::mem::offset_of!(_JPCommonLabelWord, tail) - 40usize]; + [ + "Offset of field: _JPCommonLabelWord::prev", + ][::std::mem::offset_of!(_JPCommonLabelWord, prev) - 48usize]; + [ + "Offset of field: _JPCommonLabelWord::next", + ][::std::mem::offset_of!(_JPCommonLabelWord, next) - 56usize]; + [ + "Offset of field: _JPCommonLabelWord::up", + ][::std::mem::offset_of!(_JPCommonLabelWord, up) - 64usize]; +}; pub type JPCommonLabelWord = _JPCommonLabelWord; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -2443,92 +1624,36 @@ pub struct _JPCommonLabelAccentPhrase { pub next: *mut _JPCommonLabelAccentPhrase, pub up: *mut _JPCommonLabelBreathGroup, } -#[test] -fn bindgen_test_layout__JPCommonLabelAccentPhrase() { - const UNINIT: ::std::mem::MaybeUninit<_JPCommonLabelAccentPhrase> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_JPCommonLabelAccentPhrase>(), - 56usize, - concat!("Size of: ", stringify!(_JPCommonLabelAccentPhrase)) - ); - assert_eq!( - ::std::mem::align_of::<_JPCommonLabelAccentPhrase>(), - 8usize, - concat!("Alignment of ", stringify!(_JPCommonLabelAccentPhrase)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).accent) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelAccentPhrase), - "::", - stringify!(accent) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).emotion) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelAccentPhrase), - "::", - stringify!(emotion) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).head) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelAccentPhrase), - "::", - stringify!(head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tail) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelAccentPhrase), - "::", - stringify!(tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelAccentPhrase), - "::", - stringify!(prev) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelAccentPhrase), - "::", - stringify!(next) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).up) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelAccentPhrase), - "::", - stringify!(up) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + [ + "Size of _JPCommonLabelAccentPhrase", + ][::std::mem::size_of::<_JPCommonLabelAccentPhrase>() - 56usize]; + [ + "Alignment of _JPCommonLabelAccentPhrase", + ][::std::mem::align_of::<_JPCommonLabelAccentPhrase>() - 8usize]; + [ + "Offset of field: _JPCommonLabelAccentPhrase::accent", + ][::std::mem::offset_of!(_JPCommonLabelAccentPhrase, accent) - 0usize]; + [ + "Offset of field: _JPCommonLabelAccentPhrase::emotion", + ][::std::mem::offset_of!(_JPCommonLabelAccentPhrase, emotion) - 8usize]; + [ + "Offset of field: _JPCommonLabelAccentPhrase::head", + ][::std::mem::offset_of!(_JPCommonLabelAccentPhrase, head) - 16usize]; + [ + "Offset of field: _JPCommonLabelAccentPhrase::tail", + ][::std::mem::offset_of!(_JPCommonLabelAccentPhrase, tail) - 24usize]; + [ + "Offset of field: _JPCommonLabelAccentPhrase::prev", + ][::std::mem::offset_of!(_JPCommonLabelAccentPhrase, prev) - 32usize]; + [ + "Offset of field: _JPCommonLabelAccentPhrase::next", + ][::std::mem::offset_of!(_JPCommonLabelAccentPhrase, next) - 40usize]; + [ + "Offset of field: _JPCommonLabelAccentPhrase::up", + ][::std::mem::offset_of!(_JPCommonLabelAccentPhrase, up) - 48usize]; +}; pub type JPCommonLabelAccentPhrase = _JPCommonLabelAccentPhrase; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -2538,62 +1663,27 @@ pub struct _JPCommonLabelBreathGroup { pub prev: *mut _JPCommonLabelBreathGroup, pub next: *mut _JPCommonLabelBreathGroup, } -#[test] -fn bindgen_test_layout__JPCommonLabelBreathGroup() { - const UNINIT: ::std::mem::MaybeUninit<_JPCommonLabelBreathGroup> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_JPCommonLabelBreathGroup>(), - 32usize, - concat!("Size of: ", stringify!(_JPCommonLabelBreathGroup)) - ); - assert_eq!( - ::std::mem::align_of::<_JPCommonLabelBreathGroup>(), - 8usize, - concat!("Alignment of ", stringify!(_JPCommonLabelBreathGroup)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).head) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelBreathGroup), - "::", - stringify!(head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tail) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelBreathGroup), - "::", - stringify!(tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelBreathGroup), - "::", - stringify!(prev) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelBreathGroup), - "::", - stringify!(next) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + [ + "Size of _JPCommonLabelBreathGroup", + ][::std::mem::size_of::<_JPCommonLabelBreathGroup>() - 32usize]; + [ + "Alignment of _JPCommonLabelBreathGroup", + ][::std::mem::align_of::<_JPCommonLabelBreathGroup>() - 8usize]; + [ + "Offset of field: _JPCommonLabelBreathGroup::head", + ][::std::mem::offset_of!(_JPCommonLabelBreathGroup, head) - 0usize]; + [ + "Offset of field: _JPCommonLabelBreathGroup::tail", + ][::std::mem::offset_of!(_JPCommonLabelBreathGroup, tail) - 8usize]; + [ + "Offset of field: _JPCommonLabelBreathGroup::prev", + ][::std::mem::offset_of!(_JPCommonLabelBreathGroup, prev) - 16usize]; + [ + "Offset of field: _JPCommonLabelBreathGroup::next", + ][::std::mem::offset_of!(_JPCommonLabelBreathGroup, next) - 24usize]; +}; pub type JPCommonLabelBreathGroup = _JPCommonLabelBreathGroup; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -2612,151 +1702,50 @@ pub struct _JPCommonLabel { pub phoneme_tail: *mut JPCommonLabelPhoneme, pub short_pause_flag: ::std::os::raw::c_int, } -#[test] -fn bindgen_test_layout__JPCommonLabel() { - const UNINIT: ::std::mem::MaybeUninit<_JPCommonLabel> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_JPCommonLabel>(), - 104usize, - concat!("Size of: ", stringify!(_JPCommonLabel)) - ); - assert_eq!( - ::std::mem::align_of::<_JPCommonLabel>(), - 8usize, - concat!("Alignment of ", stringify!(_JPCommonLabel)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).feature) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(feature) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).breath_head) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(breath_head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).breath_tail) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(breath_tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).accent_head) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(accent_head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).accent_tail) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(accent_tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).word_head) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(word_head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).word_tail) as usize - ptr as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(word_tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mora_head) as usize - ptr as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(mora_head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mora_tail) as usize - ptr as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(mora_tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).phoneme_head) as usize - ptr as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(phoneme_head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).phoneme_tail) as usize - ptr as usize }, - 88usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(phoneme_tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).short_pause_flag) as usize - ptr as usize }, - 96usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(short_pause_flag) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _JPCommonLabel"][::std::mem::size_of::<_JPCommonLabel>() - 104usize]; + ["Alignment of _JPCommonLabel"][::std::mem::align_of::<_JPCommonLabel>() - 8usize]; + [ + "Offset of field: _JPCommonLabel::size", + ][::std::mem::offset_of!(_JPCommonLabel, size) - 0usize]; + [ + "Offset of field: _JPCommonLabel::feature", + ][::std::mem::offset_of!(_JPCommonLabel, feature) - 8usize]; + [ + "Offset of field: _JPCommonLabel::breath_head", + ][::std::mem::offset_of!(_JPCommonLabel, breath_head) - 16usize]; + [ + "Offset of field: _JPCommonLabel::breath_tail", + ][::std::mem::offset_of!(_JPCommonLabel, breath_tail) - 24usize]; + [ + "Offset of field: _JPCommonLabel::accent_head", + ][::std::mem::offset_of!(_JPCommonLabel, accent_head) - 32usize]; + [ + "Offset of field: _JPCommonLabel::accent_tail", + ][::std::mem::offset_of!(_JPCommonLabel, accent_tail) - 40usize]; + [ + "Offset of field: _JPCommonLabel::word_head", + ][::std::mem::offset_of!(_JPCommonLabel, word_head) - 48usize]; + [ + "Offset of field: _JPCommonLabel::word_tail", + ][::std::mem::offset_of!(_JPCommonLabel, word_tail) - 56usize]; + [ + "Offset of field: _JPCommonLabel::mora_head", + ][::std::mem::offset_of!(_JPCommonLabel, mora_head) - 64usize]; + [ + "Offset of field: _JPCommonLabel::mora_tail", + ][::std::mem::offset_of!(_JPCommonLabel, mora_tail) - 72usize]; + [ + "Offset of field: _JPCommonLabel::phoneme_head", + ][::std::mem::offset_of!(_JPCommonLabel, phoneme_head) - 80usize]; + [ + "Offset of field: _JPCommonLabel::phoneme_tail", + ][::std::mem::offset_of!(_JPCommonLabel, phoneme_tail) - 88usize]; + [ + "Offset of field: _JPCommonLabel::short_pause_flag", + ][::std::mem::offset_of!(_JPCommonLabel, short_pause_flag) - 96usize]; +}; pub type JPCommonLabel = _JPCommonLabel; extern "C" { pub fn JPCommonLabel_initialize(label: *mut JPCommonLabel); @@ -2779,8 +1768,9 @@ extern "C" { pub fn JPCommonLabel_get_size(label: *mut JPCommonLabel) -> ::std::os::raw::c_int; } extern "C" { - pub fn JPCommonLabel_get_feature(label: *mut JPCommonLabel) - -> *mut *mut ::std::os::raw::c_char; + pub fn JPCommonLabel_get_feature( + label: *mut JPCommonLabel, + ) -> *mut *mut ::std::os::raw::c_char; } extern "C" { pub fn JPCommonLabel_print(label: *mut JPCommonLabel); @@ -2803,134 +1793,91 @@ pub struct _JPCommonNode { pub prev: *mut _JPCommonNode, pub next: *mut _JPCommonNode, } -#[test] -fn bindgen_test_layout__JPCommonNode() { - const UNINIT: ::std::mem::MaybeUninit<_JPCommonNode> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_JPCommonNode>(), - 56usize, - concat!("Size of: ", stringify!(_JPCommonNode)) - ); - assert_eq!( - ::std::mem::align_of::<_JPCommonNode>(), - 8usize, - concat!("Alignment of ", stringify!(_JPCommonNode)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pron) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonNode), - "::", - stringify!(pron) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pos) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonNode), - "::", - stringify!(pos) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ctype) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonNode), - "::", - stringify!(ctype) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cform) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonNode), - "::", - stringify!(cform) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).acc) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonNode), - "::", - stringify!(acc) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).chain_flag) as usize - ptr as usize }, - 36usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonNode), - "::", - stringify!(chain_flag) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonNode), - "::", - stringify!(prev) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonNode), - "::", - stringify!(next) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _JPCommonNode"][::std::mem::size_of::<_JPCommonNode>() - 56usize]; + ["Alignment of _JPCommonNode"][::std::mem::align_of::<_JPCommonNode>() - 8usize]; + [ + "Offset of field: _JPCommonNode::pron", + ][::std::mem::offset_of!(_JPCommonNode, pron) - 0usize]; + [ + "Offset of field: _JPCommonNode::pos", + ][::std::mem::offset_of!(_JPCommonNode, pos) - 8usize]; + [ + "Offset of field: _JPCommonNode::ctype", + ][::std::mem::offset_of!(_JPCommonNode, ctype) - 16usize]; + [ + "Offset of field: _JPCommonNode::cform", + ][::std::mem::offset_of!(_JPCommonNode, cform) - 24usize]; + [ + "Offset of field: _JPCommonNode::acc", + ][::std::mem::offset_of!(_JPCommonNode, acc) - 32usize]; + [ + "Offset of field: _JPCommonNode::chain_flag", + ][::std::mem::offset_of!(_JPCommonNode, chain_flag) - 36usize]; + [ + "Offset of field: _JPCommonNode::prev", + ][::std::mem::offset_of!(_JPCommonNode, prev) - 40usize]; + [ + "Offset of field: _JPCommonNode::next", + ][::std::mem::offset_of!(_JPCommonNode, next) - 48usize]; +}; pub type JPCommonNode = _JPCommonNode; extern "C" { pub fn JPCommonNode_initialize(node: *mut JPCommonNode); } extern "C" { - pub fn JPCommonNode_set_pron(node: *mut JPCommonNode, str_: *const ::std::os::raw::c_char); + pub fn JPCommonNode_set_pron( + node: *mut JPCommonNode, + str_: *const ::std::os::raw::c_char, + ); } extern "C" { - pub fn JPCommonNode_set_pos(node: *mut JPCommonNode, str_: *const ::std::os::raw::c_char); + pub fn JPCommonNode_set_pos( + node: *mut JPCommonNode, + str_: *const ::std::os::raw::c_char, + ); } extern "C" { - pub fn JPCommonNode_set_ctype(node: *mut JPCommonNode, str_: *const ::std::os::raw::c_char); + pub fn JPCommonNode_set_ctype( + node: *mut JPCommonNode, + str_: *const ::std::os::raw::c_char, + ); } extern "C" { - pub fn JPCommonNode_set_cform(node: *mut JPCommonNode, str_: *const ::std::os::raw::c_char); + pub fn JPCommonNode_set_cform( + node: *mut JPCommonNode, + str_: *const ::std::os::raw::c_char, + ); } extern "C" { pub fn JPCommonNode_set_acc(node: *mut JPCommonNode, acc: ::std::os::raw::c_int); } extern "C" { - pub fn JPCommonNode_set_chain_flag(node: *mut JPCommonNode, flag: ::std::os::raw::c_int); + pub fn JPCommonNode_set_chain_flag( + node: *mut JPCommonNode, + flag: ::std::os::raw::c_int, + ); } extern "C" { - pub fn JPCommonNode_get_pron(node: *mut JPCommonNode) -> *const ::std::os::raw::c_char; + pub fn JPCommonNode_get_pron( + node: *mut JPCommonNode, + ) -> *const ::std::os::raw::c_char; } extern "C" { - pub fn JPCommonNode_get_pos(node: *mut JPCommonNode) -> *const ::std::os::raw::c_char; + pub fn JPCommonNode_get_pos( + node: *mut JPCommonNode, + ) -> *const ::std::os::raw::c_char; } extern "C" { - pub fn JPCommonNode_get_ctype(node: *mut JPCommonNode) -> *const ::std::os::raw::c_char; + pub fn JPCommonNode_get_ctype( + node: *mut JPCommonNode, + ) -> *const ::std::os::raw::c_char; } extern "C" { - pub fn JPCommonNode_get_cform(node: *mut JPCommonNode) -> *const ::std::os::raw::c_char; + pub fn JPCommonNode_get_cform( + node: *mut JPCommonNode, + ) -> *const ::std::os::raw::c_char; } extern "C" { pub fn JPCommonNode_get_acc(node: *mut JPCommonNode) -> ::std::os::raw::c_int; @@ -2954,51 +1901,20 @@ pub struct _JPCommon { pub tail: *mut JPCommonNode, pub label: *mut JPCommonLabel, } -#[test] -fn bindgen_test_layout__JPCommon() { - const UNINIT: ::std::mem::MaybeUninit<_JPCommon> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_JPCommon>(), - 24usize, - concat!("Size of: ", stringify!(_JPCommon)) - ); - assert_eq!( - ::std::mem::align_of::<_JPCommon>(), - 8usize, - concat!("Alignment of ", stringify!(_JPCommon)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).head) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_JPCommon), - "::", - stringify!(head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tail) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_JPCommon), - "::", - stringify!(tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).label) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_JPCommon), - "::", - stringify!(label) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _JPCommon"][::std::mem::size_of::<_JPCommon>() - 24usize]; + ["Alignment of _JPCommon"][::std::mem::align_of::<_JPCommon>() - 8usize]; + [ + "Offset of field: _JPCommon::head", + ][::std::mem::offset_of!(_JPCommon, head) - 0usize]; + [ + "Offset of field: _JPCommon::tail", + ][::std::mem::offset_of!(_JPCommon, tail) - 8usize]; + [ + "Offset of field: _JPCommon::label", + ][::std::mem::offset_of!(_JPCommon, label) - 16usize]; +}; pub type JPCommon = _JPCommon; extern "C" { pub fn JPCommon_initialize(jpcommon: *mut JPCommon); @@ -3013,7 +1929,9 @@ extern "C" { pub fn JPCommon_get_label_size(jpcommon: *mut JPCommon) -> ::std::os::raw::c_int; } extern "C" { - pub fn JPCommon_get_label_feature(jpcommon: *mut JPCommon) -> *mut *mut ::std::os::raw::c_char; + pub fn JPCommon_get_label_feature( + jpcommon: *mut JPCommon, + ) -> *mut *mut ::std::os::raw::c_char; } extern "C" { pub fn JPCommon_print(jpcommon: *mut JPCommon); diff --git a/crates/open_jtalk-sys/src/generated/linux/aarch64/bindings.rs b/crates/open_jtalk-sys/src/generated/linux/aarch64/bindings.rs index 13ca6be..0cd6e25 100644 --- a/crates/open_jtalk-sys/src/generated/linux/aarch64/bindings.rs +++ b/crates/open_jtalk-sys/src/generated/linux/aarch64/bindings.rs @@ -1,542 +1,263 @@ -/* automatically generated by rust-bindgen 0.62.0 */ +/* automatically generated by rust-bindgen 0.70.1 */ pub const TRUE: u32 = 1; pub const FALSE: u32 = 0; -#[doc = " DictionaryInfo structure"] +/// DictionaryInfo structure #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct mecab_dictionary_info_t { - #[doc = " filename of dictionary"] - #[doc = " On Windows, filename is stored in UTF-8 encoding"] + /** filename of dictionary + On Windows, filename is stored in UTF-8 encoding*/ pub filename: *const ::std::os::raw::c_char, - #[doc = " character set of the dictionary. e.g., \"SHIFT-JIS\", \"UTF-8\""] + /// character set of the dictionary. e.g., "SHIFT-JIS", "UTF-8" pub charset: *const ::std::os::raw::c_char, - #[doc = " How many words are registered in this dictionary."] + /// How many words are registered in this dictionary. pub size: ::std::os::raw::c_uint, - #[doc = " dictionary type"] - #[doc = " this value should be MECAB_USR_DIC, MECAB_SYS_DIC, or MECAB_UNK_DIC."] + /** dictionary type + this value should be MECAB_USR_DIC, MECAB_SYS_DIC, or MECAB_UNK_DIC.*/ pub type_: ::std::os::raw::c_int, - #[doc = " left attributes size"] + /// left attributes size pub lsize: ::std::os::raw::c_uint, - #[doc = " right attributes size"] + /// right attributes size pub rsize: ::std::os::raw::c_uint, - #[doc = " version of this dictionary"] + /// version of this dictionary pub version: ::std::os::raw::c_ushort, - #[doc = " pointer to the next dictionary info."] + /// pointer to the next dictionary info. pub next: *mut mecab_dictionary_info_t, } -#[test] -fn bindgen_test_layout_mecab_dictionary_info_t() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 48usize, - concat!("Size of: ", stringify!(mecab_dictionary_info_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(mecab_dictionary_info_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).filename) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(mecab_dictionary_info_t), - "::", - stringify!(filename) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).charset) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(mecab_dictionary_info_t), - "::", - stringify!(charset) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(mecab_dictionary_info_t), - "::", - stringify!(size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(mecab_dictionary_info_t), - "::", - stringify!(type_) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lsize) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(mecab_dictionary_info_t), - "::", - stringify!(lsize) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rsize) as usize - ptr as usize }, - 28usize, - concat!( - "Offset of field: ", - stringify!(mecab_dictionary_info_t), - "::", - stringify!(rsize) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).version) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(mecab_dictionary_info_t), - "::", - stringify!(version) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(mecab_dictionary_info_t), - "::", - stringify!(next) - ) - ); -} -#[doc = " Path structure"] +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + [ + "Size of mecab_dictionary_info_t", + ][::std::mem::size_of::() - 48usize]; + [ + "Alignment of mecab_dictionary_info_t", + ][::std::mem::align_of::() - 8usize]; + [ + "Offset of field: mecab_dictionary_info_t::filename", + ][::std::mem::offset_of!(mecab_dictionary_info_t, filename) - 0usize]; + [ + "Offset of field: mecab_dictionary_info_t::charset", + ][::std::mem::offset_of!(mecab_dictionary_info_t, charset) - 8usize]; + [ + "Offset of field: mecab_dictionary_info_t::size", + ][::std::mem::offset_of!(mecab_dictionary_info_t, size) - 16usize]; + [ + "Offset of field: mecab_dictionary_info_t::type_", + ][::std::mem::offset_of!(mecab_dictionary_info_t, type_) - 20usize]; + [ + "Offset of field: mecab_dictionary_info_t::lsize", + ][::std::mem::offset_of!(mecab_dictionary_info_t, lsize) - 24usize]; + [ + "Offset of field: mecab_dictionary_info_t::rsize", + ][::std::mem::offset_of!(mecab_dictionary_info_t, rsize) - 28usize]; + [ + "Offset of field: mecab_dictionary_info_t::version", + ][::std::mem::offset_of!(mecab_dictionary_info_t, version) - 32usize]; + [ + "Offset of field: mecab_dictionary_info_t::next", + ][::std::mem::offset_of!(mecab_dictionary_info_t, next) - 40usize]; +}; +/// Path structure #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct mecab_path_t { - #[doc = " pointer to the right node"] + /// pointer to the right node pub rnode: *mut mecab_node_t, - #[doc = " pointer to the next right path"] + /// pointer to the next right path pub rnext: *mut mecab_path_t, - #[doc = " pointer to the left node"] + /// pointer to the left node pub lnode: *mut mecab_node_t, - #[doc = " pointer to the next left path"] + /// pointer to the next left path pub lnext: *mut mecab_path_t, - #[doc = " local cost"] + /// local cost pub cost: ::std::os::raw::c_int, - #[doc = " marginal probability"] + /// marginal probability pub prob: f32, } -#[test] -fn bindgen_test_layout_mecab_path_t() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 40usize, - concat!("Size of: ", stringify!(mecab_path_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(mecab_path_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rnode) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(mecab_path_t), - "::", - stringify!(rnode) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rnext) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(mecab_path_t), - "::", - stringify!(rnext) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lnode) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(mecab_path_t), - "::", - stringify!(lnode) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lnext) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(mecab_path_t), - "::", - stringify!(lnext) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cost) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(mecab_path_t), - "::", - stringify!(cost) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prob) as usize - ptr as usize }, - 36usize, - concat!( - "Offset of field: ", - stringify!(mecab_path_t), - "::", - stringify!(prob) - ) - ); -} -#[doc = " Node structure"] +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of mecab_path_t"][::std::mem::size_of::() - 40usize]; + ["Alignment of mecab_path_t"][::std::mem::align_of::() - 8usize]; + [ + "Offset of field: mecab_path_t::rnode", + ][::std::mem::offset_of!(mecab_path_t, rnode) - 0usize]; + [ + "Offset of field: mecab_path_t::rnext", + ][::std::mem::offset_of!(mecab_path_t, rnext) - 8usize]; + [ + "Offset of field: mecab_path_t::lnode", + ][::std::mem::offset_of!(mecab_path_t, lnode) - 16usize]; + [ + "Offset of field: mecab_path_t::lnext", + ][::std::mem::offset_of!(mecab_path_t, lnext) - 24usize]; + [ + "Offset of field: mecab_path_t::cost", + ][::std::mem::offset_of!(mecab_path_t, cost) - 32usize]; + [ + "Offset of field: mecab_path_t::prob", + ][::std::mem::offset_of!(mecab_path_t, prob) - 36usize]; +}; +/// Node structure #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct mecab_node_t { - #[doc = " pointer to the previous node."] + /// pointer to the previous node. pub prev: *mut mecab_node_t, - #[doc = " pointer to the next node."] + /// pointer to the next node. pub next: *mut mecab_node_t, - #[doc = " pointer to the node which ends at the same position."] + /// pointer to the node which ends at the same position. pub enext: *mut mecab_node_t, - #[doc = " pointer to the node which starts at the same position."] + /// pointer to the node which starts at the same position. pub bnext: *mut mecab_node_t, - #[doc = " pointer to the right path."] - #[doc = " this value is NULL if MECAB_ONE_BEST mode."] + /** pointer to the right path. + this value is NULL if MECAB_ONE_BEST mode.*/ pub rpath: *mut mecab_path_t, - #[doc = " pointer to the right path."] - #[doc = " this value is NULL if MECAB_ONE_BEST mode."] + /** pointer to the right path. + this value is NULL if MECAB_ONE_BEST mode.*/ pub lpath: *mut mecab_path_t, - #[doc = " surface string."] - #[doc = " this value is not 0 terminated."] - #[doc = " You can get the length with length/rlength members."] + /** surface string. + this value is not 0 terminated. + You can get the length with length/rlength members.*/ pub surface: *const ::std::os::raw::c_char, - #[doc = " feature string"] + /// feature string pub feature: *const ::std::os::raw::c_char, - #[doc = " unique node id"] + /// unique node id pub id: ::std::os::raw::c_uint, - #[doc = " length of the surface form."] + /// length of the surface form. pub length: ::std::os::raw::c_ushort, - #[doc = " length of the surface form including white space before the morph."] + /// length of the surface form including white space before the morph. pub rlength: ::std::os::raw::c_ushort, - #[doc = " right attribute id"] + /// right attribute id pub rcAttr: ::std::os::raw::c_ushort, - #[doc = " left attribute id"] + /// left attribute id pub lcAttr: ::std::os::raw::c_ushort, - #[doc = " unique part of speech id. This value is defined in \"pos.def\" file."] + /// unique part of speech id. This value is defined in "pos.def" file. pub posid: ::std::os::raw::c_ushort, - #[doc = " character type"] + /// character type pub char_type: ::std::os::raw::c_uchar, - #[doc = " status of this model."] - #[doc = " This value is MECAB_NOR_NODE, MECAB_UNK_NODE, MECAB_BOS_NODE, MECAB_EOS_NODE, or MECAB_EON_NODE."] + /** status of this model. + This value is MECAB_NOR_NODE, MECAB_UNK_NODE, MECAB_BOS_NODE, MECAB_EOS_NODE, or MECAB_EON_NODE.*/ pub stat: ::std::os::raw::c_uchar, - #[doc = " set 1 if this node is best node."] + /// set 1 if this node is best node. pub isbest: ::std::os::raw::c_uchar, - #[doc = " forward accumulative log summation."] - #[doc = " This value is only available when MECAB_MARGINAL_PROB is passed."] + /** forward accumulative log summation. + This value is only available when MECAB_MARGINAL_PROB is passed.*/ pub alpha: f32, - #[doc = " backward accumulative log summation."] - #[doc = " This value is only available when MECAB_MARGINAL_PROB is passed."] + /** backward accumulative log summation. + This value is only available when MECAB_MARGINAL_PROB is passed.*/ pub beta: f32, - #[doc = " marginal probability."] - #[doc = " This value is only available when MECAB_MARGINAL_PROB is passed."] + /** marginal probability. + This value is only available when MECAB_MARGINAL_PROB is passed.*/ pub prob: f32, - #[doc = " word cost."] + /// word cost. pub wcost: ::std::os::raw::c_short, - #[doc = " best accumulative cost from bos node to this node."] + /// best accumulative cost from bos node to this node. pub cost: ::std::os::raw::c_long, } -#[test] -fn bindgen_test_layout_mecab_node_t() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 112usize, - concat!("Size of: ", stringify!(mecab_node_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(mecab_node_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(prev) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(next) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).enext) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(enext) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).bnext) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(bnext) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rpath) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(rpath) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lpath) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(lpath) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).surface) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(surface) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).feature) as usize - ptr as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(feature) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).id) as usize - ptr as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(id) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).length) as usize - ptr as usize }, - 68usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(length) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rlength) as usize - ptr as usize }, - 70usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(rlength) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rcAttr) as usize - ptr as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(rcAttr) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lcAttr) as usize - ptr as usize }, - 74usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(lcAttr) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).posid) as usize - ptr as usize }, - 76usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(posid) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).char_type) as usize - ptr as usize }, - 78usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(char_type) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).stat) as usize - ptr as usize }, - 79usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(stat) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).isbest) as usize - ptr as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(isbest) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).alpha) as usize - ptr as usize }, - 84usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(alpha) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).beta) as usize - ptr as usize }, - 88usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(beta) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prob) as usize - ptr as usize }, - 92usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(prob) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).wcost) as usize - ptr as usize }, - 96usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(wcost) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cost) as usize - ptr as usize }, - 104usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(cost) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of mecab_node_t"][::std::mem::size_of::() - 112usize]; + ["Alignment of mecab_node_t"][::std::mem::align_of::() - 8usize]; + [ + "Offset of field: mecab_node_t::prev", + ][::std::mem::offset_of!(mecab_node_t, prev) - 0usize]; + [ + "Offset of field: mecab_node_t::next", + ][::std::mem::offset_of!(mecab_node_t, next) - 8usize]; + [ + "Offset of field: mecab_node_t::enext", + ][::std::mem::offset_of!(mecab_node_t, enext) - 16usize]; + [ + "Offset of field: mecab_node_t::bnext", + ][::std::mem::offset_of!(mecab_node_t, bnext) - 24usize]; + [ + "Offset of field: mecab_node_t::rpath", + ][::std::mem::offset_of!(mecab_node_t, rpath) - 32usize]; + [ + "Offset of field: mecab_node_t::lpath", + ][::std::mem::offset_of!(mecab_node_t, lpath) - 40usize]; + [ + "Offset of field: mecab_node_t::surface", + ][::std::mem::offset_of!(mecab_node_t, surface) - 48usize]; + [ + "Offset of field: mecab_node_t::feature", + ][::std::mem::offset_of!(mecab_node_t, feature) - 56usize]; + [ + "Offset of field: mecab_node_t::id", + ][::std::mem::offset_of!(mecab_node_t, id) - 64usize]; + [ + "Offset of field: mecab_node_t::length", + ][::std::mem::offset_of!(mecab_node_t, length) - 68usize]; + [ + "Offset of field: mecab_node_t::rlength", + ][::std::mem::offset_of!(mecab_node_t, rlength) - 70usize]; + [ + "Offset of field: mecab_node_t::rcAttr", + ][::std::mem::offset_of!(mecab_node_t, rcAttr) - 72usize]; + [ + "Offset of field: mecab_node_t::lcAttr", + ][::std::mem::offset_of!(mecab_node_t, lcAttr) - 74usize]; + [ + "Offset of field: mecab_node_t::posid", + ][::std::mem::offset_of!(mecab_node_t, posid) - 76usize]; + [ + "Offset of field: mecab_node_t::char_type", + ][::std::mem::offset_of!(mecab_node_t, char_type) - 78usize]; + [ + "Offset of field: mecab_node_t::stat", + ][::std::mem::offset_of!(mecab_node_t, stat) - 79usize]; + [ + "Offset of field: mecab_node_t::isbest", + ][::std::mem::offset_of!(mecab_node_t, isbest) - 80usize]; + [ + "Offset of field: mecab_node_t::alpha", + ][::std::mem::offset_of!(mecab_node_t, alpha) - 84usize]; + [ + "Offset of field: mecab_node_t::beta", + ][::std::mem::offset_of!(mecab_node_t, beta) - 88usize]; + [ + "Offset of field: mecab_node_t::prob", + ][::std::mem::offset_of!(mecab_node_t, prob) - 92usize]; + [ + "Offset of field: mecab_node_t::wcost", + ][::std::mem::offset_of!(mecab_node_t, wcost) - 96usize]; + [ + "Offset of field: mecab_node_t::cost", + ][::std::mem::offset_of!(mecab_node_t, cost) - 104usize]; +}; pub const MECAB_NOR_NODE: _bindgen_ty_1 = _bindgen_ty_1::MECAB_NOR_NODE; pub const MECAB_UNK_NODE: _bindgen_ty_1 = _bindgen_ty_1::MECAB_UNK_NODE; pub const MECAB_BOS_NODE: _bindgen_ty_1 = _bindgen_ty_1::MECAB_BOS_NODE; pub const MECAB_EOS_NODE: _bindgen_ty_1 = _bindgen_ty_1::MECAB_EOS_NODE; pub const MECAB_EON_NODE: _bindgen_ty_1 = _bindgen_ty_1::MECAB_EON_NODE; #[repr(u32)] -#[doc = " Parameters for MeCab::Node::stat"] +/// Parameters for MeCab::Node::stat #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum _bindgen_ty_1 { - #[doc = " Normal node defined in the dictionary."] + /// Normal node defined in the dictionary. MECAB_NOR_NODE = 0, - #[doc = " Unknown node not defined in the dictionary."] + /// Unknown node not defined in the dictionary. MECAB_UNK_NODE = 1, - #[doc = " Virtual node representing a beginning of the sentence."] + /// Virtual node representing a beginning of the sentence. MECAB_BOS_NODE = 2, - #[doc = " Virtual node representing a end of the sentence."] + /// Virtual node representing a end of the sentence. MECAB_EOS_NODE = 3, - #[doc = " Virtual node representing a end of the N-best enumeration."] + /// Virtual node representing a end of the N-best enumeration. MECAB_EON_NODE = 4, } pub const MECAB_SYS_DIC: _bindgen_ty_2 = _bindgen_ty_2::MECAB_SYS_DIC; pub const MECAB_USR_DIC: _bindgen_ty_2 = _bindgen_ty_2::MECAB_USR_DIC; pub const MECAB_UNK_DIC: _bindgen_ty_2 = _bindgen_ty_2::MECAB_UNK_DIC; #[repr(u32)] -#[doc = " Parameters for MeCab::DictionaryInfo::type"] +/// Parameters for MeCab::DictionaryInfo::type #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum _bindgen_ty_2 { - #[doc = " This is a system dictionary."] + /// This is a system dictionary. MECAB_SYS_DIC = 0, - #[doc = " This is a user dictionary."] + /// This is a user dictionary. MECAB_USR_DIC = 1, - #[doc = " This is a unknown word dictionary."] + /// This is a unknown word dictionary. MECAB_UNK_DIC = 2, } pub const MECAB_ONE_BEST: _bindgen_ty_3 = _bindgen_ty_3::MECAB_ONE_BEST; @@ -547,43 +268,43 @@ pub const MECAB_ALTERNATIVE: _bindgen_ty_3 = _bindgen_ty_3::MECAB_ALTERNATIVE; pub const MECAB_ALL_MORPHS: _bindgen_ty_3 = _bindgen_ty_3::MECAB_ALL_MORPHS; pub const MECAB_ALLOCATE_SENTENCE: _bindgen_ty_3 = _bindgen_ty_3::MECAB_ALLOCATE_SENTENCE; #[repr(u32)] -#[doc = " Parameters for MeCab::Lattice::request_type"] +/// Parameters for MeCab::Lattice::request_type #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum _bindgen_ty_3 { - #[doc = " One best result is obtained (default mode)"] + /// One best result is obtained (default mode) MECAB_ONE_BEST = 1, - #[doc = " Set this flag if you want to obtain N best results."] + /// Set this flag if you want to obtain N best results. MECAB_NBEST = 2, - #[doc = " Set this flag if you want to enable a partial parsing mode."] - #[doc = " When this flag is set, the input |sentence| needs to be written"] - #[doc = " in partial parsing format."] + /** Set this flag if you want to enable a partial parsing mode. + When this flag is set, the input |sentence| needs to be written + in partial parsing format.*/ MECAB_PARTIAL = 4, - #[doc = " Set this flag if you want to obtain marginal probabilities."] - #[doc = " Marginal probability is set in MeCab::Node::prob."] - #[doc = " The parsing speed will get 3-5 times slower than the default mode."] + /** Set this flag if you want to obtain marginal probabilities. + Marginal probability is set in MeCab::Node::prob. + The parsing speed will get 3-5 times slower than the default mode.*/ MECAB_MARGINAL_PROB = 8, - #[doc = " Set this flag if you want to obtain alternative results."] - #[doc = " Not implemented."] + /** Set this flag if you want to obtain alternative results. + Not implemented.*/ MECAB_ALTERNATIVE = 16, - #[doc = " When this flag is set, the result linked-list (Node::next/prev)"] - #[doc = " traverses all nodes in the lattice."] + /** When this flag is set, the result linked-list (Node::next/prev) + traverses all nodes in the lattice.*/ MECAB_ALL_MORPHS = 32, - #[doc = " When this flag is set, tagger internally copies the body of passed"] - #[doc = " sentence into internal buffer."] + /** When this flag is set, tagger internally copies the body of passed + sentence into internal buffer.*/ MECAB_ALLOCATE_SENTENCE = 64, } pub const MECAB_ANY_BOUNDARY: _bindgen_ty_4 = _bindgen_ty_4::MECAB_ANY_BOUNDARY; pub const MECAB_TOKEN_BOUNDARY: _bindgen_ty_4 = _bindgen_ty_4::MECAB_TOKEN_BOUNDARY; pub const MECAB_INSIDE_TOKEN: _bindgen_ty_4 = _bindgen_ty_4::MECAB_INSIDE_TOKEN; #[repr(u32)] -#[doc = " Parameters for MeCab::Lattice::boundary_constraint_type"] +/// Parameters for MeCab::Lattice::boundary_constraint_type #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum _bindgen_ty_4 { - #[doc = " The token boundary is not specified."] + /// The token boundary is not specified. MECAB_ANY_BOUNDARY = 0, - #[doc = " The position is a strong token boundary."] + /// The position is a strong token boundary. MECAB_TOKEN_BOUNDARY = 1, - #[doc = " The position is not a token boundary."] + /// The position is not a token boundary. MECAB_INSIDE_TOKEN = 2, } pub type __off_t = ::std::os::raw::c_long; @@ -638,311 +359,98 @@ pub struct _IO_FILE { pub _mode: ::std::os::raw::c_int, pub _unused2: [::std::os::raw::c_char; 20usize], } -#[test] -fn bindgen_test_layout__IO_FILE() { - const UNINIT: ::std::mem::MaybeUninit<_IO_FILE> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_IO_FILE>(), - 216usize, - concat!("Size of: ", stringify!(_IO_FILE)) - ); - assert_eq!( - ::std::mem::align_of::<_IO_FILE>(), - 8usize, - concat!("Alignment of ", stringify!(_IO_FILE)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._flags) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_flags) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._IO_read_ptr) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_read_ptr) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._IO_read_end) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_read_end) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._IO_read_base) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_read_base) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._IO_write_base) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_write_base) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._IO_write_ptr) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_write_ptr) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._IO_write_end) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_write_end) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._IO_buf_base) as usize - ptr as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_buf_base) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._IO_buf_end) as usize - ptr as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_buf_end) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._IO_save_base) as usize - ptr as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_save_base) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._IO_backup_base) as usize - ptr as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_backup_base) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._IO_save_end) as usize - ptr as usize }, - 88usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_save_end) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._markers) as usize - ptr as usize }, - 96usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_markers) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._chain) as usize - ptr as usize }, - 104usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_chain) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._fileno) as usize - ptr as usize }, - 112usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_fileno) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._flags2) as usize - ptr as usize }, - 116usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_flags2) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._old_offset) as usize - ptr as usize }, - 120usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_old_offset) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._cur_column) as usize - ptr as usize }, - 128usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_cur_column) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._vtable_offset) as usize - ptr as usize }, - 130usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_vtable_offset) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._shortbuf) as usize - ptr as usize }, - 131usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_shortbuf) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._lock) as usize - ptr as usize }, - 136usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_lock) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._offset) as usize - ptr as usize }, - 144usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_offset) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._codecvt) as usize - ptr as usize }, - 152usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_codecvt) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._wide_data) as usize - ptr as usize }, - 160usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_wide_data) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._freeres_list) as usize - ptr as usize }, - 168usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_freeres_list) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._freeres_buf) as usize - ptr as usize }, - 176usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_freeres_buf) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__pad5) as usize - ptr as usize }, - 184usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(__pad5) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._mode) as usize - ptr as usize }, - 192usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_mode) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._unused2) as usize - ptr as usize }, - 196usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_unused2) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _IO_FILE"][::std::mem::size_of::<_IO_FILE>() - 216usize]; + ["Alignment of _IO_FILE"][::std::mem::align_of::<_IO_FILE>() - 8usize]; + [ + "Offset of field: _IO_FILE::_flags", + ][::std::mem::offset_of!(_IO_FILE, _flags) - 0usize]; + [ + "Offset of field: _IO_FILE::_IO_read_ptr", + ][::std::mem::offset_of!(_IO_FILE, _IO_read_ptr) - 8usize]; + [ + "Offset of field: _IO_FILE::_IO_read_end", + ][::std::mem::offset_of!(_IO_FILE, _IO_read_end) - 16usize]; + [ + "Offset of field: _IO_FILE::_IO_read_base", + ][::std::mem::offset_of!(_IO_FILE, _IO_read_base) - 24usize]; + [ + "Offset of field: _IO_FILE::_IO_write_base", + ][::std::mem::offset_of!(_IO_FILE, _IO_write_base) - 32usize]; + [ + "Offset of field: _IO_FILE::_IO_write_ptr", + ][::std::mem::offset_of!(_IO_FILE, _IO_write_ptr) - 40usize]; + [ + "Offset of field: _IO_FILE::_IO_write_end", + ][::std::mem::offset_of!(_IO_FILE, _IO_write_end) - 48usize]; + [ + "Offset of field: _IO_FILE::_IO_buf_base", + ][::std::mem::offset_of!(_IO_FILE, _IO_buf_base) - 56usize]; + [ + "Offset of field: _IO_FILE::_IO_buf_end", + ][::std::mem::offset_of!(_IO_FILE, _IO_buf_end) - 64usize]; + [ + "Offset of field: _IO_FILE::_IO_save_base", + ][::std::mem::offset_of!(_IO_FILE, _IO_save_base) - 72usize]; + [ + "Offset of field: _IO_FILE::_IO_backup_base", + ][::std::mem::offset_of!(_IO_FILE, _IO_backup_base) - 80usize]; + [ + "Offset of field: _IO_FILE::_IO_save_end", + ][::std::mem::offset_of!(_IO_FILE, _IO_save_end) - 88usize]; + [ + "Offset of field: _IO_FILE::_markers", + ][::std::mem::offset_of!(_IO_FILE, _markers) - 96usize]; + [ + "Offset of field: _IO_FILE::_chain", + ][::std::mem::offset_of!(_IO_FILE, _chain) - 104usize]; + [ + "Offset of field: _IO_FILE::_fileno", + ][::std::mem::offset_of!(_IO_FILE, _fileno) - 112usize]; + [ + "Offset of field: _IO_FILE::_flags2", + ][::std::mem::offset_of!(_IO_FILE, _flags2) - 116usize]; + [ + "Offset of field: _IO_FILE::_old_offset", + ][::std::mem::offset_of!(_IO_FILE, _old_offset) - 120usize]; + [ + "Offset of field: _IO_FILE::_cur_column", + ][::std::mem::offset_of!(_IO_FILE, _cur_column) - 128usize]; + [ + "Offset of field: _IO_FILE::_vtable_offset", + ][::std::mem::offset_of!(_IO_FILE, _vtable_offset) - 130usize]; + [ + "Offset of field: _IO_FILE::_shortbuf", + ][::std::mem::offset_of!(_IO_FILE, _shortbuf) - 131usize]; + [ + "Offset of field: _IO_FILE::_lock", + ][::std::mem::offset_of!(_IO_FILE, _lock) - 136usize]; + [ + "Offset of field: _IO_FILE::_offset", + ][::std::mem::offset_of!(_IO_FILE, _offset) - 144usize]; + [ + "Offset of field: _IO_FILE::_codecvt", + ][::std::mem::offset_of!(_IO_FILE, _codecvt) - 152usize]; + [ + "Offset of field: _IO_FILE::_wide_data", + ][::std::mem::offset_of!(_IO_FILE, _wide_data) - 160usize]; + [ + "Offset of field: _IO_FILE::_freeres_list", + ][::std::mem::offset_of!(_IO_FILE, _freeres_list) - 168usize]; + [ + "Offset of field: _IO_FILE::_freeres_buf", + ][::std::mem::offset_of!(_IO_FILE, _freeres_buf) - 176usize]; + [ + "Offset of field: _IO_FILE::__pad5", + ][::std::mem::offset_of!(_IO_FILE, __pad5) - 184usize]; + [ + "Offset of field: _IO_FILE::_mode", + ][::std::mem::offset_of!(_IO_FILE, _mode) - 192usize]; + [ + "Offset of field: _IO_FILE::_unused2", + ][::std::mem::offset_of!(_IO_FILE, _unused2) - 196usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct mecab_t { @@ -959,76 +467,76 @@ pub struct mecab_lattice_t { _unused: [u8; 0], } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::create(argc, argv)"] + /// C wrapper of MeCab::Tagger::create(argc, argv) pub fn mecab_new( argc: ::std::os::raw::c_int, argv: *mut *mut ::std::os::raw::c_char, ) -> *mut mecab_t; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::create(arg)"] + /// C wrapper of MeCab::Tagger::create(arg) pub fn mecab_new2(arg: *const ::std::os::raw::c_char) -> *mut mecab_t; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::version()"] + /// C wrapper of MeCab::Tagger::version() pub fn mecab_version() -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::getLastError()"] + /// C wrapper of MeCab::getLastError() pub fn mecab_strerror(mecab: *mut mecab_t) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::deleteTagger(tagger)"] + /// C wrapper of MeCab::deleteTagger(tagger) pub fn mecab_destroy(mecab: *mut mecab_t); } extern "C" { - #[doc = " C wrapper of MeCab::Tagger:set_partial()"] + /// C wrapper of MeCab::Tagger:set_partial() pub fn mecab_get_partial(mecab: *mut mecab_t) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::partial()"] + /// C wrapper of MeCab::Tagger::partial() pub fn mecab_set_partial(mecab: *mut mecab_t, partial: ::std::os::raw::c_int); } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::theta()"] + /// C wrapper of MeCab::Tagger::theta() pub fn mecab_get_theta(mecab: *mut mecab_t) -> f32; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::set_theta()"] + /// C wrapper of MeCab::Tagger::set_theta() pub fn mecab_set_theta(mecab: *mut mecab_t, theta: f32); } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::lattice_level()"] + /// C wrapper of MeCab::Tagger::lattice_level() pub fn mecab_get_lattice_level(mecab: *mut mecab_t) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::set_lattice_level()"] + /// C wrapper of MeCab::Tagger::set_lattice_level() pub fn mecab_set_lattice_level(mecab: *mut mecab_t, level: ::std::os::raw::c_int); } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::all_morphs()"] + /// C wrapper of MeCab::Tagger::all_morphs() pub fn mecab_get_all_morphs(mecab: *mut mecab_t) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::set_all_moprhs()"] + /// C wrapper of MeCab::Tagger::set_all_moprhs() pub fn mecab_set_all_morphs(mecab: *mut mecab_t, all_morphs: ::std::os::raw::c_int); } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parse(MeCab::Lattice *lattice)"] + /// C wrapper of MeCab::Tagger::parse(MeCab::Lattice *lattice) pub fn mecab_parse_lattice( mecab: *mut mecab_t, lattice: *mut mecab_lattice_t, ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parse(const char *str)"] + /// C wrapper of MeCab::Tagger::parse(const char *str) pub fn mecab_sparse_tostr( mecab: *mut mecab_t, str_: *const ::std::os::raw::c_char, ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parse(const char *str, size_t len)"] + /// C wrapper of MeCab::Tagger::parse(const char *str, size_t len) pub fn mecab_sparse_tostr2( mecab: *mut mecab_t, str_: *const ::std::os::raw::c_char, @@ -1036,7 +544,7 @@ extern "C" { ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parse(const char *str, char *ostr, size_t olen)"] + /// C wrapper of MeCab::Tagger::parse(const char *str, char *ostr, size_t olen) pub fn mecab_sparse_tostr3( mecab: *mut mecab_t, str_: *const ::std::os::raw::c_char, @@ -1046,14 +554,14 @@ extern "C" { ) -> *mut ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parseToNode(const char *str)"] + /// C wrapper of MeCab::Tagger::parseToNode(const char *str) pub fn mecab_sparse_tonode( mecab: *mut mecab_t, arg1: *const ::std::os::raw::c_char, ) -> *const mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parseToNode(const char *str, size_t len)"] + /// C wrapper of MeCab::Tagger::parseToNode(const char *str, size_t len) pub fn mecab_sparse_tonode2( mecab: *mut mecab_t, arg1: *const ::std::os::raw::c_char, @@ -1061,7 +569,7 @@ extern "C" { ) -> *const mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parseNBest(size_t N, const char *str)"] + /// C wrapper of MeCab::Tagger::parseNBest(size_t N, const char *str) pub fn mecab_nbest_sparse_tostr( mecab: *mut mecab_t, N: usize, @@ -1069,7 +577,7 @@ extern "C" { ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parseNBest(size_t N, const char *str, size_t len)"] + /// C wrapper of MeCab::Tagger::parseNBest(size_t N, const char *str, size_t len) pub fn mecab_nbest_sparse_tostr2( mecab: *mut mecab_t, N: usize, @@ -1078,7 +586,7 @@ extern "C" { ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parseNBest(size_t N, const char *str, char *ostr, size_t olen)"] + /// C wrapper of MeCab::Tagger::parseNBest(size_t N, const char *str, char *ostr, size_t olen) pub fn mecab_nbest_sparse_tostr3( mecab: *mut mecab_t, N: usize, @@ -1089,14 +597,14 @@ extern "C" { ) -> *mut ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parseNBestInit(const char *str)"] + /// C wrapper of MeCab::Tagger::parseNBestInit(const char *str) pub fn mecab_nbest_init( mecab: *mut mecab_t, str_: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parseNBestInit(const char *str, size_t len)"] + /// C wrapper of MeCab::Tagger::parseNBestInit(const char *str, size_t len) pub fn mecab_nbest_init2( mecab: *mut mecab_t, str_: *const ::std::os::raw::c_char, @@ -1104,11 +612,11 @@ extern "C" { ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::next()"] + /// C wrapper of MeCab::Tagger::next() pub fn mecab_nbest_next_tostr(mecab: *mut mecab_t) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::next(char *ostr, size_t olen)"] + /// C wrapper of MeCab::Tagger::next(char *ostr, size_t olen) pub fn mecab_nbest_next_tostr2( mecab: *mut mecab_t, ostr: *mut ::std::os::raw::c_char, @@ -1116,84 +624,91 @@ extern "C" { ) -> *mut ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::nextNode()"] + /// C wrapper of MeCab::Tagger::nextNode() pub fn mecab_nbest_next_tonode(mecab: *mut mecab_t) -> *const mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::formatNode(const Node *node)"] + /// C wrapper of MeCab::Tagger::formatNode(const Node *node) pub fn mecab_format_node( mecab: *mut mecab_t, node: *const mecab_node_t, ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::dictionary_info()"] + /// C wrapper of MeCab::Tagger::dictionary_info() pub fn mecab_dictionary_info(mecab: *mut mecab_t) -> *const mecab_dictionary_info_t; } extern "C" { - #[doc = " C wrapper of MeCab::createLattice()"] + /// C wrapper of MeCab::createLattice() pub fn mecab_lattice_new() -> *mut mecab_lattice_t; } extern "C" { - #[doc = " C wrapper of MeCab::deleteLattice(lattice)"] + /// C wrapper of MeCab::deleteLattice(lattice) pub fn mecab_lattice_destroy(lattice: *mut mecab_lattice_t); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::clear()"] + /// C wrapper of MeCab::Lattice::clear() pub fn mecab_lattice_clear(lattice: *mut mecab_lattice_t); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::is_available()"] - pub fn mecab_lattice_is_available(lattice: *mut mecab_lattice_t) -> ::std::os::raw::c_int; + /// C wrapper of MeCab::Lattice::is_available() + pub fn mecab_lattice_is_available( + lattice: *mut mecab_lattice_t, + ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::bos_node()"] - pub fn mecab_lattice_get_bos_node(lattice: *mut mecab_lattice_t) -> *mut mecab_node_t; + /// C wrapper of MeCab::Lattice::bos_node() + pub fn mecab_lattice_get_bos_node( + lattice: *mut mecab_lattice_t, + ) -> *mut mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::eos_node()"] - pub fn mecab_lattice_get_eos_node(lattice: *mut mecab_lattice_t) -> *mut mecab_node_t; + /// C wrapper of MeCab::Lattice::eos_node() + pub fn mecab_lattice_get_eos_node( + lattice: *mut mecab_lattice_t, + ) -> *mut mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::begin_nodes()"] + /// C wrapper of MeCab::Lattice::begin_nodes() pub fn mecab_lattice_get_all_begin_nodes( lattice: *mut mecab_lattice_t, ) -> *mut *mut mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::end_nodes()"] - pub fn mecab_lattice_get_all_end_nodes(lattice: *mut mecab_lattice_t) - -> *mut *mut mecab_node_t; + /// C wrapper of MeCab::Lattice::end_nodes() + pub fn mecab_lattice_get_all_end_nodes( + lattice: *mut mecab_lattice_t, + ) -> *mut *mut mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::begin_nodes(pos)"] + /// C wrapper of MeCab::Lattice::begin_nodes(pos) pub fn mecab_lattice_get_begin_nodes( lattice: *mut mecab_lattice_t, pos: usize, ) -> *mut mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::end_nodes(pos)"] + /// C wrapper of MeCab::Lattice::end_nodes(pos) pub fn mecab_lattice_get_end_nodes( lattice: *mut mecab_lattice_t, pos: usize, ) -> *mut mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::sentence()"] + /// C wrapper of MeCab::Lattice::sentence() pub fn mecab_lattice_get_sentence( lattice: *mut mecab_lattice_t, ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::set_sentence(sentence)"] + /// C wrapper of MeCab::Lattice::set_sentence(sentence) pub fn mecab_lattice_set_sentence( lattice: *mut mecab_lattice_t, sentence: *const ::std::os::raw::c_char, ); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::set_sentence(sentence, len)"] + /// C wrapper of MeCab::Lattice::set_sentence(sentence, len) pub fn mecab_lattice_set_sentence2( lattice: *mut mecab_lattice_t, sentence: *const ::std::os::raw::c_char, @@ -1201,71 +716,75 @@ extern "C" { ); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::size()"] + /// C wrapper of MeCab::Lattice::size() pub fn mecab_lattice_get_size(lattice: *mut mecab_lattice_t) -> usize; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::Z()"] + /// C wrapper of MeCab::Lattice::Z() pub fn mecab_lattice_get_z(lattice: *mut mecab_lattice_t) -> f64; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::set_Z()"] + /// C wrapper of MeCab::Lattice::set_Z() pub fn mecab_lattice_set_z(lattice: *mut mecab_lattice_t, Z: f64); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::theta()"] + /// C wrapper of MeCab::Lattice::theta() pub fn mecab_lattice_get_theta(lattice: *mut mecab_lattice_t) -> f64; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::set_theta()"] + /// C wrapper of MeCab::Lattice::set_theta() pub fn mecab_lattice_set_theta(lattice: *mut mecab_lattice_t, theta: f64); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::next()"] + /// C wrapper of MeCab::Lattice::next() pub fn mecab_lattice_next(lattice: *mut mecab_lattice_t) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::request_type()"] - pub fn mecab_lattice_get_request_type(lattice: *mut mecab_lattice_t) -> ::std::os::raw::c_int; + /// C wrapper of MeCab::Lattice::request_type() + pub fn mecab_lattice_get_request_type( + lattice: *mut mecab_lattice_t, + ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::has_request_type()"] + /// C wrapper of MeCab::Lattice::has_request_type() pub fn mecab_lattice_has_request_type( lattice: *mut mecab_lattice_t, request_type: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::set_request_type()"] + /// C wrapper of MeCab::Lattice::set_request_type() pub fn mecab_lattice_set_request_type( lattice: *mut mecab_lattice_t, request_type: ::std::os::raw::c_int, ); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::add_request_type()"] + /// C wrapper of MeCab::Lattice::add_request_type() pub fn mecab_lattice_add_request_type( lattice: *mut mecab_lattice_t, request_type: ::std::os::raw::c_int, ); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::remove_request_type()"] + /// C wrapper of MeCab::Lattice::remove_request_type() pub fn mecab_lattice_remove_request_type( lattice: *mut mecab_lattice_t, request_type: ::std::os::raw::c_int, ); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::newNode();"] + /// C wrapper of MeCab::Lattice::newNode(); pub fn mecab_lattice_new_node(lattice: *mut mecab_lattice_t) -> *mut mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::toString()"] - pub fn mecab_lattice_tostr(lattice: *mut mecab_lattice_t) -> *const ::std::os::raw::c_char; + /// C wrapper of MeCab::Lattice::toString() + pub fn mecab_lattice_tostr( + lattice: *mut mecab_lattice_t, + ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::toString(buf, size)"] + /// C wrapper of MeCab::Lattice::toString(buf, size) pub fn mecab_lattice_tostr2( lattice: *mut mecab_lattice_t, buf: *mut ::std::os::raw::c_char, @@ -1273,14 +792,14 @@ extern "C" { ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::enumNBestAsString(N)"] + /// C wrapper of MeCab::Lattice::enumNBestAsString(N) pub fn mecab_lattice_nbest_tostr( lattice: *mut mecab_lattice_t, N: usize, ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::enumNBestAsString(N, buf, size)"] + /// C wrapper of MeCab::Lattice::enumNBestAsString(N, buf, size) pub fn mecab_lattice_nbest_tostr2( lattice: *mut mecab_lattice_t, N: usize, @@ -1289,25 +808,27 @@ extern "C" { ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::has_constraint()"] - pub fn mecab_lattice_has_constraint(lattice: *mut mecab_lattice_t) -> ::std::os::raw::c_int; + /// C wrapper of MeCab::Lattice::has_constraint() + pub fn mecab_lattice_has_constraint( + lattice: *mut mecab_lattice_t, + ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::boundary_constraint(pos)"] + /// C wrapper of MeCab::Lattice::boundary_constraint(pos) pub fn mecab_lattice_get_boundary_constraint( lattice: *mut mecab_lattice_t, pos: usize, ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::feature_constraint(pos)"] + /// C wrapper of MeCab::Lattice::feature_constraint(pos) pub fn mecab_lattice_get_feature_constraint( lattice: *mut mecab_lattice_t, pos: usize, ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::boundary_constraint(pos, type)"] + /// C wrapper of MeCab::Lattice::boundary_constraint(pos, type) pub fn mecab_lattice_set_boundary_constraint( lattice: *mut mecab_lattice_t, pos: usize, @@ -1315,7 +836,7 @@ extern "C" { ); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::set_feature_constraint(begin_pos, end_pos, feature)"] + /// C wrapper of MeCab::Lattice::set_feature_constraint(begin_pos, end_pos, feature) pub fn mecab_lattice_set_feature_constraint( lattice: *mut mecab_lattice_t, begin_pos: usize, @@ -1324,53 +845,56 @@ extern "C" { ); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::set_result(result);"] + /// C wrapper of MeCab::Lattice::set_result(result); pub fn mecab_lattice_set_result( lattice: *mut mecab_lattice_t, result: *const ::std::os::raw::c_char, ); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::what()"] - pub fn mecab_lattice_strerror(lattice: *mut mecab_lattice_t) -> *const ::std::os::raw::c_char; + /// C wrapper of MeCab::Lattice::what() + pub fn mecab_lattice_strerror( + lattice: *mut mecab_lattice_t, + ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wapper of MeCab::Model::create(argc, argv)"] + /// C wapper of MeCab::Model::create(argc, argv) pub fn mecab_model_new( argc: ::std::os::raw::c_int, argv: *mut *mut ::std::os::raw::c_char, ) -> *mut mecab_model_t; } extern "C" { - #[doc = " C wapper of MeCab::Model::create(arg)"] + /// C wapper of MeCab::Model::create(arg) pub fn mecab_model_new2(arg: *const ::std::os::raw::c_char) -> *mut mecab_model_t; } extern "C" { - #[doc = " C wapper of MeCab::deleteModel(model)"] + /// C wapper of MeCab::deleteModel(model) pub fn mecab_model_destroy(model: *mut mecab_model_t); } extern "C" { - #[doc = " C wapper of MeCab::Model::createTagger()"] + /// C wapper of MeCab::Model::createTagger() pub fn mecab_model_new_tagger(model: *mut mecab_model_t) -> *mut mecab_t; } extern "C" { - #[doc = " C wapper of MeCab::Model::createLattice()"] + /// C wapper of MeCab::Model::createLattice() pub fn mecab_model_new_lattice(model: *mut mecab_model_t) -> *mut mecab_lattice_t; } extern "C" { - #[doc = " C wrapper of MeCab::Model::swap()"] + /// C wrapper of MeCab::Model::swap() pub fn mecab_model_swap( model: *mut mecab_model_t, new_model: *mut mecab_model_t, ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wapper of MeCab::Model::dictionary_info()"] - pub fn mecab_model_dictionary_info(model: *mut mecab_model_t) - -> *const mecab_dictionary_info_t; + /// C wapper of MeCab::Model::dictionary_info() + pub fn mecab_model_dictionary_info( + model: *mut mecab_model_t, + ) -> *const mecab_dictionary_info_t; } extern "C" { - #[doc = " C wrapper of MeCab::Model::transition_cost()"] + /// C wrapper of MeCab::Model::transition_cost() pub fn mecab_model_transition_cost( model: *mut mecab_model_t, rcAttr: ::std::os::raw::c_ushort, @@ -1378,7 +902,7 @@ extern "C" { ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Model::lookup()"] + /// C wrapper of MeCab::Model::lookup() pub fn mecab_model_lookup( model: *mut mecab_model_t, begin: *const ::std::os::raw::c_char, @@ -1422,11 +946,11 @@ extern "C" { argv: *mut *mut ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } -#[doc = " DictionaryInfo structure"] +/// DictionaryInfo structure pub type MeCab_DictionaryInfo = mecab_dictionary_info_t; -#[doc = " Path structure"] +/// Path structure pub type MeCab_Path = mecab_path_t; -#[doc = " Node structure"] +/// Node structure pub type MeCab_Node = mecab_node_t; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -1435,71 +959,55 @@ pub struct MeCab_Allocator { } #[repr(C)] pub struct MeCab_Lattice__bindgen_vtable(::std::os::raw::c_void); -#[doc = " Lattice class"] +/// Lattice class #[repr(C)] #[derive(Debug)] pub struct MeCab_Lattice { pub vtable_: *const MeCab_Lattice__bindgen_vtable, } -#[test] -fn bindgen_test_layout_MeCab_Lattice() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(MeCab_Lattice)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(MeCab_Lattice)) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of MeCab_Lattice"][::std::mem::size_of::() - 8usize]; + ["Alignment of MeCab_Lattice"][::std::mem::align_of::() - 8usize]; +}; extern "C" { - #[doc = " Create new Lattice object"] - #[doc = " @return new Lattice object"] + /** Create new Lattice object + @return new Lattice object*/ #[link_name = "\u{1}_ZN5MeCab7Lattice6createEv"] pub fn MeCab_Lattice_create() -> *mut MeCab_Lattice; } impl MeCab_Lattice { #[inline] pub unsafe fn create() -> *mut MeCab_Lattice { - unsafe { MeCab_Lattice_create() } + MeCab_Lattice_create() } } #[repr(C)] pub struct MeCab_Model__bindgen_vtable(::std::os::raw::c_void); -#[doc = " Model class"] +/// Model class #[repr(C)] #[derive(Debug)] pub struct MeCab_Model { pub vtable_: *const MeCab_Model__bindgen_vtable, } -#[test] -fn bindgen_test_layout_MeCab_Model() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(MeCab_Model)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(MeCab_Model)) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of MeCab_Model"][::std::mem::size_of::() - 8usize]; + ["Alignment of MeCab_Model"][::std::mem::align_of::() - 8usize]; +}; extern "C" { - #[doc = " Return a version string"] - #[doc = " @return version string"] + /** Return a version string + @return version string*/ #[link_name = "\u{1}_ZN5MeCab5Model7versionEv"] pub fn MeCab_Model_version() -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " Factory method to create a new Model with a specified main's argc/argv-style parameters."] - #[doc = " Return NULL if new model cannot be initialized. Use MeCab::getLastError() to obtain the"] - #[doc = " cause of the errors."] - #[doc = " @return new Model object"] - #[doc = " @param argc number of parameters"] - #[doc = " @param argv parameter list"] + /** Factory method to create a new Model with a specified main's argc/argv-style parameters. + Return NULL if new model cannot be initialized. Use MeCab::getLastError() to obtain the + cause of the errors. + @return new Model object + @param argc number of parameters + @param argv parameter list*/ #[link_name = "\u{1}_ZN5MeCab5Model6createEiPPc"] pub fn MeCab_Model_create( argc: ::std::os::raw::c_int, @@ -1507,74 +1015,69 @@ extern "C" { ) -> *mut MeCab_Model; } extern "C" { - #[doc = " Factory method to create a new Model with a string parameter representation, i.e.,"] - #[doc = " \"-d /user/local/mecab/dic/ipadic -Ochasen\"."] - #[doc = " Return NULL if new model cannot be initialized. Use MeCab::getLastError() to obtain the"] - #[doc = " cause of the errors."] - #[doc = " @return new Model object"] - #[doc = " @param arg single string representation of the argment."] + /** Factory method to create a new Model with a string parameter representation, i.e., + "-d /user/local/mecab/dic/ipadic -Ochasen". + Return NULL if new model cannot be initialized. Use MeCab::getLastError() to obtain the + cause of the errors. + @return new Model object + @param arg single string representation of the argment.*/ #[link_name = "\u{1}_ZN5MeCab5Model6createEPKc"] pub fn MeCab_Model_create1(arg: *const ::std::os::raw::c_char) -> *mut MeCab_Model; } impl MeCab_Model { #[inline] pub unsafe fn version() -> *const ::std::os::raw::c_char { - unsafe { MeCab_Model_version() } + MeCab_Model_version() } #[inline] pub unsafe fn create( argc: ::std::os::raw::c_int, argv: *mut *mut ::std::os::raw::c_char, ) -> *mut MeCab_Model { - unsafe { MeCab_Model_create(argc, argv) } + MeCab_Model_create(argc, argv) } #[inline] pub unsafe fn create1(arg: *const ::std::os::raw::c_char) -> *mut MeCab_Model { - unsafe { MeCab_Model_create1(arg) } + MeCab_Model_create1(arg) } } #[repr(C)] pub struct MeCab_Tagger__bindgen_vtable(::std::os::raw::c_void); -#[doc = " Tagger class"] +/// Tagger class #[repr(C)] #[derive(Debug)] pub struct MeCab_Tagger { pub vtable_: *const MeCab_Tagger__bindgen_vtable, } -#[test] -fn bindgen_test_layout_MeCab_Tagger() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(MeCab_Tagger)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(MeCab_Tagger)) - ); -} -extern "C" { - #[doc = " Handy static method."] - #[doc = " Return true if lattice is parsed successfully."] - #[doc = " This function is equivalent to"] - #[doc = " {"] - #[doc = " Tagger *tagger = model.createModel();"] - #[doc = " cosnt bool result = tagger->parse(lattice);"] - #[doc = " delete tagger;"] - #[doc = " return result;"] - #[doc = " }"] - #[doc = " @return boolean"] +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of MeCab_Tagger"][::std::mem::size_of::() - 8usize]; + ["Alignment of MeCab_Tagger"][::std::mem::align_of::() - 8usize]; +}; +extern "C" { + /** Handy static method. + Return true if lattice is parsed successfully. + This function is equivalent to + { + Tagger *tagger = model.createModel(); + cosnt bool result = tagger->parse(lattice); + delete tagger; + return result; + } + @return boolean*/ #[link_name = "\u{1}_ZN5MeCab6Tagger5parseERKNS_5ModelEPNS_7LatticeE"] - pub fn MeCab_Tagger_parse(model: *const MeCab_Model, lattice: *mut MeCab_Lattice) -> bool; -} -extern "C" { - #[doc = " Factory method to create a new Tagger with a specified main's argc/argv-style parameters."] - #[doc = " Return NULL if new model cannot be initialized. Use MeCab::getLastError() to obtain the"] - #[doc = " cause of the errors."] - #[doc = " @return new Tagger object"] - #[doc = " @param argc number of parameters"] - #[doc = " @param argv parameter list"] + pub fn MeCab_Tagger_parse( + model: *const MeCab_Model, + lattice: *mut MeCab_Lattice, + ) -> bool; +} +extern "C" { + /** Factory method to create a new Tagger with a specified main's argc/argv-style parameters. + Return NULL if new model cannot be initialized. Use MeCab::getLastError() to obtain the + cause of the errors. + @return new Tagger object + @param argc number of parameters + @param argv parameter list*/ #[link_name = "\u{1}_ZN5MeCab6Tagger6createEiPPc"] pub fn MeCab_Tagger_create( argc: ::std::os::raw::c_int, @@ -1582,49 +1085,49 @@ extern "C" { ) -> *mut MeCab_Tagger; } extern "C" { - #[doc = " Factory method to create a new Tagger with a string parameter representation, i.e.,"] - #[doc = " \"-d /user/local/mecab/dic/ipadic -Ochasen\"."] - #[doc = " Return NULL if new model cannot be initialized. Use MeCab::getLastError() to obtain the"] - #[doc = " cause of the errors."] - #[doc = " @return new Model object"] - #[doc = " @param arg single string representation of the argment."] + /** Factory method to create a new Tagger with a string parameter representation, i.e., + "-d /user/local/mecab/dic/ipadic -Ochasen". + Return NULL if new model cannot be initialized. Use MeCab::getLastError() to obtain the + cause of the errors. + @return new Model object + @param arg single string representation of the argment.*/ #[link_name = "\u{1}_ZN5MeCab6Tagger6createEPKc"] pub fn MeCab_Tagger_create1(arg: *const ::std::os::raw::c_char) -> *mut MeCab_Tagger; } extern "C" { - #[doc = " Return a version string"] - #[doc = " @return version string"] + /** Return a version string + @return version string*/ #[link_name = "\u{1}_ZN5MeCab6Tagger7versionEv"] pub fn MeCab_Tagger_version() -> *const ::std::os::raw::c_char; } impl MeCab_Tagger { #[inline] pub unsafe fn parse(model: *const MeCab_Model, lattice: *mut MeCab_Lattice) -> bool { - unsafe { MeCab_Tagger_parse(model, lattice) } + MeCab_Tagger_parse(model, lattice) } #[inline] pub unsafe fn create( argc: ::std::os::raw::c_int, argv: *mut *mut ::std::os::raw::c_char, ) -> *mut MeCab_Tagger { - unsafe { MeCab_Tagger_create(argc, argv) } + MeCab_Tagger_create(argc, argv) } #[inline] pub unsafe fn create1(arg: *const ::std::os::raw::c_char) -> *mut MeCab_Tagger { - unsafe { MeCab_Tagger_create1(arg) } + MeCab_Tagger_create1(arg) } #[inline] pub unsafe fn version() -> *const ::std::os::raw::c_char { - unsafe { MeCab_Tagger_version() } + MeCab_Tagger_version() } } extern "C" { - #[doc = " Alias of Lattice::create()"] + /// Alias of Lattice::create() #[link_name = "\u{1}_ZN5MeCab13createLatticeEv"] pub fn MeCab_createLattice() -> *mut MeCab_Lattice; } extern "C" { - #[doc = " Alias of Mode::create(argc, argv)"] + /// Alias of Mode::create(argc, argv) #[link_name = "\u{1}_ZN5MeCab11createModelEiPPc"] pub fn MeCab_createModel( argc: ::std::os::raw::c_int, @@ -1632,12 +1135,12 @@ extern "C" { ) -> *mut MeCab_Model; } extern "C" { - #[doc = " Alias of Mode::create(arg)"] + /// Alias of Mode::create(arg) #[link_name = "\u{1}_ZN5MeCab11createModelEPKc"] pub fn MeCab_createModel1(arg: *const ::std::os::raw::c_char) -> *mut MeCab_Model; } extern "C" { - #[doc = " Alias of Tagger::create(argc, argv)"] + /// Alias of Tagger::create(argc, argv) #[link_name = "\u{1}_ZN5MeCab12createTaggerEiPPc"] pub fn MeCab_createTagger( argc: ::std::os::raw::c_int, @@ -1645,44 +1148,44 @@ extern "C" { ) -> *mut MeCab_Tagger; } extern "C" { - #[doc = " Alias of Tagger::create(arg)"] + /// Alias of Tagger::create(arg) #[link_name = "\u{1}_ZN5MeCab12createTaggerEPKc"] pub fn MeCab_createTagger1(arg: *const ::std::os::raw::c_char) -> *mut MeCab_Tagger; } extern "C" { - #[doc = " delete Lattice object."] - #[doc = " This method calles \"delete lattice\"."] - #[doc = " In some environment, e.g., MS-Windows, an object allocated inside a DLL must be deleted in the same DLL too."] - #[doc = " @param lattice lattice object"] + /** delete Lattice object. + This method calles "delete lattice". + In some environment, e.g., MS-Windows, an object allocated inside a DLL must be deleted in the same DLL too. + @param lattice lattice object*/ #[link_name = "\u{1}_ZN5MeCab13deleteLatticeEPNS_7LatticeE"] pub fn MeCab_deleteLattice(lattice: *mut MeCab_Lattice); } extern "C" { - #[doc = " delete Model object."] - #[doc = " This method calles \"delete model\"."] - #[doc = " In some environment, e.g., MS-Windows, an object allocated inside a DLL must be deleted in the same DLL too."] - #[doc = " @param model model object"] + /** delete Model object. + This method calles "delete model". + In some environment, e.g., MS-Windows, an object allocated inside a DLL must be deleted in the same DLL too. + @param model model object*/ #[link_name = "\u{1}_ZN5MeCab11deleteModelEPNS_5ModelE"] pub fn MeCab_deleteModel(model: *mut MeCab_Model); } extern "C" { - #[doc = " delete Tagger object."] - #[doc = " This method calles \"delete tagger\"."] - #[doc = " In some environment, e.g., MS-Windows, an object allocated inside a DLL must be deleted in the same DLL too."] - #[doc = " @param tagger tagger object"] + /** delete Tagger object. + This method calles "delete tagger". + In some environment, e.g., MS-Windows, an object allocated inside a DLL must be deleted in the same DLL too. + @param tagger tagger object*/ #[link_name = "\u{1}_ZN5MeCab12deleteTaggerEPNS_6TaggerE"] pub fn MeCab_deleteTagger(tagger: *mut MeCab_Tagger); } extern "C" { - #[doc = " Return last error string."] - #[doc = " @return error string"] + /** Return last error string. + @return error string*/ #[link_name = "\u{1}_ZN5MeCab12getLastErrorEv"] pub fn MeCab_getLastError() -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " An alias of getLastError."] - #[doc = " It is kept for backward compatibility."] - #[doc = " @return error string"] + /** An alias of getLastError. + It is kept for backward compatibility. + @return error string*/ #[link_name = "\u{1}_ZN5MeCab14getTaggerErrorEv"] pub fn MeCab_getTaggerError() -> *const ::std::os::raw::c_char; } @@ -1695,71 +1198,22 @@ pub struct _Mecab { pub tagger: *mut ::std::os::raw::c_void, pub lattice: *mut ::std::os::raw::c_void, } -#[test] -fn bindgen_test_layout__Mecab() { - const UNINIT: ::std::mem::MaybeUninit<_Mecab> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_Mecab>(), - 40usize, - concat!("Size of: ", stringify!(_Mecab)) - ); - assert_eq!( - ::std::mem::align_of::<_Mecab>(), - 8usize, - concat!("Alignment of ", stringify!(_Mecab)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).feature) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_Mecab), - "::", - stringify!(feature) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_Mecab), - "::", - stringify!(size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).model) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_Mecab), - "::", - stringify!(model) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tagger) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_Mecab), - "::", - stringify!(tagger) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lattice) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_Mecab), - "::", - stringify!(lattice) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _Mecab"][::std::mem::size_of::<_Mecab>() - 40usize]; + ["Alignment of _Mecab"][::std::mem::align_of::<_Mecab>() - 8usize]; + [ + "Offset of field: _Mecab::feature", + ][::std::mem::offset_of!(_Mecab, feature) - 0usize]; + ["Offset of field: _Mecab::size"][::std::mem::offset_of!(_Mecab, size) - 8usize]; + ["Offset of field: _Mecab::model"][::std::mem::offset_of!(_Mecab, model) - 16usize]; + [ + "Offset of field: _Mecab::tagger", + ][::std::mem::offset_of!(_Mecab, tagger) - 24usize]; + [ + "Offset of field: _Mecab::lattice", + ][::std::mem::offset_of!(_Mecab, lattice) - 32usize]; +}; pub type Mecab = _Mecab; extern "C" { pub fn Mecab_initialize(m: *mut Mecab) -> ::std::os::raw::c_int; @@ -1818,181 +1272,55 @@ pub struct _NJDNode { pub prev: *mut _NJDNode, pub next: *mut _NJDNode, } -#[test] -fn bindgen_test_layout__NJDNode() { - const UNINIT: ::std::mem::MaybeUninit<_NJDNode> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_NJDNode>(), - 120usize, - concat!("Size of: ", stringify!(_NJDNode)) - ); - assert_eq!( - ::std::mem::align_of::<_NJDNode>(), - 8usize, - concat!("Alignment of ", stringify!(_NJDNode)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).string) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(string) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pos) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(pos) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pos_group1) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(pos_group1) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pos_group2) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(pos_group2) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pos_group3) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(pos_group3) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ctype) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(ctype) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cform) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(cform) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).orig) as usize - ptr as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(orig) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).read) as usize - ptr as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(read) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pron) as usize - ptr as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(pron) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).acc) as usize - ptr as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(acc) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mora_size) as usize - ptr as usize }, - 84usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(mora_size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).chain_rule) as usize - ptr as usize }, - 88usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(chain_rule) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).chain_flag) as usize - ptr as usize }, - 96usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(chain_flag) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize }, - 104usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(prev) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 112usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(next) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _NJDNode"][::std::mem::size_of::<_NJDNode>() - 120usize]; + ["Alignment of _NJDNode"][::std::mem::align_of::<_NJDNode>() - 8usize]; + [ + "Offset of field: _NJDNode::string", + ][::std::mem::offset_of!(_NJDNode, string) - 0usize]; + ["Offset of field: _NJDNode::pos"][::std::mem::offset_of!(_NJDNode, pos) - 8usize]; + [ + "Offset of field: _NJDNode::pos_group1", + ][::std::mem::offset_of!(_NJDNode, pos_group1) - 16usize]; + [ + "Offset of field: _NJDNode::pos_group2", + ][::std::mem::offset_of!(_NJDNode, pos_group2) - 24usize]; + [ + "Offset of field: _NJDNode::pos_group3", + ][::std::mem::offset_of!(_NJDNode, pos_group3) - 32usize]; + [ + "Offset of field: _NJDNode::ctype", + ][::std::mem::offset_of!(_NJDNode, ctype) - 40usize]; + [ + "Offset of field: _NJDNode::cform", + ][::std::mem::offset_of!(_NJDNode, cform) - 48usize]; + [ + "Offset of field: _NJDNode::orig", + ][::std::mem::offset_of!(_NJDNode, orig) - 56usize]; + [ + "Offset of field: _NJDNode::read", + ][::std::mem::offset_of!(_NJDNode, read) - 64usize]; + [ + "Offset of field: _NJDNode::pron", + ][::std::mem::offset_of!(_NJDNode, pron) - 72usize]; + ["Offset of field: _NJDNode::acc"][::std::mem::offset_of!(_NJDNode, acc) - 80usize]; + [ + "Offset of field: _NJDNode::mora_size", + ][::std::mem::offset_of!(_NJDNode, mora_size) - 84usize]; + [ + "Offset of field: _NJDNode::chain_rule", + ][::std::mem::offset_of!(_NJDNode, chain_rule) - 88usize]; + [ + "Offset of field: _NJDNode::chain_flag", + ][::std::mem::offset_of!(_NJDNode, chain_flag) - 96usize]; + [ + "Offset of field: _NJDNode::prev", + ][::std::mem::offset_of!(_NJDNode, prev) - 104usize]; + [ + "Offset of field: _NJDNode::next", + ][::std::mem::offset_of!(_NJDNode, next) - 112usize]; +}; pub type NJDNode = _NJDNode; extern "C" { pub fn NJDNode_initialize(node: *mut NJDNode); @@ -2004,13 +1332,22 @@ extern "C" { pub fn NJDNode_set_pos(node: *mut NJDNode, str_: *const ::std::os::raw::c_char); } extern "C" { - pub fn NJDNode_set_pos_group1(node: *mut NJDNode, str_: *const ::std::os::raw::c_char); + pub fn NJDNode_set_pos_group1( + node: *mut NJDNode, + str_: *const ::std::os::raw::c_char, + ); } extern "C" { - pub fn NJDNode_set_pos_group2(node: *mut NJDNode, str_: *const ::std::os::raw::c_char); + pub fn NJDNode_set_pos_group2( + node: *mut NJDNode, + str_: *const ::std::os::raw::c_char, + ); } extern "C" { - pub fn NJDNode_set_pos_group3(node: *mut NJDNode, str_: *const ::std::os::raw::c_char); + pub fn NJDNode_set_pos_group3( + node: *mut NJDNode, + str_: *const ::std::os::raw::c_char, + ); } extern "C" { pub fn NJDNode_set_ctype(node: *mut NJDNode, str_: *const ::std::os::raw::c_char); @@ -2034,7 +1371,10 @@ extern "C" { pub fn NJDNode_set_mora_size(node: *mut NJDNode, size: ::std::os::raw::c_int); } extern "C" { - pub fn NJDNode_set_chain_rule(node: *mut NJDNode, str_: *const ::std::os::raw::c_char); + pub fn NJDNode_set_chain_rule( + node: *mut NJDNode, + str_: *const ::std::os::raw::c_char, + ); } extern "C" { pub fn NJDNode_set_chain_flag(node: *mut NJDNode, flag: ::std::os::raw::c_int); @@ -2134,41 +1474,13 @@ pub struct _NJD { pub head: *mut NJDNode, pub tail: *mut NJDNode, } -#[test] -fn bindgen_test_layout__NJD() { - const UNINIT: ::std::mem::MaybeUninit<_NJD> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_NJD>(), - 16usize, - concat!("Size of: ", stringify!(_NJD)) - ); - assert_eq!( - ::std::mem::align_of::<_NJD>(), - 8usize, - concat!("Alignment of ", stringify!(_NJD)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).head) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_NJD), - "::", - stringify!(head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tail) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_NJD), - "::", - stringify!(tail) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _NJD"][::std::mem::size_of::<_NJD>() - 16usize]; + ["Alignment of _NJD"][::std::mem::align_of::<_NJD>() - 8usize]; + ["Offset of field: _NJD::head"][::std::mem::offset_of!(_NJD, head) - 0usize]; + ["Offset of field: _NJD::tail"][::std::mem::offset_of!(_NJD, tail) - 8usize]; +}; pub type NJD = _NJD; extern "C" { pub fn NJD_initialize(njd: *mut NJD); @@ -2218,62 +1530,27 @@ pub struct _JPCommonLabelPhoneme { pub next: *mut _JPCommonLabelPhoneme, pub up: *mut _JPCommonLabelMora, } -#[test] -fn bindgen_test_layout__JPCommonLabelPhoneme() { - const UNINIT: ::std::mem::MaybeUninit<_JPCommonLabelPhoneme> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_JPCommonLabelPhoneme>(), - 32usize, - concat!("Size of: ", stringify!(_JPCommonLabelPhoneme)) - ); - assert_eq!( - ::std::mem::align_of::<_JPCommonLabelPhoneme>(), - 8usize, - concat!("Alignment of ", stringify!(_JPCommonLabelPhoneme)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).phoneme) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelPhoneme), - "::", - stringify!(phoneme) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelPhoneme), - "::", - stringify!(prev) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelPhoneme), - "::", - stringify!(next) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).up) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelPhoneme), - "::", - stringify!(up) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + [ + "Size of _JPCommonLabelPhoneme", + ][::std::mem::size_of::<_JPCommonLabelPhoneme>() - 32usize]; + [ + "Alignment of _JPCommonLabelPhoneme", + ][::std::mem::align_of::<_JPCommonLabelPhoneme>() - 8usize]; + [ + "Offset of field: _JPCommonLabelPhoneme::phoneme", + ][::std::mem::offset_of!(_JPCommonLabelPhoneme, phoneme) - 0usize]; + [ + "Offset of field: _JPCommonLabelPhoneme::prev", + ][::std::mem::offset_of!(_JPCommonLabelPhoneme, prev) - 8usize]; + [ + "Offset of field: _JPCommonLabelPhoneme::next", + ][::std::mem::offset_of!(_JPCommonLabelPhoneme, next) - 16usize]; + [ + "Offset of field: _JPCommonLabelPhoneme::up", + ][::std::mem::offset_of!(_JPCommonLabelPhoneme, up) - 24usize]; +}; pub type JPCommonLabelPhoneme = _JPCommonLabelPhoneme; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -2285,81 +1562,33 @@ pub struct _JPCommonLabelMora { pub next: *mut _JPCommonLabelMora, pub up: *mut _JPCommonLabelWord, } -#[test] -fn bindgen_test_layout__JPCommonLabelMora() { - const UNINIT: ::std::mem::MaybeUninit<_JPCommonLabelMora> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_JPCommonLabelMora>(), - 48usize, - concat!("Size of: ", stringify!(_JPCommonLabelMora)) - ); - assert_eq!( - ::std::mem::align_of::<_JPCommonLabelMora>(), - 8usize, - concat!("Alignment of ", stringify!(_JPCommonLabelMora)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mora) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelMora), - "::", - stringify!(mora) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).head) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelMora), - "::", - stringify!(head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tail) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelMora), - "::", - stringify!(tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelMora), - "::", - stringify!(prev) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelMora), - "::", - stringify!(next) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).up) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelMora), - "::", - stringify!(up) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + [ + "Size of _JPCommonLabelMora", + ][::std::mem::size_of::<_JPCommonLabelMora>() - 48usize]; + [ + "Alignment of _JPCommonLabelMora", + ][::std::mem::align_of::<_JPCommonLabelMora>() - 8usize]; + [ + "Offset of field: _JPCommonLabelMora::mora", + ][::std::mem::offset_of!(_JPCommonLabelMora, mora) - 0usize]; + [ + "Offset of field: _JPCommonLabelMora::head", + ][::std::mem::offset_of!(_JPCommonLabelMora, head) - 8usize]; + [ + "Offset of field: _JPCommonLabelMora::tail", + ][::std::mem::offset_of!(_JPCommonLabelMora, tail) - 16usize]; + [ + "Offset of field: _JPCommonLabelMora::prev", + ][::std::mem::offset_of!(_JPCommonLabelMora, prev) - 24usize]; + [ + "Offset of field: _JPCommonLabelMora::next", + ][::std::mem::offset_of!(_JPCommonLabelMora, next) - 32usize]; + [ + "Offset of field: _JPCommonLabelMora::up", + ][::std::mem::offset_of!(_JPCommonLabelMora, up) - 40usize]; +}; pub type JPCommonLabelMora = _JPCommonLabelMora; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -2374,111 +1603,42 @@ pub struct _JPCommonLabelWord { pub next: *mut _JPCommonLabelWord, pub up: *mut _JPCommonLabelAccentPhrase, } -#[test] -fn bindgen_test_layout__JPCommonLabelWord() { - const UNINIT: ::std::mem::MaybeUninit<_JPCommonLabelWord> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_JPCommonLabelWord>(), - 72usize, - concat!("Size of: ", stringify!(_JPCommonLabelWord)) - ); - assert_eq!( - ::std::mem::align_of::<_JPCommonLabelWord>(), - 8usize, - concat!("Alignment of ", stringify!(_JPCommonLabelWord)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pron) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(pron) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pos) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(pos) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ctype) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(ctype) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cform) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(cform) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).head) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tail) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(prev) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(next) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).up) as usize - ptr as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(up) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + [ + "Size of _JPCommonLabelWord", + ][::std::mem::size_of::<_JPCommonLabelWord>() - 72usize]; + [ + "Alignment of _JPCommonLabelWord", + ][::std::mem::align_of::<_JPCommonLabelWord>() - 8usize]; + [ + "Offset of field: _JPCommonLabelWord::pron", + ][::std::mem::offset_of!(_JPCommonLabelWord, pron) - 0usize]; + [ + "Offset of field: _JPCommonLabelWord::pos", + ][::std::mem::offset_of!(_JPCommonLabelWord, pos) - 8usize]; + [ + "Offset of field: _JPCommonLabelWord::ctype", + ][::std::mem::offset_of!(_JPCommonLabelWord, ctype) - 16usize]; + [ + "Offset of field: _JPCommonLabelWord::cform", + ][::std::mem::offset_of!(_JPCommonLabelWord, cform) - 24usize]; + [ + "Offset of field: _JPCommonLabelWord::head", + ][::std::mem::offset_of!(_JPCommonLabelWord, head) - 32usize]; + [ + "Offset of field: _JPCommonLabelWord::tail", + ][::std::mem::offset_of!(_JPCommonLabelWord, tail) - 40usize]; + [ + "Offset of field: _JPCommonLabelWord::prev", + ][::std::mem::offset_of!(_JPCommonLabelWord, prev) - 48usize]; + [ + "Offset of field: _JPCommonLabelWord::next", + ][::std::mem::offset_of!(_JPCommonLabelWord, next) - 56usize]; + [ + "Offset of field: _JPCommonLabelWord::up", + ][::std::mem::offset_of!(_JPCommonLabelWord, up) - 64usize]; +}; pub type JPCommonLabelWord = _JPCommonLabelWord; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -2491,92 +1651,36 @@ pub struct _JPCommonLabelAccentPhrase { pub next: *mut _JPCommonLabelAccentPhrase, pub up: *mut _JPCommonLabelBreathGroup, } -#[test] -fn bindgen_test_layout__JPCommonLabelAccentPhrase() { - const UNINIT: ::std::mem::MaybeUninit<_JPCommonLabelAccentPhrase> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_JPCommonLabelAccentPhrase>(), - 56usize, - concat!("Size of: ", stringify!(_JPCommonLabelAccentPhrase)) - ); - assert_eq!( - ::std::mem::align_of::<_JPCommonLabelAccentPhrase>(), - 8usize, - concat!("Alignment of ", stringify!(_JPCommonLabelAccentPhrase)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).accent) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelAccentPhrase), - "::", - stringify!(accent) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).emotion) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelAccentPhrase), - "::", - stringify!(emotion) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).head) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelAccentPhrase), - "::", - stringify!(head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tail) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelAccentPhrase), - "::", - stringify!(tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelAccentPhrase), - "::", - stringify!(prev) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelAccentPhrase), - "::", - stringify!(next) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).up) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelAccentPhrase), - "::", - stringify!(up) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + [ + "Size of _JPCommonLabelAccentPhrase", + ][::std::mem::size_of::<_JPCommonLabelAccentPhrase>() - 56usize]; + [ + "Alignment of _JPCommonLabelAccentPhrase", + ][::std::mem::align_of::<_JPCommonLabelAccentPhrase>() - 8usize]; + [ + "Offset of field: _JPCommonLabelAccentPhrase::accent", + ][::std::mem::offset_of!(_JPCommonLabelAccentPhrase, accent) - 0usize]; + [ + "Offset of field: _JPCommonLabelAccentPhrase::emotion", + ][::std::mem::offset_of!(_JPCommonLabelAccentPhrase, emotion) - 8usize]; + [ + "Offset of field: _JPCommonLabelAccentPhrase::head", + ][::std::mem::offset_of!(_JPCommonLabelAccentPhrase, head) - 16usize]; + [ + "Offset of field: _JPCommonLabelAccentPhrase::tail", + ][::std::mem::offset_of!(_JPCommonLabelAccentPhrase, tail) - 24usize]; + [ + "Offset of field: _JPCommonLabelAccentPhrase::prev", + ][::std::mem::offset_of!(_JPCommonLabelAccentPhrase, prev) - 32usize]; + [ + "Offset of field: _JPCommonLabelAccentPhrase::next", + ][::std::mem::offset_of!(_JPCommonLabelAccentPhrase, next) - 40usize]; + [ + "Offset of field: _JPCommonLabelAccentPhrase::up", + ][::std::mem::offset_of!(_JPCommonLabelAccentPhrase, up) - 48usize]; +}; pub type JPCommonLabelAccentPhrase = _JPCommonLabelAccentPhrase; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -2586,62 +1690,27 @@ pub struct _JPCommonLabelBreathGroup { pub prev: *mut _JPCommonLabelBreathGroup, pub next: *mut _JPCommonLabelBreathGroup, } -#[test] -fn bindgen_test_layout__JPCommonLabelBreathGroup() { - const UNINIT: ::std::mem::MaybeUninit<_JPCommonLabelBreathGroup> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_JPCommonLabelBreathGroup>(), - 32usize, - concat!("Size of: ", stringify!(_JPCommonLabelBreathGroup)) - ); - assert_eq!( - ::std::mem::align_of::<_JPCommonLabelBreathGroup>(), - 8usize, - concat!("Alignment of ", stringify!(_JPCommonLabelBreathGroup)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).head) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelBreathGroup), - "::", - stringify!(head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tail) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelBreathGroup), - "::", - stringify!(tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelBreathGroup), - "::", - stringify!(prev) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelBreathGroup), - "::", - stringify!(next) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + [ + "Size of _JPCommonLabelBreathGroup", + ][::std::mem::size_of::<_JPCommonLabelBreathGroup>() - 32usize]; + [ + "Alignment of _JPCommonLabelBreathGroup", + ][::std::mem::align_of::<_JPCommonLabelBreathGroup>() - 8usize]; + [ + "Offset of field: _JPCommonLabelBreathGroup::head", + ][::std::mem::offset_of!(_JPCommonLabelBreathGroup, head) - 0usize]; + [ + "Offset of field: _JPCommonLabelBreathGroup::tail", + ][::std::mem::offset_of!(_JPCommonLabelBreathGroup, tail) - 8usize]; + [ + "Offset of field: _JPCommonLabelBreathGroup::prev", + ][::std::mem::offset_of!(_JPCommonLabelBreathGroup, prev) - 16usize]; + [ + "Offset of field: _JPCommonLabelBreathGroup::next", + ][::std::mem::offset_of!(_JPCommonLabelBreathGroup, next) - 24usize]; +}; pub type JPCommonLabelBreathGroup = _JPCommonLabelBreathGroup; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -2660,151 +1729,50 @@ pub struct _JPCommonLabel { pub phoneme_tail: *mut JPCommonLabelPhoneme, pub short_pause_flag: ::std::os::raw::c_int, } -#[test] -fn bindgen_test_layout__JPCommonLabel() { - const UNINIT: ::std::mem::MaybeUninit<_JPCommonLabel> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_JPCommonLabel>(), - 104usize, - concat!("Size of: ", stringify!(_JPCommonLabel)) - ); - assert_eq!( - ::std::mem::align_of::<_JPCommonLabel>(), - 8usize, - concat!("Alignment of ", stringify!(_JPCommonLabel)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).feature) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(feature) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).breath_head) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(breath_head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).breath_tail) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(breath_tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).accent_head) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(accent_head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).accent_tail) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(accent_tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).word_head) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(word_head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).word_tail) as usize - ptr as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(word_tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mora_head) as usize - ptr as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(mora_head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mora_tail) as usize - ptr as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(mora_tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).phoneme_head) as usize - ptr as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(phoneme_head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).phoneme_tail) as usize - ptr as usize }, - 88usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(phoneme_tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).short_pause_flag) as usize - ptr as usize }, - 96usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(short_pause_flag) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _JPCommonLabel"][::std::mem::size_of::<_JPCommonLabel>() - 104usize]; + ["Alignment of _JPCommonLabel"][::std::mem::align_of::<_JPCommonLabel>() - 8usize]; + [ + "Offset of field: _JPCommonLabel::size", + ][::std::mem::offset_of!(_JPCommonLabel, size) - 0usize]; + [ + "Offset of field: _JPCommonLabel::feature", + ][::std::mem::offset_of!(_JPCommonLabel, feature) - 8usize]; + [ + "Offset of field: _JPCommonLabel::breath_head", + ][::std::mem::offset_of!(_JPCommonLabel, breath_head) - 16usize]; + [ + "Offset of field: _JPCommonLabel::breath_tail", + ][::std::mem::offset_of!(_JPCommonLabel, breath_tail) - 24usize]; + [ + "Offset of field: _JPCommonLabel::accent_head", + ][::std::mem::offset_of!(_JPCommonLabel, accent_head) - 32usize]; + [ + "Offset of field: _JPCommonLabel::accent_tail", + ][::std::mem::offset_of!(_JPCommonLabel, accent_tail) - 40usize]; + [ + "Offset of field: _JPCommonLabel::word_head", + ][::std::mem::offset_of!(_JPCommonLabel, word_head) - 48usize]; + [ + "Offset of field: _JPCommonLabel::word_tail", + ][::std::mem::offset_of!(_JPCommonLabel, word_tail) - 56usize]; + [ + "Offset of field: _JPCommonLabel::mora_head", + ][::std::mem::offset_of!(_JPCommonLabel, mora_head) - 64usize]; + [ + "Offset of field: _JPCommonLabel::mora_tail", + ][::std::mem::offset_of!(_JPCommonLabel, mora_tail) - 72usize]; + [ + "Offset of field: _JPCommonLabel::phoneme_head", + ][::std::mem::offset_of!(_JPCommonLabel, phoneme_head) - 80usize]; + [ + "Offset of field: _JPCommonLabel::phoneme_tail", + ][::std::mem::offset_of!(_JPCommonLabel, phoneme_tail) - 88usize]; + [ + "Offset of field: _JPCommonLabel::short_pause_flag", + ][::std::mem::offset_of!(_JPCommonLabel, short_pause_flag) - 96usize]; +}; pub type JPCommonLabel = _JPCommonLabel; extern "C" { pub fn JPCommonLabel_initialize(label: *mut JPCommonLabel); @@ -2827,8 +1795,9 @@ extern "C" { pub fn JPCommonLabel_get_size(label: *mut JPCommonLabel) -> ::std::os::raw::c_int; } extern "C" { - pub fn JPCommonLabel_get_feature(label: *mut JPCommonLabel) - -> *mut *mut ::std::os::raw::c_char; + pub fn JPCommonLabel_get_feature( + label: *mut JPCommonLabel, + ) -> *mut *mut ::std::os::raw::c_char; } extern "C" { pub fn JPCommonLabel_print(label: *mut JPCommonLabel); @@ -2851,134 +1820,91 @@ pub struct _JPCommonNode { pub prev: *mut _JPCommonNode, pub next: *mut _JPCommonNode, } -#[test] -fn bindgen_test_layout__JPCommonNode() { - const UNINIT: ::std::mem::MaybeUninit<_JPCommonNode> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_JPCommonNode>(), - 56usize, - concat!("Size of: ", stringify!(_JPCommonNode)) - ); - assert_eq!( - ::std::mem::align_of::<_JPCommonNode>(), - 8usize, - concat!("Alignment of ", stringify!(_JPCommonNode)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pron) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonNode), - "::", - stringify!(pron) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pos) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonNode), - "::", - stringify!(pos) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ctype) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonNode), - "::", - stringify!(ctype) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cform) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonNode), - "::", - stringify!(cform) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).acc) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonNode), - "::", - stringify!(acc) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).chain_flag) as usize - ptr as usize }, - 36usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonNode), - "::", - stringify!(chain_flag) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonNode), - "::", - stringify!(prev) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonNode), - "::", - stringify!(next) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _JPCommonNode"][::std::mem::size_of::<_JPCommonNode>() - 56usize]; + ["Alignment of _JPCommonNode"][::std::mem::align_of::<_JPCommonNode>() - 8usize]; + [ + "Offset of field: _JPCommonNode::pron", + ][::std::mem::offset_of!(_JPCommonNode, pron) - 0usize]; + [ + "Offset of field: _JPCommonNode::pos", + ][::std::mem::offset_of!(_JPCommonNode, pos) - 8usize]; + [ + "Offset of field: _JPCommonNode::ctype", + ][::std::mem::offset_of!(_JPCommonNode, ctype) - 16usize]; + [ + "Offset of field: _JPCommonNode::cform", + ][::std::mem::offset_of!(_JPCommonNode, cform) - 24usize]; + [ + "Offset of field: _JPCommonNode::acc", + ][::std::mem::offset_of!(_JPCommonNode, acc) - 32usize]; + [ + "Offset of field: _JPCommonNode::chain_flag", + ][::std::mem::offset_of!(_JPCommonNode, chain_flag) - 36usize]; + [ + "Offset of field: _JPCommonNode::prev", + ][::std::mem::offset_of!(_JPCommonNode, prev) - 40usize]; + [ + "Offset of field: _JPCommonNode::next", + ][::std::mem::offset_of!(_JPCommonNode, next) - 48usize]; +}; pub type JPCommonNode = _JPCommonNode; extern "C" { pub fn JPCommonNode_initialize(node: *mut JPCommonNode); } extern "C" { - pub fn JPCommonNode_set_pron(node: *mut JPCommonNode, str_: *const ::std::os::raw::c_char); + pub fn JPCommonNode_set_pron( + node: *mut JPCommonNode, + str_: *const ::std::os::raw::c_char, + ); } extern "C" { - pub fn JPCommonNode_set_pos(node: *mut JPCommonNode, str_: *const ::std::os::raw::c_char); + pub fn JPCommonNode_set_pos( + node: *mut JPCommonNode, + str_: *const ::std::os::raw::c_char, + ); } extern "C" { - pub fn JPCommonNode_set_ctype(node: *mut JPCommonNode, str_: *const ::std::os::raw::c_char); + pub fn JPCommonNode_set_ctype( + node: *mut JPCommonNode, + str_: *const ::std::os::raw::c_char, + ); } extern "C" { - pub fn JPCommonNode_set_cform(node: *mut JPCommonNode, str_: *const ::std::os::raw::c_char); + pub fn JPCommonNode_set_cform( + node: *mut JPCommonNode, + str_: *const ::std::os::raw::c_char, + ); } extern "C" { pub fn JPCommonNode_set_acc(node: *mut JPCommonNode, acc: ::std::os::raw::c_int); } extern "C" { - pub fn JPCommonNode_set_chain_flag(node: *mut JPCommonNode, flag: ::std::os::raw::c_int); + pub fn JPCommonNode_set_chain_flag( + node: *mut JPCommonNode, + flag: ::std::os::raw::c_int, + ); } extern "C" { - pub fn JPCommonNode_get_pron(node: *mut JPCommonNode) -> *const ::std::os::raw::c_char; + pub fn JPCommonNode_get_pron( + node: *mut JPCommonNode, + ) -> *const ::std::os::raw::c_char; } extern "C" { - pub fn JPCommonNode_get_pos(node: *mut JPCommonNode) -> *const ::std::os::raw::c_char; + pub fn JPCommonNode_get_pos( + node: *mut JPCommonNode, + ) -> *const ::std::os::raw::c_char; } extern "C" { - pub fn JPCommonNode_get_ctype(node: *mut JPCommonNode) -> *const ::std::os::raw::c_char; + pub fn JPCommonNode_get_ctype( + node: *mut JPCommonNode, + ) -> *const ::std::os::raw::c_char; } extern "C" { - pub fn JPCommonNode_get_cform(node: *mut JPCommonNode) -> *const ::std::os::raw::c_char; + pub fn JPCommonNode_get_cform( + node: *mut JPCommonNode, + ) -> *const ::std::os::raw::c_char; } extern "C" { pub fn JPCommonNode_get_acc(node: *mut JPCommonNode) -> ::std::os::raw::c_int; @@ -3002,51 +1928,20 @@ pub struct _JPCommon { pub tail: *mut JPCommonNode, pub label: *mut JPCommonLabel, } -#[test] -fn bindgen_test_layout__JPCommon() { - const UNINIT: ::std::mem::MaybeUninit<_JPCommon> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_JPCommon>(), - 24usize, - concat!("Size of: ", stringify!(_JPCommon)) - ); - assert_eq!( - ::std::mem::align_of::<_JPCommon>(), - 8usize, - concat!("Alignment of ", stringify!(_JPCommon)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).head) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_JPCommon), - "::", - stringify!(head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tail) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_JPCommon), - "::", - stringify!(tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).label) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_JPCommon), - "::", - stringify!(label) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _JPCommon"][::std::mem::size_of::<_JPCommon>() - 24usize]; + ["Alignment of _JPCommon"][::std::mem::align_of::<_JPCommon>() - 8usize]; + [ + "Offset of field: _JPCommon::head", + ][::std::mem::offset_of!(_JPCommon, head) - 0usize]; + [ + "Offset of field: _JPCommon::tail", + ][::std::mem::offset_of!(_JPCommon, tail) - 8usize]; + [ + "Offset of field: _JPCommon::label", + ][::std::mem::offset_of!(_JPCommon, label) - 16usize]; +}; pub type JPCommon = _JPCommon; extern "C" { pub fn JPCommon_initialize(jpcommon: *mut JPCommon); @@ -3061,7 +1956,9 @@ extern "C" { pub fn JPCommon_get_label_size(jpcommon: *mut JPCommon) -> ::std::os::raw::c_int; } extern "C" { - pub fn JPCommon_get_label_feature(jpcommon: *mut JPCommon) -> *mut *mut ::std::os::raw::c_char; + pub fn JPCommon_get_label_feature( + jpcommon: *mut JPCommon, + ) -> *mut *mut ::std::os::raw::c_char; } extern "C" { pub fn JPCommon_print(jpcommon: *mut JPCommon); diff --git a/crates/open_jtalk-sys/src/generated/linux/x86_64/bindings.rs b/crates/open_jtalk-sys/src/generated/linux/x86_64/bindings.rs index 13ca6be..0cd6e25 100644 --- a/crates/open_jtalk-sys/src/generated/linux/x86_64/bindings.rs +++ b/crates/open_jtalk-sys/src/generated/linux/x86_64/bindings.rs @@ -1,542 +1,263 @@ -/* automatically generated by rust-bindgen 0.62.0 */ +/* automatically generated by rust-bindgen 0.70.1 */ pub const TRUE: u32 = 1; pub const FALSE: u32 = 0; -#[doc = " DictionaryInfo structure"] +/// DictionaryInfo structure #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct mecab_dictionary_info_t { - #[doc = " filename of dictionary"] - #[doc = " On Windows, filename is stored in UTF-8 encoding"] + /** filename of dictionary + On Windows, filename is stored in UTF-8 encoding*/ pub filename: *const ::std::os::raw::c_char, - #[doc = " character set of the dictionary. e.g., \"SHIFT-JIS\", \"UTF-8\""] + /// character set of the dictionary. e.g., "SHIFT-JIS", "UTF-8" pub charset: *const ::std::os::raw::c_char, - #[doc = " How many words are registered in this dictionary."] + /// How many words are registered in this dictionary. pub size: ::std::os::raw::c_uint, - #[doc = " dictionary type"] - #[doc = " this value should be MECAB_USR_DIC, MECAB_SYS_DIC, or MECAB_UNK_DIC."] + /** dictionary type + this value should be MECAB_USR_DIC, MECAB_SYS_DIC, or MECAB_UNK_DIC.*/ pub type_: ::std::os::raw::c_int, - #[doc = " left attributes size"] + /// left attributes size pub lsize: ::std::os::raw::c_uint, - #[doc = " right attributes size"] + /// right attributes size pub rsize: ::std::os::raw::c_uint, - #[doc = " version of this dictionary"] + /// version of this dictionary pub version: ::std::os::raw::c_ushort, - #[doc = " pointer to the next dictionary info."] + /// pointer to the next dictionary info. pub next: *mut mecab_dictionary_info_t, } -#[test] -fn bindgen_test_layout_mecab_dictionary_info_t() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 48usize, - concat!("Size of: ", stringify!(mecab_dictionary_info_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(mecab_dictionary_info_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).filename) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(mecab_dictionary_info_t), - "::", - stringify!(filename) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).charset) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(mecab_dictionary_info_t), - "::", - stringify!(charset) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(mecab_dictionary_info_t), - "::", - stringify!(size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(mecab_dictionary_info_t), - "::", - stringify!(type_) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lsize) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(mecab_dictionary_info_t), - "::", - stringify!(lsize) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rsize) as usize - ptr as usize }, - 28usize, - concat!( - "Offset of field: ", - stringify!(mecab_dictionary_info_t), - "::", - stringify!(rsize) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).version) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(mecab_dictionary_info_t), - "::", - stringify!(version) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(mecab_dictionary_info_t), - "::", - stringify!(next) - ) - ); -} -#[doc = " Path structure"] +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + [ + "Size of mecab_dictionary_info_t", + ][::std::mem::size_of::() - 48usize]; + [ + "Alignment of mecab_dictionary_info_t", + ][::std::mem::align_of::() - 8usize]; + [ + "Offset of field: mecab_dictionary_info_t::filename", + ][::std::mem::offset_of!(mecab_dictionary_info_t, filename) - 0usize]; + [ + "Offset of field: mecab_dictionary_info_t::charset", + ][::std::mem::offset_of!(mecab_dictionary_info_t, charset) - 8usize]; + [ + "Offset of field: mecab_dictionary_info_t::size", + ][::std::mem::offset_of!(mecab_dictionary_info_t, size) - 16usize]; + [ + "Offset of field: mecab_dictionary_info_t::type_", + ][::std::mem::offset_of!(mecab_dictionary_info_t, type_) - 20usize]; + [ + "Offset of field: mecab_dictionary_info_t::lsize", + ][::std::mem::offset_of!(mecab_dictionary_info_t, lsize) - 24usize]; + [ + "Offset of field: mecab_dictionary_info_t::rsize", + ][::std::mem::offset_of!(mecab_dictionary_info_t, rsize) - 28usize]; + [ + "Offset of field: mecab_dictionary_info_t::version", + ][::std::mem::offset_of!(mecab_dictionary_info_t, version) - 32usize]; + [ + "Offset of field: mecab_dictionary_info_t::next", + ][::std::mem::offset_of!(mecab_dictionary_info_t, next) - 40usize]; +}; +/// Path structure #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct mecab_path_t { - #[doc = " pointer to the right node"] + /// pointer to the right node pub rnode: *mut mecab_node_t, - #[doc = " pointer to the next right path"] + /// pointer to the next right path pub rnext: *mut mecab_path_t, - #[doc = " pointer to the left node"] + /// pointer to the left node pub lnode: *mut mecab_node_t, - #[doc = " pointer to the next left path"] + /// pointer to the next left path pub lnext: *mut mecab_path_t, - #[doc = " local cost"] + /// local cost pub cost: ::std::os::raw::c_int, - #[doc = " marginal probability"] + /// marginal probability pub prob: f32, } -#[test] -fn bindgen_test_layout_mecab_path_t() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 40usize, - concat!("Size of: ", stringify!(mecab_path_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(mecab_path_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rnode) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(mecab_path_t), - "::", - stringify!(rnode) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rnext) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(mecab_path_t), - "::", - stringify!(rnext) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lnode) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(mecab_path_t), - "::", - stringify!(lnode) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lnext) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(mecab_path_t), - "::", - stringify!(lnext) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cost) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(mecab_path_t), - "::", - stringify!(cost) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prob) as usize - ptr as usize }, - 36usize, - concat!( - "Offset of field: ", - stringify!(mecab_path_t), - "::", - stringify!(prob) - ) - ); -} -#[doc = " Node structure"] +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of mecab_path_t"][::std::mem::size_of::() - 40usize]; + ["Alignment of mecab_path_t"][::std::mem::align_of::() - 8usize]; + [ + "Offset of field: mecab_path_t::rnode", + ][::std::mem::offset_of!(mecab_path_t, rnode) - 0usize]; + [ + "Offset of field: mecab_path_t::rnext", + ][::std::mem::offset_of!(mecab_path_t, rnext) - 8usize]; + [ + "Offset of field: mecab_path_t::lnode", + ][::std::mem::offset_of!(mecab_path_t, lnode) - 16usize]; + [ + "Offset of field: mecab_path_t::lnext", + ][::std::mem::offset_of!(mecab_path_t, lnext) - 24usize]; + [ + "Offset of field: mecab_path_t::cost", + ][::std::mem::offset_of!(mecab_path_t, cost) - 32usize]; + [ + "Offset of field: mecab_path_t::prob", + ][::std::mem::offset_of!(mecab_path_t, prob) - 36usize]; +}; +/// Node structure #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct mecab_node_t { - #[doc = " pointer to the previous node."] + /// pointer to the previous node. pub prev: *mut mecab_node_t, - #[doc = " pointer to the next node."] + /// pointer to the next node. pub next: *mut mecab_node_t, - #[doc = " pointer to the node which ends at the same position."] + /// pointer to the node which ends at the same position. pub enext: *mut mecab_node_t, - #[doc = " pointer to the node which starts at the same position."] + /// pointer to the node which starts at the same position. pub bnext: *mut mecab_node_t, - #[doc = " pointer to the right path."] - #[doc = " this value is NULL if MECAB_ONE_BEST mode."] + /** pointer to the right path. + this value is NULL if MECAB_ONE_BEST mode.*/ pub rpath: *mut mecab_path_t, - #[doc = " pointer to the right path."] - #[doc = " this value is NULL if MECAB_ONE_BEST mode."] + /** pointer to the right path. + this value is NULL if MECAB_ONE_BEST mode.*/ pub lpath: *mut mecab_path_t, - #[doc = " surface string."] - #[doc = " this value is not 0 terminated."] - #[doc = " You can get the length with length/rlength members."] + /** surface string. + this value is not 0 terminated. + You can get the length with length/rlength members.*/ pub surface: *const ::std::os::raw::c_char, - #[doc = " feature string"] + /// feature string pub feature: *const ::std::os::raw::c_char, - #[doc = " unique node id"] + /// unique node id pub id: ::std::os::raw::c_uint, - #[doc = " length of the surface form."] + /// length of the surface form. pub length: ::std::os::raw::c_ushort, - #[doc = " length of the surface form including white space before the morph."] + /// length of the surface form including white space before the morph. pub rlength: ::std::os::raw::c_ushort, - #[doc = " right attribute id"] + /// right attribute id pub rcAttr: ::std::os::raw::c_ushort, - #[doc = " left attribute id"] + /// left attribute id pub lcAttr: ::std::os::raw::c_ushort, - #[doc = " unique part of speech id. This value is defined in \"pos.def\" file."] + /// unique part of speech id. This value is defined in "pos.def" file. pub posid: ::std::os::raw::c_ushort, - #[doc = " character type"] + /// character type pub char_type: ::std::os::raw::c_uchar, - #[doc = " status of this model."] - #[doc = " This value is MECAB_NOR_NODE, MECAB_UNK_NODE, MECAB_BOS_NODE, MECAB_EOS_NODE, or MECAB_EON_NODE."] + /** status of this model. + This value is MECAB_NOR_NODE, MECAB_UNK_NODE, MECAB_BOS_NODE, MECAB_EOS_NODE, or MECAB_EON_NODE.*/ pub stat: ::std::os::raw::c_uchar, - #[doc = " set 1 if this node is best node."] + /// set 1 if this node is best node. pub isbest: ::std::os::raw::c_uchar, - #[doc = " forward accumulative log summation."] - #[doc = " This value is only available when MECAB_MARGINAL_PROB is passed."] + /** forward accumulative log summation. + This value is only available when MECAB_MARGINAL_PROB is passed.*/ pub alpha: f32, - #[doc = " backward accumulative log summation."] - #[doc = " This value is only available when MECAB_MARGINAL_PROB is passed."] + /** backward accumulative log summation. + This value is only available when MECAB_MARGINAL_PROB is passed.*/ pub beta: f32, - #[doc = " marginal probability."] - #[doc = " This value is only available when MECAB_MARGINAL_PROB is passed."] + /** marginal probability. + This value is only available when MECAB_MARGINAL_PROB is passed.*/ pub prob: f32, - #[doc = " word cost."] + /// word cost. pub wcost: ::std::os::raw::c_short, - #[doc = " best accumulative cost from bos node to this node."] + /// best accumulative cost from bos node to this node. pub cost: ::std::os::raw::c_long, } -#[test] -fn bindgen_test_layout_mecab_node_t() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 112usize, - concat!("Size of: ", stringify!(mecab_node_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(mecab_node_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(prev) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(next) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).enext) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(enext) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).bnext) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(bnext) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rpath) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(rpath) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lpath) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(lpath) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).surface) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(surface) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).feature) as usize - ptr as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(feature) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).id) as usize - ptr as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(id) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).length) as usize - ptr as usize }, - 68usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(length) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rlength) as usize - ptr as usize }, - 70usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(rlength) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rcAttr) as usize - ptr as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(rcAttr) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lcAttr) as usize - ptr as usize }, - 74usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(lcAttr) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).posid) as usize - ptr as usize }, - 76usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(posid) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).char_type) as usize - ptr as usize }, - 78usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(char_type) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).stat) as usize - ptr as usize }, - 79usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(stat) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).isbest) as usize - ptr as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(isbest) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).alpha) as usize - ptr as usize }, - 84usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(alpha) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).beta) as usize - ptr as usize }, - 88usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(beta) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prob) as usize - ptr as usize }, - 92usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(prob) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).wcost) as usize - ptr as usize }, - 96usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(wcost) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cost) as usize - ptr as usize }, - 104usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(cost) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of mecab_node_t"][::std::mem::size_of::() - 112usize]; + ["Alignment of mecab_node_t"][::std::mem::align_of::() - 8usize]; + [ + "Offset of field: mecab_node_t::prev", + ][::std::mem::offset_of!(mecab_node_t, prev) - 0usize]; + [ + "Offset of field: mecab_node_t::next", + ][::std::mem::offset_of!(mecab_node_t, next) - 8usize]; + [ + "Offset of field: mecab_node_t::enext", + ][::std::mem::offset_of!(mecab_node_t, enext) - 16usize]; + [ + "Offset of field: mecab_node_t::bnext", + ][::std::mem::offset_of!(mecab_node_t, bnext) - 24usize]; + [ + "Offset of field: mecab_node_t::rpath", + ][::std::mem::offset_of!(mecab_node_t, rpath) - 32usize]; + [ + "Offset of field: mecab_node_t::lpath", + ][::std::mem::offset_of!(mecab_node_t, lpath) - 40usize]; + [ + "Offset of field: mecab_node_t::surface", + ][::std::mem::offset_of!(mecab_node_t, surface) - 48usize]; + [ + "Offset of field: mecab_node_t::feature", + ][::std::mem::offset_of!(mecab_node_t, feature) - 56usize]; + [ + "Offset of field: mecab_node_t::id", + ][::std::mem::offset_of!(mecab_node_t, id) - 64usize]; + [ + "Offset of field: mecab_node_t::length", + ][::std::mem::offset_of!(mecab_node_t, length) - 68usize]; + [ + "Offset of field: mecab_node_t::rlength", + ][::std::mem::offset_of!(mecab_node_t, rlength) - 70usize]; + [ + "Offset of field: mecab_node_t::rcAttr", + ][::std::mem::offset_of!(mecab_node_t, rcAttr) - 72usize]; + [ + "Offset of field: mecab_node_t::lcAttr", + ][::std::mem::offset_of!(mecab_node_t, lcAttr) - 74usize]; + [ + "Offset of field: mecab_node_t::posid", + ][::std::mem::offset_of!(mecab_node_t, posid) - 76usize]; + [ + "Offset of field: mecab_node_t::char_type", + ][::std::mem::offset_of!(mecab_node_t, char_type) - 78usize]; + [ + "Offset of field: mecab_node_t::stat", + ][::std::mem::offset_of!(mecab_node_t, stat) - 79usize]; + [ + "Offset of field: mecab_node_t::isbest", + ][::std::mem::offset_of!(mecab_node_t, isbest) - 80usize]; + [ + "Offset of field: mecab_node_t::alpha", + ][::std::mem::offset_of!(mecab_node_t, alpha) - 84usize]; + [ + "Offset of field: mecab_node_t::beta", + ][::std::mem::offset_of!(mecab_node_t, beta) - 88usize]; + [ + "Offset of field: mecab_node_t::prob", + ][::std::mem::offset_of!(mecab_node_t, prob) - 92usize]; + [ + "Offset of field: mecab_node_t::wcost", + ][::std::mem::offset_of!(mecab_node_t, wcost) - 96usize]; + [ + "Offset of field: mecab_node_t::cost", + ][::std::mem::offset_of!(mecab_node_t, cost) - 104usize]; +}; pub const MECAB_NOR_NODE: _bindgen_ty_1 = _bindgen_ty_1::MECAB_NOR_NODE; pub const MECAB_UNK_NODE: _bindgen_ty_1 = _bindgen_ty_1::MECAB_UNK_NODE; pub const MECAB_BOS_NODE: _bindgen_ty_1 = _bindgen_ty_1::MECAB_BOS_NODE; pub const MECAB_EOS_NODE: _bindgen_ty_1 = _bindgen_ty_1::MECAB_EOS_NODE; pub const MECAB_EON_NODE: _bindgen_ty_1 = _bindgen_ty_1::MECAB_EON_NODE; #[repr(u32)] -#[doc = " Parameters for MeCab::Node::stat"] +/// Parameters for MeCab::Node::stat #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum _bindgen_ty_1 { - #[doc = " Normal node defined in the dictionary."] + /// Normal node defined in the dictionary. MECAB_NOR_NODE = 0, - #[doc = " Unknown node not defined in the dictionary."] + /// Unknown node not defined in the dictionary. MECAB_UNK_NODE = 1, - #[doc = " Virtual node representing a beginning of the sentence."] + /// Virtual node representing a beginning of the sentence. MECAB_BOS_NODE = 2, - #[doc = " Virtual node representing a end of the sentence."] + /// Virtual node representing a end of the sentence. MECAB_EOS_NODE = 3, - #[doc = " Virtual node representing a end of the N-best enumeration."] + /// Virtual node representing a end of the N-best enumeration. MECAB_EON_NODE = 4, } pub const MECAB_SYS_DIC: _bindgen_ty_2 = _bindgen_ty_2::MECAB_SYS_DIC; pub const MECAB_USR_DIC: _bindgen_ty_2 = _bindgen_ty_2::MECAB_USR_DIC; pub const MECAB_UNK_DIC: _bindgen_ty_2 = _bindgen_ty_2::MECAB_UNK_DIC; #[repr(u32)] -#[doc = " Parameters for MeCab::DictionaryInfo::type"] +/// Parameters for MeCab::DictionaryInfo::type #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum _bindgen_ty_2 { - #[doc = " This is a system dictionary."] + /// This is a system dictionary. MECAB_SYS_DIC = 0, - #[doc = " This is a user dictionary."] + /// This is a user dictionary. MECAB_USR_DIC = 1, - #[doc = " This is a unknown word dictionary."] + /// This is a unknown word dictionary. MECAB_UNK_DIC = 2, } pub const MECAB_ONE_BEST: _bindgen_ty_3 = _bindgen_ty_3::MECAB_ONE_BEST; @@ -547,43 +268,43 @@ pub const MECAB_ALTERNATIVE: _bindgen_ty_3 = _bindgen_ty_3::MECAB_ALTERNATIVE; pub const MECAB_ALL_MORPHS: _bindgen_ty_3 = _bindgen_ty_3::MECAB_ALL_MORPHS; pub const MECAB_ALLOCATE_SENTENCE: _bindgen_ty_3 = _bindgen_ty_3::MECAB_ALLOCATE_SENTENCE; #[repr(u32)] -#[doc = " Parameters for MeCab::Lattice::request_type"] +/// Parameters for MeCab::Lattice::request_type #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum _bindgen_ty_3 { - #[doc = " One best result is obtained (default mode)"] + /// One best result is obtained (default mode) MECAB_ONE_BEST = 1, - #[doc = " Set this flag if you want to obtain N best results."] + /// Set this flag if you want to obtain N best results. MECAB_NBEST = 2, - #[doc = " Set this flag if you want to enable a partial parsing mode."] - #[doc = " When this flag is set, the input |sentence| needs to be written"] - #[doc = " in partial parsing format."] + /** Set this flag if you want to enable a partial parsing mode. + When this flag is set, the input |sentence| needs to be written + in partial parsing format.*/ MECAB_PARTIAL = 4, - #[doc = " Set this flag if you want to obtain marginal probabilities."] - #[doc = " Marginal probability is set in MeCab::Node::prob."] - #[doc = " The parsing speed will get 3-5 times slower than the default mode."] + /** Set this flag if you want to obtain marginal probabilities. + Marginal probability is set in MeCab::Node::prob. + The parsing speed will get 3-5 times slower than the default mode.*/ MECAB_MARGINAL_PROB = 8, - #[doc = " Set this flag if you want to obtain alternative results."] - #[doc = " Not implemented."] + /** Set this flag if you want to obtain alternative results. + Not implemented.*/ MECAB_ALTERNATIVE = 16, - #[doc = " When this flag is set, the result linked-list (Node::next/prev)"] - #[doc = " traverses all nodes in the lattice."] + /** When this flag is set, the result linked-list (Node::next/prev) + traverses all nodes in the lattice.*/ MECAB_ALL_MORPHS = 32, - #[doc = " When this flag is set, tagger internally copies the body of passed"] - #[doc = " sentence into internal buffer."] + /** When this flag is set, tagger internally copies the body of passed + sentence into internal buffer.*/ MECAB_ALLOCATE_SENTENCE = 64, } pub const MECAB_ANY_BOUNDARY: _bindgen_ty_4 = _bindgen_ty_4::MECAB_ANY_BOUNDARY; pub const MECAB_TOKEN_BOUNDARY: _bindgen_ty_4 = _bindgen_ty_4::MECAB_TOKEN_BOUNDARY; pub const MECAB_INSIDE_TOKEN: _bindgen_ty_4 = _bindgen_ty_4::MECAB_INSIDE_TOKEN; #[repr(u32)] -#[doc = " Parameters for MeCab::Lattice::boundary_constraint_type"] +/// Parameters for MeCab::Lattice::boundary_constraint_type #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum _bindgen_ty_4 { - #[doc = " The token boundary is not specified."] + /// The token boundary is not specified. MECAB_ANY_BOUNDARY = 0, - #[doc = " The position is a strong token boundary."] + /// The position is a strong token boundary. MECAB_TOKEN_BOUNDARY = 1, - #[doc = " The position is not a token boundary."] + /// The position is not a token boundary. MECAB_INSIDE_TOKEN = 2, } pub type __off_t = ::std::os::raw::c_long; @@ -638,311 +359,98 @@ pub struct _IO_FILE { pub _mode: ::std::os::raw::c_int, pub _unused2: [::std::os::raw::c_char; 20usize], } -#[test] -fn bindgen_test_layout__IO_FILE() { - const UNINIT: ::std::mem::MaybeUninit<_IO_FILE> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_IO_FILE>(), - 216usize, - concat!("Size of: ", stringify!(_IO_FILE)) - ); - assert_eq!( - ::std::mem::align_of::<_IO_FILE>(), - 8usize, - concat!("Alignment of ", stringify!(_IO_FILE)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._flags) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_flags) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._IO_read_ptr) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_read_ptr) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._IO_read_end) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_read_end) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._IO_read_base) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_read_base) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._IO_write_base) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_write_base) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._IO_write_ptr) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_write_ptr) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._IO_write_end) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_write_end) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._IO_buf_base) as usize - ptr as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_buf_base) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._IO_buf_end) as usize - ptr as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_buf_end) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._IO_save_base) as usize - ptr as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_save_base) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._IO_backup_base) as usize - ptr as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_backup_base) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._IO_save_end) as usize - ptr as usize }, - 88usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_save_end) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._markers) as usize - ptr as usize }, - 96usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_markers) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._chain) as usize - ptr as usize }, - 104usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_chain) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._fileno) as usize - ptr as usize }, - 112usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_fileno) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._flags2) as usize - ptr as usize }, - 116usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_flags2) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._old_offset) as usize - ptr as usize }, - 120usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_old_offset) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._cur_column) as usize - ptr as usize }, - 128usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_cur_column) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._vtable_offset) as usize - ptr as usize }, - 130usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_vtable_offset) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._shortbuf) as usize - ptr as usize }, - 131usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_shortbuf) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._lock) as usize - ptr as usize }, - 136usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_lock) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._offset) as usize - ptr as usize }, - 144usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_offset) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._codecvt) as usize - ptr as usize }, - 152usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_codecvt) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._wide_data) as usize - ptr as usize }, - 160usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_wide_data) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._freeres_list) as usize - ptr as usize }, - 168usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_freeres_list) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._freeres_buf) as usize - ptr as usize }, - 176usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_freeres_buf) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__pad5) as usize - ptr as usize }, - 184usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(__pad5) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._mode) as usize - ptr as usize }, - 192usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_mode) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._unused2) as usize - ptr as usize }, - 196usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_unused2) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _IO_FILE"][::std::mem::size_of::<_IO_FILE>() - 216usize]; + ["Alignment of _IO_FILE"][::std::mem::align_of::<_IO_FILE>() - 8usize]; + [ + "Offset of field: _IO_FILE::_flags", + ][::std::mem::offset_of!(_IO_FILE, _flags) - 0usize]; + [ + "Offset of field: _IO_FILE::_IO_read_ptr", + ][::std::mem::offset_of!(_IO_FILE, _IO_read_ptr) - 8usize]; + [ + "Offset of field: _IO_FILE::_IO_read_end", + ][::std::mem::offset_of!(_IO_FILE, _IO_read_end) - 16usize]; + [ + "Offset of field: _IO_FILE::_IO_read_base", + ][::std::mem::offset_of!(_IO_FILE, _IO_read_base) - 24usize]; + [ + "Offset of field: _IO_FILE::_IO_write_base", + ][::std::mem::offset_of!(_IO_FILE, _IO_write_base) - 32usize]; + [ + "Offset of field: _IO_FILE::_IO_write_ptr", + ][::std::mem::offset_of!(_IO_FILE, _IO_write_ptr) - 40usize]; + [ + "Offset of field: _IO_FILE::_IO_write_end", + ][::std::mem::offset_of!(_IO_FILE, _IO_write_end) - 48usize]; + [ + "Offset of field: _IO_FILE::_IO_buf_base", + ][::std::mem::offset_of!(_IO_FILE, _IO_buf_base) - 56usize]; + [ + "Offset of field: _IO_FILE::_IO_buf_end", + ][::std::mem::offset_of!(_IO_FILE, _IO_buf_end) - 64usize]; + [ + "Offset of field: _IO_FILE::_IO_save_base", + ][::std::mem::offset_of!(_IO_FILE, _IO_save_base) - 72usize]; + [ + "Offset of field: _IO_FILE::_IO_backup_base", + ][::std::mem::offset_of!(_IO_FILE, _IO_backup_base) - 80usize]; + [ + "Offset of field: _IO_FILE::_IO_save_end", + ][::std::mem::offset_of!(_IO_FILE, _IO_save_end) - 88usize]; + [ + "Offset of field: _IO_FILE::_markers", + ][::std::mem::offset_of!(_IO_FILE, _markers) - 96usize]; + [ + "Offset of field: _IO_FILE::_chain", + ][::std::mem::offset_of!(_IO_FILE, _chain) - 104usize]; + [ + "Offset of field: _IO_FILE::_fileno", + ][::std::mem::offset_of!(_IO_FILE, _fileno) - 112usize]; + [ + "Offset of field: _IO_FILE::_flags2", + ][::std::mem::offset_of!(_IO_FILE, _flags2) - 116usize]; + [ + "Offset of field: _IO_FILE::_old_offset", + ][::std::mem::offset_of!(_IO_FILE, _old_offset) - 120usize]; + [ + "Offset of field: _IO_FILE::_cur_column", + ][::std::mem::offset_of!(_IO_FILE, _cur_column) - 128usize]; + [ + "Offset of field: _IO_FILE::_vtable_offset", + ][::std::mem::offset_of!(_IO_FILE, _vtable_offset) - 130usize]; + [ + "Offset of field: _IO_FILE::_shortbuf", + ][::std::mem::offset_of!(_IO_FILE, _shortbuf) - 131usize]; + [ + "Offset of field: _IO_FILE::_lock", + ][::std::mem::offset_of!(_IO_FILE, _lock) - 136usize]; + [ + "Offset of field: _IO_FILE::_offset", + ][::std::mem::offset_of!(_IO_FILE, _offset) - 144usize]; + [ + "Offset of field: _IO_FILE::_codecvt", + ][::std::mem::offset_of!(_IO_FILE, _codecvt) - 152usize]; + [ + "Offset of field: _IO_FILE::_wide_data", + ][::std::mem::offset_of!(_IO_FILE, _wide_data) - 160usize]; + [ + "Offset of field: _IO_FILE::_freeres_list", + ][::std::mem::offset_of!(_IO_FILE, _freeres_list) - 168usize]; + [ + "Offset of field: _IO_FILE::_freeres_buf", + ][::std::mem::offset_of!(_IO_FILE, _freeres_buf) - 176usize]; + [ + "Offset of field: _IO_FILE::__pad5", + ][::std::mem::offset_of!(_IO_FILE, __pad5) - 184usize]; + [ + "Offset of field: _IO_FILE::_mode", + ][::std::mem::offset_of!(_IO_FILE, _mode) - 192usize]; + [ + "Offset of field: _IO_FILE::_unused2", + ][::std::mem::offset_of!(_IO_FILE, _unused2) - 196usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct mecab_t { @@ -959,76 +467,76 @@ pub struct mecab_lattice_t { _unused: [u8; 0], } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::create(argc, argv)"] + /// C wrapper of MeCab::Tagger::create(argc, argv) pub fn mecab_new( argc: ::std::os::raw::c_int, argv: *mut *mut ::std::os::raw::c_char, ) -> *mut mecab_t; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::create(arg)"] + /// C wrapper of MeCab::Tagger::create(arg) pub fn mecab_new2(arg: *const ::std::os::raw::c_char) -> *mut mecab_t; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::version()"] + /// C wrapper of MeCab::Tagger::version() pub fn mecab_version() -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::getLastError()"] + /// C wrapper of MeCab::getLastError() pub fn mecab_strerror(mecab: *mut mecab_t) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::deleteTagger(tagger)"] + /// C wrapper of MeCab::deleteTagger(tagger) pub fn mecab_destroy(mecab: *mut mecab_t); } extern "C" { - #[doc = " C wrapper of MeCab::Tagger:set_partial()"] + /// C wrapper of MeCab::Tagger:set_partial() pub fn mecab_get_partial(mecab: *mut mecab_t) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::partial()"] + /// C wrapper of MeCab::Tagger::partial() pub fn mecab_set_partial(mecab: *mut mecab_t, partial: ::std::os::raw::c_int); } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::theta()"] + /// C wrapper of MeCab::Tagger::theta() pub fn mecab_get_theta(mecab: *mut mecab_t) -> f32; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::set_theta()"] + /// C wrapper of MeCab::Tagger::set_theta() pub fn mecab_set_theta(mecab: *mut mecab_t, theta: f32); } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::lattice_level()"] + /// C wrapper of MeCab::Tagger::lattice_level() pub fn mecab_get_lattice_level(mecab: *mut mecab_t) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::set_lattice_level()"] + /// C wrapper of MeCab::Tagger::set_lattice_level() pub fn mecab_set_lattice_level(mecab: *mut mecab_t, level: ::std::os::raw::c_int); } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::all_morphs()"] + /// C wrapper of MeCab::Tagger::all_morphs() pub fn mecab_get_all_morphs(mecab: *mut mecab_t) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::set_all_moprhs()"] + /// C wrapper of MeCab::Tagger::set_all_moprhs() pub fn mecab_set_all_morphs(mecab: *mut mecab_t, all_morphs: ::std::os::raw::c_int); } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parse(MeCab::Lattice *lattice)"] + /// C wrapper of MeCab::Tagger::parse(MeCab::Lattice *lattice) pub fn mecab_parse_lattice( mecab: *mut mecab_t, lattice: *mut mecab_lattice_t, ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parse(const char *str)"] + /// C wrapper of MeCab::Tagger::parse(const char *str) pub fn mecab_sparse_tostr( mecab: *mut mecab_t, str_: *const ::std::os::raw::c_char, ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parse(const char *str, size_t len)"] + /// C wrapper of MeCab::Tagger::parse(const char *str, size_t len) pub fn mecab_sparse_tostr2( mecab: *mut mecab_t, str_: *const ::std::os::raw::c_char, @@ -1036,7 +544,7 @@ extern "C" { ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parse(const char *str, char *ostr, size_t olen)"] + /// C wrapper of MeCab::Tagger::parse(const char *str, char *ostr, size_t olen) pub fn mecab_sparse_tostr3( mecab: *mut mecab_t, str_: *const ::std::os::raw::c_char, @@ -1046,14 +554,14 @@ extern "C" { ) -> *mut ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parseToNode(const char *str)"] + /// C wrapper of MeCab::Tagger::parseToNode(const char *str) pub fn mecab_sparse_tonode( mecab: *mut mecab_t, arg1: *const ::std::os::raw::c_char, ) -> *const mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parseToNode(const char *str, size_t len)"] + /// C wrapper of MeCab::Tagger::parseToNode(const char *str, size_t len) pub fn mecab_sparse_tonode2( mecab: *mut mecab_t, arg1: *const ::std::os::raw::c_char, @@ -1061,7 +569,7 @@ extern "C" { ) -> *const mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parseNBest(size_t N, const char *str)"] + /// C wrapper of MeCab::Tagger::parseNBest(size_t N, const char *str) pub fn mecab_nbest_sparse_tostr( mecab: *mut mecab_t, N: usize, @@ -1069,7 +577,7 @@ extern "C" { ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parseNBest(size_t N, const char *str, size_t len)"] + /// C wrapper of MeCab::Tagger::parseNBest(size_t N, const char *str, size_t len) pub fn mecab_nbest_sparse_tostr2( mecab: *mut mecab_t, N: usize, @@ -1078,7 +586,7 @@ extern "C" { ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parseNBest(size_t N, const char *str, char *ostr, size_t olen)"] + /// C wrapper of MeCab::Tagger::parseNBest(size_t N, const char *str, char *ostr, size_t olen) pub fn mecab_nbest_sparse_tostr3( mecab: *mut mecab_t, N: usize, @@ -1089,14 +597,14 @@ extern "C" { ) -> *mut ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parseNBestInit(const char *str)"] + /// C wrapper of MeCab::Tagger::parseNBestInit(const char *str) pub fn mecab_nbest_init( mecab: *mut mecab_t, str_: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parseNBestInit(const char *str, size_t len)"] + /// C wrapper of MeCab::Tagger::parseNBestInit(const char *str, size_t len) pub fn mecab_nbest_init2( mecab: *mut mecab_t, str_: *const ::std::os::raw::c_char, @@ -1104,11 +612,11 @@ extern "C" { ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::next()"] + /// C wrapper of MeCab::Tagger::next() pub fn mecab_nbest_next_tostr(mecab: *mut mecab_t) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::next(char *ostr, size_t olen)"] + /// C wrapper of MeCab::Tagger::next(char *ostr, size_t olen) pub fn mecab_nbest_next_tostr2( mecab: *mut mecab_t, ostr: *mut ::std::os::raw::c_char, @@ -1116,84 +624,91 @@ extern "C" { ) -> *mut ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::nextNode()"] + /// C wrapper of MeCab::Tagger::nextNode() pub fn mecab_nbest_next_tonode(mecab: *mut mecab_t) -> *const mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::formatNode(const Node *node)"] + /// C wrapper of MeCab::Tagger::formatNode(const Node *node) pub fn mecab_format_node( mecab: *mut mecab_t, node: *const mecab_node_t, ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::dictionary_info()"] + /// C wrapper of MeCab::Tagger::dictionary_info() pub fn mecab_dictionary_info(mecab: *mut mecab_t) -> *const mecab_dictionary_info_t; } extern "C" { - #[doc = " C wrapper of MeCab::createLattice()"] + /// C wrapper of MeCab::createLattice() pub fn mecab_lattice_new() -> *mut mecab_lattice_t; } extern "C" { - #[doc = " C wrapper of MeCab::deleteLattice(lattice)"] + /// C wrapper of MeCab::deleteLattice(lattice) pub fn mecab_lattice_destroy(lattice: *mut mecab_lattice_t); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::clear()"] + /// C wrapper of MeCab::Lattice::clear() pub fn mecab_lattice_clear(lattice: *mut mecab_lattice_t); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::is_available()"] - pub fn mecab_lattice_is_available(lattice: *mut mecab_lattice_t) -> ::std::os::raw::c_int; + /// C wrapper of MeCab::Lattice::is_available() + pub fn mecab_lattice_is_available( + lattice: *mut mecab_lattice_t, + ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::bos_node()"] - pub fn mecab_lattice_get_bos_node(lattice: *mut mecab_lattice_t) -> *mut mecab_node_t; + /// C wrapper of MeCab::Lattice::bos_node() + pub fn mecab_lattice_get_bos_node( + lattice: *mut mecab_lattice_t, + ) -> *mut mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::eos_node()"] - pub fn mecab_lattice_get_eos_node(lattice: *mut mecab_lattice_t) -> *mut mecab_node_t; + /// C wrapper of MeCab::Lattice::eos_node() + pub fn mecab_lattice_get_eos_node( + lattice: *mut mecab_lattice_t, + ) -> *mut mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::begin_nodes()"] + /// C wrapper of MeCab::Lattice::begin_nodes() pub fn mecab_lattice_get_all_begin_nodes( lattice: *mut mecab_lattice_t, ) -> *mut *mut mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::end_nodes()"] - pub fn mecab_lattice_get_all_end_nodes(lattice: *mut mecab_lattice_t) - -> *mut *mut mecab_node_t; + /// C wrapper of MeCab::Lattice::end_nodes() + pub fn mecab_lattice_get_all_end_nodes( + lattice: *mut mecab_lattice_t, + ) -> *mut *mut mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::begin_nodes(pos)"] + /// C wrapper of MeCab::Lattice::begin_nodes(pos) pub fn mecab_lattice_get_begin_nodes( lattice: *mut mecab_lattice_t, pos: usize, ) -> *mut mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::end_nodes(pos)"] + /// C wrapper of MeCab::Lattice::end_nodes(pos) pub fn mecab_lattice_get_end_nodes( lattice: *mut mecab_lattice_t, pos: usize, ) -> *mut mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::sentence()"] + /// C wrapper of MeCab::Lattice::sentence() pub fn mecab_lattice_get_sentence( lattice: *mut mecab_lattice_t, ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::set_sentence(sentence)"] + /// C wrapper of MeCab::Lattice::set_sentence(sentence) pub fn mecab_lattice_set_sentence( lattice: *mut mecab_lattice_t, sentence: *const ::std::os::raw::c_char, ); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::set_sentence(sentence, len)"] + /// C wrapper of MeCab::Lattice::set_sentence(sentence, len) pub fn mecab_lattice_set_sentence2( lattice: *mut mecab_lattice_t, sentence: *const ::std::os::raw::c_char, @@ -1201,71 +716,75 @@ extern "C" { ); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::size()"] + /// C wrapper of MeCab::Lattice::size() pub fn mecab_lattice_get_size(lattice: *mut mecab_lattice_t) -> usize; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::Z()"] + /// C wrapper of MeCab::Lattice::Z() pub fn mecab_lattice_get_z(lattice: *mut mecab_lattice_t) -> f64; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::set_Z()"] + /// C wrapper of MeCab::Lattice::set_Z() pub fn mecab_lattice_set_z(lattice: *mut mecab_lattice_t, Z: f64); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::theta()"] + /// C wrapper of MeCab::Lattice::theta() pub fn mecab_lattice_get_theta(lattice: *mut mecab_lattice_t) -> f64; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::set_theta()"] + /// C wrapper of MeCab::Lattice::set_theta() pub fn mecab_lattice_set_theta(lattice: *mut mecab_lattice_t, theta: f64); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::next()"] + /// C wrapper of MeCab::Lattice::next() pub fn mecab_lattice_next(lattice: *mut mecab_lattice_t) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::request_type()"] - pub fn mecab_lattice_get_request_type(lattice: *mut mecab_lattice_t) -> ::std::os::raw::c_int; + /// C wrapper of MeCab::Lattice::request_type() + pub fn mecab_lattice_get_request_type( + lattice: *mut mecab_lattice_t, + ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::has_request_type()"] + /// C wrapper of MeCab::Lattice::has_request_type() pub fn mecab_lattice_has_request_type( lattice: *mut mecab_lattice_t, request_type: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::set_request_type()"] + /// C wrapper of MeCab::Lattice::set_request_type() pub fn mecab_lattice_set_request_type( lattice: *mut mecab_lattice_t, request_type: ::std::os::raw::c_int, ); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::add_request_type()"] + /// C wrapper of MeCab::Lattice::add_request_type() pub fn mecab_lattice_add_request_type( lattice: *mut mecab_lattice_t, request_type: ::std::os::raw::c_int, ); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::remove_request_type()"] + /// C wrapper of MeCab::Lattice::remove_request_type() pub fn mecab_lattice_remove_request_type( lattice: *mut mecab_lattice_t, request_type: ::std::os::raw::c_int, ); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::newNode();"] + /// C wrapper of MeCab::Lattice::newNode(); pub fn mecab_lattice_new_node(lattice: *mut mecab_lattice_t) -> *mut mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::toString()"] - pub fn mecab_lattice_tostr(lattice: *mut mecab_lattice_t) -> *const ::std::os::raw::c_char; + /// C wrapper of MeCab::Lattice::toString() + pub fn mecab_lattice_tostr( + lattice: *mut mecab_lattice_t, + ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::toString(buf, size)"] + /// C wrapper of MeCab::Lattice::toString(buf, size) pub fn mecab_lattice_tostr2( lattice: *mut mecab_lattice_t, buf: *mut ::std::os::raw::c_char, @@ -1273,14 +792,14 @@ extern "C" { ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::enumNBestAsString(N)"] + /// C wrapper of MeCab::Lattice::enumNBestAsString(N) pub fn mecab_lattice_nbest_tostr( lattice: *mut mecab_lattice_t, N: usize, ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::enumNBestAsString(N, buf, size)"] + /// C wrapper of MeCab::Lattice::enumNBestAsString(N, buf, size) pub fn mecab_lattice_nbest_tostr2( lattice: *mut mecab_lattice_t, N: usize, @@ -1289,25 +808,27 @@ extern "C" { ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::has_constraint()"] - pub fn mecab_lattice_has_constraint(lattice: *mut mecab_lattice_t) -> ::std::os::raw::c_int; + /// C wrapper of MeCab::Lattice::has_constraint() + pub fn mecab_lattice_has_constraint( + lattice: *mut mecab_lattice_t, + ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::boundary_constraint(pos)"] + /// C wrapper of MeCab::Lattice::boundary_constraint(pos) pub fn mecab_lattice_get_boundary_constraint( lattice: *mut mecab_lattice_t, pos: usize, ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::feature_constraint(pos)"] + /// C wrapper of MeCab::Lattice::feature_constraint(pos) pub fn mecab_lattice_get_feature_constraint( lattice: *mut mecab_lattice_t, pos: usize, ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::boundary_constraint(pos, type)"] + /// C wrapper of MeCab::Lattice::boundary_constraint(pos, type) pub fn mecab_lattice_set_boundary_constraint( lattice: *mut mecab_lattice_t, pos: usize, @@ -1315,7 +836,7 @@ extern "C" { ); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::set_feature_constraint(begin_pos, end_pos, feature)"] + /// C wrapper of MeCab::Lattice::set_feature_constraint(begin_pos, end_pos, feature) pub fn mecab_lattice_set_feature_constraint( lattice: *mut mecab_lattice_t, begin_pos: usize, @@ -1324,53 +845,56 @@ extern "C" { ); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::set_result(result);"] + /// C wrapper of MeCab::Lattice::set_result(result); pub fn mecab_lattice_set_result( lattice: *mut mecab_lattice_t, result: *const ::std::os::raw::c_char, ); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::what()"] - pub fn mecab_lattice_strerror(lattice: *mut mecab_lattice_t) -> *const ::std::os::raw::c_char; + /// C wrapper of MeCab::Lattice::what() + pub fn mecab_lattice_strerror( + lattice: *mut mecab_lattice_t, + ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wapper of MeCab::Model::create(argc, argv)"] + /// C wapper of MeCab::Model::create(argc, argv) pub fn mecab_model_new( argc: ::std::os::raw::c_int, argv: *mut *mut ::std::os::raw::c_char, ) -> *mut mecab_model_t; } extern "C" { - #[doc = " C wapper of MeCab::Model::create(arg)"] + /// C wapper of MeCab::Model::create(arg) pub fn mecab_model_new2(arg: *const ::std::os::raw::c_char) -> *mut mecab_model_t; } extern "C" { - #[doc = " C wapper of MeCab::deleteModel(model)"] + /// C wapper of MeCab::deleteModel(model) pub fn mecab_model_destroy(model: *mut mecab_model_t); } extern "C" { - #[doc = " C wapper of MeCab::Model::createTagger()"] + /// C wapper of MeCab::Model::createTagger() pub fn mecab_model_new_tagger(model: *mut mecab_model_t) -> *mut mecab_t; } extern "C" { - #[doc = " C wapper of MeCab::Model::createLattice()"] + /// C wapper of MeCab::Model::createLattice() pub fn mecab_model_new_lattice(model: *mut mecab_model_t) -> *mut mecab_lattice_t; } extern "C" { - #[doc = " C wrapper of MeCab::Model::swap()"] + /// C wrapper of MeCab::Model::swap() pub fn mecab_model_swap( model: *mut mecab_model_t, new_model: *mut mecab_model_t, ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wapper of MeCab::Model::dictionary_info()"] - pub fn mecab_model_dictionary_info(model: *mut mecab_model_t) - -> *const mecab_dictionary_info_t; + /// C wapper of MeCab::Model::dictionary_info() + pub fn mecab_model_dictionary_info( + model: *mut mecab_model_t, + ) -> *const mecab_dictionary_info_t; } extern "C" { - #[doc = " C wrapper of MeCab::Model::transition_cost()"] + /// C wrapper of MeCab::Model::transition_cost() pub fn mecab_model_transition_cost( model: *mut mecab_model_t, rcAttr: ::std::os::raw::c_ushort, @@ -1378,7 +902,7 @@ extern "C" { ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Model::lookup()"] + /// C wrapper of MeCab::Model::lookup() pub fn mecab_model_lookup( model: *mut mecab_model_t, begin: *const ::std::os::raw::c_char, @@ -1422,11 +946,11 @@ extern "C" { argv: *mut *mut ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } -#[doc = " DictionaryInfo structure"] +/// DictionaryInfo structure pub type MeCab_DictionaryInfo = mecab_dictionary_info_t; -#[doc = " Path structure"] +/// Path structure pub type MeCab_Path = mecab_path_t; -#[doc = " Node structure"] +/// Node structure pub type MeCab_Node = mecab_node_t; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -1435,71 +959,55 @@ pub struct MeCab_Allocator { } #[repr(C)] pub struct MeCab_Lattice__bindgen_vtable(::std::os::raw::c_void); -#[doc = " Lattice class"] +/// Lattice class #[repr(C)] #[derive(Debug)] pub struct MeCab_Lattice { pub vtable_: *const MeCab_Lattice__bindgen_vtable, } -#[test] -fn bindgen_test_layout_MeCab_Lattice() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(MeCab_Lattice)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(MeCab_Lattice)) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of MeCab_Lattice"][::std::mem::size_of::() - 8usize]; + ["Alignment of MeCab_Lattice"][::std::mem::align_of::() - 8usize]; +}; extern "C" { - #[doc = " Create new Lattice object"] - #[doc = " @return new Lattice object"] + /** Create new Lattice object + @return new Lattice object*/ #[link_name = "\u{1}_ZN5MeCab7Lattice6createEv"] pub fn MeCab_Lattice_create() -> *mut MeCab_Lattice; } impl MeCab_Lattice { #[inline] pub unsafe fn create() -> *mut MeCab_Lattice { - unsafe { MeCab_Lattice_create() } + MeCab_Lattice_create() } } #[repr(C)] pub struct MeCab_Model__bindgen_vtable(::std::os::raw::c_void); -#[doc = " Model class"] +/// Model class #[repr(C)] #[derive(Debug)] pub struct MeCab_Model { pub vtable_: *const MeCab_Model__bindgen_vtable, } -#[test] -fn bindgen_test_layout_MeCab_Model() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(MeCab_Model)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(MeCab_Model)) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of MeCab_Model"][::std::mem::size_of::() - 8usize]; + ["Alignment of MeCab_Model"][::std::mem::align_of::() - 8usize]; +}; extern "C" { - #[doc = " Return a version string"] - #[doc = " @return version string"] + /** Return a version string + @return version string*/ #[link_name = "\u{1}_ZN5MeCab5Model7versionEv"] pub fn MeCab_Model_version() -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " Factory method to create a new Model with a specified main's argc/argv-style parameters."] - #[doc = " Return NULL if new model cannot be initialized. Use MeCab::getLastError() to obtain the"] - #[doc = " cause of the errors."] - #[doc = " @return new Model object"] - #[doc = " @param argc number of parameters"] - #[doc = " @param argv parameter list"] + /** Factory method to create a new Model with a specified main's argc/argv-style parameters. + Return NULL if new model cannot be initialized. Use MeCab::getLastError() to obtain the + cause of the errors. + @return new Model object + @param argc number of parameters + @param argv parameter list*/ #[link_name = "\u{1}_ZN5MeCab5Model6createEiPPc"] pub fn MeCab_Model_create( argc: ::std::os::raw::c_int, @@ -1507,74 +1015,69 @@ extern "C" { ) -> *mut MeCab_Model; } extern "C" { - #[doc = " Factory method to create a new Model with a string parameter representation, i.e.,"] - #[doc = " \"-d /user/local/mecab/dic/ipadic -Ochasen\"."] - #[doc = " Return NULL if new model cannot be initialized. Use MeCab::getLastError() to obtain the"] - #[doc = " cause of the errors."] - #[doc = " @return new Model object"] - #[doc = " @param arg single string representation of the argment."] + /** Factory method to create a new Model with a string parameter representation, i.e., + "-d /user/local/mecab/dic/ipadic -Ochasen". + Return NULL if new model cannot be initialized. Use MeCab::getLastError() to obtain the + cause of the errors. + @return new Model object + @param arg single string representation of the argment.*/ #[link_name = "\u{1}_ZN5MeCab5Model6createEPKc"] pub fn MeCab_Model_create1(arg: *const ::std::os::raw::c_char) -> *mut MeCab_Model; } impl MeCab_Model { #[inline] pub unsafe fn version() -> *const ::std::os::raw::c_char { - unsafe { MeCab_Model_version() } + MeCab_Model_version() } #[inline] pub unsafe fn create( argc: ::std::os::raw::c_int, argv: *mut *mut ::std::os::raw::c_char, ) -> *mut MeCab_Model { - unsafe { MeCab_Model_create(argc, argv) } + MeCab_Model_create(argc, argv) } #[inline] pub unsafe fn create1(arg: *const ::std::os::raw::c_char) -> *mut MeCab_Model { - unsafe { MeCab_Model_create1(arg) } + MeCab_Model_create1(arg) } } #[repr(C)] pub struct MeCab_Tagger__bindgen_vtable(::std::os::raw::c_void); -#[doc = " Tagger class"] +/// Tagger class #[repr(C)] #[derive(Debug)] pub struct MeCab_Tagger { pub vtable_: *const MeCab_Tagger__bindgen_vtable, } -#[test] -fn bindgen_test_layout_MeCab_Tagger() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(MeCab_Tagger)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(MeCab_Tagger)) - ); -} -extern "C" { - #[doc = " Handy static method."] - #[doc = " Return true if lattice is parsed successfully."] - #[doc = " This function is equivalent to"] - #[doc = " {"] - #[doc = " Tagger *tagger = model.createModel();"] - #[doc = " cosnt bool result = tagger->parse(lattice);"] - #[doc = " delete tagger;"] - #[doc = " return result;"] - #[doc = " }"] - #[doc = " @return boolean"] +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of MeCab_Tagger"][::std::mem::size_of::() - 8usize]; + ["Alignment of MeCab_Tagger"][::std::mem::align_of::() - 8usize]; +}; +extern "C" { + /** Handy static method. + Return true if lattice is parsed successfully. + This function is equivalent to + { + Tagger *tagger = model.createModel(); + cosnt bool result = tagger->parse(lattice); + delete tagger; + return result; + } + @return boolean*/ #[link_name = "\u{1}_ZN5MeCab6Tagger5parseERKNS_5ModelEPNS_7LatticeE"] - pub fn MeCab_Tagger_parse(model: *const MeCab_Model, lattice: *mut MeCab_Lattice) -> bool; -} -extern "C" { - #[doc = " Factory method to create a new Tagger with a specified main's argc/argv-style parameters."] - #[doc = " Return NULL if new model cannot be initialized. Use MeCab::getLastError() to obtain the"] - #[doc = " cause of the errors."] - #[doc = " @return new Tagger object"] - #[doc = " @param argc number of parameters"] - #[doc = " @param argv parameter list"] + pub fn MeCab_Tagger_parse( + model: *const MeCab_Model, + lattice: *mut MeCab_Lattice, + ) -> bool; +} +extern "C" { + /** Factory method to create a new Tagger with a specified main's argc/argv-style parameters. + Return NULL if new model cannot be initialized. Use MeCab::getLastError() to obtain the + cause of the errors. + @return new Tagger object + @param argc number of parameters + @param argv parameter list*/ #[link_name = "\u{1}_ZN5MeCab6Tagger6createEiPPc"] pub fn MeCab_Tagger_create( argc: ::std::os::raw::c_int, @@ -1582,49 +1085,49 @@ extern "C" { ) -> *mut MeCab_Tagger; } extern "C" { - #[doc = " Factory method to create a new Tagger with a string parameter representation, i.e.,"] - #[doc = " \"-d /user/local/mecab/dic/ipadic -Ochasen\"."] - #[doc = " Return NULL if new model cannot be initialized. Use MeCab::getLastError() to obtain the"] - #[doc = " cause of the errors."] - #[doc = " @return new Model object"] - #[doc = " @param arg single string representation of the argment."] + /** Factory method to create a new Tagger with a string parameter representation, i.e., + "-d /user/local/mecab/dic/ipadic -Ochasen". + Return NULL if new model cannot be initialized. Use MeCab::getLastError() to obtain the + cause of the errors. + @return new Model object + @param arg single string representation of the argment.*/ #[link_name = "\u{1}_ZN5MeCab6Tagger6createEPKc"] pub fn MeCab_Tagger_create1(arg: *const ::std::os::raw::c_char) -> *mut MeCab_Tagger; } extern "C" { - #[doc = " Return a version string"] - #[doc = " @return version string"] + /** Return a version string + @return version string*/ #[link_name = "\u{1}_ZN5MeCab6Tagger7versionEv"] pub fn MeCab_Tagger_version() -> *const ::std::os::raw::c_char; } impl MeCab_Tagger { #[inline] pub unsafe fn parse(model: *const MeCab_Model, lattice: *mut MeCab_Lattice) -> bool { - unsafe { MeCab_Tagger_parse(model, lattice) } + MeCab_Tagger_parse(model, lattice) } #[inline] pub unsafe fn create( argc: ::std::os::raw::c_int, argv: *mut *mut ::std::os::raw::c_char, ) -> *mut MeCab_Tagger { - unsafe { MeCab_Tagger_create(argc, argv) } + MeCab_Tagger_create(argc, argv) } #[inline] pub unsafe fn create1(arg: *const ::std::os::raw::c_char) -> *mut MeCab_Tagger { - unsafe { MeCab_Tagger_create1(arg) } + MeCab_Tagger_create1(arg) } #[inline] pub unsafe fn version() -> *const ::std::os::raw::c_char { - unsafe { MeCab_Tagger_version() } + MeCab_Tagger_version() } } extern "C" { - #[doc = " Alias of Lattice::create()"] + /// Alias of Lattice::create() #[link_name = "\u{1}_ZN5MeCab13createLatticeEv"] pub fn MeCab_createLattice() -> *mut MeCab_Lattice; } extern "C" { - #[doc = " Alias of Mode::create(argc, argv)"] + /// Alias of Mode::create(argc, argv) #[link_name = "\u{1}_ZN5MeCab11createModelEiPPc"] pub fn MeCab_createModel( argc: ::std::os::raw::c_int, @@ -1632,12 +1135,12 @@ extern "C" { ) -> *mut MeCab_Model; } extern "C" { - #[doc = " Alias of Mode::create(arg)"] + /// Alias of Mode::create(arg) #[link_name = "\u{1}_ZN5MeCab11createModelEPKc"] pub fn MeCab_createModel1(arg: *const ::std::os::raw::c_char) -> *mut MeCab_Model; } extern "C" { - #[doc = " Alias of Tagger::create(argc, argv)"] + /// Alias of Tagger::create(argc, argv) #[link_name = "\u{1}_ZN5MeCab12createTaggerEiPPc"] pub fn MeCab_createTagger( argc: ::std::os::raw::c_int, @@ -1645,44 +1148,44 @@ extern "C" { ) -> *mut MeCab_Tagger; } extern "C" { - #[doc = " Alias of Tagger::create(arg)"] + /// Alias of Tagger::create(arg) #[link_name = "\u{1}_ZN5MeCab12createTaggerEPKc"] pub fn MeCab_createTagger1(arg: *const ::std::os::raw::c_char) -> *mut MeCab_Tagger; } extern "C" { - #[doc = " delete Lattice object."] - #[doc = " This method calles \"delete lattice\"."] - #[doc = " In some environment, e.g., MS-Windows, an object allocated inside a DLL must be deleted in the same DLL too."] - #[doc = " @param lattice lattice object"] + /** delete Lattice object. + This method calles "delete lattice". + In some environment, e.g., MS-Windows, an object allocated inside a DLL must be deleted in the same DLL too. + @param lattice lattice object*/ #[link_name = "\u{1}_ZN5MeCab13deleteLatticeEPNS_7LatticeE"] pub fn MeCab_deleteLattice(lattice: *mut MeCab_Lattice); } extern "C" { - #[doc = " delete Model object."] - #[doc = " This method calles \"delete model\"."] - #[doc = " In some environment, e.g., MS-Windows, an object allocated inside a DLL must be deleted in the same DLL too."] - #[doc = " @param model model object"] + /** delete Model object. + This method calles "delete model". + In some environment, e.g., MS-Windows, an object allocated inside a DLL must be deleted in the same DLL too. + @param model model object*/ #[link_name = "\u{1}_ZN5MeCab11deleteModelEPNS_5ModelE"] pub fn MeCab_deleteModel(model: *mut MeCab_Model); } extern "C" { - #[doc = " delete Tagger object."] - #[doc = " This method calles \"delete tagger\"."] - #[doc = " In some environment, e.g., MS-Windows, an object allocated inside a DLL must be deleted in the same DLL too."] - #[doc = " @param tagger tagger object"] + /** delete Tagger object. + This method calles "delete tagger". + In some environment, e.g., MS-Windows, an object allocated inside a DLL must be deleted in the same DLL too. + @param tagger tagger object*/ #[link_name = "\u{1}_ZN5MeCab12deleteTaggerEPNS_6TaggerE"] pub fn MeCab_deleteTagger(tagger: *mut MeCab_Tagger); } extern "C" { - #[doc = " Return last error string."] - #[doc = " @return error string"] + /** Return last error string. + @return error string*/ #[link_name = "\u{1}_ZN5MeCab12getLastErrorEv"] pub fn MeCab_getLastError() -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " An alias of getLastError."] - #[doc = " It is kept for backward compatibility."] - #[doc = " @return error string"] + /** An alias of getLastError. + It is kept for backward compatibility. + @return error string*/ #[link_name = "\u{1}_ZN5MeCab14getTaggerErrorEv"] pub fn MeCab_getTaggerError() -> *const ::std::os::raw::c_char; } @@ -1695,71 +1198,22 @@ pub struct _Mecab { pub tagger: *mut ::std::os::raw::c_void, pub lattice: *mut ::std::os::raw::c_void, } -#[test] -fn bindgen_test_layout__Mecab() { - const UNINIT: ::std::mem::MaybeUninit<_Mecab> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_Mecab>(), - 40usize, - concat!("Size of: ", stringify!(_Mecab)) - ); - assert_eq!( - ::std::mem::align_of::<_Mecab>(), - 8usize, - concat!("Alignment of ", stringify!(_Mecab)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).feature) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_Mecab), - "::", - stringify!(feature) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_Mecab), - "::", - stringify!(size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).model) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_Mecab), - "::", - stringify!(model) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tagger) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_Mecab), - "::", - stringify!(tagger) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lattice) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_Mecab), - "::", - stringify!(lattice) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _Mecab"][::std::mem::size_of::<_Mecab>() - 40usize]; + ["Alignment of _Mecab"][::std::mem::align_of::<_Mecab>() - 8usize]; + [ + "Offset of field: _Mecab::feature", + ][::std::mem::offset_of!(_Mecab, feature) - 0usize]; + ["Offset of field: _Mecab::size"][::std::mem::offset_of!(_Mecab, size) - 8usize]; + ["Offset of field: _Mecab::model"][::std::mem::offset_of!(_Mecab, model) - 16usize]; + [ + "Offset of field: _Mecab::tagger", + ][::std::mem::offset_of!(_Mecab, tagger) - 24usize]; + [ + "Offset of field: _Mecab::lattice", + ][::std::mem::offset_of!(_Mecab, lattice) - 32usize]; +}; pub type Mecab = _Mecab; extern "C" { pub fn Mecab_initialize(m: *mut Mecab) -> ::std::os::raw::c_int; @@ -1818,181 +1272,55 @@ pub struct _NJDNode { pub prev: *mut _NJDNode, pub next: *mut _NJDNode, } -#[test] -fn bindgen_test_layout__NJDNode() { - const UNINIT: ::std::mem::MaybeUninit<_NJDNode> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_NJDNode>(), - 120usize, - concat!("Size of: ", stringify!(_NJDNode)) - ); - assert_eq!( - ::std::mem::align_of::<_NJDNode>(), - 8usize, - concat!("Alignment of ", stringify!(_NJDNode)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).string) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(string) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pos) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(pos) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pos_group1) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(pos_group1) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pos_group2) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(pos_group2) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pos_group3) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(pos_group3) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ctype) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(ctype) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cform) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(cform) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).orig) as usize - ptr as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(orig) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).read) as usize - ptr as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(read) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pron) as usize - ptr as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(pron) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).acc) as usize - ptr as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(acc) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mora_size) as usize - ptr as usize }, - 84usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(mora_size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).chain_rule) as usize - ptr as usize }, - 88usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(chain_rule) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).chain_flag) as usize - ptr as usize }, - 96usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(chain_flag) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize }, - 104usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(prev) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 112usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(next) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _NJDNode"][::std::mem::size_of::<_NJDNode>() - 120usize]; + ["Alignment of _NJDNode"][::std::mem::align_of::<_NJDNode>() - 8usize]; + [ + "Offset of field: _NJDNode::string", + ][::std::mem::offset_of!(_NJDNode, string) - 0usize]; + ["Offset of field: _NJDNode::pos"][::std::mem::offset_of!(_NJDNode, pos) - 8usize]; + [ + "Offset of field: _NJDNode::pos_group1", + ][::std::mem::offset_of!(_NJDNode, pos_group1) - 16usize]; + [ + "Offset of field: _NJDNode::pos_group2", + ][::std::mem::offset_of!(_NJDNode, pos_group2) - 24usize]; + [ + "Offset of field: _NJDNode::pos_group3", + ][::std::mem::offset_of!(_NJDNode, pos_group3) - 32usize]; + [ + "Offset of field: _NJDNode::ctype", + ][::std::mem::offset_of!(_NJDNode, ctype) - 40usize]; + [ + "Offset of field: _NJDNode::cform", + ][::std::mem::offset_of!(_NJDNode, cform) - 48usize]; + [ + "Offset of field: _NJDNode::orig", + ][::std::mem::offset_of!(_NJDNode, orig) - 56usize]; + [ + "Offset of field: _NJDNode::read", + ][::std::mem::offset_of!(_NJDNode, read) - 64usize]; + [ + "Offset of field: _NJDNode::pron", + ][::std::mem::offset_of!(_NJDNode, pron) - 72usize]; + ["Offset of field: _NJDNode::acc"][::std::mem::offset_of!(_NJDNode, acc) - 80usize]; + [ + "Offset of field: _NJDNode::mora_size", + ][::std::mem::offset_of!(_NJDNode, mora_size) - 84usize]; + [ + "Offset of field: _NJDNode::chain_rule", + ][::std::mem::offset_of!(_NJDNode, chain_rule) - 88usize]; + [ + "Offset of field: _NJDNode::chain_flag", + ][::std::mem::offset_of!(_NJDNode, chain_flag) - 96usize]; + [ + "Offset of field: _NJDNode::prev", + ][::std::mem::offset_of!(_NJDNode, prev) - 104usize]; + [ + "Offset of field: _NJDNode::next", + ][::std::mem::offset_of!(_NJDNode, next) - 112usize]; +}; pub type NJDNode = _NJDNode; extern "C" { pub fn NJDNode_initialize(node: *mut NJDNode); @@ -2004,13 +1332,22 @@ extern "C" { pub fn NJDNode_set_pos(node: *mut NJDNode, str_: *const ::std::os::raw::c_char); } extern "C" { - pub fn NJDNode_set_pos_group1(node: *mut NJDNode, str_: *const ::std::os::raw::c_char); + pub fn NJDNode_set_pos_group1( + node: *mut NJDNode, + str_: *const ::std::os::raw::c_char, + ); } extern "C" { - pub fn NJDNode_set_pos_group2(node: *mut NJDNode, str_: *const ::std::os::raw::c_char); + pub fn NJDNode_set_pos_group2( + node: *mut NJDNode, + str_: *const ::std::os::raw::c_char, + ); } extern "C" { - pub fn NJDNode_set_pos_group3(node: *mut NJDNode, str_: *const ::std::os::raw::c_char); + pub fn NJDNode_set_pos_group3( + node: *mut NJDNode, + str_: *const ::std::os::raw::c_char, + ); } extern "C" { pub fn NJDNode_set_ctype(node: *mut NJDNode, str_: *const ::std::os::raw::c_char); @@ -2034,7 +1371,10 @@ extern "C" { pub fn NJDNode_set_mora_size(node: *mut NJDNode, size: ::std::os::raw::c_int); } extern "C" { - pub fn NJDNode_set_chain_rule(node: *mut NJDNode, str_: *const ::std::os::raw::c_char); + pub fn NJDNode_set_chain_rule( + node: *mut NJDNode, + str_: *const ::std::os::raw::c_char, + ); } extern "C" { pub fn NJDNode_set_chain_flag(node: *mut NJDNode, flag: ::std::os::raw::c_int); @@ -2134,41 +1474,13 @@ pub struct _NJD { pub head: *mut NJDNode, pub tail: *mut NJDNode, } -#[test] -fn bindgen_test_layout__NJD() { - const UNINIT: ::std::mem::MaybeUninit<_NJD> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_NJD>(), - 16usize, - concat!("Size of: ", stringify!(_NJD)) - ); - assert_eq!( - ::std::mem::align_of::<_NJD>(), - 8usize, - concat!("Alignment of ", stringify!(_NJD)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).head) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_NJD), - "::", - stringify!(head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tail) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_NJD), - "::", - stringify!(tail) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _NJD"][::std::mem::size_of::<_NJD>() - 16usize]; + ["Alignment of _NJD"][::std::mem::align_of::<_NJD>() - 8usize]; + ["Offset of field: _NJD::head"][::std::mem::offset_of!(_NJD, head) - 0usize]; + ["Offset of field: _NJD::tail"][::std::mem::offset_of!(_NJD, tail) - 8usize]; +}; pub type NJD = _NJD; extern "C" { pub fn NJD_initialize(njd: *mut NJD); @@ -2218,62 +1530,27 @@ pub struct _JPCommonLabelPhoneme { pub next: *mut _JPCommonLabelPhoneme, pub up: *mut _JPCommonLabelMora, } -#[test] -fn bindgen_test_layout__JPCommonLabelPhoneme() { - const UNINIT: ::std::mem::MaybeUninit<_JPCommonLabelPhoneme> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_JPCommonLabelPhoneme>(), - 32usize, - concat!("Size of: ", stringify!(_JPCommonLabelPhoneme)) - ); - assert_eq!( - ::std::mem::align_of::<_JPCommonLabelPhoneme>(), - 8usize, - concat!("Alignment of ", stringify!(_JPCommonLabelPhoneme)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).phoneme) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelPhoneme), - "::", - stringify!(phoneme) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelPhoneme), - "::", - stringify!(prev) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelPhoneme), - "::", - stringify!(next) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).up) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelPhoneme), - "::", - stringify!(up) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + [ + "Size of _JPCommonLabelPhoneme", + ][::std::mem::size_of::<_JPCommonLabelPhoneme>() - 32usize]; + [ + "Alignment of _JPCommonLabelPhoneme", + ][::std::mem::align_of::<_JPCommonLabelPhoneme>() - 8usize]; + [ + "Offset of field: _JPCommonLabelPhoneme::phoneme", + ][::std::mem::offset_of!(_JPCommonLabelPhoneme, phoneme) - 0usize]; + [ + "Offset of field: _JPCommonLabelPhoneme::prev", + ][::std::mem::offset_of!(_JPCommonLabelPhoneme, prev) - 8usize]; + [ + "Offset of field: _JPCommonLabelPhoneme::next", + ][::std::mem::offset_of!(_JPCommonLabelPhoneme, next) - 16usize]; + [ + "Offset of field: _JPCommonLabelPhoneme::up", + ][::std::mem::offset_of!(_JPCommonLabelPhoneme, up) - 24usize]; +}; pub type JPCommonLabelPhoneme = _JPCommonLabelPhoneme; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -2285,81 +1562,33 @@ pub struct _JPCommonLabelMora { pub next: *mut _JPCommonLabelMora, pub up: *mut _JPCommonLabelWord, } -#[test] -fn bindgen_test_layout__JPCommonLabelMora() { - const UNINIT: ::std::mem::MaybeUninit<_JPCommonLabelMora> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_JPCommonLabelMora>(), - 48usize, - concat!("Size of: ", stringify!(_JPCommonLabelMora)) - ); - assert_eq!( - ::std::mem::align_of::<_JPCommonLabelMora>(), - 8usize, - concat!("Alignment of ", stringify!(_JPCommonLabelMora)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mora) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelMora), - "::", - stringify!(mora) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).head) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelMora), - "::", - stringify!(head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tail) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelMora), - "::", - stringify!(tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelMora), - "::", - stringify!(prev) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelMora), - "::", - stringify!(next) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).up) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelMora), - "::", - stringify!(up) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + [ + "Size of _JPCommonLabelMora", + ][::std::mem::size_of::<_JPCommonLabelMora>() - 48usize]; + [ + "Alignment of _JPCommonLabelMora", + ][::std::mem::align_of::<_JPCommonLabelMora>() - 8usize]; + [ + "Offset of field: _JPCommonLabelMora::mora", + ][::std::mem::offset_of!(_JPCommonLabelMora, mora) - 0usize]; + [ + "Offset of field: _JPCommonLabelMora::head", + ][::std::mem::offset_of!(_JPCommonLabelMora, head) - 8usize]; + [ + "Offset of field: _JPCommonLabelMora::tail", + ][::std::mem::offset_of!(_JPCommonLabelMora, tail) - 16usize]; + [ + "Offset of field: _JPCommonLabelMora::prev", + ][::std::mem::offset_of!(_JPCommonLabelMora, prev) - 24usize]; + [ + "Offset of field: _JPCommonLabelMora::next", + ][::std::mem::offset_of!(_JPCommonLabelMora, next) - 32usize]; + [ + "Offset of field: _JPCommonLabelMora::up", + ][::std::mem::offset_of!(_JPCommonLabelMora, up) - 40usize]; +}; pub type JPCommonLabelMora = _JPCommonLabelMora; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -2374,111 +1603,42 @@ pub struct _JPCommonLabelWord { pub next: *mut _JPCommonLabelWord, pub up: *mut _JPCommonLabelAccentPhrase, } -#[test] -fn bindgen_test_layout__JPCommonLabelWord() { - const UNINIT: ::std::mem::MaybeUninit<_JPCommonLabelWord> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_JPCommonLabelWord>(), - 72usize, - concat!("Size of: ", stringify!(_JPCommonLabelWord)) - ); - assert_eq!( - ::std::mem::align_of::<_JPCommonLabelWord>(), - 8usize, - concat!("Alignment of ", stringify!(_JPCommonLabelWord)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pron) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(pron) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pos) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(pos) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ctype) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(ctype) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cform) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(cform) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).head) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tail) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(prev) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(next) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).up) as usize - ptr as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(up) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + [ + "Size of _JPCommonLabelWord", + ][::std::mem::size_of::<_JPCommonLabelWord>() - 72usize]; + [ + "Alignment of _JPCommonLabelWord", + ][::std::mem::align_of::<_JPCommonLabelWord>() - 8usize]; + [ + "Offset of field: _JPCommonLabelWord::pron", + ][::std::mem::offset_of!(_JPCommonLabelWord, pron) - 0usize]; + [ + "Offset of field: _JPCommonLabelWord::pos", + ][::std::mem::offset_of!(_JPCommonLabelWord, pos) - 8usize]; + [ + "Offset of field: _JPCommonLabelWord::ctype", + ][::std::mem::offset_of!(_JPCommonLabelWord, ctype) - 16usize]; + [ + "Offset of field: _JPCommonLabelWord::cform", + ][::std::mem::offset_of!(_JPCommonLabelWord, cform) - 24usize]; + [ + "Offset of field: _JPCommonLabelWord::head", + ][::std::mem::offset_of!(_JPCommonLabelWord, head) - 32usize]; + [ + "Offset of field: _JPCommonLabelWord::tail", + ][::std::mem::offset_of!(_JPCommonLabelWord, tail) - 40usize]; + [ + "Offset of field: _JPCommonLabelWord::prev", + ][::std::mem::offset_of!(_JPCommonLabelWord, prev) - 48usize]; + [ + "Offset of field: _JPCommonLabelWord::next", + ][::std::mem::offset_of!(_JPCommonLabelWord, next) - 56usize]; + [ + "Offset of field: _JPCommonLabelWord::up", + ][::std::mem::offset_of!(_JPCommonLabelWord, up) - 64usize]; +}; pub type JPCommonLabelWord = _JPCommonLabelWord; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -2491,92 +1651,36 @@ pub struct _JPCommonLabelAccentPhrase { pub next: *mut _JPCommonLabelAccentPhrase, pub up: *mut _JPCommonLabelBreathGroup, } -#[test] -fn bindgen_test_layout__JPCommonLabelAccentPhrase() { - const UNINIT: ::std::mem::MaybeUninit<_JPCommonLabelAccentPhrase> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_JPCommonLabelAccentPhrase>(), - 56usize, - concat!("Size of: ", stringify!(_JPCommonLabelAccentPhrase)) - ); - assert_eq!( - ::std::mem::align_of::<_JPCommonLabelAccentPhrase>(), - 8usize, - concat!("Alignment of ", stringify!(_JPCommonLabelAccentPhrase)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).accent) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelAccentPhrase), - "::", - stringify!(accent) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).emotion) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelAccentPhrase), - "::", - stringify!(emotion) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).head) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelAccentPhrase), - "::", - stringify!(head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tail) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelAccentPhrase), - "::", - stringify!(tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelAccentPhrase), - "::", - stringify!(prev) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelAccentPhrase), - "::", - stringify!(next) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).up) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelAccentPhrase), - "::", - stringify!(up) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + [ + "Size of _JPCommonLabelAccentPhrase", + ][::std::mem::size_of::<_JPCommonLabelAccentPhrase>() - 56usize]; + [ + "Alignment of _JPCommonLabelAccentPhrase", + ][::std::mem::align_of::<_JPCommonLabelAccentPhrase>() - 8usize]; + [ + "Offset of field: _JPCommonLabelAccentPhrase::accent", + ][::std::mem::offset_of!(_JPCommonLabelAccentPhrase, accent) - 0usize]; + [ + "Offset of field: _JPCommonLabelAccentPhrase::emotion", + ][::std::mem::offset_of!(_JPCommonLabelAccentPhrase, emotion) - 8usize]; + [ + "Offset of field: _JPCommonLabelAccentPhrase::head", + ][::std::mem::offset_of!(_JPCommonLabelAccentPhrase, head) - 16usize]; + [ + "Offset of field: _JPCommonLabelAccentPhrase::tail", + ][::std::mem::offset_of!(_JPCommonLabelAccentPhrase, tail) - 24usize]; + [ + "Offset of field: _JPCommonLabelAccentPhrase::prev", + ][::std::mem::offset_of!(_JPCommonLabelAccentPhrase, prev) - 32usize]; + [ + "Offset of field: _JPCommonLabelAccentPhrase::next", + ][::std::mem::offset_of!(_JPCommonLabelAccentPhrase, next) - 40usize]; + [ + "Offset of field: _JPCommonLabelAccentPhrase::up", + ][::std::mem::offset_of!(_JPCommonLabelAccentPhrase, up) - 48usize]; +}; pub type JPCommonLabelAccentPhrase = _JPCommonLabelAccentPhrase; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -2586,62 +1690,27 @@ pub struct _JPCommonLabelBreathGroup { pub prev: *mut _JPCommonLabelBreathGroup, pub next: *mut _JPCommonLabelBreathGroup, } -#[test] -fn bindgen_test_layout__JPCommonLabelBreathGroup() { - const UNINIT: ::std::mem::MaybeUninit<_JPCommonLabelBreathGroup> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_JPCommonLabelBreathGroup>(), - 32usize, - concat!("Size of: ", stringify!(_JPCommonLabelBreathGroup)) - ); - assert_eq!( - ::std::mem::align_of::<_JPCommonLabelBreathGroup>(), - 8usize, - concat!("Alignment of ", stringify!(_JPCommonLabelBreathGroup)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).head) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelBreathGroup), - "::", - stringify!(head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tail) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelBreathGroup), - "::", - stringify!(tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelBreathGroup), - "::", - stringify!(prev) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelBreathGroup), - "::", - stringify!(next) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + [ + "Size of _JPCommonLabelBreathGroup", + ][::std::mem::size_of::<_JPCommonLabelBreathGroup>() - 32usize]; + [ + "Alignment of _JPCommonLabelBreathGroup", + ][::std::mem::align_of::<_JPCommonLabelBreathGroup>() - 8usize]; + [ + "Offset of field: _JPCommonLabelBreathGroup::head", + ][::std::mem::offset_of!(_JPCommonLabelBreathGroup, head) - 0usize]; + [ + "Offset of field: _JPCommonLabelBreathGroup::tail", + ][::std::mem::offset_of!(_JPCommonLabelBreathGroup, tail) - 8usize]; + [ + "Offset of field: _JPCommonLabelBreathGroup::prev", + ][::std::mem::offset_of!(_JPCommonLabelBreathGroup, prev) - 16usize]; + [ + "Offset of field: _JPCommonLabelBreathGroup::next", + ][::std::mem::offset_of!(_JPCommonLabelBreathGroup, next) - 24usize]; +}; pub type JPCommonLabelBreathGroup = _JPCommonLabelBreathGroup; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -2660,151 +1729,50 @@ pub struct _JPCommonLabel { pub phoneme_tail: *mut JPCommonLabelPhoneme, pub short_pause_flag: ::std::os::raw::c_int, } -#[test] -fn bindgen_test_layout__JPCommonLabel() { - const UNINIT: ::std::mem::MaybeUninit<_JPCommonLabel> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_JPCommonLabel>(), - 104usize, - concat!("Size of: ", stringify!(_JPCommonLabel)) - ); - assert_eq!( - ::std::mem::align_of::<_JPCommonLabel>(), - 8usize, - concat!("Alignment of ", stringify!(_JPCommonLabel)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).feature) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(feature) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).breath_head) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(breath_head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).breath_tail) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(breath_tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).accent_head) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(accent_head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).accent_tail) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(accent_tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).word_head) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(word_head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).word_tail) as usize - ptr as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(word_tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mora_head) as usize - ptr as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(mora_head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mora_tail) as usize - ptr as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(mora_tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).phoneme_head) as usize - ptr as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(phoneme_head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).phoneme_tail) as usize - ptr as usize }, - 88usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(phoneme_tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).short_pause_flag) as usize - ptr as usize }, - 96usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(short_pause_flag) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _JPCommonLabel"][::std::mem::size_of::<_JPCommonLabel>() - 104usize]; + ["Alignment of _JPCommonLabel"][::std::mem::align_of::<_JPCommonLabel>() - 8usize]; + [ + "Offset of field: _JPCommonLabel::size", + ][::std::mem::offset_of!(_JPCommonLabel, size) - 0usize]; + [ + "Offset of field: _JPCommonLabel::feature", + ][::std::mem::offset_of!(_JPCommonLabel, feature) - 8usize]; + [ + "Offset of field: _JPCommonLabel::breath_head", + ][::std::mem::offset_of!(_JPCommonLabel, breath_head) - 16usize]; + [ + "Offset of field: _JPCommonLabel::breath_tail", + ][::std::mem::offset_of!(_JPCommonLabel, breath_tail) - 24usize]; + [ + "Offset of field: _JPCommonLabel::accent_head", + ][::std::mem::offset_of!(_JPCommonLabel, accent_head) - 32usize]; + [ + "Offset of field: _JPCommonLabel::accent_tail", + ][::std::mem::offset_of!(_JPCommonLabel, accent_tail) - 40usize]; + [ + "Offset of field: _JPCommonLabel::word_head", + ][::std::mem::offset_of!(_JPCommonLabel, word_head) - 48usize]; + [ + "Offset of field: _JPCommonLabel::word_tail", + ][::std::mem::offset_of!(_JPCommonLabel, word_tail) - 56usize]; + [ + "Offset of field: _JPCommonLabel::mora_head", + ][::std::mem::offset_of!(_JPCommonLabel, mora_head) - 64usize]; + [ + "Offset of field: _JPCommonLabel::mora_tail", + ][::std::mem::offset_of!(_JPCommonLabel, mora_tail) - 72usize]; + [ + "Offset of field: _JPCommonLabel::phoneme_head", + ][::std::mem::offset_of!(_JPCommonLabel, phoneme_head) - 80usize]; + [ + "Offset of field: _JPCommonLabel::phoneme_tail", + ][::std::mem::offset_of!(_JPCommonLabel, phoneme_tail) - 88usize]; + [ + "Offset of field: _JPCommonLabel::short_pause_flag", + ][::std::mem::offset_of!(_JPCommonLabel, short_pause_flag) - 96usize]; +}; pub type JPCommonLabel = _JPCommonLabel; extern "C" { pub fn JPCommonLabel_initialize(label: *mut JPCommonLabel); @@ -2827,8 +1795,9 @@ extern "C" { pub fn JPCommonLabel_get_size(label: *mut JPCommonLabel) -> ::std::os::raw::c_int; } extern "C" { - pub fn JPCommonLabel_get_feature(label: *mut JPCommonLabel) - -> *mut *mut ::std::os::raw::c_char; + pub fn JPCommonLabel_get_feature( + label: *mut JPCommonLabel, + ) -> *mut *mut ::std::os::raw::c_char; } extern "C" { pub fn JPCommonLabel_print(label: *mut JPCommonLabel); @@ -2851,134 +1820,91 @@ pub struct _JPCommonNode { pub prev: *mut _JPCommonNode, pub next: *mut _JPCommonNode, } -#[test] -fn bindgen_test_layout__JPCommonNode() { - const UNINIT: ::std::mem::MaybeUninit<_JPCommonNode> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_JPCommonNode>(), - 56usize, - concat!("Size of: ", stringify!(_JPCommonNode)) - ); - assert_eq!( - ::std::mem::align_of::<_JPCommonNode>(), - 8usize, - concat!("Alignment of ", stringify!(_JPCommonNode)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pron) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonNode), - "::", - stringify!(pron) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pos) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonNode), - "::", - stringify!(pos) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ctype) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonNode), - "::", - stringify!(ctype) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cform) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonNode), - "::", - stringify!(cform) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).acc) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonNode), - "::", - stringify!(acc) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).chain_flag) as usize - ptr as usize }, - 36usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonNode), - "::", - stringify!(chain_flag) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonNode), - "::", - stringify!(prev) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonNode), - "::", - stringify!(next) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _JPCommonNode"][::std::mem::size_of::<_JPCommonNode>() - 56usize]; + ["Alignment of _JPCommonNode"][::std::mem::align_of::<_JPCommonNode>() - 8usize]; + [ + "Offset of field: _JPCommonNode::pron", + ][::std::mem::offset_of!(_JPCommonNode, pron) - 0usize]; + [ + "Offset of field: _JPCommonNode::pos", + ][::std::mem::offset_of!(_JPCommonNode, pos) - 8usize]; + [ + "Offset of field: _JPCommonNode::ctype", + ][::std::mem::offset_of!(_JPCommonNode, ctype) - 16usize]; + [ + "Offset of field: _JPCommonNode::cform", + ][::std::mem::offset_of!(_JPCommonNode, cform) - 24usize]; + [ + "Offset of field: _JPCommonNode::acc", + ][::std::mem::offset_of!(_JPCommonNode, acc) - 32usize]; + [ + "Offset of field: _JPCommonNode::chain_flag", + ][::std::mem::offset_of!(_JPCommonNode, chain_flag) - 36usize]; + [ + "Offset of field: _JPCommonNode::prev", + ][::std::mem::offset_of!(_JPCommonNode, prev) - 40usize]; + [ + "Offset of field: _JPCommonNode::next", + ][::std::mem::offset_of!(_JPCommonNode, next) - 48usize]; +}; pub type JPCommonNode = _JPCommonNode; extern "C" { pub fn JPCommonNode_initialize(node: *mut JPCommonNode); } extern "C" { - pub fn JPCommonNode_set_pron(node: *mut JPCommonNode, str_: *const ::std::os::raw::c_char); + pub fn JPCommonNode_set_pron( + node: *mut JPCommonNode, + str_: *const ::std::os::raw::c_char, + ); } extern "C" { - pub fn JPCommonNode_set_pos(node: *mut JPCommonNode, str_: *const ::std::os::raw::c_char); + pub fn JPCommonNode_set_pos( + node: *mut JPCommonNode, + str_: *const ::std::os::raw::c_char, + ); } extern "C" { - pub fn JPCommonNode_set_ctype(node: *mut JPCommonNode, str_: *const ::std::os::raw::c_char); + pub fn JPCommonNode_set_ctype( + node: *mut JPCommonNode, + str_: *const ::std::os::raw::c_char, + ); } extern "C" { - pub fn JPCommonNode_set_cform(node: *mut JPCommonNode, str_: *const ::std::os::raw::c_char); + pub fn JPCommonNode_set_cform( + node: *mut JPCommonNode, + str_: *const ::std::os::raw::c_char, + ); } extern "C" { pub fn JPCommonNode_set_acc(node: *mut JPCommonNode, acc: ::std::os::raw::c_int); } extern "C" { - pub fn JPCommonNode_set_chain_flag(node: *mut JPCommonNode, flag: ::std::os::raw::c_int); + pub fn JPCommonNode_set_chain_flag( + node: *mut JPCommonNode, + flag: ::std::os::raw::c_int, + ); } extern "C" { - pub fn JPCommonNode_get_pron(node: *mut JPCommonNode) -> *const ::std::os::raw::c_char; + pub fn JPCommonNode_get_pron( + node: *mut JPCommonNode, + ) -> *const ::std::os::raw::c_char; } extern "C" { - pub fn JPCommonNode_get_pos(node: *mut JPCommonNode) -> *const ::std::os::raw::c_char; + pub fn JPCommonNode_get_pos( + node: *mut JPCommonNode, + ) -> *const ::std::os::raw::c_char; } extern "C" { - pub fn JPCommonNode_get_ctype(node: *mut JPCommonNode) -> *const ::std::os::raw::c_char; + pub fn JPCommonNode_get_ctype( + node: *mut JPCommonNode, + ) -> *const ::std::os::raw::c_char; } extern "C" { - pub fn JPCommonNode_get_cform(node: *mut JPCommonNode) -> *const ::std::os::raw::c_char; + pub fn JPCommonNode_get_cform( + node: *mut JPCommonNode, + ) -> *const ::std::os::raw::c_char; } extern "C" { pub fn JPCommonNode_get_acc(node: *mut JPCommonNode) -> ::std::os::raw::c_int; @@ -3002,51 +1928,20 @@ pub struct _JPCommon { pub tail: *mut JPCommonNode, pub label: *mut JPCommonLabel, } -#[test] -fn bindgen_test_layout__JPCommon() { - const UNINIT: ::std::mem::MaybeUninit<_JPCommon> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_JPCommon>(), - 24usize, - concat!("Size of: ", stringify!(_JPCommon)) - ); - assert_eq!( - ::std::mem::align_of::<_JPCommon>(), - 8usize, - concat!("Alignment of ", stringify!(_JPCommon)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).head) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_JPCommon), - "::", - stringify!(head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tail) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_JPCommon), - "::", - stringify!(tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).label) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_JPCommon), - "::", - stringify!(label) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _JPCommon"][::std::mem::size_of::<_JPCommon>() - 24usize]; + ["Alignment of _JPCommon"][::std::mem::align_of::<_JPCommon>() - 8usize]; + [ + "Offset of field: _JPCommon::head", + ][::std::mem::offset_of!(_JPCommon, head) - 0usize]; + [ + "Offset of field: _JPCommon::tail", + ][::std::mem::offset_of!(_JPCommon, tail) - 8usize]; + [ + "Offset of field: _JPCommon::label", + ][::std::mem::offset_of!(_JPCommon, label) - 16usize]; +}; pub type JPCommon = _JPCommon; extern "C" { pub fn JPCommon_initialize(jpcommon: *mut JPCommon); @@ -3061,7 +1956,9 @@ extern "C" { pub fn JPCommon_get_label_size(jpcommon: *mut JPCommon) -> ::std::os::raw::c_int; } extern "C" { - pub fn JPCommon_get_label_feature(jpcommon: *mut JPCommon) -> *mut *mut ::std::os::raw::c_char; + pub fn JPCommon_get_label_feature( + jpcommon: *mut JPCommon, + ) -> *mut *mut ::std::os::raw::c_char; } extern "C" { pub fn JPCommon_print(jpcommon: *mut JPCommon); diff --git a/crates/open_jtalk-sys/src/generated/macos/aarch64/bindings.rs b/crates/open_jtalk-sys/src/generated/macos/aarch64/bindings.rs index 8486cb8..ee16937 100644 --- a/crates/open_jtalk-sys/src/generated/macos/aarch64/bindings.rs +++ b/crates/open_jtalk-sys/src/generated/macos/aarch64/bindings.rs @@ -1,542 +1,263 @@ -/* automatically generated by rust-bindgen 0.62.0 */ +/* automatically generated by rust-bindgen 0.70.1 */ pub const TRUE: u32 = 1; pub const FALSE: u32 = 0; -#[doc = " DictionaryInfo structure"] +/// DictionaryInfo structure #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct mecab_dictionary_info_t { - #[doc = " filename of dictionary"] - #[doc = " On Windows, filename is stored in UTF-8 encoding"] + /** filename of dictionary + On Windows, filename is stored in UTF-8 encoding*/ pub filename: *const ::std::os::raw::c_char, - #[doc = " character set of the dictionary. e.g., \"SHIFT-JIS\", \"UTF-8\""] + /// character set of the dictionary. e.g., "SHIFT-JIS", "UTF-8" pub charset: *const ::std::os::raw::c_char, - #[doc = " How many words are registered in this dictionary."] + /// How many words are registered in this dictionary. pub size: ::std::os::raw::c_uint, - #[doc = " dictionary type"] - #[doc = " this value should be MECAB_USR_DIC, MECAB_SYS_DIC, or MECAB_UNK_DIC."] + /** dictionary type + this value should be MECAB_USR_DIC, MECAB_SYS_DIC, or MECAB_UNK_DIC.*/ pub type_: ::std::os::raw::c_int, - #[doc = " left attributes size"] + /// left attributes size pub lsize: ::std::os::raw::c_uint, - #[doc = " right attributes size"] + /// right attributes size pub rsize: ::std::os::raw::c_uint, - #[doc = " version of this dictionary"] + /// version of this dictionary pub version: ::std::os::raw::c_ushort, - #[doc = " pointer to the next dictionary info."] + /// pointer to the next dictionary info. pub next: *mut mecab_dictionary_info_t, } -#[test] -fn bindgen_test_layout_mecab_dictionary_info_t() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 48usize, - concat!("Size of: ", stringify!(mecab_dictionary_info_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(mecab_dictionary_info_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).filename) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(mecab_dictionary_info_t), - "::", - stringify!(filename) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).charset) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(mecab_dictionary_info_t), - "::", - stringify!(charset) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(mecab_dictionary_info_t), - "::", - stringify!(size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(mecab_dictionary_info_t), - "::", - stringify!(type_) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lsize) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(mecab_dictionary_info_t), - "::", - stringify!(lsize) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rsize) as usize - ptr as usize }, - 28usize, - concat!( - "Offset of field: ", - stringify!(mecab_dictionary_info_t), - "::", - stringify!(rsize) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).version) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(mecab_dictionary_info_t), - "::", - stringify!(version) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(mecab_dictionary_info_t), - "::", - stringify!(next) - ) - ); -} -#[doc = " Path structure"] +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + [ + "Size of mecab_dictionary_info_t", + ][::std::mem::size_of::() - 48usize]; + [ + "Alignment of mecab_dictionary_info_t", + ][::std::mem::align_of::() - 8usize]; + [ + "Offset of field: mecab_dictionary_info_t::filename", + ][::std::mem::offset_of!(mecab_dictionary_info_t, filename) - 0usize]; + [ + "Offset of field: mecab_dictionary_info_t::charset", + ][::std::mem::offset_of!(mecab_dictionary_info_t, charset) - 8usize]; + [ + "Offset of field: mecab_dictionary_info_t::size", + ][::std::mem::offset_of!(mecab_dictionary_info_t, size) - 16usize]; + [ + "Offset of field: mecab_dictionary_info_t::type_", + ][::std::mem::offset_of!(mecab_dictionary_info_t, type_) - 20usize]; + [ + "Offset of field: mecab_dictionary_info_t::lsize", + ][::std::mem::offset_of!(mecab_dictionary_info_t, lsize) - 24usize]; + [ + "Offset of field: mecab_dictionary_info_t::rsize", + ][::std::mem::offset_of!(mecab_dictionary_info_t, rsize) - 28usize]; + [ + "Offset of field: mecab_dictionary_info_t::version", + ][::std::mem::offset_of!(mecab_dictionary_info_t, version) - 32usize]; + [ + "Offset of field: mecab_dictionary_info_t::next", + ][::std::mem::offset_of!(mecab_dictionary_info_t, next) - 40usize]; +}; +/// Path structure #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct mecab_path_t { - #[doc = " pointer to the right node"] + /// pointer to the right node pub rnode: *mut mecab_node_t, - #[doc = " pointer to the next right path"] + /// pointer to the next right path pub rnext: *mut mecab_path_t, - #[doc = " pointer to the left node"] + /// pointer to the left node pub lnode: *mut mecab_node_t, - #[doc = " pointer to the next left path"] + /// pointer to the next left path pub lnext: *mut mecab_path_t, - #[doc = " local cost"] + /// local cost pub cost: ::std::os::raw::c_int, - #[doc = " marginal probability"] + /// marginal probability pub prob: f32, } -#[test] -fn bindgen_test_layout_mecab_path_t() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 40usize, - concat!("Size of: ", stringify!(mecab_path_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(mecab_path_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rnode) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(mecab_path_t), - "::", - stringify!(rnode) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rnext) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(mecab_path_t), - "::", - stringify!(rnext) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lnode) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(mecab_path_t), - "::", - stringify!(lnode) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lnext) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(mecab_path_t), - "::", - stringify!(lnext) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cost) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(mecab_path_t), - "::", - stringify!(cost) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prob) as usize - ptr as usize }, - 36usize, - concat!( - "Offset of field: ", - stringify!(mecab_path_t), - "::", - stringify!(prob) - ) - ); -} -#[doc = " Node structure"] +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of mecab_path_t"][::std::mem::size_of::() - 40usize]; + ["Alignment of mecab_path_t"][::std::mem::align_of::() - 8usize]; + [ + "Offset of field: mecab_path_t::rnode", + ][::std::mem::offset_of!(mecab_path_t, rnode) - 0usize]; + [ + "Offset of field: mecab_path_t::rnext", + ][::std::mem::offset_of!(mecab_path_t, rnext) - 8usize]; + [ + "Offset of field: mecab_path_t::lnode", + ][::std::mem::offset_of!(mecab_path_t, lnode) - 16usize]; + [ + "Offset of field: mecab_path_t::lnext", + ][::std::mem::offset_of!(mecab_path_t, lnext) - 24usize]; + [ + "Offset of field: mecab_path_t::cost", + ][::std::mem::offset_of!(mecab_path_t, cost) - 32usize]; + [ + "Offset of field: mecab_path_t::prob", + ][::std::mem::offset_of!(mecab_path_t, prob) - 36usize]; +}; +/// Node structure #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct mecab_node_t { - #[doc = " pointer to the previous node."] + /// pointer to the previous node. pub prev: *mut mecab_node_t, - #[doc = " pointer to the next node."] + /// pointer to the next node. pub next: *mut mecab_node_t, - #[doc = " pointer to the node which ends at the same position."] + /// pointer to the node which ends at the same position. pub enext: *mut mecab_node_t, - #[doc = " pointer to the node which starts at the same position."] + /// pointer to the node which starts at the same position. pub bnext: *mut mecab_node_t, - #[doc = " pointer to the right path."] - #[doc = " this value is NULL if MECAB_ONE_BEST mode."] + /** pointer to the right path. + this value is NULL if MECAB_ONE_BEST mode.*/ pub rpath: *mut mecab_path_t, - #[doc = " pointer to the right path."] - #[doc = " this value is NULL if MECAB_ONE_BEST mode."] + /** pointer to the right path. + this value is NULL if MECAB_ONE_BEST mode.*/ pub lpath: *mut mecab_path_t, - #[doc = " surface string."] - #[doc = " this value is not 0 terminated."] - #[doc = " You can get the length with length/rlength members."] + /** surface string. + this value is not 0 terminated. + You can get the length with length/rlength members.*/ pub surface: *const ::std::os::raw::c_char, - #[doc = " feature string"] + /// feature string pub feature: *const ::std::os::raw::c_char, - #[doc = " unique node id"] + /// unique node id pub id: ::std::os::raw::c_uint, - #[doc = " length of the surface form."] + /// length of the surface form. pub length: ::std::os::raw::c_ushort, - #[doc = " length of the surface form including white space before the morph."] + /// length of the surface form including white space before the morph. pub rlength: ::std::os::raw::c_ushort, - #[doc = " right attribute id"] + /// right attribute id pub rcAttr: ::std::os::raw::c_ushort, - #[doc = " left attribute id"] + /// left attribute id pub lcAttr: ::std::os::raw::c_ushort, - #[doc = " unique part of speech id. This value is defined in \"pos.def\" file."] + /// unique part of speech id. This value is defined in "pos.def" file. pub posid: ::std::os::raw::c_ushort, - #[doc = " character type"] + /// character type pub char_type: ::std::os::raw::c_uchar, - #[doc = " status of this model."] - #[doc = " This value is MECAB_NOR_NODE, MECAB_UNK_NODE, MECAB_BOS_NODE, MECAB_EOS_NODE, or MECAB_EON_NODE."] + /** status of this model. + This value is MECAB_NOR_NODE, MECAB_UNK_NODE, MECAB_BOS_NODE, MECAB_EOS_NODE, or MECAB_EON_NODE.*/ pub stat: ::std::os::raw::c_uchar, - #[doc = " set 1 if this node is best node."] + /// set 1 if this node is best node. pub isbest: ::std::os::raw::c_uchar, - #[doc = " forward accumulative log summation."] - #[doc = " This value is only available when MECAB_MARGINAL_PROB is passed."] + /** forward accumulative log summation. + This value is only available when MECAB_MARGINAL_PROB is passed.*/ pub alpha: f32, - #[doc = " backward accumulative log summation."] - #[doc = " This value is only available when MECAB_MARGINAL_PROB is passed."] + /** backward accumulative log summation. + This value is only available when MECAB_MARGINAL_PROB is passed.*/ pub beta: f32, - #[doc = " marginal probability."] - #[doc = " This value is only available when MECAB_MARGINAL_PROB is passed."] + /** marginal probability. + This value is only available when MECAB_MARGINAL_PROB is passed.*/ pub prob: f32, - #[doc = " word cost."] + /// word cost. pub wcost: ::std::os::raw::c_short, - #[doc = " best accumulative cost from bos node to this node."] + /// best accumulative cost from bos node to this node. pub cost: ::std::os::raw::c_long, } -#[test] -fn bindgen_test_layout_mecab_node_t() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 112usize, - concat!("Size of: ", stringify!(mecab_node_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(mecab_node_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(prev) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(next) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).enext) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(enext) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).bnext) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(bnext) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rpath) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(rpath) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lpath) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(lpath) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).surface) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(surface) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).feature) as usize - ptr as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(feature) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).id) as usize - ptr as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(id) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).length) as usize - ptr as usize }, - 68usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(length) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rlength) as usize - ptr as usize }, - 70usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(rlength) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rcAttr) as usize - ptr as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(rcAttr) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lcAttr) as usize - ptr as usize }, - 74usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(lcAttr) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).posid) as usize - ptr as usize }, - 76usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(posid) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).char_type) as usize - ptr as usize }, - 78usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(char_type) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).stat) as usize - ptr as usize }, - 79usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(stat) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).isbest) as usize - ptr as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(isbest) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).alpha) as usize - ptr as usize }, - 84usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(alpha) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).beta) as usize - ptr as usize }, - 88usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(beta) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prob) as usize - ptr as usize }, - 92usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(prob) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).wcost) as usize - ptr as usize }, - 96usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(wcost) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cost) as usize - ptr as usize }, - 104usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(cost) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of mecab_node_t"][::std::mem::size_of::() - 112usize]; + ["Alignment of mecab_node_t"][::std::mem::align_of::() - 8usize]; + [ + "Offset of field: mecab_node_t::prev", + ][::std::mem::offset_of!(mecab_node_t, prev) - 0usize]; + [ + "Offset of field: mecab_node_t::next", + ][::std::mem::offset_of!(mecab_node_t, next) - 8usize]; + [ + "Offset of field: mecab_node_t::enext", + ][::std::mem::offset_of!(mecab_node_t, enext) - 16usize]; + [ + "Offset of field: mecab_node_t::bnext", + ][::std::mem::offset_of!(mecab_node_t, bnext) - 24usize]; + [ + "Offset of field: mecab_node_t::rpath", + ][::std::mem::offset_of!(mecab_node_t, rpath) - 32usize]; + [ + "Offset of field: mecab_node_t::lpath", + ][::std::mem::offset_of!(mecab_node_t, lpath) - 40usize]; + [ + "Offset of field: mecab_node_t::surface", + ][::std::mem::offset_of!(mecab_node_t, surface) - 48usize]; + [ + "Offset of field: mecab_node_t::feature", + ][::std::mem::offset_of!(mecab_node_t, feature) - 56usize]; + [ + "Offset of field: mecab_node_t::id", + ][::std::mem::offset_of!(mecab_node_t, id) - 64usize]; + [ + "Offset of field: mecab_node_t::length", + ][::std::mem::offset_of!(mecab_node_t, length) - 68usize]; + [ + "Offset of field: mecab_node_t::rlength", + ][::std::mem::offset_of!(mecab_node_t, rlength) - 70usize]; + [ + "Offset of field: mecab_node_t::rcAttr", + ][::std::mem::offset_of!(mecab_node_t, rcAttr) - 72usize]; + [ + "Offset of field: mecab_node_t::lcAttr", + ][::std::mem::offset_of!(mecab_node_t, lcAttr) - 74usize]; + [ + "Offset of field: mecab_node_t::posid", + ][::std::mem::offset_of!(mecab_node_t, posid) - 76usize]; + [ + "Offset of field: mecab_node_t::char_type", + ][::std::mem::offset_of!(mecab_node_t, char_type) - 78usize]; + [ + "Offset of field: mecab_node_t::stat", + ][::std::mem::offset_of!(mecab_node_t, stat) - 79usize]; + [ + "Offset of field: mecab_node_t::isbest", + ][::std::mem::offset_of!(mecab_node_t, isbest) - 80usize]; + [ + "Offset of field: mecab_node_t::alpha", + ][::std::mem::offset_of!(mecab_node_t, alpha) - 84usize]; + [ + "Offset of field: mecab_node_t::beta", + ][::std::mem::offset_of!(mecab_node_t, beta) - 88usize]; + [ + "Offset of field: mecab_node_t::prob", + ][::std::mem::offset_of!(mecab_node_t, prob) - 92usize]; + [ + "Offset of field: mecab_node_t::wcost", + ][::std::mem::offset_of!(mecab_node_t, wcost) - 96usize]; + [ + "Offset of field: mecab_node_t::cost", + ][::std::mem::offset_of!(mecab_node_t, cost) - 104usize]; +}; pub const MECAB_NOR_NODE: _bindgen_ty_1 = _bindgen_ty_1::MECAB_NOR_NODE; pub const MECAB_UNK_NODE: _bindgen_ty_1 = _bindgen_ty_1::MECAB_UNK_NODE; pub const MECAB_BOS_NODE: _bindgen_ty_1 = _bindgen_ty_1::MECAB_BOS_NODE; pub const MECAB_EOS_NODE: _bindgen_ty_1 = _bindgen_ty_1::MECAB_EOS_NODE; pub const MECAB_EON_NODE: _bindgen_ty_1 = _bindgen_ty_1::MECAB_EON_NODE; #[repr(u32)] -#[doc = " Parameters for MeCab::Node::stat"] +/// Parameters for MeCab::Node::stat #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum _bindgen_ty_1 { - #[doc = " Normal node defined in the dictionary."] + /// Normal node defined in the dictionary. MECAB_NOR_NODE = 0, - #[doc = " Unknown node not defined in the dictionary."] + /// Unknown node not defined in the dictionary. MECAB_UNK_NODE = 1, - #[doc = " Virtual node representing a beginning of the sentence."] + /// Virtual node representing a beginning of the sentence. MECAB_BOS_NODE = 2, - #[doc = " Virtual node representing a end of the sentence."] + /// Virtual node representing a end of the sentence. MECAB_EOS_NODE = 3, - #[doc = " Virtual node representing a end of the N-best enumeration."] + /// Virtual node representing a end of the N-best enumeration. MECAB_EON_NODE = 4, } pub const MECAB_SYS_DIC: _bindgen_ty_2 = _bindgen_ty_2::MECAB_SYS_DIC; pub const MECAB_USR_DIC: _bindgen_ty_2 = _bindgen_ty_2::MECAB_USR_DIC; pub const MECAB_UNK_DIC: _bindgen_ty_2 = _bindgen_ty_2::MECAB_UNK_DIC; #[repr(u32)] -#[doc = " Parameters for MeCab::DictionaryInfo::type"] +/// Parameters for MeCab::DictionaryInfo::type #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum _bindgen_ty_2 { - #[doc = " This is a system dictionary."] + /// This is a system dictionary. MECAB_SYS_DIC = 0, - #[doc = " This is a user dictionary."] + /// This is a user dictionary. MECAB_USR_DIC = 1, - #[doc = " This is a unknown word dictionary."] + /// This is a unknown word dictionary. MECAB_UNK_DIC = 2, } pub const MECAB_ONE_BEST: _bindgen_ty_3 = _bindgen_ty_3::MECAB_ONE_BEST; @@ -547,43 +268,43 @@ pub const MECAB_ALTERNATIVE: _bindgen_ty_3 = _bindgen_ty_3::MECAB_ALTERNATIVE; pub const MECAB_ALL_MORPHS: _bindgen_ty_3 = _bindgen_ty_3::MECAB_ALL_MORPHS; pub const MECAB_ALLOCATE_SENTENCE: _bindgen_ty_3 = _bindgen_ty_3::MECAB_ALLOCATE_SENTENCE; #[repr(u32)] -#[doc = " Parameters for MeCab::Lattice::request_type"] +/// Parameters for MeCab::Lattice::request_type #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum _bindgen_ty_3 { - #[doc = " One best result is obtained (default mode)"] + /// One best result is obtained (default mode) MECAB_ONE_BEST = 1, - #[doc = " Set this flag if you want to obtain N best results."] + /// Set this flag if you want to obtain N best results. MECAB_NBEST = 2, - #[doc = " Set this flag if you want to enable a partial parsing mode."] - #[doc = " When this flag is set, the input |sentence| needs to be written"] - #[doc = " in partial parsing format."] + /** Set this flag if you want to enable a partial parsing mode. + When this flag is set, the input |sentence| needs to be written + in partial parsing format.*/ MECAB_PARTIAL = 4, - #[doc = " Set this flag if you want to obtain marginal probabilities."] - #[doc = " Marginal probability is set in MeCab::Node::prob."] - #[doc = " The parsing speed will get 3-5 times slower than the default mode."] + /** Set this flag if you want to obtain marginal probabilities. + Marginal probability is set in MeCab::Node::prob. + The parsing speed will get 3-5 times slower than the default mode.*/ MECAB_MARGINAL_PROB = 8, - #[doc = " Set this flag if you want to obtain alternative results."] - #[doc = " Not implemented."] + /** Set this flag if you want to obtain alternative results. + Not implemented.*/ MECAB_ALTERNATIVE = 16, - #[doc = " When this flag is set, the result linked-list (Node::next/prev)"] - #[doc = " traverses all nodes in the lattice."] + /** When this flag is set, the result linked-list (Node::next/prev) + traverses all nodes in the lattice.*/ MECAB_ALL_MORPHS = 32, - #[doc = " When this flag is set, tagger internally copies the body of passed"] - #[doc = " sentence into internal buffer."] + /** When this flag is set, tagger internally copies the body of passed + sentence into internal buffer.*/ MECAB_ALLOCATE_SENTENCE = 64, } pub const MECAB_ANY_BOUNDARY: _bindgen_ty_4 = _bindgen_ty_4::MECAB_ANY_BOUNDARY; pub const MECAB_TOKEN_BOUNDARY: _bindgen_ty_4 = _bindgen_ty_4::MECAB_TOKEN_BOUNDARY; pub const MECAB_INSIDE_TOKEN: _bindgen_ty_4 = _bindgen_ty_4::MECAB_INSIDE_TOKEN; #[repr(u32)] -#[doc = " Parameters for MeCab::Lattice::boundary_constraint_type"] +/// Parameters for MeCab::Lattice::boundary_constraint_type #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum _bindgen_ty_4 { - #[doc = " The token boundary is not specified."] + /// The token boundary is not specified. MECAB_ANY_BOUNDARY = 0, - #[doc = " The position is a strong token boundary."] + /// The position is a strong token boundary. MECAB_TOKEN_BOUNDARY = 1, - #[doc = " The position is not a token boundary."] + /// The position is not a token boundary. MECAB_INSIDE_TOKEN = 2, } pub type __int64_t = ::std::os::raw::c_longlong; @@ -595,41 +316,13 @@ pub struct __sbuf { pub _base: *mut ::std::os::raw::c_uchar, pub _size: ::std::os::raw::c_int, } -#[test] -fn bindgen_test_layout___sbuf() { - const UNINIT: ::std::mem::MaybeUninit<__sbuf> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__sbuf>(), - 16usize, - concat!("Size of: ", stringify!(__sbuf)) - ); - assert_eq!( - ::std::mem::align_of::<__sbuf>(), - 8usize, - concat!("Alignment of ", stringify!(__sbuf)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._base) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__sbuf), - "::", - stringify!(_base) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._size) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(__sbuf), - "::", - stringify!(_size) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __sbuf"][::std::mem::size_of::<__sbuf>() - 16usize]; + ["Alignment of __sbuf"][::std::mem::align_of::<__sbuf>() - 8usize]; + ["Offset of field: __sbuf::_base"][::std::mem::offset_of!(__sbuf, _base) - 0usize]; + ["Offset of field: __sbuf::_size"][::std::mem::offset_of!(__sbuf, _size) - 8usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct __sFILEX { @@ -679,221 +372,57 @@ pub struct __sFILE { pub _blksize: ::std::os::raw::c_int, pub _offset: fpos_t, } -#[test] -fn bindgen_test_layout___sFILE() { - const UNINIT: ::std::mem::MaybeUninit<__sFILE> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__sFILE>(), - 152usize, - concat!("Size of: ", stringify!(__sFILE)) - ); - assert_eq!( - ::std::mem::align_of::<__sFILE>(), - 8usize, - concat!("Alignment of ", stringify!(__sFILE)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._p) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__sFILE), - "::", - stringify!(_p) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._r) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(__sFILE), - "::", - stringify!(_r) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._w) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(__sFILE), - "::", - stringify!(_w) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._flags) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(__sFILE), - "::", - stringify!(_flags) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._file) as usize - ptr as usize }, - 18usize, - concat!( - "Offset of field: ", - stringify!(__sFILE), - "::", - stringify!(_file) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._bf) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(__sFILE), - "::", - stringify!(_bf) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._lbfsize) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(__sFILE), - "::", - stringify!(_lbfsize) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._cookie) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(__sFILE), - "::", - stringify!(_cookie) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._close) as usize - ptr as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(__sFILE), - "::", - stringify!(_close) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._read) as usize - ptr as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(__sFILE), - "::", - stringify!(_read) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._seek) as usize - ptr as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(__sFILE), - "::", - stringify!(_seek) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._write) as usize - ptr as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(__sFILE), - "::", - stringify!(_write) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._ub) as usize - ptr as usize }, - 88usize, - concat!( - "Offset of field: ", - stringify!(__sFILE), - "::", - stringify!(_ub) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._extra) as usize - ptr as usize }, - 104usize, - concat!( - "Offset of field: ", - stringify!(__sFILE), - "::", - stringify!(_extra) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._ur) as usize - ptr as usize }, - 112usize, - concat!( - "Offset of field: ", - stringify!(__sFILE), - "::", - stringify!(_ur) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._ubuf) as usize - ptr as usize }, - 116usize, - concat!( - "Offset of field: ", - stringify!(__sFILE), - "::", - stringify!(_ubuf) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._nbuf) as usize - ptr as usize }, - 119usize, - concat!( - "Offset of field: ", - stringify!(__sFILE), - "::", - stringify!(_nbuf) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._lb) as usize - ptr as usize }, - 120usize, - concat!( - "Offset of field: ", - stringify!(__sFILE), - "::", - stringify!(_lb) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._blksize) as usize - ptr as usize }, - 136usize, - concat!( - "Offset of field: ", - stringify!(__sFILE), - "::", - stringify!(_blksize) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._offset) as usize - ptr as usize }, - 144usize, - concat!( - "Offset of field: ", - stringify!(__sFILE), - "::", - stringify!(_offset) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __sFILE"][::std::mem::size_of::<__sFILE>() - 152usize]; + ["Alignment of __sFILE"][::std::mem::align_of::<__sFILE>() - 8usize]; + ["Offset of field: __sFILE::_p"][::std::mem::offset_of!(__sFILE, _p) - 0usize]; + ["Offset of field: __sFILE::_r"][::std::mem::offset_of!(__sFILE, _r) - 8usize]; + ["Offset of field: __sFILE::_w"][::std::mem::offset_of!(__sFILE, _w) - 12usize]; + [ + "Offset of field: __sFILE::_flags", + ][::std::mem::offset_of!(__sFILE, _flags) - 16usize]; + [ + "Offset of field: __sFILE::_file", + ][::std::mem::offset_of!(__sFILE, _file) - 18usize]; + ["Offset of field: __sFILE::_bf"][::std::mem::offset_of!(__sFILE, _bf) - 24usize]; + [ + "Offset of field: __sFILE::_lbfsize", + ][::std::mem::offset_of!(__sFILE, _lbfsize) - 40usize]; + [ + "Offset of field: __sFILE::_cookie", + ][::std::mem::offset_of!(__sFILE, _cookie) - 48usize]; + [ + "Offset of field: __sFILE::_close", + ][::std::mem::offset_of!(__sFILE, _close) - 56usize]; + [ + "Offset of field: __sFILE::_read", + ][::std::mem::offset_of!(__sFILE, _read) - 64usize]; + [ + "Offset of field: __sFILE::_seek", + ][::std::mem::offset_of!(__sFILE, _seek) - 72usize]; + [ + "Offset of field: __sFILE::_write", + ][::std::mem::offset_of!(__sFILE, _write) - 80usize]; + ["Offset of field: __sFILE::_ub"][::std::mem::offset_of!(__sFILE, _ub) - 88usize]; + [ + "Offset of field: __sFILE::_extra", + ][::std::mem::offset_of!(__sFILE, _extra) - 104usize]; + ["Offset of field: __sFILE::_ur"][::std::mem::offset_of!(__sFILE, _ur) - 112usize]; + [ + "Offset of field: __sFILE::_ubuf", + ][::std::mem::offset_of!(__sFILE, _ubuf) - 116usize]; + [ + "Offset of field: __sFILE::_nbuf", + ][::std::mem::offset_of!(__sFILE, _nbuf) - 119usize]; + ["Offset of field: __sFILE::_lb"][::std::mem::offset_of!(__sFILE, _lb) - 120usize]; + [ + "Offset of field: __sFILE::_blksize", + ][::std::mem::offset_of!(__sFILE, _blksize) - 136usize]; + [ + "Offset of field: __sFILE::_offset", + ][::std::mem::offset_of!(__sFILE, _offset) - 144usize]; +}; pub type FILE = __sFILE; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -911,76 +440,76 @@ pub struct mecab_lattice_t { _unused: [u8; 0], } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::create(argc, argv)"] + /// C wrapper of MeCab::Tagger::create(argc, argv) pub fn mecab_new( argc: ::std::os::raw::c_int, argv: *mut *mut ::std::os::raw::c_char, ) -> *mut mecab_t; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::create(arg)"] + /// C wrapper of MeCab::Tagger::create(arg) pub fn mecab_new2(arg: *const ::std::os::raw::c_char) -> *mut mecab_t; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::version()"] + /// C wrapper of MeCab::Tagger::version() pub fn mecab_version() -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::getLastError()"] + /// C wrapper of MeCab::getLastError() pub fn mecab_strerror(mecab: *mut mecab_t) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::deleteTagger(tagger)"] + /// C wrapper of MeCab::deleteTagger(tagger) pub fn mecab_destroy(mecab: *mut mecab_t); } extern "C" { - #[doc = " C wrapper of MeCab::Tagger:set_partial()"] + /// C wrapper of MeCab::Tagger:set_partial() pub fn mecab_get_partial(mecab: *mut mecab_t) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::partial()"] + /// C wrapper of MeCab::Tagger::partial() pub fn mecab_set_partial(mecab: *mut mecab_t, partial: ::std::os::raw::c_int); } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::theta()"] + /// C wrapper of MeCab::Tagger::theta() pub fn mecab_get_theta(mecab: *mut mecab_t) -> f32; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::set_theta()"] + /// C wrapper of MeCab::Tagger::set_theta() pub fn mecab_set_theta(mecab: *mut mecab_t, theta: f32); } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::lattice_level()"] + /// C wrapper of MeCab::Tagger::lattice_level() pub fn mecab_get_lattice_level(mecab: *mut mecab_t) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::set_lattice_level()"] + /// C wrapper of MeCab::Tagger::set_lattice_level() pub fn mecab_set_lattice_level(mecab: *mut mecab_t, level: ::std::os::raw::c_int); } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::all_morphs()"] + /// C wrapper of MeCab::Tagger::all_morphs() pub fn mecab_get_all_morphs(mecab: *mut mecab_t) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::set_all_moprhs()"] + /// C wrapper of MeCab::Tagger::set_all_moprhs() pub fn mecab_set_all_morphs(mecab: *mut mecab_t, all_morphs: ::std::os::raw::c_int); } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parse(MeCab::Lattice *lattice)"] + /// C wrapper of MeCab::Tagger::parse(MeCab::Lattice *lattice) pub fn mecab_parse_lattice( mecab: *mut mecab_t, lattice: *mut mecab_lattice_t, ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parse(const char *str)"] + /// C wrapper of MeCab::Tagger::parse(const char *str) pub fn mecab_sparse_tostr( mecab: *mut mecab_t, str_: *const ::std::os::raw::c_char, ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parse(const char *str, size_t len)"] + /// C wrapper of MeCab::Tagger::parse(const char *str, size_t len) pub fn mecab_sparse_tostr2( mecab: *mut mecab_t, str_: *const ::std::os::raw::c_char, @@ -988,7 +517,7 @@ extern "C" { ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parse(const char *str, char *ostr, size_t olen)"] + /// C wrapper of MeCab::Tagger::parse(const char *str, char *ostr, size_t olen) pub fn mecab_sparse_tostr3( mecab: *mut mecab_t, str_: *const ::std::os::raw::c_char, @@ -998,14 +527,14 @@ extern "C" { ) -> *mut ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parseToNode(const char *str)"] + /// C wrapper of MeCab::Tagger::parseToNode(const char *str) pub fn mecab_sparse_tonode( mecab: *mut mecab_t, arg1: *const ::std::os::raw::c_char, ) -> *const mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parseToNode(const char *str, size_t len)"] + /// C wrapper of MeCab::Tagger::parseToNode(const char *str, size_t len) pub fn mecab_sparse_tonode2( mecab: *mut mecab_t, arg1: *const ::std::os::raw::c_char, @@ -1013,7 +542,7 @@ extern "C" { ) -> *const mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parseNBest(size_t N, const char *str)"] + /// C wrapper of MeCab::Tagger::parseNBest(size_t N, const char *str) pub fn mecab_nbest_sparse_tostr( mecab: *mut mecab_t, N: usize, @@ -1021,7 +550,7 @@ extern "C" { ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parseNBest(size_t N, const char *str, size_t len)"] + /// C wrapper of MeCab::Tagger::parseNBest(size_t N, const char *str, size_t len) pub fn mecab_nbest_sparse_tostr2( mecab: *mut mecab_t, N: usize, @@ -1030,7 +559,7 @@ extern "C" { ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parseNBest(size_t N, const char *str, char *ostr, size_t olen)"] + /// C wrapper of MeCab::Tagger::parseNBest(size_t N, const char *str, char *ostr, size_t olen) pub fn mecab_nbest_sparse_tostr3( mecab: *mut mecab_t, N: usize, @@ -1041,14 +570,14 @@ extern "C" { ) -> *mut ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parseNBestInit(const char *str)"] + /// C wrapper of MeCab::Tagger::parseNBestInit(const char *str) pub fn mecab_nbest_init( mecab: *mut mecab_t, str_: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parseNBestInit(const char *str, size_t len)"] + /// C wrapper of MeCab::Tagger::parseNBestInit(const char *str, size_t len) pub fn mecab_nbest_init2( mecab: *mut mecab_t, str_: *const ::std::os::raw::c_char, @@ -1056,11 +585,11 @@ extern "C" { ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::next()"] + /// C wrapper of MeCab::Tagger::next() pub fn mecab_nbest_next_tostr(mecab: *mut mecab_t) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::next(char *ostr, size_t olen)"] + /// C wrapper of MeCab::Tagger::next(char *ostr, size_t olen) pub fn mecab_nbest_next_tostr2( mecab: *mut mecab_t, ostr: *mut ::std::os::raw::c_char, @@ -1068,84 +597,91 @@ extern "C" { ) -> *mut ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::nextNode()"] + /// C wrapper of MeCab::Tagger::nextNode() pub fn mecab_nbest_next_tonode(mecab: *mut mecab_t) -> *const mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::formatNode(const Node *node)"] + /// C wrapper of MeCab::Tagger::formatNode(const Node *node) pub fn mecab_format_node( mecab: *mut mecab_t, node: *const mecab_node_t, ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::dictionary_info()"] + /// C wrapper of MeCab::Tagger::dictionary_info() pub fn mecab_dictionary_info(mecab: *mut mecab_t) -> *const mecab_dictionary_info_t; } extern "C" { - #[doc = " C wrapper of MeCab::createLattice()"] + /// C wrapper of MeCab::createLattice() pub fn mecab_lattice_new() -> *mut mecab_lattice_t; } extern "C" { - #[doc = " C wrapper of MeCab::deleteLattice(lattice)"] + /// C wrapper of MeCab::deleteLattice(lattice) pub fn mecab_lattice_destroy(lattice: *mut mecab_lattice_t); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::clear()"] + /// C wrapper of MeCab::Lattice::clear() pub fn mecab_lattice_clear(lattice: *mut mecab_lattice_t); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::is_available()"] - pub fn mecab_lattice_is_available(lattice: *mut mecab_lattice_t) -> ::std::os::raw::c_int; + /// C wrapper of MeCab::Lattice::is_available() + pub fn mecab_lattice_is_available( + lattice: *mut mecab_lattice_t, + ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::bos_node()"] - pub fn mecab_lattice_get_bos_node(lattice: *mut mecab_lattice_t) -> *mut mecab_node_t; + /// C wrapper of MeCab::Lattice::bos_node() + pub fn mecab_lattice_get_bos_node( + lattice: *mut mecab_lattice_t, + ) -> *mut mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::eos_node()"] - pub fn mecab_lattice_get_eos_node(lattice: *mut mecab_lattice_t) -> *mut mecab_node_t; + /// C wrapper of MeCab::Lattice::eos_node() + pub fn mecab_lattice_get_eos_node( + lattice: *mut mecab_lattice_t, + ) -> *mut mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::begin_nodes()"] + /// C wrapper of MeCab::Lattice::begin_nodes() pub fn mecab_lattice_get_all_begin_nodes( lattice: *mut mecab_lattice_t, ) -> *mut *mut mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::end_nodes()"] - pub fn mecab_lattice_get_all_end_nodes(lattice: *mut mecab_lattice_t) - -> *mut *mut mecab_node_t; + /// C wrapper of MeCab::Lattice::end_nodes() + pub fn mecab_lattice_get_all_end_nodes( + lattice: *mut mecab_lattice_t, + ) -> *mut *mut mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::begin_nodes(pos)"] + /// C wrapper of MeCab::Lattice::begin_nodes(pos) pub fn mecab_lattice_get_begin_nodes( lattice: *mut mecab_lattice_t, pos: usize, ) -> *mut mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::end_nodes(pos)"] + /// C wrapper of MeCab::Lattice::end_nodes(pos) pub fn mecab_lattice_get_end_nodes( lattice: *mut mecab_lattice_t, pos: usize, ) -> *mut mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::sentence()"] + /// C wrapper of MeCab::Lattice::sentence() pub fn mecab_lattice_get_sentence( lattice: *mut mecab_lattice_t, ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::set_sentence(sentence)"] + /// C wrapper of MeCab::Lattice::set_sentence(sentence) pub fn mecab_lattice_set_sentence( lattice: *mut mecab_lattice_t, sentence: *const ::std::os::raw::c_char, ); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::set_sentence(sentence, len)"] + /// C wrapper of MeCab::Lattice::set_sentence(sentence, len) pub fn mecab_lattice_set_sentence2( lattice: *mut mecab_lattice_t, sentence: *const ::std::os::raw::c_char, @@ -1153,71 +689,75 @@ extern "C" { ); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::size()"] + /// C wrapper of MeCab::Lattice::size() pub fn mecab_lattice_get_size(lattice: *mut mecab_lattice_t) -> usize; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::Z()"] + /// C wrapper of MeCab::Lattice::Z() pub fn mecab_lattice_get_z(lattice: *mut mecab_lattice_t) -> f64; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::set_Z()"] + /// C wrapper of MeCab::Lattice::set_Z() pub fn mecab_lattice_set_z(lattice: *mut mecab_lattice_t, Z: f64); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::theta()"] + /// C wrapper of MeCab::Lattice::theta() pub fn mecab_lattice_get_theta(lattice: *mut mecab_lattice_t) -> f64; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::set_theta()"] + /// C wrapper of MeCab::Lattice::set_theta() pub fn mecab_lattice_set_theta(lattice: *mut mecab_lattice_t, theta: f64); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::next()"] + /// C wrapper of MeCab::Lattice::next() pub fn mecab_lattice_next(lattice: *mut mecab_lattice_t) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::request_type()"] - pub fn mecab_lattice_get_request_type(lattice: *mut mecab_lattice_t) -> ::std::os::raw::c_int; + /// C wrapper of MeCab::Lattice::request_type() + pub fn mecab_lattice_get_request_type( + lattice: *mut mecab_lattice_t, + ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::has_request_type()"] + /// C wrapper of MeCab::Lattice::has_request_type() pub fn mecab_lattice_has_request_type( lattice: *mut mecab_lattice_t, request_type: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::set_request_type()"] + /// C wrapper of MeCab::Lattice::set_request_type() pub fn mecab_lattice_set_request_type( lattice: *mut mecab_lattice_t, request_type: ::std::os::raw::c_int, ); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::add_request_type()"] + /// C wrapper of MeCab::Lattice::add_request_type() pub fn mecab_lattice_add_request_type( lattice: *mut mecab_lattice_t, request_type: ::std::os::raw::c_int, ); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::remove_request_type()"] + /// C wrapper of MeCab::Lattice::remove_request_type() pub fn mecab_lattice_remove_request_type( lattice: *mut mecab_lattice_t, request_type: ::std::os::raw::c_int, ); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::newNode();"] + /// C wrapper of MeCab::Lattice::newNode(); pub fn mecab_lattice_new_node(lattice: *mut mecab_lattice_t) -> *mut mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::toString()"] - pub fn mecab_lattice_tostr(lattice: *mut mecab_lattice_t) -> *const ::std::os::raw::c_char; + /// C wrapper of MeCab::Lattice::toString() + pub fn mecab_lattice_tostr( + lattice: *mut mecab_lattice_t, + ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::toString(buf, size)"] + /// C wrapper of MeCab::Lattice::toString(buf, size) pub fn mecab_lattice_tostr2( lattice: *mut mecab_lattice_t, buf: *mut ::std::os::raw::c_char, @@ -1225,14 +765,14 @@ extern "C" { ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::enumNBestAsString(N)"] + /// C wrapper of MeCab::Lattice::enumNBestAsString(N) pub fn mecab_lattice_nbest_tostr( lattice: *mut mecab_lattice_t, N: usize, ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::enumNBestAsString(N, buf, size)"] + /// C wrapper of MeCab::Lattice::enumNBestAsString(N, buf, size) pub fn mecab_lattice_nbest_tostr2( lattice: *mut mecab_lattice_t, N: usize, @@ -1241,25 +781,27 @@ extern "C" { ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::has_constraint()"] - pub fn mecab_lattice_has_constraint(lattice: *mut mecab_lattice_t) -> ::std::os::raw::c_int; + /// C wrapper of MeCab::Lattice::has_constraint() + pub fn mecab_lattice_has_constraint( + lattice: *mut mecab_lattice_t, + ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::boundary_constraint(pos)"] + /// C wrapper of MeCab::Lattice::boundary_constraint(pos) pub fn mecab_lattice_get_boundary_constraint( lattice: *mut mecab_lattice_t, pos: usize, ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::feature_constraint(pos)"] + /// C wrapper of MeCab::Lattice::feature_constraint(pos) pub fn mecab_lattice_get_feature_constraint( lattice: *mut mecab_lattice_t, pos: usize, ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::boundary_constraint(pos, type)"] + /// C wrapper of MeCab::Lattice::boundary_constraint(pos, type) pub fn mecab_lattice_set_boundary_constraint( lattice: *mut mecab_lattice_t, pos: usize, @@ -1267,7 +809,7 @@ extern "C" { ); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::set_feature_constraint(begin_pos, end_pos, feature)"] + /// C wrapper of MeCab::Lattice::set_feature_constraint(begin_pos, end_pos, feature) pub fn mecab_lattice_set_feature_constraint( lattice: *mut mecab_lattice_t, begin_pos: usize, @@ -1276,53 +818,56 @@ extern "C" { ); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::set_result(result);"] + /// C wrapper of MeCab::Lattice::set_result(result); pub fn mecab_lattice_set_result( lattice: *mut mecab_lattice_t, result: *const ::std::os::raw::c_char, ); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::what()"] - pub fn mecab_lattice_strerror(lattice: *mut mecab_lattice_t) -> *const ::std::os::raw::c_char; + /// C wrapper of MeCab::Lattice::what() + pub fn mecab_lattice_strerror( + lattice: *mut mecab_lattice_t, + ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wapper of MeCab::Model::create(argc, argv)"] + /// C wapper of MeCab::Model::create(argc, argv) pub fn mecab_model_new( argc: ::std::os::raw::c_int, argv: *mut *mut ::std::os::raw::c_char, ) -> *mut mecab_model_t; } extern "C" { - #[doc = " C wapper of MeCab::Model::create(arg)"] + /// C wapper of MeCab::Model::create(arg) pub fn mecab_model_new2(arg: *const ::std::os::raw::c_char) -> *mut mecab_model_t; } extern "C" { - #[doc = " C wapper of MeCab::deleteModel(model)"] + /// C wapper of MeCab::deleteModel(model) pub fn mecab_model_destroy(model: *mut mecab_model_t); } extern "C" { - #[doc = " C wapper of MeCab::Model::createTagger()"] + /// C wapper of MeCab::Model::createTagger() pub fn mecab_model_new_tagger(model: *mut mecab_model_t) -> *mut mecab_t; } extern "C" { - #[doc = " C wapper of MeCab::Model::createLattice()"] + /// C wapper of MeCab::Model::createLattice() pub fn mecab_model_new_lattice(model: *mut mecab_model_t) -> *mut mecab_lattice_t; } extern "C" { - #[doc = " C wrapper of MeCab::Model::swap()"] + /// C wrapper of MeCab::Model::swap() pub fn mecab_model_swap( model: *mut mecab_model_t, new_model: *mut mecab_model_t, ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wapper of MeCab::Model::dictionary_info()"] - pub fn mecab_model_dictionary_info(model: *mut mecab_model_t) - -> *const mecab_dictionary_info_t; + /// C wapper of MeCab::Model::dictionary_info() + pub fn mecab_model_dictionary_info( + model: *mut mecab_model_t, + ) -> *const mecab_dictionary_info_t; } extern "C" { - #[doc = " C wrapper of MeCab::Model::transition_cost()"] + /// C wrapper of MeCab::Model::transition_cost() pub fn mecab_model_transition_cost( model: *mut mecab_model_t, rcAttr: ::std::os::raw::c_ushort, @@ -1330,7 +875,7 @@ extern "C" { ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Model::lookup()"] + /// C wrapper of MeCab::Model::lookup() pub fn mecab_model_lookup( model: *mut mecab_model_t, begin: *const ::std::os::raw::c_char, @@ -1374,11 +919,11 @@ extern "C" { argv: *mut *mut ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } -#[doc = " DictionaryInfo structure"] +/// DictionaryInfo structure pub type MeCab_DictionaryInfo = mecab_dictionary_info_t; -#[doc = " Path structure"] +/// Path structure pub type MeCab_Path = mecab_path_t; -#[doc = " Node structure"] +/// Node structure pub type MeCab_Node = mecab_node_t; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -1387,71 +932,55 @@ pub struct MeCab_Allocator { } #[repr(C)] pub struct MeCab_Lattice__bindgen_vtable(::std::os::raw::c_void); -#[doc = " Lattice class"] +/// Lattice class #[repr(C)] #[derive(Debug)] pub struct MeCab_Lattice { pub vtable_: *const MeCab_Lattice__bindgen_vtable, } -#[test] -fn bindgen_test_layout_MeCab_Lattice() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(MeCab_Lattice)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(MeCab_Lattice)) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of MeCab_Lattice"][::std::mem::size_of::() - 8usize]; + ["Alignment of MeCab_Lattice"][::std::mem::align_of::() - 8usize]; +}; extern "C" { - #[doc = " Create new Lattice object"] - #[doc = " @return new Lattice object"] + /** Create new Lattice object + @return new Lattice object*/ #[link_name = "\u{1}__ZN5MeCab7Lattice6createEv"] pub fn MeCab_Lattice_create() -> *mut MeCab_Lattice; } impl MeCab_Lattice { #[inline] pub unsafe fn create() -> *mut MeCab_Lattice { - unsafe { MeCab_Lattice_create() } + MeCab_Lattice_create() } } #[repr(C)] pub struct MeCab_Model__bindgen_vtable(::std::os::raw::c_void); -#[doc = " Model class"] +/// Model class #[repr(C)] #[derive(Debug)] pub struct MeCab_Model { pub vtable_: *const MeCab_Model__bindgen_vtable, } -#[test] -fn bindgen_test_layout_MeCab_Model() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(MeCab_Model)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(MeCab_Model)) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of MeCab_Model"][::std::mem::size_of::() - 8usize]; + ["Alignment of MeCab_Model"][::std::mem::align_of::() - 8usize]; +}; extern "C" { - #[doc = " Return a version string"] - #[doc = " @return version string"] + /** Return a version string + @return version string*/ #[link_name = "\u{1}__ZN5MeCab5Model7versionEv"] pub fn MeCab_Model_version() -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " Factory method to create a new Model with a specified main's argc/argv-style parameters."] - #[doc = " Return NULL if new model cannot be initialized. Use MeCab::getLastError() to obtain the"] - #[doc = " cause of the errors."] - #[doc = " @return new Model object"] - #[doc = " @param argc number of parameters"] - #[doc = " @param argv parameter list"] + /** Factory method to create a new Model with a specified main's argc/argv-style parameters. + Return NULL if new model cannot be initialized. Use MeCab::getLastError() to obtain the + cause of the errors. + @return new Model object + @param argc number of parameters + @param argv parameter list*/ #[link_name = "\u{1}__ZN5MeCab5Model6createEiPPc"] pub fn MeCab_Model_create( argc: ::std::os::raw::c_int, @@ -1459,74 +988,69 @@ extern "C" { ) -> *mut MeCab_Model; } extern "C" { - #[doc = " Factory method to create a new Model with a string parameter representation, i.e.,"] - #[doc = " \"-d /user/local/mecab/dic/ipadic -Ochasen\"."] - #[doc = " Return NULL if new model cannot be initialized. Use MeCab::getLastError() to obtain the"] - #[doc = " cause of the errors."] - #[doc = " @return new Model object"] - #[doc = " @param arg single string representation of the argment."] + /** Factory method to create a new Model with a string parameter representation, i.e., + "-d /user/local/mecab/dic/ipadic -Ochasen". + Return NULL if new model cannot be initialized. Use MeCab::getLastError() to obtain the + cause of the errors. + @return new Model object + @param arg single string representation of the argment.*/ #[link_name = "\u{1}__ZN5MeCab5Model6createEPKc"] pub fn MeCab_Model_create1(arg: *const ::std::os::raw::c_char) -> *mut MeCab_Model; } impl MeCab_Model { #[inline] pub unsafe fn version() -> *const ::std::os::raw::c_char { - unsafe { MeCab_Model_version() } + MeCab_Model_version() } #[inline] pub unsafe fn create( argc: ::std::os::raw::c_int, argv: *mut *mut ::std::os::raw::c_char, ) -> *mut MeCab_Model { - unsafe { MeCab_Model_create(argc, argv) } + MeCab_Model_create(argc, argv) } #[inline] pub unsafe fn create1(arg: *const ::std::os::raw::c_char) -> *mut MeCab_Model { - unsafe { MeCab_Model_create1(arg) } + MeCab_Model_create1(arg) } } #[repr(C)] pub struct MeCab_Tagger__bindgen_vtable(::std::os::raw::c_void); -#[doc = " Tagger class"] +/// Tagger class #[repr(C)] #[derive(Debug)] pub struct MeCab_Tagger { pub vtable_: *const MeCab_Tagger__bindgen_vtable, } -#[test] -fn bindgen_test_layout_MeCab_Tagger() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(MeCab_Tagger)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(MeCab_Tagger)) - ); -} -extern "C" { - #[doc = " Handy static method."] - #[doc = " Return true if lattice is parsed successfully."] - #[doc = " This function is equivalent to"] - #[doc = " {"] - #[doc = " Tagger *tagger = model.createModel();"] - #[doc = " cosnt bool result = tagger->parse(lattice);"] - #[doc = " delete tagger;"] - #[doc = " return result;"] - #[doc = " }"] - #[doc = " @return boolean"] +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of MeCab_Tagger"][::std::mem::size_of::() - 8usize]; + ["Alignment of MeCab_Tagger"][::std::mem::align_of::() - 8usize]; +}; +extern "C" { + /** Handy static method. + Return true if lattice is parsed successfully. + This function is equivalent to + { + Tagger *tagger = model.createModel(); + cosnt bool result = tagger->parse(lattice); + delete tagger; + return result; + } + @return boolean*/ #[link_name = "\u{1}__ZN5MeCab6Tagger5parseERKNS_5ModelEPNS_7LatticeE"] - pub fn MeCab_Tagger_parse(model: *const MeCab_Model, lattice: *mut MeCab_Lattice) -> bool; -} -extern "C" { - #[doc = " Factory method to create a new Tagger with a specified main's argc/argv-style parameters."] - #[doc = " Return NULL if new model cannot be initialized. Use MeCab::getLastError() to obtain the"] - #[doc = " cause of the errors."] - #[doc = " @return new Tagger object"] - #[doc = " @param argc number of parameters"] - #[doc = " @param argv parameter list"] + pub fn MeCab_Tagger_parse( + model: *const MeCab_Model, + lattice: *mut MeCab_Lattice, + ) -> bool; +} +extern "C" { + /** Factory method to create a new Tagger with a specified main's argc/argv-style parameters. + Return NULL if new model cannot be initialized. Use MeCab::getLastError() to obtain the + cause of the errors. + @return new Tagger object + @param argc number of parameters + @param argv parameter list*/ #[link_name = "\u{1}__ZN5MeCab6Tagger6createEiPPc"] pub fn MeCab_Tagger_create( argc: ::std::os::raw::c_int, @@ -1534,49 +1058,49 @@ extern "C" { ) -> *mut MeCab_Tagger; } extern "C" { - #[doc = " Factory method to create a new Tagger with a string parameter representation, i.e.,"] - #[doc = " \"-d /user/local/mecab/dic/ipadic -Ochasen\"."] - #[doc = " Return NULL if new model cannot be initialized. Use MeCab::getLastError() to obtain the"] - #[doc = " cause of the errors."] - #[doc = " @return new Model object"] - #[doc = " @param arg single string representation of the argment."] + /** Factory method to create a new Tagger with a string parameter representation, i.e., + "-d /user/local/mecab/dic/ipadic -Ochasen". + Return NULL if new model cannot be initialized. Use MeCab::getLastError() to obtain the + cause of the errors. + @return new Model object + @param arg single string representation of the argment.*/ #[link_name = "\u{1}__ZN5MeCab6Tagger6createEPKc"] pub fn MeCab_Tagger_create1(arg: *const ::std::os::raw::c_char) -> *mut MeCab_Tagger; } extern "C" { - #[doc = " Return a version string"] - #[doc = " @return version string"] + /** Return a version string + @return version string*/ #[link_name = "\u{1}__ZN5MeCab6Tagger7versionEv"] pub fn MeCab_Tagger_version() -> *const ::std::os::raw::c_char; } impl MeCab_Tagger { #[inline] pub unsafe fn parse(model: *const MeCab_Model, lattice: *mut MeCab_Lattice) -> bool { - unsafe { MeCab_Tagger_parse(model, lattice) } + MeCab_Tagger_parse(model, lattice) } #[inline] pub unsafe fn create( argc: ::std::os::raw::c_int, argv: *mut *mut ::std::os::raw::c_char, ) -> *mut MeCab_Tagger { - unsafe { MeCab_Tagger_create(argc, argv) } + MeCab_Tagger_create(argc, argv) } #[inline] pub unsafe fn create1(arg: *const ::std::os::raw::c_char) -> *mut MeCab_Tagger { - unsafe { MeCab_Tagger_create1(arg) } + MeCab_Tagger_create1(arg) } #[inline] pub unsafe fn version() -> *const ::std::os::raw::c_char { - unsafe { MeCab_Tagger_version() } + MeCab_Tagger_version() } } extern "C" { - #[doc = " Alias of Lattice::create()"] + /// Alias of Lattice::create() #[link_name = "\u{1}__ZN5MeCab13createLatticeEv"] pub fn MeCab_createLattice() -> *mut MeCab_Lattice; } extern "C" { - #[doc = " Alias of Mode::create(argc, argv)"] + /// Alias of Mode::create(argc, argv) #[link_name = "\u{1}__ZN5MeCab11createModelEiPPc"] pub fn MeCab_createModel( argc: ::std::os::raw::c_int, @@ -1584,12 +1108,12 @@ extern "C" { ) -> *mut MeCab_Model; } extern "C" { - #[doc = " Alias of Mode::create(arg)"] + /// Alias of Mode::create(arg) #[link_name = "\u{1}__ZN5MeCab11createModelEPKc"] pub fn MeCab_createModel1(arg: *const ::std::os::raw::c_char) -> *mut MeCab_Model; } extern "C" { - #[doc = " Alias of Tagger::create(argc, argv)"] + /// Alias of Tagger::create(argc, argv) #[link_name = "\u{1}__ZN5MeCab12createTaggerEiPPc"] pub fn MeCab_createTagger( argc: ::std::os::raw::c_int, @@ -1597,44 +1121,44 @@ extern "C" { ) -> *mut MeCab_Tagger; } extern "C" { - #[doc = " Alias of Tagger::create(arg)"] + /// Alias of Tagger::create(arg) #[link_name = "\u{1}__ZN5MeCab12createTaggerEPKc"] pub fn MeCab_createTagger1(arg: *const ::std::os::raw::c_char) -> *mut MeCab_Tagger; } extern "C" { - #[doc = " delete Lattice object."] - #[doc = " This method calles \"delete lattice\"."] - #[doc = " In some environment, e.g., MS-Windows, an object allocated inside a DLL must be deleted in the same DLL too."] - #[doc = " @param lattice lattice object"] + /** delete Lattice object. + This method calles "delete lattice". + In some environment, e.g., MS-Windows, an object allocated inside a DLL must be deleted in the same DLL too. + @param lattice lattice object*/ #[link_name = "\u{1}__ZN5MeCab13deleteLatticeEPNS_7LatticeE"] pub fn MeCab_deleteLattice(lattice: *mut MeCab_Lattice); } extern "C" { - #[doc = " delete Model object."] - #[doc = " This method calles \"delete model\"."] - #[doc = " In some environment, e.g., MS-Windows, an object allocated inside a DLL must be deleted in the same DLL too."] - #[doc = " @param model model object"] + /** delete Model object. + This method calles "delete model". + In some environment, e.g., MS-Windows, an object allocated inside a DLL must be deleted in the same DLL too. + @param model model object*/ #[link_name = "\u{1}__ZN5MeCab11deleteModelEPNS_5ModelE"] pub fn MeCab_deleteModel(model: *mut MeCab_Model); } extern "C" { - #[doc = " delete Tagger object."] - #[doc = " This method calles \"delete tagger\"."] - #[doc = " In some environment, e.g., MS-Windows, an object allocated inside a DLL must be deleted in the same DLL too."] - #[doc = " @param tagger tagger object"] + /** delete Tagger object. + This method calles "delete tagger". + In some environment, e.g., MS-Windows, an object allocated inside a DLL must be deleted in the same DLL too. + @param tagger tagger object*/ #[link_name = "\u{1}__ZN5MeCab12deleteTaggerEPNS_6TaggerE"] pub fn MeCab_deleteTagger(tagger: *mut MeCab_Tagger); } extern "C" { - #[doc = " Return last error string."] - #[doc = " @return error string"] + /** Return last error string. + @return error string*/ #[link_name = "\u{1}__ZN5MeCab12getLastErrorEv"] pub fn MeCab_getLastError() -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " An alias of getLastError."] - #[doc = " It is kept for backward compatibility."] - #[doc = " @return error string"] + /** An alias of getLastError. + It is kept for backward compatibility. + @return error string*/ #[link_name = "\u{1}__ZN5MeCab14getTaggerErrorEv"] pub fn MeCab_getTaggerError() -> *const ::std::os::raw::c_char; } @@ -1647,71 +1171,22 @@ pub struct _Mecab { pub tagger: *mut ::std::os::raw::c_void, pub lattice: *mut ::std::os::raw::c_void, } -#[test] -fn bindgen_test_layout__Mecab() { - const UNINIT: ::std::mem::MaybeUninit<_Mecab> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_Mecab>(), - 40usize, - concat!("Size of: ", stringify!(_Mecab)) - ); - assert_eq!( - ::std::mem::align_of::<_Mecab>(), - 8usize, - concat!("Alignment of ", stringify!(_Mecab)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).feature) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_Mecab), - "::", - stringify!(feature) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_Mecab), - "::", - stringify!(size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).model) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_Mecab), - "::", - stringify!(model) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tagger) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_Mecab), - "::", - stringify!(tagger) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lattice) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_Mecab), - "::", - stringify!(lattice) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _Mecab"][::std::mem::size_of::<_Mecab>() - 40usize]; + ["Alignment of _Mecab"][::std::mem::align_of::<_Mecab>() - 8usize]; + [ + "Offset of field: _Mecab::feature", + ][::std::mem::offset_of!(_Mecab, feature) - 0usize]; + ["Offset of field: _Mecab::size"][::std::mem::offset_of!(_Mecab, size) - 8usize]; + ["Offset of field: _Mecab::model"][::std::mem::offset_of!(_Mecab, model) - 16usize]; + [ + "Offset of field: _Mecab::tagger", + ][::std::mem::offset_of!(_Mecab, tagger) - 24usize]; + [ + "Offset of field: _Mecab::lattice", + ][::std::mem::offset_of!(_Mecab, lattice) - 32usize]; +}; pub type Mecab = _Mecab; extern "C" { pub fn Mecab_initialize(m: *mut Mecab) -> ::std::os::raw::c_int; @@ -1770,181 +1245,55 @@ pub struct _NJDNode { pub prev: *mut _NJDNode, pub next: *mut _NJDNode, } -#[test] -fn bindgen_test_layout__NJDNode() { - const UNINIT: ::std::mem::MaybeUninit<_NJDNode> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_NJDNode>(), - 120usize, - concat!("Size of: ", stringify!(_NJDNode)) - ); - assert_eq!( - ::std::mem::align_of::<_NJDNode>(), - 8usize, - concat!("Alignment of ", stringify!(_NJDNode)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).string) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(string) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pos) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(pos) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pos_group1) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(pos_group1) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pos_group2) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(pos_group2) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pos_group3) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(pos_group3) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ctype) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(ctype) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cform) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(cform) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).orig) as usize - ptr as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(orig) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).read) as usize - ptr as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(read) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pron) as usize - ptr as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(pron) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).acc) as usize - ptr as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(acc) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mora_size) as usize - ptr as usize }, - 84usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(mora_size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).chain_rule) as usize - ptr as usize }, - 88usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(chain_rule) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).chain_flag) as usize - ptr as usize }, - 96usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(chain_flag) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize }, - 104usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(prev) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 112usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(next) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _NJDNode"][::std::mem::size_of::<_NJDNode>() - 120usize]; + ["Alignment of _NJDNode"][::std::mem::align_of::<_NJDNode>() - 8usize]; + [ + "Offset of field: _NJDNode::string", + ][::std::mem::offset_of!(_NJDNode, string) - 0usize]; + ["Offset of field: _NJDNode::pos"][::std::mem::offset_of!(_NJDNode, pos) - 8usize]; + [ + "Offset of field: _NJDNode::pos_group1", + ][::std::mem::offset_of!(_NJDNode, pos_group1) - 16usize]; + [ + "Offset of field: _NJDNode::pos_group2", + ][::std::mem::offset_of!(_NJDNode, pos_group2) - 24usize]; + [ + "Offset of field: _NJDNode::pos_group3", + ][::std::mem::offset_of!(_NJDNode, pos_group3) - 32usize]; + [ + "Offset of field: _NJDNode::ctype", + ][::std::mem::offset_of!(_NJDNode, ctype) - 40usize]; + [ + "Offset of field: _NJDNode::cform", + ][::std::mem::offset_of!(_NJDNode, cform) - 48usize]; + [ + "Offset of field: _NJDNode::orig", + ][::std::mem::offset_of!(_NJDNode, orig) - 56usize]; + [ + "Offset of field: _NJDNode::read", + ][::std::mem::offset_of!(_NJDNode, read) - 64usize]; + [ + "Offset of field: _NJDNode::pron", + ][::std::mem::offset_of!(_NJDNode, pron) - 72usize]; + ["Offset of field: _NJDNode::acc"][::std::mem::offset_of!(_NJDNode, acc) - 80usize]; + [ + "Offset of field: _NJDNode::mora_size", + ][::std::mem::offset_of!(_NJDNode, mora_size) - 84usize]; + [ + "Offset of field: _NJDNode::chain_rule", + ][::std::mem::offset_of!(_NJDNode, chain_rule) - 88usize]; + [ + "Offset of field: _NJDNode::chain_flag", + ][::std::mem::offset_of!(_NJDNode, chain_flag) - 96usize]; + [ + "Offset of field: _NJDNode::prev", + ][::std::mem::offset_of!(_NJDNode, prev) - 104usize]; + [ + "Offset of field: _NJDNode::next", + ][::std::mem::offset_of!(_NJDNode, next) - 112usize]; +}; pub type NJDNode = _NJDNode; extern "C" { pub fn NJDNode_initialize(node: *mut NJDNode); @@ -1956,13 +1305,22 @@ extern "C" { pub fn NJDNode_set_pos(node: *mut NJDNode, str_: *const ::std::os::raw::c_char); } extern "C" { - pub fn NJDNode_set_pos_group1(node: *mut NJDNode, str_: *const ::std::os::raw::c_char); + pub fn NJDNode_set_pos_group1( + node: *mut NJDNode, + str_: *const ::std::os::raw::c_char, + ); } extern "C" { - pub fn NJDNode_set_pos_group2(node: *mut NJDNode, str_: *const ::std::os::raw::c_char); + pub fn NJDNode_set_pos_group2( + node: *mut NJDNode, + str_: *const ::std::os::raw::c_char, + ); } extern "C" { - pub fn NJDNode_set_pos_group3(node: *mut NJDNode, str_: *const ::std::os::raw::c_char); + pub fn NJDNode_set_pos_group3( + node: *mut NJDNode, + str_: *const ::std::os::raw::c_char, + ); } extern "C" { pub fn NJDNode_set_ctype(node: *mut NJDNode, str_: *const ::std::os::raw::c_char); @@ -1986,7 +1344,10 @@ extern "C" { pub fn NJDNode_set_mora_size(node: *mut NJDNode, size: ::std::os::raw::c_int); } extern "C" { - pub fn NJDNode_set_chain_rule(node: *mut NJDNode, str_: *const ::std::os::raw::c_char); + pub fn NJDNode_set_chain_rule( + node: *mut NJDNode, + str_: *const ::std::os::raw::c_char, + ); } extern "C" { pub fn NJDNode_set_chain_flag(node: *mut NJDNode, flag: ::std::os::raw::c_int); @@ -2086,41 +1447,13 @@ pub struct _NJD { pub head: *mut NJDNode, pub tail: *mut NJDNode, } -#[test] -fn bindgen_test_layout__NJD() { - const UNINIT: ::std::mem::MaybeUninit<_NJD> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_NJD>(), - 16usize, - concat!("Size of: ", stringify!(_NJD)) - ); - assert_eq!( - ::std::mem::align_of::<_NJD>(), - 8usize, - concat!("Alignment of ", stringify!(_NJD)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).head) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_NJD), - "::", - stringify!(head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tail) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_NJD), - "::", - stringify!(tail) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _NJD"][::std::mem::size_of::<_NJD>() - 16usize]; + ["Alignment of _NJD"][::std::mem::align_of::<_NJD>() - 8usize]; + ["Offset of field: _NJD::head"][::std::mem::offset_of!(_NJD, head) - 0usize]; + ["Offset of field: _NJD::tail"][::std::mem::offset_of!(_NJD, tail) - 8usize]; +}; pub type NJD = _NJD; extern "C" { pub fn NJD_initialize(njd: *mut NJD); @@ -2170,62 +1503,27 @@ pub struct _JPCommonLabelPhoneme { pub next: *mut _JPCommonLabelPhoneme, pub up: *mut _JPCommonLabelMora, } -#[test] -fn bindgen_test_layout__JPCommonLabelPhoneme() { - const UNINIT: ::std::mem::MaybeUninit<_JPCommonLabelPhoneme> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_JPCommonLabelPhoneme>(), - 32usize, - concat!("Size of: ", stringify!(_JPCommonLabelPhoneme)) - ); - assert_eq!( - ::std::mem::align_of::<_JPCommonLabelPhoneme>(), - 8usize, - concat!("Alignment of ", stringify!(_JPCommonLabelPhoneme)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).phoneme) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelPhoneme), - "::", - stringify!(phoneme) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelPhoneme), - "::", - stringify!(prev) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelPhoneme), - "::", - stringify!(next) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).up) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelPhoneme), - "::", - stringify!(up) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + [ + "Size of _JPCommonLabelPhoneme", + ][::std::mem::size_of::<_JPCommonLabelPhoneme>() - 32usize]; + [ + "Alignment of _JPCommonLabelPhoneme", + ][::std::mem::align_of::<_JPCommonLabelPhoneme>() - 8usize]; + [ + "Offset of field: _JPCommonLabelPhoneme::phoneme", + ][::std::mem::offset_of!(_JPCommonLabelPhoneme, phoneme) - 0usize]; + [ + "Offset of field: _JPCommonLabelPhoneme::prev", + ][::std::mem::offset_of!(_JPCommonLabelPhoneme, prev) - 8usize]; + [ + "Offset of field: _JPCommonLabelPhoneme::next", + ][::std::mem::offset_of!(_JPCommonLabelPhoneme, next) - 16usize]; + [ + "Offset of field: _JPCommonLabelPhoneme::up", + ][::std::mem::offset_of!(_JPCommonLabelPhoneme, up) - 24usize]; +}; pub type JPCommonLabelPhoneme = _JPCommonLabelPhoneme; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -2237,81 +1535,33 @@ pub struct _JPCommonLabelMora { pub next: *mut _JPCommonLabelMora, pub up: *mut _JPCommonLabelWord, } -#[test] -fn bindgen_test_layout__JPCommonLabelMora() { - const UNINIT: ::std::mem::MaybeUninit<_JPCommonLabelMora> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_JPCommonLabelMora>(), - 48usize, - concat!("Size of: ", stringify!(_JPCommonLabelMora)) - ); - assert_eq!( - ::std::mem::align_of::<_JPCommonLabelMora>(), - 8usize, - concat!("Alignment of ", stringify!(_JPCommonLabelMora)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mora) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelMora), - "::", - stringify!(mora) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).head) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelMora), - "::", - stringify!(head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tail) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelMora), - "::", - stringify!(tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelMora), - "::", - stringify!(prev) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelMora), - "::", - stringify!(next) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).up) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelMora), - "::", - stringify!(up) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + [ + "Size of _JPCommonLabelMora", + ][::std::mem::size_of::<_JPCommonLabelMora>() - 48usize]; + [ + "Alignment of _JPCommonLabelMora", + ][::std::mem::align_of::<_JPCommonLabelMora>() - 8usize]; + [ + "Offset of field: _JPCommonLabelMora::mora", + ][::std::mem::offset_of!(_JPCommonLabelMora, mora) - 0usize]; + [ + "Offset of field: _JPCommonLabelMora::head", + ][::std::mem::offset_of!(_JPCommonLabelMora, head) - 8usize]; + [ + "Offset of field: _JPCommonLabelMora::tail", + ][::std::mem::offset_of!(_JPCommonLabelMora, tail) - 16usize]; + [ + "Offset of field: _JPCommonLabelMora::prev", + ][::std::mem::offset_of!(_JPCommonLabelMora, prev) - 24usize]; + [ + "Offset of field: _JPCommonLabelMora::next", + ][::std::mem::offset_of!(_JPCommonLabelMora, next) - 32usize]; + [ + "Offset of field: _JPCommonLabelMora::up", + ][::std::mem::offset_of!(_JPCommonLabelMora, up) - 40usize]; +}; pub type JPCommonLabelMora = _JPCommonLabelMora; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -2326,111 +1576,42 @@ pub struct _JPCommonLabelWord { pub next: *mut _JPCommonLabelWord, pub up: *mut _JPCommonLabelAccentPhrase, } -#[test] -fn bindgen_test_layout__JPCommonLabelWord() { - const UNINIT: ::std::mem::MaybeUninit<_JPCommonLabelWord> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_JPCommonLabelWord>(), - 72usize, - concat!("Size of: ", stringify!(_JPCommonLabelWord)) - ); - assert_eq!( - ::std::mem::align_of::<_JPCommonLabelWord>(), - 8usize, - concat!("Alignment of ", stringify!(_JPCommonLabelWord)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pron) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(pron) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pos) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(pos) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ctype) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(ctype) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cform) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(cform) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).head) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tail) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(prev) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(next) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).up) as usize - ptr as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(up) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + [ + "Size of _JPCommonLabelWord", + ][::std::mem::size_of::<_JPCommonLabelWord>() - 72usize]; + [ + "Alignment of _JPCommonLabelWord", + ][::std::mem::align_of::<_JPCommonLabelWord>() - 8usize]; + [ + "Offset of field: _JPCommonLabelWord::pron", + ][::std::mem::offset_of!(_JPCommonLabelWord, pron) - 0usize]; + [ + "Offset of field: _JPCommonLabelWord::pos", + ][::std::mem::offset_of!(_JPCommonLabelWord, pos) - 8usize]; + [ + "Offset of field: _JPCommonLabelWord::ctype", + ][::std::mem::offset_of!(_JPCommonLabelWord, ctype) - 16usize]; + [ + "Offset of field: _JPCommonLabelWord::cform", + ][::std::mem::offset_of!(_JPCommonLabelWord, cform) - 24usize]; + [ + "Offset of field: _JPCommonLabelWord::head", + ][::std::mem::offset_of!(_JPCommonLabelWord, head) - 32usize]; + [ + "Offset of field: _JPCommonLabelWord::tail", + ][::std::mem::offset_of!(_JPCommonLabelWord, tail) - 40usize]; + [ + "Offset of field: _JPCommonLabelWord::prev", + ][::std::mem::offset_of!(_JPCommonLabelWord, prev) - 48usize]; + [ + "Offset of field: _JPCommonLabelWord::next", + ][::std::mem::offset_of!(_JPCommonLabelWord, next) - 56usize]; + [ + "Offset of field: _JPCommonLabelWord::up", + ][::std::mem::offset_of!(_JPCommonLabelWord, up) - 64usize]; +}; pub type JPCommonLabelWord = _JPCommonLabelWord; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -2443,92 +1624,36 @@ pub struct _JPCommonLabelAccentPhrase { pub next: *mut _JPCommonLabelAccentPhrase, pub up: *mut _JPCommonLabelBreathGroup, } -#[test] -fn bindgen_test_layout__JPCommonLabelAccentPhrase() { - const UNINIT: ::std::mem::MaybeUninit<_JPCommonLabelAccentPhrase> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_JPCommonLabelAccentPhrase>(), - 56usize, - concat!("Size of: ", stringify!(_JPCommonLabelAccentPhrase)) - ); - assert_eq!( - ::std::mem::align_of::<_JPCommonLabelAccentPhrase>(), - 8usize, - concat!("Alignment of ", stringify!(_JPCommonLabelAccentPhrase)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).accent) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelAccentPhrase), - "::", - stringify!(accent) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).emotion) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelAccentPhrase), - "::", - stringify!(emotion) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).head) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelAccentPhrase), - "::", - stringify!(head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tail) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelAccentPhrase), - "::", - stringify!(tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelAccentPhrase), - "::", - stringify!(prev) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelAccentPhrase), - "::", - stringify!(next) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).up) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelAccentPhrase), - "::", - stringify!(up) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + [ + "Size of _JPCommonLabelAccentPhrase", + ][::std::mem::size_of::<_JPCommonLabelAccentPhrase>() - 56usize]; + [ + "Alignment of _JPCommonLabelAccentPhrase", + ][::std::mem::align_of::<_JPCommonLabelAccentPhrase>() - 8usize]; + [ + "Offset of field: _JPCommonLabelAccentPhrase::accent", + ][::std::mem::offset_of!(_JPCommonLabelAccentPhrase, accent) - 0usize]; + [ + "Offset of field: _JPCommonLabelAccentPhrase::emotion", + ][::std::mem::offset_of!(_JPCommonLabelAccentPhrase, emotion) - 8usize]; + [ + "Offset of field: _JPCommonLabelAccentPhrase::head", + ][::std::mem::offset_of!(_JPCommonLabelAccentPhrase, head) - 16usize]; + [ + "Offset of field: _JPCommonLabelAccentPhrase::tail", + ][::std::mem::offset_of!(_JPCommonLabelAccentPhrase, tail) - 24usize]; + [ + "Offset of field: _JPCommonLabelAccentPhrase::prev", + ][::std::mem::offset_of!(_JPCommonLabelAccentPhrase, prev) - 32usize]; + [ + "Offset of field: _JPCommonLabelAccentPhrase::next", + ][::std::mem::offset_of!(_JPCommonLabelAccentPhrase, next) - 40usize]; + [ + "Offset of field: _JPCommonLabelAccentPhrase::up", + ][::std::mem::offset_of!(_JPCommonLabelAccentPhrase, up) - 48usize]; +}; pub type JPCommonLabelAccentPhrase = _JPCommonLabelAccentPhrase; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -2538,62 +1663,27 @@ pub struct _JPCommonLabelBreathGroup { pub prev: *mut _JPCommonLabelBreathGroup, pub next: *mut _JPCommonLabelBreathGroup, } -#[test] -fn bindgen_test_layout__JPCommonLabelBreathGroup() { - const UNINIT: ::std::mem::MaybeUninit<_JPCommonLabelBreathGroup> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_JPCommonLabelBreathGroup>(), - 32usize, - concat!("Size of: ", stringify!(_JPCommonLabelBreathGroup)) - ); - assert_eq!( - ::std::mem::align_of::<_JPCommonLabelBreathGroup>(), - 8usize, - concat!("Alignment of ", stringify!(_JPCommonLabelBreathGroup)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).head) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelBreathGroup), - "::", - stringify!(head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tail) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelBreathGroup), - "::", - stringify!(tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelBreathGroup), - "::", - stringify!(prev) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelBreathGroup), - "::", - stringify!(next) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + [ + "Size of _JPCommonLabelBreathGroup", + ][::std::mem::size_of::<_JPCommonLabelBreathGroup>() - 32usize]; + [ + "Alignment of _JPCommonLabelBreathGroup", + ][::std::mem::align_of::<_JPCommonLabelBreathGroup>() - 8usize]; + [ + "Offset of field: _JPCommonLabelBreathGroup::head", + ][::std::mem::offset_of!(_JPCommonLabelBreathGroup, head) - 0usize]; + [ + "Offset of field: _JPCommonLabelBreathGroup::tail", + ][::std::mem::offset_of!(_JPCommonLabelBreathGroup, tail) - 8usize]; + [ + "Offset of field: _JPCommonLabelBreathGroup::prev", + ][::std::mem::offset_of!(_JPCommonLabelBreathGroup, prev) - 16usize]; + [ + "Offset of field: _JPCommonLabelBreathGroup::next", + ][::std::mem::offset_of!(_JPCommonLabelBreathGroup, next) - 24usize]; +}; pub type JPCommonLabelBreathGroup = _JPCommonLabelBreathGroup; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -2612,151 +1702,50 @@ pub struct _JPCommonLabel { pub phoneme_tail: *mut JPCommonLabelPhoneme, pub short_pause_flag: ::std::os::raw::c_int, } -#[test] -fn bindgen_test_layout__JPCommonLabel() { - const UNINIT: ::std::mem::MaybeUninit<_JPCommonLabel> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_JPCommonLabel>(), - 104usize, - concat!("Size of: ", stringify!(_JPCommonLabel)) - ); - assert_eq!( - ::std::mem::align_of::<_JPCommonLabel>(), - 8usize, - concat!("Alignment of ", stringify!(_JPCommonLabel)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).feature) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(feature) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).breath_head) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(breath_head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).breath_tail) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(breath_tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).accent_head) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(accent_head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).accent_tail) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(accent_tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).word_head) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(word_head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).word_tail) as usize - ptr as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(word_tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mora_head) as usize - ptr as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(mora_head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mora_tail) as usize - ptr as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(mora_tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).phoneme_head) as usize - ptr as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(phoneme_head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).phoneme_tail) as usize - ptr as usize }, - 88usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(phoneme_tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).short_pause_flag) as usize - ptr as usize }, - 96usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(short_pause_flag) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _JPCommonLabel"][::std::mem::size_of::<_JPCommonLabel>() - 104usize]; + ["Alignment of _JPCommonLabel"][::std::mem::align_of::<_JPCommonLabel>() - 8usize]; + [ + "Offset of field: _JPCommonLabel::size", + ][::std::mem::offset_of!(_JPCommonLabel, size) - 0usize]; + [ + "Offset of field: _JPCommonLabel::feature", + ][::std::mem::offset_of!(_JPCommonLabel, feature) - 8usize]; + [ + "Offset of field: _JPCommonLabel::breath_head", + ][::std::mem::offset_of!(_JPCommonLabel, breath_head) - 16usize]; + [ + "Offset of field: _JPCommonLabel::breath_tail", + ][::std::mem::offset_of!(_JPCommonLabel, breath_tail) - 24usize]; + [ + "Offset of field: _JPCommonLabel::accent_head", + ][::std::mem::offset_of!(_JPCommonLabel, accent_head) - 32usize]; + [ + "Offset of field: _JPCommonLabel::accent_tail", + ][::std::mem::offset_of!(_JPCommonLabel, accent_tail) - 40usize]; + [ + "Offset of field: _JPCommonLabel::word_head", + ][::std::mem::offset_of!(_JPCommonLabel, word_head) - 48usize]; + [ + "Offset of field: _JPCommonLabel::word_tail", + ][::std::mem::offset_of!(_JPCommonLabel, word_tail) - 56usize]; + [ + "Offset of field: _JPCommonLabel::mora_head", + ][::std::mem::offset_of!(_JPCommonLabel, mora_head) - 64usize]; + [ + "Offset of field: _JPCommonLabel::mora_tail", + ][::std::mem::offset_of!(_JPCommonLabel, mora_tail) - 72usize]; + [ + "Offset of field: _JPCommonLabel::phoneme_head", + ][::std::mem::offset_of!(_JPCommonLabel, phoneme_head) - 80usize]; + [ + "Offset of field: _JPCommonLabel::phoneme_tail", + ][::std::mem::offset_of!(_JPCommonLabel, phoneme_tail) - 88usize]; + [ + "Offset of field: _JPCommonLabel::short_pause_flag", + ][::std::mem::offset_of!(_JPCommonLabel, short_pause_flag) - 96usize]; +}; pub type JPCommonLabel = _JPCommonLabel; extern "C" { pub fn JPCommonLabel_initialize(label: *mut JPCommonLabel); @@ -2779,8 +1768,9 @@ extern "C" { pub fn JPCommonLabel_get_size(label: *mut JPCommonLabel) -> ::std::os::raw::c_int; } extern "C" { - pub fn JPCommonLabel_get_feature(label: *mut JPCommonLabel) - -> *mut *mut ::std::os::raw::c_char; + pub fn JPCommonLabel_get_feature( + label: *mut JPCommonLabel, + ) -> *mut *mut ::std::os::raw::c_char; } extern "C" { pub fn JPCommonLabel_print(label: *mut JPCommonLabel); @@ -2803,134 +1793,91 @@ pub struct _JPCommonNode { pub prev: *mut _JPCommonNode, pub next: *mut _JPCommonNode, } -#[test] -fn bindgen_test_layout__JPCommonNode() { - const UNINIT: ::std::mem::MaybeUninit<_JPCommonNode> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_JPCommonNode>(), - 56usize, - concat!("Size of: ", stringify!(_JPCommonNode)) - ); - assert_eq!( - ::std::mem::align_of::<_JPCommonNode>(), - 8usize, - concat!("Alignment of ", stringify!(_JPCommonNode)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pron) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonNode), - "::", - stringify!(pron) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pos) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonNode), - "::", - stringify!(pos) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ctype) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonNode), - "::", - stringify!(ctype) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cform) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonNode), - "::", - stringify!(cform) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).acc) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonNode), - "::", - stringify!(acc) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).chain_flag) as usize - ptr as usize }, - 36usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonNode), - "::", - stringify!(chain_flag) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonNode), - "::", - stringify!(prev) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonNode), - "::", - stringify!(next) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _JPCommonNode"][::std::mem::size_of::<_JPCommonNode>() - 56usize]; + ["Alignment of _JPCommonNode"][::std::mem::align_of::<_JPCommonNode>() - 8usize]; + [ + "Offset of field: _JPCommonNode::pron", + ][::std::mem::offset_of!(_JPCommonNode, pron) - 0usize]; + [ + "Offset of field: _JPCommonNode::pos", + ][::std::mem::offset_of!(_JPCommonNode, pos) - 8usize]; + [ + "Offset of field: _JPCommonNode::ctype", + ][::std::mem::offset_of!(_JPCommonNode, ctype) - 16usize]; + [ + "Offset of field: _JPCommonNode::cform", + ][::std::mem::offset_of!(_JPCommonNode, cform) - 24usize]; + [ + "Offset of field: _JPCommonNode::acc", + ][::std::mem::offset_of!(_JPCommonNode, acc) - 32usize]; + [ + "Offset of field: _JPCommonNode::chain_flag", + ][::std::mem::offset_of!(_JPCommonNode, chain_flag) - 36usize]; + [ + "Offset of field: _JPCommonNode::prev", + ][::std::mem::offset_of!(_JPCommonNode, prev) - 40usize]; + [ + "Offset of field: _JPCommonNode::next", + ][::std::mem::offset_of!(_JPCommonNode, next) - 48usize]; +}; pub type JPCommonNode = _JPCommonNode; extern "C" { pub fn JPCommonNode_initialize(node: *mut JPCommonNode); } extern "C" { - pub fn JPCommonNode_set_pron(node: *mut JPCommonNode, str_: *const ::std::os::raw::c_char); + pub fn JPCommonNode_set_pron( + node: *mut JPCommonNode, + str_: *const ::std::os::raw::c_char, + ); } extern "C" { - pub fn JPCommonNode_set_pos(node: *mut JPCommonNode, str_: *const ::std::os::raw::c_char); + pub fn JPCommonNode_set_pos( + node: *mut JPCommonNode, + str_: *const ::std::os::raw::c_char, + ); } extern "C" { - pub fn JPCommonNode_set_ctype(node: *mut JPCommonNode, str_: *const ::std::os::raw::c_char); + pub fn JPCommonNode_set_ctype( + node: *mut JPCommonNode, + str_: *const ::std::os::raw::c_char, + ); } extern "C" { - pub fn JPCommonNode_set_cform(node: *mut JPCommonNode, str_: *const ::std::os::raw::c_char); + pub fn JPCommonNode_set_cform( + node: *mut JPCommonNode, + str_: *const ::std::os::raw::c_char, + ); } extern "C" { pub fn JPCommonNode_set_acc(node: *mut JPCommonNode, acc: ::std::os::raw::c_int); } extern "C" { - pub fn JPCommonNode_set_chain_flag(node: *mut JPCommonNode, flag: ::std::os::raw::c_int); + pub fn JPCommonNode_set_chain_flag( + node: *mut JPCommonNode, + flag: ::std::os::raw::c_int, + ); } extern "C" { - pub fn JPCommonNode_get_pron(node: *mut JPCommonNode) -> *const ::std::os::raw::c_char; + pub fn JPCommonNode_get_pron( + node: *mut JPCommonNode, + ) -> *const ::std::os::raw::c_char; } extern "C" { - pub fn JPCommonNode_get_pos(node: *mut JPCommonNode) -> *const ::std::os::raw::c_char; + pub fn JPCommonNode_get_pos( + node: *mut JPCommonNode, + ) -> *const ::std::os::raw::c_char; } extern "C" { - pub fn JPCommonNode_get_ctype(node: *mut JPCommonNode) -> *const ::std::os::raw::c_char; + pub fn JPCommonNode_get_ctype( + node: *mut JPCommonNode, + ) -> *const ::std::os::raw::c_char; } extern "C" { - pub fn JPCommonNode_get_cform(node: *mut JPCommonNode) -> *const ::std::os::raw::c_char; + pub fn JPCommonNode_get_cform( + node: *mut JPCommonNode, + ) -> *const ::std::os::raw::c_char; } extern "C" { pub fn JPCommonNode_get_acc(node: *mut JPCommonNode) -> ::std::os::raw::c_int; @@ -2954,51 +1901,20 @@ pub struct _JPCommon { pub tail: *mut JPCommonNode, pub label: *mut JPCommonLabel, } -#[test] -fn bindgen_test_layout__JPCommon() { - const UNINIT: ::std::mem::MaybeUninit<_JPCommon> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_JPCommon>(), - 24usize, - concat!("Size of: ", stringify!(_JPCommon)) - ); - assert_eq!( - ::std::mem::align_of::<_JPCommon>(), - 8usize, - concat!("Alignment of ", stringify!(_JPCommon)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).head) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_JPCommon), - "::", - stringify!(head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tail) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_JPCommon), - "::", - stringify!(tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).label) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_JPCommon), - "::", - stringify!(label) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _JPCommon"][::std::mem::size_of::<_JPCommon>() - 24usize]; + ["Alignment of _JPCommon"][::std::mem::align_of::<_JPCommon>() - 8usize]; + [ + "Offset of field: _JPCommon::head", + ][::std::mem::offset_of!(_JPCommon, head) - 0usize]; + [ + "Offset of field: _JPCommon::tail", + ][::std::mem::offset_of!(_JPCommon, tail) - 8usize]; + [ + "Offset of field: _JPCommon::label", + ][::std::mem::offset_of!(_JPCommon, label) - 16usize]; +}; pub type JPCommon = _JPCommon; extern "C" { pub fn JPCommon_initialize(jpcommon: *mut JPCommon); @@ -3013,7 +1929,9 @@ extern "C" { pub fn JPCommon_get_label_size(jpcommon: *mut JPCommon) -> ::std::os::raw::c_int; } extern "C" { - pub fn JPCommon_get_label_feature(jpcommon: *mut JPCommon) -> *mut *mut ::std::os::raw::c_char; + pub fn JPCommon_get_label_feature( + jpcommon: *mut JPCommon, + ) -> *mut *mut ::std::os::raw::c_char; } extern "C" { pub fn JPCommon_print(jpcommon: *mut JPCommon); diff --git a/crates/open_jtalk-sys/src/generated/macos/x86_64/bindings.rs b/crates/open_jtalk-sys/src/generated/macos/x86_64/bindings.rs index 8486cb8..ee16937 100644 --- a/crates/open_jtalk-sys/src/generated/macos/x86_64/bindings.rs +++ b/crates/open_jtalk-sys/src/generated/macos/x86_64/bindings.rs @@ -1,542 +1,263 @@ -/* automatically generated by rust-bindgen 0.62.0 */ +/* automatically generated by rust-bindgen 0.70.1 */ pub const TRUE: u32 = 1; pub const FALSE: u32 = 0; -#[doc = " DictionaryInfo structure"] +/// DictionaryInfo structure #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct mecab_dictionary_info_t { - #[doc = " filename of dictionary"] - #[doc = " On Windows, filename is stored in UTF-8 encoding"] + /** filename of dictionary + On Windows, filename is stored in UTF-8 encoding*/ pub filename: *const ::std::os::raw::c_char, - #[doc = " character set of the dictionary. e.g., \"SHIFT-JIS\", \"UTF-8\""] + /// character set of the dictionary. e.g., "SHIFT-JIS", "UTF-8" pub charset: *const ::std::os::raw::c_char, - #[doc = " How many words are registered in this dictionary."] + /// How many words are registered in this dictionary. pub size: ::std::os::raw::c_uint, - #[doc = " dictionary type"] - #[doc = " this value should be MECAB_USR_DIC, MECAB_SYS_DIC, or MECAB_UNK_DIC."] + /** dictionary type + this value should be MECAB_USR_DIC, MECAB_SYS_DIC, or MECAB_UNK_DIC.*/ pub type_: ::std::os::raw::c_int, - #[doc = " left attributes size"] + /// left attributes size pub lsize: ::std::os::raw::c_uint, - #[doc = " right attributes size"] + /// right attributes size pub rsize: ::std::os::raw::c_uint, - #[doc = " version of this dictionary"] + /// version of this dictionary pub version: ::std::os::raw::c_ushort, - #[doc = " pointer to the next dictionary info."] + /// pointer to the next dictionary info. pub next: *mut mecab_dictionary_info_t, } -#[test] -fn bindgen_test_layout_mecab_dictionary_info_t() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 48usize, - concat!("Size of: ", stringify!(mecab_dictionary_info_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(mecab_dictionary_info_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).filename) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(mecab_dictionary_info_t), - "::", - stringify!(filename) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).charset) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(mecab_dictionary_info_t), - "::", - stringify!(charset) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(mecab_dictionary_info_t), - "::", - stringify!(size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(mecab_dictionary_info_t), - "::", - stringify!(type_) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lsize) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(mecab_dictionary_info_t), - "::", - stringify!(lsize) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rsize) as usize - ptr as usize }, - 28usize, - concat!( - "Offset of field: ", - stringify!(mecab_dictionary_info_t), - "::", - stringify!(rsize) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).version) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(mecab_dictionary_info_t), - "::", - stringify!(version) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(mecab_dictionary_info_t), - "::", - stringify!(next) - ) - ); -} -#[doc = " Path structure"] +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + [ + "Size of mecab_dictionary_info_t", + ][::std::mem::size_of::() - 48usize]; + [ + "Alignment of mecab_dictionary_info_t", + ][::std::mem::align_of::() - 8usize]; + [ + "Offset of field: mecab_dictionary_info_t::filename", + ][::std::mem::offset_of!(mecab_dictionary_info_t, filename) - 0usize]; + [ + "Offset of field: mecab_dictionary_info_t::charset", + ][::std::mem::offset_of!(mecab_dictionary_info_t, charset) - 8usize]; + [ + "Offset of field: mecab_dictionary_info_t::size", + ][::std::mem::offset_of!(mecab_dictionary_info_t, size) - 16usize]; + [ + "Offset of field: mecab_dictionary_info_t::type_", + ][::std::mem::offset_of!(mecab_dictionary_info_t, type_) - 20usize]; + [ + "Offset of field: mecab_dictionary_info_t::lsize", + ][::std::mem::offset_of!(mecab_dictionary_info_t, lsize) - 24usize]; + [ + "Offset of field: mecab_dictionary_info_t::rsize", + ][::std::mem::offset_of!(mecab_dictionary_info_t, rsize) - 28usize]; + [ + "Offset of field: mecab_dictionary_info_t::version", + ][::std::mem::offset_of!(mecab_dictionary_info_t, version) - 32usize]; + [ + "Offset of field: mecab_dictionary_info_t::next", + ][::std::mem::offset_of!(mecab_dictionary_info_t, next) - 40usize]; +}; +/// Path structure #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct mecab_path_t { - #[doc = " pointer to the right node"] + /// pointer to the right node pub rnode: *mut mecab_node_t, - #[doc = " pointer to the next right path"] + /// pointer to the next right path pub rnext: *mut mecab_path_t, - #[doc = " pointer to the left node"] + /// pointer to the left node pub lnode: *mut mecab_node_t, - #[doc = " pointer to the next left path"] + /// pointer to the next left path pub lnext: *mut mecab_path_t, - #[doc = " local cost"] + /// local cost pub cost: ::std::os::raw::c_int, - #[doc = " marginal probability"] + /// marginal probability pub prob: f32, } -#[test] -fn bindgen_test_layout_mecab_path_t() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 40usize, - concat!("Size of: ", stringify!(mecab_path_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(mecab_path_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rnode) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(mecab_path_t), - "::", - stringify!(rnode) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rnext) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(mecab_path_t), - "::", - stringify!(rnext) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lnode) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(mecab_path_t), - "::", - stringify!(lnode) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lnext) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(mecab_path_t), - "::", - stringify!(lnext) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cost) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(mecab_path_t), - "::", - stringify!(cost) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prob) as usize - ptr as usize }, - 36usize, - concat!( - "Offset of field: ", - stringify!(mecab_path_t), - "::", - stringify!(prob) - ) - ); -} -#[doc = " Node structure"] +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of mecab_path_t"][::std::mem::size_of::() - 40usize]; + ["Alignment of mecab_path_t"][::std::mem::align_of::() - 8usize]; + [ + "Offset of field: mecab_path_t::rnode", + ][::std::mem::offset_of!(mecab_path_t, rnode) - 0usize]; + [ + "Offset of field: mecab_path_t::rnext", + ][::std::mem::offset_of!(mecab_path_t, rnext) - 8usize]; + [ + "Offset of field: mecab_path_t::lnode", + ][::std::mem::offset_of!(mecab_path_t, lnode) - 16usize]; + [ + "Offset of field: mecab_path_t::lnext", + ][::std::mem::offset_of!(mecab_path_t, lnext) - 24usize]; + [ + "Offset of field: mecab_path_t::cost", + ][::std::mem::offset_of!(mecab_path_t, cost) - 32usize]; + [ + "Offset of field: mecab_path_t::prob", + ][::std::mem::offset_of!(mecab_path_t, prob) - 36usize]; +}; +/// Node structure #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct mecab_node_t { - #[doc = " pointer to the previous node."] + /// pointer to the previous node. pub prev: *mut mecab_node_t, - #[doc = " pointer to the next node."] + /// pointer to the next node. pub next: *mut mecab_node_t, - #[doc = " pointer to the node which ends at the same position."] + /// pointer to the node which ends at the same position. pub enext: *mut mecab_node_t, - #[doc = " pointer to the node which starts at the same position."] + /// pointer to the node which starts at the same position. pub bnext: *mut mecab_node_t, - #[doc = " pointer to the right path."] - #[doc = " this value is NULL if MECAB_ONE_BEST mode."] + /** pointer to the right path. + this value is NULL if MECAB_ONE_BEST mode.*/ pub rpath: *mut mecab_path_t, - #[doc = " pointer to the right path."] - #[doc = " this value is NULL if MECAB_ONE_BEST mode."] + /** pointer to the right path. + this value is NULL if MECAB_ONE_BEST mode.*/ pub lpath: *mut mecab_path_t, - #[doc = " surface string."] - #[doc = " this value is not 0 terminated."] - #[doc = " You can get the length with length/rlength members."] + /** surface string. + this value is not 0 terminated. + You can get the length with length/rlength members.*/ pub surface: *const ::std::os::raw::c_char, - #[doc = " feature string"] + /// feature string pub feature: *const ::std::os::raw::c_char, - #[doc = " unique node id"] + /// unique node id pub id: ::std::os::raw::c_uint, - #[doc = " length of the surface form."] + /// length of the surface form. pub length: ::std::os::raw::c_ushort, - #[doc = " length of the surface form including white space before the morph."] + /// length of the surface form including white space before the morph. pub rlength: ::std::os::raw::c_ushort, - #[doc = " right attribute id"] + /// right attribute id pub rcAttr: ::std::os::raw::c_ushort, - #[doc = " left attribute id"] + /// left attribute id pub lcAttr: ::std::os::raw::c_ushort, - #[doc = " unique part of speech id. This value is defined in \"pos.def\" file."] + /// unique part of speech id. This value is defined in "pos.def" file. pub posid: ::std::os::raw::c_ushort, - #[doc = " character type"] + /// character type pub char_type: ::std::os::raw::c_uchar, - #[doc = " status of this model."] - #[doc = " This value is MECAB_NOR_NODE, MECAB_UNK_NODE, MECAB_BOS_NODE, MECAB_EOS_NODE, or MECAB_EON_NODE."] + /** status of this model. + This value is MECAB_NOR_NODE, MECAB_UNK_NODE, MECAB_BOS_NODE, MECAB_EOS_NODE, or MECAB_EON_NODE.*/ pub stat: ::std::os::raw::c_uchar, - #[doc = " set 1 if this node is best node."] + /// set 1 if this node is best node. pub isbest: ::std::os::raw::c_uchar, - #[doc = " forward accumulative log summation."] - #[doc = " This value is only available when MECAB_MARGINAL_PROB is passed."] + /** forward accumulative log summation. + This value is only available when MECAB_MARGINAL_PROB is passed.*/ pub alpha: f32, - #[doc = " backward accumulative log summation."] - #[doc = " This value is only available when MECAB_MARGINAL_PROB is passed."] + /** backward accumulative log summation. + This value is only available when MECAB_MARGINAL_PROB is passed.*/ pub beta: f32, - #[doc = " marginal probability."] - #[doc = " This value is only available when MECAB_MARGINAL_PROB is passed."] + /** marginal probability. + This value is only available when MECAB_MARGINAL_PROB is passed.*/ pub prob: f32, - #[doc = " word cost."] + /// word cost. pub wcost: ::std::os::raw::c_short, - #[doc = " best accumulative cost from bos node to this node."] + /// best accumulative cost from bos node to this node. pub cost: ::std::os::raw::c_long, } -#[test] -fn bindgen_test_layout_mecab_node_t() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 112usize, - concat!("Size of: ", stringify!(mecab_node_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(mecab_node_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(prev) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(next) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).enext) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(enext) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).bnext) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(bnext) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rpath) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(rpath) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lpath) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(lpath) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).surface) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(surface) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).feature) as usize - ptr as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(feature) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).id) as usize - ptr as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(id) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).length) as usize - ptr as usize }, - 68usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(length) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rlength) as usize - ptr as usize }, - 70usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(rlength) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rcAttr) as usize - ptr as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(rcAttr) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lcAttr) as usize - ptr as usize }, - 74usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(lcAttr) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).posid) as usize - ptr as usize }, - 76usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(posid) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).char_type) as usize - ptr as usize }, - 78usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(char_type) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).stat) as usize - ptr as usize }, - 79usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(stat) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).isbest) as usize - ptr as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(isbest) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).alpha) as usize - ptr as usize }, - 84usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(alpha) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).beta) as usize - ptr as usize }, - 88usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(beta) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prob) as usize - ptr as usize }, - 92usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(prob) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).wcost) as usize - ptr as usize }, - 96usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(wcost) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cost) as usize - ptr as usize }, - 104usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(cost) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of mecab_node_t"][::std::mem::size_of::() - 112usize]; + ["Alignment of mecab_node_t"][::std::mem::align_of::() - 8usize]; + [ + "Offset of field: mecab_node_t::prev", + ][::std::mem::offset_of!(mecab_node_t, prev) - 0usize]; + [ + "Offset of field: mecab_node_t::next", + ][::std::mem::offset_of!(mecab_node_t, next) - 8usize]; + [ + "Offset of field: mecab_node_t::enext", + ][::std::mem::offset_of!(mecab_node_t, enext) - 16usize]; + [ + "Offset of field: mecab_node_t::bnext", + ][::std::mem::offset_of!(mecab_node_t, bnext) - 24usize]; + [ + "Offset of field: mecab_node_t::rpath", + ][::std::mem::offset_of!(mecab_node_t, rpath) - 32usize]; + [ + "Offset of field: mecab_node_t::lpath", + ][::std::mem::offset_of!(mecab_node_t, lpath) - 40usize]; + [ + "Offset of field: mecab_node_t::surface", + ][::std::mem::offset_of!(mecab_node_t, surface) - 48usize]; + [ + "Offset of field: mecab_node_t::feature", + ][::std::mem::offset_of!(mecab_node_t, feature) - 56usize]; + [ + "Offset of field: mecab_node_t::id", + ][::std::mem::offset_of!(mecab_node_t, id) - 64usize]; + [ + "Offset of field: mecab_node_t::length", + ][::std::mem::offset_of!(mecab_node_t, length) - 68usize]; + [ + "Offset of field: mecab_node_t::rlength", + ][::std::mem::offset_of!(mecab_node_t, rlength) - 70usize]; + [ + "Offset of field: mecab_node_t::rcAttr", + ][::std::mem::offset_of!(mecab_node_t, rcAttr) - 72usize]; + [ + "Offset of field: mecab_node_t::lcAttr", + ][::std::mem::offset_of!(mecab_node_t, lcAttr) - 74usize]; + [ + "Offset of field: mecab_node_t::posid", + ][::std::mem::offset_of!(mecab_node_t, posid) - 76usize]; + [ + "Offset of field: mecab_node_t::char_type", + ][::std::mem::offset_of!(mecab_node_t, char_type) - 78usize]; + [ + "Offset of field: mecab_node_t::stat", + ][::std::mem::offset_of!(mecab_node_t, stat) - 79usize]; + [ + "Offset of field: mecab_node_t::isbest", + ][::std::mem::offset_of!(mecab_node_t, isbest) - 80usize]; + [ + "Offset of field: mecab_node_t::alpha", + ][::std::mem::offset_of!(mecab_node_t, alpha) - 84usize]; + [ + "Offset of field: mecab_node_t::beta", + ][::std::mem::offset_of!(mecab_node_t, beta) - 88usize]; + [ + "Offset of field: mecab_node_t::prob", + ][::std::mem::offset_of!(mecab_node_t, prob) - 92usize]; + [ + "Offset of field: mecab_node_t::wcost", + ][::std::mem::offset_of!(mecab_node_t, wcost) - 96usize]; + [ + "Offset of field: mecab_node_t::cost", + ][::std::mem::offset_of!(mecab_node_t, cost) - 104usize]; +}; pub const MECAB_NOR_NODE: _bindgen_ty_1 = _bindgen_ty_1::MECAB_NOR_NODE; pub const MECAB_UNK_NODE: _bindgen_ty_1 = _bindgen_ty_1::MECAB_UNK_NODE; pub const MECAB_BOS_NODE: _bindgen_ty_1 = _bindgen_ty_1::MECAB_BOS_NODE; pub const MECAB_EOS_NODE: _bindgen_ty_1 = _bindgen_ty_1::MECAB_EOS_NODE; pub const MECAB_EON_NODE: _bindgen_ty_1 = _bindgen_ty_1::MECAB_EON_NODE; #[repr(u32)] -#[doc = " Parameters for MeCab::Node::stat"] +/// Parameters for MeCab::Node::stat #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum _bindgen_ty_1 { - #[doc = " Normal node defined in the dictionary."] + /// Normal node defined in the dictionary. MECAB_NOR_NODE = 0, - #[doc = " Unknown node not defined in the dictionary."] + /// Unknown node not defined in the dictionary. MECAB_UNK_NODE = 1, - #[doc = " Virtual node representing a beginning of the sentence."] + /// Virtual node representing a beginning of the sentence. MECAB_BOS_NODE = 2, - #[doc = " Virtual node representing a end of the sentence."] + /// Virtual node representing a end of the sentence. MECAB_EOS_NODE = 3, - #[doc = " Virtual node representing a end of the N-best enumeration."] + /// Virtual node representing a end of the N-best enumeration. MECAB_EON_NODE = 4, } pub const MECAB_SYS_DIC: _bindgen_ty_2 = _bindgen_ty_2::MECAB_SYS_DIC; pub const MECAB_USR_DIC: _bindgen_ty_2 = _bindgen_ty_2::MECAB_USR_DIC; pub const MECAB_UNK_DIC: _bindgen_ty_2 = _bindgen_ty_2::MECAB_UNK_DIC; #[repr(u32)] -#[doc = " Parameters for MeCab::DictionaryInfo::type"] +/// Parameters for MeCab::DictionaryInfo::type #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum _bindgen_ty_2 { - #[doc = " This is a system dictionary."] + /// This is a system dictionary. MECAB_SYS_DIC = 0, - #[doc = " This is a user dictionary."] + /// This is a user dictionary. MECAB_USR_DIC = 1, - #[doc = " This is a unknown word dictionary."] + /// This is a unknown word dictionary. MECAB_UNK_DIC = 2, } pub const MECAB_ONE_BEST: _bindgen_ty_3 = _bindgen_ty_3::MECAB_ONE_BEST; @@ -547,43 +268,43 @@ pub const MECAB_ALTERNATIVE: _bindgen_ty_3 = _bindgen_ty_3::MECAB_ALTERNATIVE; pub const MECAB_ALL_MORPHS: _bindgen_ty_3 = _bindgen_ty_3::MECAB_ALL_MORPHS; pub const MECAB_ALLOCATE_SENTENCE: _bindgen_ty_3 = _bindgen_ty_3::MECAB_ALLOCATE_SENTENCE; #[repr(u32)] -#[doc = " Parameters for MeCab::Lattice::request_type"] +/// Parameters for MeCab::Lattice::request_type #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum _bindgen_ty_3 { - #[doc = " One best result is obtained (default mode)"] + /// One best result is obtained (default mode) MECAB_ONE_BEST = 1, - #[doc = " Set this flag if you want to obtain N best results."] + /// Set this flag if you want to obtain N best results. MECAB_NBEST = 2, - #[doc = " Set this flag if you want to enable a partial parsing mode."] - #[doc = " When this flag is set, the input |sentence| needs to be written"] - #[doc = " in partial parsing format."] + /** Set this flag if you want to enable a partial parsing mode. + When this flag is set, the input |sentence| needs to be written + in partial parsing format.*/ MECAB_PARTIAL = 4, - #[doc = " Set this flag if you want to obtain marginal probabilities."] - #[doc = " Marginal probability is set in MeCab::Node::prob."] - #[doc = " The parsing speed will get 3-5 times slower than the default mode."] + /** Set this flag if you want to obtain marginal probabilities. + Marginal probability is set in MeCab::Node::prob. + The parsing speed will get 3-5 times slower than the default mode.*/ MECAB_MARGINAL_PROB = 8, - #[doc = " Set this flag if you want to obtain alternative results."] - #[doc = " Not implemented."] + /** Set this flag if you want to obtain alternative results. + Not implemented.*/ MECAB_ALTERNATIVE = 16, - #[doc = " When this flag is set, the result linked-list (Node::next/prev)"] - #[doc = " traverses all nodes in the lattice."] + /** When this flag is set, the result linked-list (Node::next/prev) + traverses all nodes in the lattice.*/ MECAB_ALL_MORPHS = 32, - #[doc = " When this flag is set, tagger internally copies the body of passed"] - #[doc = " sentence into internal buffer."] + /** When this flag is set, tagger internally copies the body of passed + sentence into internal buffer.*/ MECAB_ALLOCATE_SENTENCE = 64, } pub const MECAB_ANY_BOUNDARY: _bindgen_ty_4 = _bindgen_ty_4::MECAB_ANY_BOUNDARY; pub const MECAB_TOKEN_BOUNDARY: _bindgen_ty_4 = _bindgen_ty_4::MECAB_TOKEN_BOUNDARY; pub const MECAB_INSIDE_TOKEN: _bindgen_ty_4 = _bindgen_ty_4::MECAB_INSIDE_TOKEN; #[repr(u32)] -#[doc = " Parameters for MeCab::Lattice::boundary_constraint_type"] +/// Parameters for MeCab::Lattice::boundary_constraint_type #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum _bindgen_ty_4 { - #[doc = " The token boundary is not specified."] + /// The token boundary is not specified. MECAB_ANY_BOUNDARY = 0, - #[doc = " The position is a strong token boundary."] + /// The position is a strong token boundary. MECAB_TOKEN_BOUNDARY = 1, - #[doc = " The position is not a token boundary."] + /// The position is not a token boundary. MECAB_INSIDE_TOKEN = 2, } pub type __int64_t = ::std::os::raw::c_longlong; @@ -595,41 +316,13 @@ pub struct __sbuf { pub _base: *mut ::std::os::raw::c_uchar, pub _size: ::std::os::raw::c_int, } -#[test] -fn bindgen_test_layout___sbuf() { - const UNINIT: ::std::mem::MaybeUninit<__sbuf> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__sbuf>(), - 16usize, - concat!("Size of: ", stringify!(__sbuf)) - ); - assert_eq!( - ::std::mem::align_of::<__sbuf>(), - 8usize, - concat!("Alignment of ", stringify!(__sbuf)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._base) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__sbuf), - "::", - stringify!(_base) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._size) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(__sbuf), - "::", - stringify!(_size) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __sbuf"][::std::mem::size_of::<__sbuf>() - 16usize]; + ["Alignment of __sbuf"][::std::mem::align_of::<__sbuf>() - 8usize]; + ["Offset of field: __sbuf::_base"][::std::mem::offset_of!(__sbuf, _base) - 0usize]; + ["Offset of field: __sbuf::_size"][::std::mem::offset_of!(__sbuf, _size) - 8usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct __sFILEX { @@ -679,221 +372,57 @@ pub struct __sFILE { pub _blksize: ::std::os::raw::c_int, pub _offset: fpos_t, } -#[test] -fn bindgen_test_layout___sFILE() { - const UNINIT: ::std::mem::MaybeUninit<__sFILE> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__sFILE>(), - 152usize, - concat!("Size of: ", stringify!(__sFILE)) - ); - assert_eq!( - ::std::mem::align_of::<__sFILE>(), - 8usize, - concat!("Alignment of ", stringify!(__sFILE)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._p) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__sFILE), - "::", - stringify!(_p) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._r) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(__sFILE), - "::", - stringify!(_r) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._w) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(__sFILE), - "::", - stringify!(_w) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._flags) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(__sFILE), - "::", - stringify!(_flags) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._file) as usize - ptr as usize }, - 18usize, - concat!( - "Offset of field: ", - stringify!(__sFILE), - "::", - stringify!(_file) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._bf) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(__sFILE), - "::", - stringify!(_bf) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._lbfsize) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(__sFILE), - "::", - stringify!(_lbfsize) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._cookie) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(__sFILE), - "::", - stringify!(_cookie) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._close) as usize - ptr as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(__sFILE), - "::", - stringify!(_close) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._read) as usize - ptr as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(__sFILE), - "::", - stringify!(_read) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._seek) as usize - ptr as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(__sFILE), - "::", - stringify!(_seek) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._write) as usize - ptr as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(__sFILE), - "::", - stringify!(_write) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._ub) as usize - ptr as usize }, - 88usize, - concat!( - "Offset of field: ", - stringify!(__sFILE), - "::", - stringify!(_ub) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._extra) as usize - ptr as usize }, - 104usize, - concat!( - "Offset of field: ", - stringify!(__sFILE), - "::", - stringify!(_extra) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._ur) as usize - ptr as usize }, - 112usize, - concat!( - "Offset of field: ", - stringify!(__sFILE), - "::", - stringify!(_ur) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._ubuf) as usize - ptr as usize }, - 116usize, - concat!( - "Offset of field: ", - stringify!(__sFILE), - "::", - stringify!(_ubuf) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._nbuf) as usize - ptr as usize }, - 119usize, - concat!( - "Offset of field: ", - stringify!(__sFILE), - "::", - stringify!(_nbuf) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._lb) as usize - ptr as usize }, - 120usize, - concat!( - "Offset of field: ", - stringify!(__sFILE), - "::", - stringify!(_lb) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._blksize) as usize - ptr as usize }, - 136usize, - concat!( - "Offset of field: ", - stringify!(__sFILE), - "::", - stringify!(_blksize) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._offset) as usize - ptr as usize }, - 144usize, - concat!( - "Offset of field: ", - stringify!(__sFILE), - "::", - stringify!(_offset) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __sFILE"][::std::mem::size_of::<__sFILE>() - 152usize]; + ["Alignment of __sFILE"][::std::mem::align_of::<__sFILE>() - 8usize]; + ["Offset of field: __sFILE::_p"][::std::mem::offset_of!(__sFILE, _p) - 0usize]; + ["Offset of field: __sFILE::_r"][::std::mem::offset_of!(__sFILE, _r) - 8usize]; + ["Offset of field: __sFILE::_w"][::std::mem::offset_of!(__sFILE, _w) - 12usize]; + [ + "Offset of field: __sFILE::_flags", + ][::std::mem::offset_of!(__sFILE, _flags) - 16usize]; + [ + "Offset of field: __sFILE::_file", + ][::std::mem::offset_of!(__sFILE, _file) - 18usize]; + ["Offset of field: __sFILE::_bf"][::std::mem::offset_of!(__sFILE, _bf) - 24usize]; + [ + "Offset of field: __sFILE::_lbfsize", + ][::std::mem::offset_of!(__sFILE, _lbfsize) - 40usize]; + [ + "Offset of field: __sFILE::_cookie", + ][::std::mem::offset_of!(__sFILE, _cookie) - 48usize]; + [ + "Offset of field: __sFILE::_close", + ][::std::mem::offset_of!(__sFILE, _close) - 56usize]; + [ + "Offset of field: __sFILE::_read", + ][::std::mem::offset_of!(__sFILE, _read) - 64usize]; + [ + "Offset of field: __sFILE::_seek", + ][::std::mem::offset_of!(__sFILE, _seek) - 72usize]; + [ + "Offset of field: __sFILE::_write", + ][::std::mem::offset_of!(__sFILE, _write) - 80usize]; + ["Offset of field: __sFILE::_ub"][::std::mem::offset_of!(__sFILE, _ub) - 88usize]; + [ + "Offset of field: __sFILE::_extra", + ][::std::mem::offset_of!(__sFILE, _extra) - 104usize]; + ["Offset of field: __sFILE::_ur"][::std::mem::offset_of!(__sFILE, _ur) - 112usize]; + [ + "Offset of field: __sFILE::_ubuf", + ][::std::mem::offset_of!(__sFILE, _ubuf) - 116usize]; + [ + "Offset of field: __sFILE::_nbuf", + ][::std::mem::offset_of!(__sFILE, _nbuf) - 119usize]; + ["Offset of field: __sFILE::_lb"][::std::mem::offset_of!(__sFILE, _lb) - 120usize]; + [ + "Offset of field: __sFILE::_blksize", + ][::std::mem::offset_of!(__sFILE, _blksize) - 136usize]; + [ + "Offset of field: __sFILE::_offset", + ][::std::mem::offset_of!(__sFILE, _offset) - 144usize]; +}; pub type FILE = __sFILE; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -911,76 +440,76 @@ pub struct mecab_lattice_t { _unused: [u8; 0], } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::create(argc, argv)"] + /// C wrapper of MeCab::Tagger::create(argc, argv) pub fn mecab_new( argc: ::std::os::raw::c_int, argv: *mut *mut ::std::os::raw::c_char, ) -> *mut mecab_t; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::create(arg)"] + /// C wrapper of MeCab::Tagger::create(arg) pub fn mecab_new2(arg: *const ::std::os::raw::c_char) -> *mut mecab_t; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::version()"] + /// C wrapper of MeCab::Tagger::version() pub fn mecab_version() -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::getLastError()"] + /// C wrapper of MeCab::getLastError() pub fn mecab_strerror(mecab: *mut mecab_t) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::deleteTagger(tagger)"] + /// C wrapper of MeCab::deleteTagger(tagger) pub fn mecab_destroy(mecab: *mut mecab_t); } extern "C" { - #[doc = " C wrapper of MeCab::Tagger:set_partial()"] + /// C wrapper of MeCab::Tagger:set_partial() pub fn mecab_get_partial(mecab: *mut mecab_t) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::partial()"] + /// C wrapper of MeCab::Tagger::partial() pub fn mecab_set_partial(mecab: *mut mecab_t, partial: ::std::os::raw::c_int); } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::theta()"] + /// C wrapper of MeCab::Tagger::theta() pub fn mecab_get_theta(mecab: *mut mecab_t) -> f32; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::set_theta()"] + /// C wrapper of MeCab::Tagger::set_theta() pub fn mecab_set_theta(mecab: *mut mecab_t, theta: f32); } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::lattice_level()"] + /// C wrapper of MeCab::Tagger::lattice_level() pub fn mecab_get_lattice_level(mecab: *mut mecab_t) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::set_lattice_level()"] + /// C wrapper of MeCab::Tagger::set_lattice_level() pub fn mecab_set_lattice_level(mecab: *mut mecab_t, level: ::std::os::raw::c_int); } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::all_morphs()"] + /// C wrapper of MeCab::Tagger::all_morphs() pub fn mecab_get_all_morphs(mecab: *mut mecab_t) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::set_all_moprhs()"] + /// C wrapper of MeCab::Tagger::set_all_moprhs() pub fn mecab_set_all_morphs(mecab: *mut mecab_t, all_morphs: ::std::os::raw::c_int); } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parse(MeCab::Lattice *lattice)"] + /// C wrapper of MeCab::Tagger::parse(MeCab::Lattice *lattice) pub fn mecab_parse_lattice( mecab: *mut mecab_t, lattice: *mut mecab_lattice_t, ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parse(const char *str)"] + /// C wrapper of MeCab::Tagger::parse(const char *str) pub fn mecab_sparse_tostr( mecab: *mut mecab_t, str_: *const ::std::os::raw::c_char, ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parse(const char *str, size_t len)"] + /// C wrapper of MeCab::Tagger::parse(const char *str, size_t len) pub fn mecab_sparse_tostr2( mecab: *mut mecab_t, str_: *const ::std::os::raw::c_char, @@ -988,7 +517,7 @@ extern "C" { ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parse(const char *str, char *ostr, size_t olen)"] + /// C wrapper of MeCab::Tagger::parse(const char *str, char *ostr, size_t olen) pub fn mecab_sparse_tostr3( mecab: *mut mecab_t, str_: *const ::std::os::raw::c_char, @@ -998,14 +527,14 @@ extern "C" { ) -> *mut ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parseToNode(const char *str)"] + /// C wrapper of MeCab::Tagger::parseToNode(const char *str) pub fn mecab_sparse_tonode( mecab: *mut mecab_t, arg1: *const ::std::os::raw::c_char, ) -> *const mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parseToNode(const char *str, size_t len)"] + /// C wrapper of MeCab::Tagger::parseToNode(const char *str, size_t len) pub fn mecab_sparse_tonode2( mecab: *mut mecab_t, arg1: *const ::std::os::raw::c_char, @@ -1013,7 +542,7 @@ extern "C" { ) -> *const mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parseNBest(size_t N, const char *str)"] + /// C wrapper of MeCab::Tagger::parseNBest(size_t N, const char *str) pub fn mecab_nbest_sparse_tostr( mecab: *mut mecab_t, N: usize, @@ -1021,7 +550,7 @@ extern "C" { ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parseNBest(size_t N, const char *str, size_t len)"] + /// C wrapper of MeCab::Tagger::parseNBest(size_t N, const char *str, size_t len) pub fn mecab_nbest_sparse_tostr2( mecab: *mut mecab_t, N: usize, @@ -1030,7 +559,7 @@ extern "C" { ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parseNBest(size_t N, const char *str, char *ostr, size_t olen)"] + /// C wrapper of MeCab::Tagger::parseNBest(size_t N, const char *str, char *ostr, size_t olen) pub fn mecab_nbest_sparse_tostr3( mecab: *mut mecab_t, N: usize, @@ -1041,14 +570,14 @@ extern "C" { ) -> *mut ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parseNBestInit(const char *str)"] + /// C wrapper of MeCab::Tagger::parseNBestInit(const char *str) pub fn mecab_nbest_init( mecab: *mut mecab_t, str_: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parseNBestInit(const char *str, size_t len)"] + /// C wrapper of MeCab::Tagger::parseNBestInit(const char *str, size_t len) pub fn mecab_nbest_init2( mecab: *mut mecab_t, str_: *const ::std::os::raw::c_char, @@ -1056,11 +585,11 @@ extern "C" { ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::next()"] + /// C wrapper of MeCab::Tagger::next() pub fn mecab_nbest_next_tostr(mecab: *mut mecab_t) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::next(char *ostr, size_t olen)"] + /// C wrapper of MeCab::Tagger::next(char *ostr, size_t olen) pub fn mecab_nbest_next_tostr2( mecab: *mut mecab_t, ostr: *mut ::std::os::raw::c_char, @@ -1068,84 +597,91 @@ extern "C" { ) -> *mut ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::nextNode()"] + /// C wrapper of MeCab::Tagger::nextNode() pub fn mecab_nbest_next_tonode(mecab: *mut mecab_t) -> *const mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::formatNode(const Node *node)"] + /// C wrapper of MeCab::Tagger::formatNode(const Node *node) pub fn mecab_format_node( mecab: *mut mecab_t, node: *const mecab_node_t, ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::dictionary_info()"] + /// C wrapper of MeCab::Tagger::dictionary_info() pub fn mecab_dictionary_info(mecab: *mut mecab_t) -> *const mecab_dictionary_info_t; } extern "C" { - #[doc = " C wrapper of MeCab::createLattice()"] + /// C wrapper of MeCab::createLattice() pub fn mecab_lattice_new() -> *mut mecab_lattice_t; } extern "C" { - #[doc = " C wrapper of MeCab::deleteLattice(lattice)"] + /// C wrapper of MeCab::deleteLattice(lattice) pub fn mecab_lattice_destroy(lattice: *mut mecab_lattice_t); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::clear()"] + /// C wrapper of MeCab::Lattice::clear() pub fn mecab_lattice_clear(lattice: *mut mecab_lattice_t); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::is_available()"] - pub fn mecab_lattice_is_available(lattice: *mut mecab_lattice_t) -> ::std::os::raw::c_int; + /// C wrapper of MeCab::Lattice::is_available() + pub fn mecab_lattice_is_available( + lattice: *mut mecab_lattice_t, + ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::bos_node()"] - pub fn mecab_lattice_get_bos_node(lattice: *mut mecab_lattice_t) -> *mut mecab_node_t; + /// C wrapper of MeCab::Lattice::bos_node() + pub fn mecab_lattice_get_bos_node( + lattice: *mut mecab_lattice_t, + ) -> *mut mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::eos_node()"] - pub fn mecab_lattice_get_eos_node(lattice: *mut mecab_lattice_t) -> *mut mecab_node_t; + /// C wrapper of MeCab::Lattice::eos_node() + pub fn mecab_lattice_get_eos_node( + lattice: *mut mecab_lattice_t, + ) -> *mut mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::begin_nodes()"] + /// C wrapper of MeCab::Lattice::begin_nodes() pub fn mecab_lattice_get_all_begin_nodes( lattice: *mut mecab_lattice_t, ) -> *mut *mut mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::end_nodes()"] - pub fn mecab_lattice_get_all_end_nodes(lattice: *mut mecab_lattice_t) - -> *mut *mut mecab_node_t; + /// C wrapper of MeCab::Lattice::end_nodes() + pub fn mecab_lattice_get_all_end_nodes( + lattice: *mut mecab_lattice_t, + ) -> *mut *mut mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::begin_nodes(pos)"] + /// C wrapper of MeCab::Lattice::begin_nodes(pos) pub fn mecab_lattice_get_begin_nodes( lattice: *mut mecab_lattice_t, pos: usize, ) -> *mut mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::end_nodes(pos)"] + /// C wrapper of MeCab::Lattice::end_nodes(pos) pub fn mecab_lattice_get_end_nodes( lattice: *mut mecab_lattice_t, pos: usize, ) -> *mut mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::sentence()"] + /// C wrapper of MeCab::Lattice::sentence() pub fn mecab_lattice_get_sentence( lattice: *mut mecab_lattice_t, ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::set_sentence(sentence)"] + /// C wrapper of MeCab::Lattice::set_sentence(sentence) pub fn mecab_lattice_set_sentence( lattice: *mut mecab_lattice_t, sentence: *const ::std::os::raw::c_char, ); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::set_sentence(sentence, len)"] + /// C wrapper of MeCab::Lattice::set_sentence(sentence, len) pub fn mecab_lattice_set_sentence2( lattice: *mut mecab_lattice_t, sentence: *const ::std::os::raw::c_char, @@ -1153,71 +689,75 @@ extern "C" { ); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::size()"] + /// C wrapper of MeCab::Lattice::size() pub fn mecab_lattice_get_size(lattice: *mut mecab_lattice_t) -> usize; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::Z()"] + /// C wrapper of MeCab::Lattice::Z() pub fn mecab_lattice_get_z(lattice: *mut mecab_lattice_t) -> f64; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::set_Z()"] + /// C wrapper of MeCab::Lattice::set_Z() pub fn mecab_lattice_set_z(lattice: *mut mecab_lattice_t, Z: f64); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::theta()"] + /// C wrapper of MeCab::Lattice::theta() pub fn mecab_lattice_get_theta(lattice: *mut mecab_lattice_t) -> f64; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::set_theta()"] + /// C wrapper of MeCab::Lattice::set_theta() pub fn mecab_lattice_set_theta(lattice: *mut mecab_lattice_t, theta: f64); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::next()"] + /// C wrapper of MeCab::Lattice::next() pub fn mecab_lattice_next(lattice: *mut mecab_lattice_t) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::request_type()"] - pub fn mecab_lattice_get_request_type(lattice: *mut mecab_lattice_t) -> ::std::os::raw::c_int; + /// C wrapper of MeCab::Lattice::request_type() + pub fn mecab_lattice_get_request_type( + lattice: *mut mecab_lattice_t, + ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::has_request_type()"] + /// C wrapper of MeCab::Lattice::has_request_type() pub fn mecab_lattice_has_request_type( lattice: *mut mecab_lattice_t, request_type: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::set_request_type()"] + /// C wrapper of MeCab::Lattice::set_request_type() pub fn mecab_lattice_set_request_type( lattice: *mut mecab_lattice_t, request_type: ::std::os::raw::c_int, ); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::add_request_type()"] + /// C wrapper of MeCab::Lattice::add_request_type() pub fn mecab_lattice_add_request_type( lattice: *mut mecab_lattice_t, request_type: ::std::os::raw::c_int, ); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::remove_request_type()"] + /// C wrapper of MeCab::Lattice::remove_request_type() pub fn mecab_lattice_remove_request_type( lattice: *mut mecab_lattice_t, request_type: ::std::os::raw::c_int, ); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::newNode();"] + /// C wrapper of MeCab::Lattice::newNode(); pub fn mecab_lattice_new_node(lattice: *mut mecab_lattice_t) -> *mut mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::toString()"] - pub fn mecab_lattice_tostr(lattice: *mut mecab_lattice_t) -> *const ::std::os::raw::c_char; + /// C wrapper of MeCab::Lattice::toString() + pub fn mecab_lattice_tostr( + lattice: *mut mecab_lattice_t, + ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::toString(buf, size)"] + /// C wrapper of MeCab::Lattice::toString(buf, size) pub fn mecab_lattice_tostr2( lattice: *mut mecab_lattice_t, buf: *mut ::std::os::raw::c_char, @@ -1225,14 +765,14 @@ extern "C" { ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::enumNBestAsString(N)"] + /// C wrapper of MeCab::Lattice::enumNBestAsString(N) pub fn mecab_lattice_nbest_tostr( lattice: *mut mecab_lattice_t, N: usize, ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::enumNBestAsString(N, buf, size)"] + /// C wrapper of MeCab::Lattice::enumNBestAsString(N, buf, size) pub fn mecab_lattice_nbest_tostr2( lattice: *mut mecab_lattice_t, N: usize, @@ -1241,25 +781,27 @@ extern "C" { ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::has_constraint()"] - pub fn mecab_lattice_has_constraint(lattice: *mut mecab_lattice_t) -> ::std::os::raw::c_int; + /// C wrapper of MeCab::Lattice::has_constraint() + pub fn mecab_lattice_has_constraint( + lattice: *mut mecab_lattice_t, + ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::boundary_constraint(pos)"] + /// C wrapper of MeCab::Lattice::boundary_constraint(pos) pub fn mecab_lattice_get_boundary_constraint( lattice: *mut mecab_lattice_t, pos: usize, ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::feature_constraint(pos)"] + /// C wrapper of MeCab::Lattice::feature_constraint(pos) pub fn mecab_lattice_get_feature_constraint( lattice: *mut mecab_lattice_t, pos: usize, ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::boundary_constraint(pos, type)"] + /// C wrapper of MeCab::Lattice::boundary_constraint(pos, type) pub fn mecab_lattice_set_boundary_constraint( lattice: *mut mecab_lattice_t, pos: usize, @@ -1267,7 +809,7 @@ extern "C" { ); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::set_feature_constraint(begin_pos, end_pos, feature)"] + /// C wrapper of MeCab::Lattice::set_feature_constraint(begin_pos, end_pos, feature) pub fn mecab_lattice_set_feature_constraint( lattice: *mut mecab_lattice_t, begin_pos: usize, @@ -1276,53 +818,56 @@ extern "C" { ); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::set_result(result);"] + /// C wrapper of MeCab::Lattice::set_result(result); pub fn mecab_lattice_set_result( lattice: *mut mecab_lattice_t, result: *const ::std::os::raw::c_char, ); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::what()"] - pub fn mecab_lattice_strerror(lattice: *mut mecab_lattice_t) -> *const ::std::os::raw::c_char; + /// C wrapper of MeCab::Lattice::what() + pub fn mecab_lattice_strerror( + lattice: *mut mecab_lattice_t, + ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wapper of MeCab::Model::create(argc, argv)"] + /// C wapper of MeCab::Model::create(argc, argv) pub fn mecab_model_new( argc: ::std::os::raw::c_int, argv: *mut *mut ::std::os::raw::c_char, ) -> *mut mecab_model_t; } extern "C" { - #[doc = " C wapper of MeCab::Model::create(arg)"] + /// C wapper of MeCab::Model::create(arg) pub fn mecab_model_new2(arg: *const ::std::os::raw::c_char) -> *mut mecab_model_t; } extern "C" { - #[doc = " C wapper of MeCab::deleteModel(model)"] + /// C wapper of MeCab::deleteModel(model) pub fn mecab_model_destroy(model: *mut mecab_model_t); } extern "C" { - #[doc = " C wapper of MeCab::Model::createTagger()"] + /// C wapper of MeCab::Model::createTagger() pub fn mecab_model_new_tagger(model: *mut mecab_model_t) -> *mut mecab_t; } extern "C" { - #[doc = " C wapper of MeCab::Model::createLattice()"] + /// C wapper of MeCab::Model::createLattice() pub fn mecab_model_new_lattice(model: *mut mecab_model_t) -> *mut mecab_lattice_t; } extern "C" { - #[doc = " C wrapper of MeCab::Model::swap()"] + /// C wrapper of MeCab::Model::swap() pub fn mecab_model_swap( model: *mut mecab_model_t, new_model: *mut mecab_model_t, ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wapper of MeCab::Model::dictionary_info()"] - pub fn mecab_model_dictionary_info(model: *mut mecab_model_t) - -> *const mecab_dictionary_info_t; + /// C wapper of MeCab::Model::dictionary_info() + pub fn mecab_model_dictionary_info( + model: *mut mecab_model_t, + ) -> *const mecab_dictionary_info_t; } extern "C" { - #[doc = " C wrapper of MeCab::Model::transition_cost()"] + /// C wrapper of MeCab::Model::transition_cost() pub fn mecab_model_transition_cost( model: *mut mecab_model_t, rcAttr: ::std::os::raw::c_ushort, @@ -1330,7 +875,7 @@ extern "C" { ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Model::lookup()"] + /// C wrapper of MeCab::Model::lookup() pub fn mecab_model_lookup( model: *mut mecab_model_t, begin: *const ::std::os::raw::c_char, @@ -1374,11 +919,11 @@ extern "C" { argv: *mut *mut ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } -#[doc = " DictionaryInfo structure"] +/// DictionaryInfo structure pub type MeCab_DictionaryInfo = mecab_dictionary_info_t; -#[doc = " Path structure"] +/// Path structure pub type MeCab_Path = mecab_path_t; -#[doc = " Node structure"] +/// Node structure pub type MeCab_Node = mecab_node_t; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -1387,71 +932,55 @@ pub struct MeCab_Allocator { } #[repr(C)] pub struct MeCab_Lattice__bindgen_vtable(::std::os::raw::c_void); -#[doc = " Lattice class"] +/// Lattice class #[repr(C)] #[derive(Debug)] pub struct MeCab_Lattice { pub vtable_: *const MeCab_Lattice__bindgen_vtable, } -#[test] -fn bindgen_test_layout_MeCab_Lattice() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(MeCab_Lattice)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(MeCab_Lattice)) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of MeCab_Lattice"][::std::mem::size_of::() - 8usize]; + ["Alignment of MeCab_Lattice"][::std::mem::align_of::() - 8usize]; +}; extern "C" { - #[doc = " Create new Lattice object"] - #[doc = " @return new Lattice object"] + /** Create new Lattice object + @return new Lattice object*/ #[link_name = "\u{1}__ZN5MeCab7Lattice6createEv"] pub fn MeCab_Lattice_create() -> *mut MeCab_Lattice; } impl MeCab_Lattice { #[inline] pub unsafe fn create() -> *mut MeCab_Lattice { - unsafe { MeCab_Lattice_create() } + MeCab_Lattice_create() } } #[repr(C)] pub struct MeCab_Model__bindgen_vtable(::std::os::raw::c_void); -#[doc = " Model class"] +/// Model class #[repr(C)] #[derive(Debug)] pub struct MeCab_Model { pub vtable_: *const MeCab_Model__bindgen_vtable, } -#[test] -fn bindgen_test_layout_MeCab_Model() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(MeCab_Model)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(MeCab_Model)) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of MeCab_Model"][::std::mem::size_of::() - 8usize]; + ["Alignment of MeCab_Model"][::std::mem::align_of::() - 8usize]; +}; extern "C" { - #[doc = " Return a version string"] - #[doc = " @return version string"] + /** Return a version string + @return version string*/ #[link_name = "\u{1}__ZN5MeCab5Model7versionEv"] pub fn MeCab_Model_version() -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " Factory method to create a new Model with a specified main's argc/argv-style parameters."] - #[doc = " Return NULL if new model cannot be initialized. Use MeCab::getLastError() to obtain the"] - #[doc = " cause of the errors."] - #[doc = " @return new Model object"] - #[doc = " @param argc number of parameters"] - #[doc = " @param argv parameter list"] + /** Factory method to create a new Model with a specified main's argc/argv-style parameters. + Return NULL if new model cannot be initialized. Use MeCab::getLastError() to obtain the + cause of the errors. + @return new Model object + @param argc number of parameters + @param argv parameter list*/ #[link_name = "\u{1}__ZN5MeCab5Model6createEiPPc"] pub fn MeCab_Model_create( argc: ::std::os::raw::c_int, @@ -1459,74 +988,69 @@ extern "C" { ) -> *mut MeCab_Model; } extern "C" { - #[doc = " Factory method to create a new Model with a string parameter representation, i.e.,"] - #[doc = " \"-d /user/local/mecab/dic/ipadic -Ochasen\"."] - #[doc = " Return NULL if new model cannot be initialized. Use MeCab::getLastError() to obtain the"] - #[doc = " cause of the errors."] - #[doc = " @return new Model object"] - #[doc = " @param arg single string representation of the argment."] + /** Factory method to create a new Model with a string parameter representation, i.e., + "-d /user/local/mecab/dic/ipadic -Ochasen". + Return NULL if new model cannot be initialized. Use MeCab::getLastError() to obtain the + cause of the errors. + @return new Model object + @param arg single string representation of the argment.*/ #[link_name = "\u{1}__ZN5MeCab5Model6createEPKc"] pub fn MeCab_Model_create1(arg: *const ::std::os::raw::c_char) -> *mut MeCab_Model; } impl MeCab_Model { #[inline] pub unsafe fn version() -> *const ::std::os::raw::c_char { - unsafe { MeCab_Model_version() } + MeCab_Model_version() } #[inline] pub unsafe fn create( argc: ::std::os::raw::c_int, argv: *mut *mut ::std::os::raw::c_char, ) -> *mut MeCab_Model { - unsafe { MeCab_Model_create(argc, argv) } + MeCab_Model_create(argc, argv) } #[inline] pub unsafe fn create1(arg: *const ::std::os::raw::c_char) -> *mut MeCab_Model { - unsafe { MeCab_Model_create1(arg) } + MeCab_Model_create1(arg) } } #[repr(C)] pub struct MeCab_Tagger__bindgen_vtable(::std::os::raw::c_void); -#[doc = " Tagger class"] +/// Tagger class #[repr(C)] #[derive(Debug)] pub struct MeCab_Tagger { pub vtable_: *const MeCab_Tagger__bindgen_vtable, } -#[test] -fn bindgen_test_layout_MeCab_Tagger() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(MeCab_Tagger)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(MeCab_Tagger)) - ); -} -extern "C" { - #[doc = " Handy static method."] - #[doc = " Return true if lattice is parsed successfully."] - #[doc = " This function is equivalent to"] - #[doc = " {"] - #[doc = " Tagger *tagger = model.createModel();"] - #[doc = " cosnt bool result = tagger->parse(lattice);"] - #[doc = " delete tagger;"] - #[doc = " return result;"] - #[doc = " }"] - #[doc = " @return boolean"] +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of MeCab_Tagger"][::std::mem::size_of::() - 8usize]; + ["Alignment of MeCab_Tagger"][::std::mem::align_of::() - 8usize]; +}; +extern "C" { + /** Handy static method. + Return true if lattice is parsed successfully. + This function is equivalent to + { + Tagger *tagger = model.createModel(); + cosnt bool result = tagger->parse(lattice); + delete tagger; + return result; + } + @return boolean*/ #[link_name = "\u{1}__ZN5MeCab6Tagger5parseERKNS_5ModelEPNS_7LatticeE"] - pub fn MeCab_Tagger_parse(model: *const MeCab_Model, lattice: *mut MeCab_Lattice) -> bool; -} -extern "C" { - #[doc = " Factory method to create a new Tagger with a specified main's argc/argv-style parameters."] - #[doc = " Return NULL if new model cannot be initialized. Use MeCab::getLastError() to obtain the"] - #[doc = " cause of the errors."] - #[doc = " @return new Tagger object"] - #[doc = " @param argc number of parameters"] - #[doc = " @param argv parameter list"] + pub fn MeCab_Tagger_parse( + model: *const MeCab_Model, + lattice: *mut MeCab_Lattice, + ) -> bool; +} +extern "C" { + /** Factory method to create a new Tagger with a specified main's argc/argv-style parameters. + Return NULL if new model cannot be initialized. Use MeCab::getLastError() to obtain the + cause of the errors. + @return new Tagger object + @param argc number of parameters + @param argv parameter list*/ #[link_name = "\u{1}__ZN5MeCab6Tagger6createEiPPc"] pub fn MeCab_Tagger_create( argc: ::std::os::raw::c_int, @@ -1534,49 +1058,49 @@ extern "C" { ) -> *mut MeCab_Tagger; } extern "C" { - #[doc = " Factory method to create a new Tagger with a string parameter representation, i.e.,"] - #[doc = " \"-d /user/local/mecab/dic/ipadic -Ochasen\"."] - #[doc = " Return NULL if new model cannot be initialized. Use MeCab::getLastError() to obtain the"] - #[doc = " cause of the errors."] - #[doc = " @return new Model object"] - #[doc = " @param arg single string representation of the argment."] + /** Factory method to create a new Tagger with a string parameter representation, i.e., + "-d /user/local/mecab/dic/ipadic -Ochasen". + Return NULL if new model cannot be initialized. Use MeCab::getLastError() to obtain the + cause of the errors. + @return new Model object + @param arg single string representation of the argment.*/ #[link_name = "\u{1}__ZN5MeCab6Tagger6createEPKc"] pub fn MeCab_Tagger_create1(arg: *const ::std::os::raw::c_char) -> *mut MeCab_Tagger; } extern "C" { - #[doc = " Return a version string"] - #[doc = " @return version string"] + /** Return a version string + @return version string*/ #[link_name = "\u{1}__ZN5MeCab6Tagger7versionEv"] pub fn MeCab_Tagger_version() -> *const ::std::os::raw::c_char; } impl MeCab_Tagger { #[inline] pub unsafe fn parse(model: *const MeCab_Model, lattice: *mut MeCab_Lattice) -> bool { - unsafe { MeCab_Tagger_parse(model, lattice) } + MeCab_Tagger_parse(model, lattice) } #[inline] pub unsafe fn create( argc: ::std::os::raw::c_int, argv: *mut *mut ::std::os::raw::c_char, ) -> *mut MeCab_Tagger { - unsafe { MeCab_Tagger_create(argc, argv) } + MeCab_Tagger_create(argc, argv) } #[inline] pub unsafe fn create1(arg: *const ::std::os::raw::c_char) -> *mut MeCab_Tagger { - unsafe { MeCab_Tagger_create1(arg) } + MeCab_Tagger_create1(arg) } #[inline] pub unsafe fn version() -> *const ::std::os::raw::c_char { - unsafe { MeCab_Tagger_version() } + MeCab_Tagger_version() } } extern "C" { - #[doc = " Alias of Lattice::create()"] + /// Alias of Lattice::create() #[link_name = "\u{1}__ZN5MeCab13createLatticeEv"] pub fn MeCab_createLattice() -> *mut MeCab_Lattice; } extern "C" { - #[doc = " Alias of Mode::create(argc, argv)"] + /// Alias of Mode::create(argc, argv) #[link_name = "\u{1}__ZN5MeCab11createModelEiPPc"] pub fn MeCab_createModel( argc: ::std::os::raw::c_int, @@ -1584,12 +1108,12 @@ extern "C" { ) -> *mut MeCab_Model; } extern "C" { - #[doc = " Alias of Mode::create(arg)"] + /// Alias of Mode::create(arg) #[link_name = "\u{1}__ZN5MeCab11createModelEPKc"] pub fn MeCab_createModel1(arg: *const ::std::os::raw::c_char) -> *mut MeCab_Model; } extern "C" { - #[doc = " Alias of Tagger::create(argc, argv)"] + /// Alias of Tagger::create(argc, argv) #[link_name = "\u{1}__ZN5MeCab12createTaggerEiPPc"] pub fn MeCab_createTagger( argc: ::std::os::raw::c_int, @@ -1597,44 +1121,44 @@ extern "C" { ) -> *mut MeCab_Tagger; } extern "C" { - #[doc = " Alias of Tagger::create(arg)"] + /// Alias of Tagger::create(arg) #[link_name = "\u{1}__ZN5MeCab12createTaggerEPKc"] pub fn MeCab_createTagger1(arg: *const ::std::os::raw::c_char) -> *mut MeCab_Tagger; } extern "C" { - #[doc = " delete Lattice object."] - #[doc = " This method calles \"delete lattice\"."] - #[doc = " In some environment, e.g., MS-Windows, an object allocated inside a DLL must be deleted in the same DLL too."] - #[doc = " @param lattice lattice object"] + /** delete Lattice object. + This method calles "delete lattice". + In some environment, e.g., MS-Windows, an object allocated inside a DLL must be deleted in the same DLL too. + @param lattice lattice object*/ #[link_name = "\u{1}__ZN5MeCab13deleteLatticeEPNS_7LatticeE"] pub fn MeCab_deleteLattice(lattice: *mut MeCab_Lattice); } extern "C" { - #[doc = " delete Model object."] - #[doc = " This method calles \"delete model\"."] - #[doc = " In some environment, e.g., MS-Windows, an object allocated inside a DLL must be deleted in the same DLL too."] - #[doc = " @param model model object"] + /** delete Model object. + This method calles "delete model". + In some environment, e.g., MS-Windows, an object allocated inside a DLL must be deleted in the same DLL too. + @param model model object*/ #[link_name = "\u{1}__ZN5MeCab11deleteModelEPNS_5ModelE"] pub fn MeCab_deleteModel(model: *mut MeCab_Model); } extern "C" { - #[doc = " delete Tagger object."] - #[doc = " This method calles \"delete tagger\"."] - #[doc = " In some environment, e.g., MS-Windows, an object allocated inside a DLL must be deleted in the same DLL too."] - #[doc = " @param tagger tagger object"] + /** delete Tagger object. + This method calles "delete tagger". + In some environment, e.g., MS-Windows, an object allocated inside a DLL must be deleted in the same DLL too. + @param tagger tagger object*/ #[link_name = "\u{1}__ZN5MeCab12deleteTaggerEPNS_6TaggerE"] pub fn MeCab_deleteTagger(tagger: *mut MeCab_Tagger); } extern "C" { - #[doc = " Return last error string."] - #[doc = " @return error string"] + /** Return last error string. + @return error string*/ #[link_name = "\u{1}__ZN5MeCab12getLastErrorEv"] pub fn MeCab_getLastError() -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " An alias of getLastError."] - #[doc = " It is kept for backward compatibility."] - #[doc = " @return error string"] + /** An alias of getLastError. + It is kept for backward compatibility. + @return error string*/ #[link_name = "\u{1}__ZN5MeCab14getTaggerErrorEv"] pub fn MeCab_getTaggerError() -> *const ::std::os::raw::c_char; } @@ -1647,71 +1171,22 @@ pub struct _Mecab { pub tagger: *mut ::std::os::raw::c_void, pub lattice: *mut ::std::os::raw::c_void, } -#[test] -fn bindgen_test_layout__Mecab() { - const UNINIT: ::std::mem::MaybeUninit<_Mecab> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_Mecab>(), - 40usize, - concat!("Size of: ", stringify!(_Mecab)) - ); - assert_eq!( - ::std::mem::align_of::<_Mecab>(), - 8usize, - concat!("Alignment of ", stringify!(_Mecab)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).feature) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_Mecab), - "::", - stringify!(feature) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_Mecab), - "::", - stringify!(size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).model) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_Mecab), - "::", - stringify!(model) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tagger) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_Mecab), - "::", - stringify!(tagger) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lattice) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_Mecab), - "::", - stringify!(lattice) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _Mecab"][::std::mem::size_of::<_Mecab>() - 40usize]; + ["Alignment of _Mecab"][::std::mem::align_of::<_Mecab>() - 8usize]; + [ + "Offset of field: _Mecab::feature", + ][::std::mem::offset_of!(_Mecab, feature) - 0usize]; + ["Offset of field: _Mecab::size"][::std::mem::offset_of!(_Mecab, size) - 8usize]; + ["Offset of field: _Mecab::model"][::std::mem::offset_of!(_Mecab, model) - 16usize]; + [ + "Offset of field: _Mecab::tagger", + ][::std::mem::offset_of!(_Mecab, tagger) - 24usize]; + [ + "Offset of field: _Mecab::lattice", + ][::std::mem::offset_of!(_Mecab, lattice) - 32usize]; +}; pub type Mecab = _Mecab; extern "C" { pub fn Mecab_initialize(m: *mut Mecab) -> ::std::os::raw::c_int; @@ -1770,181 +1245,55 @@ pub struct _NJDNode { pub prev: *mut _NJDNode, pub next: *mut _NJDNode, } -#[test] -fn bindgen_test_layout__NJDNode() { - const UNINIT: ::std::mem::MaybeUninit<_NJDNode> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_NJDNode>(), - 120usize, - concat!("Size of: ", stringify!(_NJDNode)) - ); - assert_eq!( - ::std::mem::align_of::<_NJDNode>(), - 8usize, - concat!("Alignment of ", stringify!(_NJDNode)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).string) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(string) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pos) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(pos) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pos_group1) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(pos_group1) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pos_group2) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(pos_group2) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pos_group3) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(pos_group3) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ctype) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(ctype) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cform) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(cform) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).orig) as usize - ptr as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(orig) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).read) as usize - ptr as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(read) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pron) as usize - ptr as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(pron) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).acc) as usize - ptr as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(acc) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mora_size) as usize - ptr as usize }, - 84usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(mora_size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).chain_rule) as usize - ptr as usize }, - 88usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(chain_rule) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).chain_flag) as usize - ptr as usize }, - 96usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(chain_flag) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize }, - 104usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(prev) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 112usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(next) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _NJDNode"][::std::mem::size_of::<_NJDNode>() - 120usize]; + ["Alignment of _NJDNode"][::std::mem::align_of::<_NJDNode>() - 8usize]; + [ + "Offset of field: _NJDNode::string", + ][::std::mem::offset_of!(_NJDNode, string) - 0usize]; + ["Offset of field: _NJDNode::pos"][::std::mem::offset_of!(_NJDNode, pos) - 8usize]; + [ + "Offset of field: _NJDNode::pos_group1", + ][::std::mem::offset_of!(_NJDNode, pos_group1) - 16usize]; + [ + "Offset of field: _NJDNode::pos_group2", + ][::std::mem::offset_of!(_NJDNode, pos_group2) - 24usize]; + [ + "Offset of field: _NJDNode::pos_group3", + ][::std::mem::offset_of!(_NJDNode, pos_group3) - 32usize]; + [ + "Offset of field: _NJDNode::ctype", + ][::std::mem::offset_of!(_NJDNode, ctype) - 40usize]; + [ + "Offset of field: _NJDNode::cform", + ][::std::mem::offset_of!(_NJDNode, cform) - 48usize]; + [ + "Offset of field: _NJDNode::orig", + ][::std::mem::offset_of!(_NJDNode, orig) - 56usize]; + [ + "Offset of field: _NJDNode::read", + ][::std::mem::offset_of!(_NJDNode, read) - 64usize]; + [ + "Offset of field: _NJDNode::pron", + ][::std::mem::offset_of!(_NJDNode, pron) - 72usize]; + ["Offset of field: _NJDNode::acc"][::std::mem::offset_of!(_NJDNode, acc) - 80usize]; + [ + "Offset of field: _NJDNode::mora_size", + ][::std::mem::offset_of!(_NJDNode, mora_size) - 84usize]; + [ + "Offset of field: _NJDNode::chain_rule", + ][::std::mem::offset_of!(_NJDNode, chain_rule) - 88usize]; + [ + "Offset of field: _NJDNode::chain_flag", + ][::std::mem::offset_of!(_NJDNode, chain_flag) - 96usize]; + [ + "Offset of field: _NJDNode::prev", + ][::std::mem::offset_of!(_NJDNode, prev) - 104usize]; + [ + "Offset of field: _NJDNode::next", + ][::std::mem::offset_of!(_NJDNode, next) - 112usize]; +}; pub type NJDNode = _NJDNode; extern "C" { pub fn NJDNode_initialize(node: *mut NJDNode); @@ -1956,13 +1305,22 @@ extern "C" { pub fn NJDNode_set_pos(node: *mut NJDNode, str_: *const ::std::os::raw::c_char); } extern "C" { - pub fn NJDNode_set_pos_group1(node: *mut NJDNode, str_: *const ::std::os::raw::c_char); + pub fn NJDNode_set_pos_group1( + node: *mut NJDNode, + str_: *const ::std::os::raw::c_char, + ); } extern "C" { - pub fn NJDNode_set_pos_group2(node: *mut NJDNode, str_: *const ::std::os::raw::c_char); + pub fn NJDNode_set_pos_group2( + node: *mut NJDNode, + str_: *const ::std::os::raw::c_char, + ); } extern "C" { - pub fn NJDNode_set_pos_group3(node: *mut NJDNode, str_: *const ::std::os::raw::c_char); + pub fn NJDNode_set_pos_group3( + node: *mut NJDNode, + str_: *const ::std::os::raw::c_char, + ); } extern "C" { pub fn NJDNode_set_ctype(node: *mut NJDNode, str_: *const ::std::os::raw::c_char); @@ -1986,7 +1344,10 @@ extern "C" { pub fn NJDNode_set_mora_size(node: *mut NJDNode, size: ::std::os::raw::c_int); } extern "C" { - pub fn NJDNode_set_chain_rule(node: *mut NJDNode, str_: *const ::std::os::raw::c_char); + pub fn NJDNode_set_chain_rule( + node: *mut NJDNode, + str_: *const ::std::os::raw::c_char, + ); } extern "C" { pub fn NJDNode_set_chain_flag(node: *mut NJDNode, flag: ::std::os::raw::c_int); @@ -2086,41 +1447,13 @@ pub struct _NJD { pub head: *mut NJDNode, pub tail: *mut NJDNode, } -#[test] -fn bindgen_test_layout__NJD() { - const UNINIT: ::std::mem::MaybeUninit<_NJD> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_NJD>(), - 16usize, - concat!("Size of: ", stringify!(_NJD)) - ); - assert_eq!( - ::std::mem::align_of::<_NJD>(), - 8usize, - concat!("Alignment of ", stringify!(_NJD)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).head) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_NJD), - "::", - stringify!(head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tail) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_NJD), - "::", - stringify!(tail) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _NJD"][::std::mem::size_of::<_NJD>() - 16usize]; + ["Alignment of _NJD"][::std::mem::align_of::<_NJD>() - 8usize]; + ["Offset of field: _NJD::head"][::std::mem::offset_of!(_NJD, head) - 0usize]; + ["Offset of field: _NJD::tail"][::std::mem::offset_of!(_NJD, tail) - 8usize]; +}; pub type NJD = _NJD; extern "C" { pub fn NJD_initialize(njd: *mut NJD); @@ -2170,62 +1503,27 @@ pub struct _JPCommonLabelPhoneme { pub next: *mut _JPCommonLabelPhoneme, pub up: *mut _JPCommonLabelMora, } -#[test] -fn bindgen_test_layout__JPCommonLabelPhoneme() { - const UNINIT: ::std::mem::MaybeUninit<_JPCommonLabelPhoneme> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_JPCommonLabelPhoneme>(), - 32usize, - concat!("Size of: ", stringify!(_JPCommonLabelPhoneme)) - ); - assert_eq!( - ::std::mem::align_of::<_JPCommonLabelPhoneme>(), - 8usize, - concat!("Alignment of ", stringify!(_JPCommonLabelPhoneme)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).phoneme) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelPhoneme), - "::", - stringify!(phoneme) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelPhoneme), - "::", - stringify!(prev) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelPhoneme), - "::", - stringify!(next) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).up) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelPhoneme), - "::", - stringify!(up) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + [ + "Size of _JPCommonLabelPhoneme", + ][::std::mem::size_of::<_JPCommonLabelPhoneme>() - 32usize]; + [ + "Alignment of _JPCommonLabelPhoneme", + ][::std::mem::align_of::<_JPCommonLabelPhoneme>() - 8usize]; + [ + "Offset of field: _JPCommonLabelPhoneme::phoneme", + ][::std::mem::offset_of!(_JPCommonLabelPhoneme, phoneme) - 0usize]; + [ + "Offset of field: _JPCommonLabelPhoneme::prev", + ][::std::mem::offset_of!(_JPCommonLabelPhoneme, prev) - 8usize]; + [ + "Offset of field: _JPCommonLabelPhoneme::next", + ][::std::mem::offset_of!(_JPCommonLabelPhoneme, next) - 16usize]; + [ + "Offset of field: _JPCommonLabelPhoneme::up", + ][::std::mem::offset_of!(_JPCommonLabelPhoneme, up) - 24usize]; +}; pub type JPCommonLabelPhoneme = _JPCommonLabelPhoneme; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -2237,81 +1535,33 @@ pub struct _JPCommonLabelMora { pub next: *mut _JPCommonLabelMora, pub up: *mut _JPCommonLabelWord, } -#[test] -fn bindgen_test_layout__JPCommonLabelMora() { - const UNINIT: ::std::mem::MaybeUninit<_JPCommonLabelMora> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_JPCommonLabelMora>(), - 48usize, - concat!("Size of: ", stringify!(_JPCommonLabelMora)) - ); - assert_eq!( - ::std::mem::align_of::<_JPCommonLabelMora>(), - 8usize, - concat!("Alignment of ", stringify!(_JPCommonLabelMora)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mora) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelMora), - "::", - stringify!(mora) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).head) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelMora), - "::", - stringify!(head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tail) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelMora), - "::", - stringify!(tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelMora), - "::", - stringify!(prev) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelMora), - "::", - stringify!(next) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).up) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelMora), - "::", - stringify!(up) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + [ + "Size of _JPCommonLabelMora", + ][::std::mem::size_of::<_JPCommonLabelMora>() - 48usize]; + [ + "Alignment of _JPCommonLabelMora", + ][::std::mem::align_of::<_JPCommonLabelMora>() - 8usize]; + [ + "Offset of field: _JPCommonLabelMora::mora", + ][::std::mem::offset_of!(_JPCommonLabelMora, mora) - 0usize]; + [ + "Offset of field: _JPCommonLabelMora::head", + ][::std::mem::offset_of!(_JPCommonLabelMora, head) - 8usize]; + [ + "Offset of field: _JPCommonLabelMora::tail", + ][::std::mem::offset_of!(_JPCommonLabelMora, tail) - 16usize]; + [ + "Offset of field: _JPCommonLabelMora::prev", + ][::std::mem::offset_of!(_JPCommonLabelMora, prev) - 24usize]; + [ + "Offset of field: _JPCommonLabelMora::next", + ][::std::mem::offset_of!(_JPCommonLabelMora, next) - 32usize]; + [ + "Offset of field: _JPCommonLabelMora::up", + ][::std::mem::offset_of!(_JPCommonLabelMora, up) - 40usize]; +}; pub type JPCommonLabelMora = _JPCommonLabelMora; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -2326,111 +1576,42 @@ pub struct _JPCommonLabelWord { pub next: *mut _JPCommonLabelWord, pub up: *mut _JPCommonLabelAccentPhrase, } -#[test] -fn bindgen_test_layout__JPCommonLabelWord() { - const UNINIT: ::std::mem::MaybeUninit<_JPCommonLabelWord> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_JPCommonLabelWord>(), - 72usize, - concat!("Size of: ", stringify!(_JPCommonLabelWord)) - ); - assert_eq!( - ::std::mem::align_of::<_JPCommonLabelWord>(), - 8usize, - concat!("Alignment of ", stringify!(_JPCommonLabelWord)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pron) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(pron) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pos) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(pos) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ctype) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(ctype) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cform) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(cform) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).head) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tail) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(prev) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(next) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).up) as usize - ptr as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(up) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + [ + "Size of _JPCommonLabelWord", + ][::std::mem::size_of::<_JPCommonLabelWord>() - 72usize]; + [ + "Alignment of _JPCommonLabelWord", + ][::std::mem::align_of::<_JPCommonLabelWord>() - 8usize]; + [ + "Offset of field: _JPCommonLabelWord::pron", + ][::std::mem::offset_of!(_JPCommonLabelWord, pron) - 0usize]; + [ + "Offset of field: _JPCommonLabelWord::pos", + ][::std::mem::offset_of!(_JPCommonLabelWord, pos) - 8usize]; + [ + "Offset of field: _JPCommonLabelWord::ctype", + ][::std::mem::offset_of!(_JPCommonLabelWord, ctype) - 16usize]; + [ + "Offset of field: _JPCommonLabelWord::cform", + ][::std::mem::offset_of!(_JPCommonLabelWord, cform) - 24usize]; + [ + "Offset of field: _JPCommonLabelWord::head", + ][::std::mem::offset_of!(_JPCommonLabelWord, head) - 32usize]; + [ + "Offset of field: _JPCommonLabelWord::tail", + ][::std::mem::offset_of!(_JPCommonLabelWord, tail) - 40usize]; + [ + "Offset of field: _JPCommonLabelWord::prev", + ][::std::mem::offset_of!(_JPCommonLabelWord, prev) - 48usize]; + [ + "Offset of field: _JPCommonLabelWord::next", + ][::std::mem::offset_of!(_JPCommonLabelWord, next) - 56usize]; + [ + "Offset of field: _JPCommonLabelWord::up", + ][::std::mem::offset_of!(_JPCommonLabelWord, up) - 64usize]; +}; pub type JPCommonLabelWord = _JPCommonLabelWord; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -2443,92 +1624,36 @@ pub struct _JPCommonLabelAccentPhrase { pub next: *mut _JPCommonLabelAccentPhrase, pub up: *mut _JPCommonLabelBreathGroup, } -#[test] -fn bindgen_test_layout__JPCommonLabelAccentPhrase() { - const UNINIT: ::std::mem::MaybeUninit<_JPCommonLabelAccentPhrase> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_JPCommonLabelAccentPhrase>(), - 56usize, - concat!("Size of: ", stringify!(_JPCommonLabelAccentPhrase)) - ); - assert_eq!( - ::std::mem::align_of::<_JPCommonLabelAccentPhrase>(), - 8usize, - concat!("Alignment of ", stringify!(_JPCommonLabelAccentPhrase)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).accent) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelAccentPhrase), - "::", - stringify!(accent) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).emotion) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelAccentPhrase), - "::", - stringify!(emotion) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).head) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelAccentPhrase), - "::", - stringify!(head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tail) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelAccentPhrase), - "::", - stringify!(tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelAccentPhrase), - "::", - stringify!(prev) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelAccentPhrase), - "::", - stringify!(next) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).up) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelAccentPhrase), - "::", - stringify!(up) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + [ + "Size of _JPCommonLabelAccentPhrase", + ][::std::mem::size_of::<_JPCommonLabelAccentPhrase>() - 56usize]; + [ + "Alignment of _JPCommonLabelAccentPhrase", + ][::std::mem::align_of::<_JPCommonLabelAccentPhrase>() - 8usize]; + [ + "Offset of field: _JPCommonLabelAccentPhrase::accent", + ][::std::mem::offset_of!(_JPCommonLabelAccentPhrase, accent) - 0usize]; + [ + "Offset of field: _JPCommonLabelAccentPhrase::emotion", + ][::std::mem::offset_of!(_JPCommonLabelAccentPhrase, emotion) - 8usize]; + [ + "Offset of field: _JPCommonLabelAccentPhrase::head", + ][::std::mem::offset_of!(_JPCommonLabelAccentPhrase, head) - 16usize]; + [ + "Offset of field: _JPCommonLabelAccentPhrase::tail", + ][::std::mem::offset_of!(_JPCommonLabelAccentPhrase, tail) - 24usize]; + [ + "Offset of field: _JPCommonLabelAccentPhrase::prev", + ][::std::mem::offset_of!(_JPCommonLabelAccentPhrase, prev) - 32usize]; + [ + "Offset of field: _JPCommonLabelAccentPhrase::next", + ][::std::mem::offset_of!(_JPCommonLabelAccentPhrase, next) - 40usize]; + [ + "Offset of field: _JPCommonLabelAccentPhrase::up", + ][::std::mem::offset_of!(_JPCommonLabelAccentPhrase, up) - 48usize]; +}; pub type JPCommonLabelAccentPhrase = _JPCommonLabelAccentPhrase; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -2538,62 +1663,27 @@ pub struct _JPCommonLabelBreathGroup { pub prev: *mut _JPCommonLabelBreathGroup, pub next: *mut _JPCommonLabelBreathGroup, } -#[test] -fn bindgen_test_layout__JPCommonLabelBreathGroup() { - const UNINIT: ::std::mem::MaybeUninit<_JPCommonLabelBreathGroup> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_JPCommonLabelBreathGroup>(), - 32usize, - concat!("Size of: ", stringify!(_JPCommonLabelBreathGroup)) - ); - assert_eq!( - ::std::mem::align_of::<_JPCommonLabelBreathGroup>(), - 8usize, - concat!("Alignment of ", stringify!(_JPCommonLabelBreathGroup)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).head) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelBreathGroup), - "::", - stringify!(head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tail) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelBreathGroup), - "::", - stringify!(tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelBreathGroup), - "::", - stringify!(prev) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelBreathGroup), - "::", - stringify!(next) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + [ + "Size of _JPCommonLabelBreathGroup", + ][::std::mem::size_of::<_JPCommonLabelBreathGroup>() - 32usize]; + [ + "Alignment of _JPCommonLabelBreathGroup", + ][::std::mem::align_of::<_JPCommonLabelBreathGroup>() - 8usize]; + [ + "Offset of field: _JPCommonLabelBreathGroup::head", + ][::std::mem::offset_of!(_JPCommonLabelBreathGroup, head) - 0usize]; + [ + "Offset of field: _JPCommonLabelBreathGroup::tail", + ][::std::mem::offset_of!(_JPCommonLabelBreathGroup, tail) - 8usize]; + [ + "Offset of field: _JPCommonLabelBreathGroup::prev", + ][::std::mem::offset_of!(_JPCommonLabelBreathGroup, prev) - 16usize]; + [ + "Offset of field: _JPCommonLabelBreathGroup::next", + ][::std::mem::offset_of!(_JPCommonLabelBreathGroup, next) - 24usize]; +}; pub type JPCommonLabelBreathGroup = _JPCommonLabelBreathGroup; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -2612,151 +1702,50 @@ pub struct _JPCommonLabel { pub phoneme_tail: *mut JPCommonLabelPhoneme, pub short_pause_flag: ::std::os::raw::c_int, } -#[test] -fn bindgen_test_layout__JPCommonLabel() { - const UNINIT: ::std::mem::MaybeUninit<_JPCommonLabel> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_JPCommonLabel>(), - 104usize, - concat!("Size of: ", stringify!(_JPCommonLabel)) - ); - assert_eq!( - ::std::mem::align_of::<_JPCommonLabel>(), - 8usize, - concat!("Alignment of ", stringify!(_JPCommonLabel)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).feature) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(feature) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).breath_head) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(breath_head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).breath_tail) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(breath_tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).accent_head) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(accent_head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).accent_tail) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(accent_tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).word_head) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(word_head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).word_tail) as usize - ptr as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(word_tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mora_head) as usize - ptr as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(mora_head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mora_tail) as usize - ptr as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(mora_tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).phoneme_head) as usize - ptr as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(phoneme_head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).phoneme_tail) as usize - ptr as usize }, - 88usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(phoneme_tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).short_pause_flag) as usize - ptr as usize }, - 96usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(short_pause_flag) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _JPCommonLabel"][::std::mem::size_of::<_JPCommonLabel>() - 104usize]; + ["Alignment of _JPCommonLabel"][::std::mem::align_of::<_JPCommonLabel>() - 8usize]; + [ + "Offset of field: _JPCommonLabel::size", + ][::std::mem::offset_of!(_JPCommonLabel, size) - 0usize]; + [ + "Offset of field: _JPCommonLabel::feature", + ][::std::mem::offset_of!(_JPCommonLabel, feature) - 8usize]; + [ + "Offset of field: _JPCommonLabel::breath_head", + ][::std::mem::offset_of!(_JPCommonLabel, breath_head) - 16usize]; + [ + "Offset of field: _JPCommonLabel::breath_tail", + ][::std::mem::offset_of!(_JPCommonLabel, breath_tail) - 24usize]; + [ + "Offset of field: _JPCommonLabel::accent_head", + ][::std::mem::offset_of!(_JPCommonLabel, accent_head) - 32usize]; + [ + "Offset of field: _JPCommonLabel::accent_tail", + ][::std::mem::offset_of!(_JPCommonLabel, accent_tail) - 40usize]; + [ + "Offset of field: _JPCommonLabel::word_head", + ][::std::mem::offset_of!(_JPCommonLabel, word_head) - 48usize]; + [ + "Offset of field: _JPCommonLabel::word_tail", + ][::std::mem::offset_of!(_JPCommonLabel, word_tail) - 56usize]; + [ + "Offset of field: _JPCommonLabel::mora_head", + ][::std::mem::offset_of!(_JPCommonLabel, mora_head) - 64usize]; + [ + "Offset of field: _JPCommonLabel::mora_tail", + ][::std::mem::offset_of!(_JPCommonLabel, mora_tail) - 72usize]; + [ + "Offset of field: _JPCommonLabel::phoneme_head", + ][::std::mem::offset_of!(_JPCommonLabel, phoneme_head) - 80usize]; + [ + "Offset of field: _JPCommonLabel::phoneme_tail", + ][::std::mem::offset_of!(_JPCommonLabel, phoneme_tail) - 88usize]; + [ + "Offset of field: _JPCommonLabel::short_pause_flag", + ][::std::mem::offset_of!(_JPCommonLabel, short_pause_flag) - 96usize]; +}; pub type JPCommonLabel = _JPCommonLabel; extern "C" { pub fn JPCommonLabel_initialize(label: *mut JPCommonLabel); @@ -2779,8 +1768,9 @@ extern "C" { pub fn JPCommonLabel_get_size(label: *mut JPCommonLabel) -> ::std::os::raw::c_int; } extern "C" { - pub fn JPCommonLabel_get_feature(label: *mut JPCommonLabel) - -> *mut *mut ::std::os::raw::c_char; + pub fn JPCommonLabel_get_feature( + label: *mut JPCommonLabel, + ) -> *mut *mut ::std::os::raw::c_char; } extern "C" { pub fn JPCommonLabel_print(label: *mut JPCommonLabel); @@ -2803,134 +1793,91 @@ pub struct _JPCommonNode { pub prev: *mut _JPCommonNode, pub next: *mut _JPCommonNode, } -#[test] -fn bindgen_test_layout__JPCommonNode() { - const UNINIT: ::std::mem::MaybeUninit<_JPCommonNode> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_JPCommonNode>(), - 56usize, - concat!("Size of: ", stringify!(_JPCommonNode)) - ); - assert_eq!( - ::std::mem::align_of::<_JPCommonNode>(), - 8usize, - concat!("Alignment of ", stringify!(_JPCommonNode)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pron) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonNode), - "::", - stringify!(pron) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pos) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonNode), - "::", - stringify!(pos) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ctype) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonNode), - "::", - stringify!(ctype) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cform) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonNode), - "::", - stringify!(cform) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).acc) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonNode), - "::", - stringify!(acc) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).chain_flag) as usize - ptr as usize }, - 36usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonNode), - "::", - stringify!(chain_flag) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonNode), - "::", - stringify!(prev) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonNode), - "::", - stringify!(next) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _JPCommonNode"][::std::mem::size_of::<_JPCommonNode>() - 56usize]; + ["Alignment of _JPCommonNode"][::std::mem::align_of::<_JPCommonNode>() - 8usize]; + [ + "Offset of field: _JPCommonNode::pron", + ][::std::mem::offset_of!(_JPCommonNode, pron) - 0usize]; + [ + "Offset of field: _JPCommonNode::pos", + ][::std::mem::offset_of!(_JPCommonNode, pos) - 8usize]; + [ + "Offset of field: _JPCommonNode::ctype", + ][::std::mem::offset_of!(_JPCommonNode, ctype) - 16usize]; + [ + "Offset of field: _JPCommonNode::cform", + ][::std::mem::offset_of!(_JPCommonNode, cform) - 24usize]; + [ + "Offset of field: _JPCommonNode::acc", + ][::std::mem::offset_of!(_JPCommonNode, acc) - 32usize]; + [ + "Offset of field: _JPCommonNode::chain_flag", + ][::std::mem::offset_of!(_JPCommonNode, chain_flag) - 36usize]; + [ + "Offset of field: _JPCommonNode::prev", + ][::std::mem::offset_of!(_JPCommonNode, prev) - 40usize]; + [ + "Offset of field: _JPCommonNode::next", + ][::std::mem::offset_of!(_JPCommonNode, next) - 48usize]; +}; pub type JPCommonNode = _JPCommonNode; extern "C" { pub fn JPCommonNode_initialize(node: *mut JPCommonNode); } extern "C" { - pub fn JPCommonNode_set_pron(node: *mut JPCommonNode, str_: *const ::std::os::raw::c_char); + pub fn JPCommonNode_set_pron( + node: *mut JPCommonNode, + str_: *const ::std::os::raw::c_char, + ); } extern "C" { - pub fn JPCommonNode_set_pos(node: *mut JPCommonNode, str_: *const ::std::os::raw::c_char); + pub fn JPCommonNode_set_pos( + node: *mut JPCommonNode, + str_: *const ::std::os::raw::c_char, + ); } extern "C" { - pub fn JPCommonNode_set_ctype(node: *mut JPCommonNode, str_: *const ::std::os::raw::c_char); + pub fn JPCommonNode_set_ctype( + node: *mut JPCommonNode, + str_: *const ::std::os::raw::c_char, + ); } extern "C" { - pub fn JPCommonNode_set_cform(node: *mut JPCommonNode, str_: *const ::std::os::raw::c_char); + pub fn JPCommonNode_set_cform( + node: *mut JPCommonNode, + str_: *const ::std::os::raw::c_char, + ); } extern "C" { pub fn JPCommonNode_set_acc(node: *mut JPCommonNode, acc: ::std::os::raw::c_int); } extern "C" { - pub fn JPCommonNode_set_chain_flag(node: *mut JPCommonNode, flag: ::std::os::raw::c_int); + pub fn JPCommonNode_set_chain_flag( + node: *mut JPCommonNode, + flag: ::std::os::raw::c_int, + ); } extern "C" { - pub fn JPCommonNode_get_pron(node: *mut JPCommonNode) -> *const ::std::os::raw::c_char; + pub fn JPCommonNode_get_pron( + node: *mut JPCommonNode, + ) -> *const ::std::os::raw::c_char; } extern "C" { - pub fn JPCommonNode_get_pos(node: *mut JPCommonNode) -> *const ::std::os::raw::c_char; + pub fn JPCommonNode_get_pos( + node: *mut JPCommonNode, + ) -> *const ::std::os::raw::c_char; } extern "C" { - pub fn JPCommonNode_get_ctype(node: *mut JPCommonNode) -> *const ::std::os::raw::c_char; + pub fn JPCommonNode_get_ctype( + node: *mut JPCommonNode, + ) -> *const ::std::os::raw::c_char; } extern "C" { - pub fn JPCommonNode_get_cform(node: *mut JPCommonNode) -> *const ::std::os::raw::c_char; + pub fn JPCommonNode_get_cform( + node: *mut JPCommonNode, + ) -> *const ::std::os::raw::c_char; } extern "C" { pub fn JPCommonNode_get_acc(node: *mut JPCommonNode) -> ::std::os::raw::c_int; @@ -2954,51 +1901,20 @@ pub struct _JPCommon { pub tail: *mut JPCommonNode, pub label: *mut JPCommonLabel, } -#[test] -fn bindgen_test_layout__JPCommon() { - const UNINIT: ::std::mem::MaybeUninit<_JPCommon> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_JPCommon>(), - 24usize, - concat!("Size of: ", stringify!(_JPCommon)) - ); - assert_eq!( - ::std::mem::align_of::<_JPCommon>(), - 8usize, - concat!("Alignment of ", stringify!(_JPCommon)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).head) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_JPCommon), - "::", - stringify!(head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tail) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_JPCommon), - "::", - stringify!(tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).label) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_JPCommon), - "::", - stringify!(label) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _JPCommon"][::std::mem::size_of::<_JPCommon>() - 24usize]; + ["Alignment of _JPCommon"][::std::mem::align_of::<_JPCommon>() - 8usize]; + [ + "Offset of field: _JPCommon::head", + ][::std::mem::offset_of!(_JPCommon, head) - 0usize]; + [ + "Offset of field: _JPCommon::tail", + ][::std::mem::offset_of!(_JPCommon, tail) - 8usize]; + [ + "Offset of field: _JPCommon::label", + ][::std::mem::offset_of!(_JPCommon, label) - 16usize]; +}; pub type JPCommon = _JPCommon; extern "C" { pub fn JPCommon_initialize(jpcommon: *mut JPCommon); @@ -3013,7 +1929,9 @@ extern "C" { pub fn JPCommon_get_label_size(jpcommon: *mut JPCommon) -> ::std::os::raw::c_int; } extern "C" { - pub fn JPCommon_get_label_feature(jpcommon: *mut JPCommon) -> *mut *mut ::std::os::raw::c_char; + pub fn JPCommon_get_label_feature( + jpcommon: *mut JPCommon, + ) -> *mut *mut ::std::os::raw::c_char; } extern "C" { pub fn JPCommon_print(jpcommon: *mut JPCommon); diff --git a/crates/open_jtalk-sys/src/generated/windows/x86/bindings.rs b/crates/open_jtalk-sys/src/generated/windows/x86/bindings.rs index 97f0a27..43438f3 100644 --- a/crates/open_jtalk-sys/src/generated/windows/x86/bindings.rs +++ b/crates/open_jtalk-sys/src/generated/windows/x86/bindings.rs @@ -1,540 +1,261 @@ -/* automatically generated by rust-bindgen 0.62.0 */ +/* automatically generated by rust-bindgen 0.70.1 */ -#[doc = " DictionaryInfo structure"] +/// DictionaryInfo structure #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct mecab_dictionary_info_t { - #[doc = " filename of dictionary"] - #[doc = " On Windows, filename is stored in UTF-8 encoding"] + /** filename of dictionary + On Windows, filename is stored in UTF-8 encoding*/ pub filename: *const ::std::os::raw::c_char, - #[doc = " character set of the dictionary. e.g., \"SHIFT-JIS\", \"UTF-8\""] + /// character set of the dictionary. e.g., "SHIFT-JIS", "UTF-8" pub charset: *const ::std::os::raw::c_char, - #[doc = " How many words are registered in this dictionary."] + /// How many words are registered in this dictionary. pub size: ::std::os::raw::c_uint, - #[doc = " dictionary type"] - #[doc = " this value should be MECAB_USR_DIC, MECAB_SYS_DIC, or MECAB_UNK_DIC."] + /** dictionary type + this value should be MECAB_USR_DIC, MECAB_SYS_DIC, or MECAB_UNK_DIC.*/ pub type_: ::std::os::raw::c_int, - #[doc = " left attributes size"] + /// left attributes size pub lsize: ::std::os::raw::c_uint, - #[doc = " right attributes size"] + /// right attributes size pub rsize: ::std::os::raw::c_uint, - #[doc = " version of this dictionary"] + /// version of this dictionary pub version: ::std::os::raw::c_ushort, - #[doc = " pointer to the next dictionary info."] + /// pointer to the next dictionary info. pub next: *mut mecab_dictionary_info_t, } -#[test] -fn bindgen_test_layout_mecab_dictionary_info_t() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!("Size of: ", stringify!(mecab_dictionary_info_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(mecab_dictionary_info_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).filename) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(mecab_dictionary_info_t), - "::", - stringify!(filename) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).charset) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(mecab_dictionary_info_t), - "::", - stringify!(charset) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(mecab_dictionary_info_t), - "::", - stringify!(size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(mecab_dictionary_info_t), - "::", - stringify!(type_) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lsize) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(mecab_dictionary_info_t), - "::", - stringify!(lsize) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rsize) as usize - ptr as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(mecab_dictionary_info_t), - "::", - stringify!(rsize) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).version) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(mecab_dictionary_info_t), - "::", - stringify!(version) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 28usize, - concat!( - "Offset of field: ", - stringify!(mecab_dictionary_info_t), - "::", - stringify!(next) - ) - ); -} -#[doc = " Path structure"] +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + [ + "Size of mecab_dictionary_info_t", + ][::std::mem::size_of::() - 32usize]; + [ + "Alignment of mecab_dictionary_info_t", + ][::std::mem::align_of::() - 4usize]; + [ + "Offset of field: mecab_dictionary_info_t::filename", + ][::std::mem::offset_of!(mecab_dictionary_info_t, filename) - 0usize]; + [ + "Offset of field: mecab_dictionary_info_t::charset", + ][::std::mem::offset_of!(mecab_dictionary_info_t, charset) - 4usize]; + [ + "Offset of field: mecab_dictionary_info_t::size", + ][::std::mem::offset_of!(mecab_dictionary_info_t, size) - 8usize]; + [ + "Offset of field: mecab_dictionary_info_t::type_", + ][::std::mem::offset_of!(mecab_dictionary_info_t, type_) - 12usize]; + [ + "Offset of field: mecab_dictionary_info_t::lsize", + ][::std::mem::offset_of!(mecab_dictionary_info_t, lsize) - 16usize]; + [ + "Offset of field: mecab_dictionary_info_t::rsize", + ][::std::mem::offset_of!(mecab_dictionary_info_t, rsize) - 20usize]; + [ + "Offset of field: mecab_dictionary_info_t::version", + ][::std::mem::offset_of!(mecab_dictionary_info_t, version) - 24usize]; + [ + "Offset of field: mecab_dictionary_info_t::next", + ][::std::mem::offset_of!(mecab_dictionary_info_t, next) - 28usize]; +}; +/// Path structure #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct mecab_path_t { - #[doc = " pointer to the right node"] + /// pointer to the right node pub rnode: *mut mecab_node_t, - #[doc = " pointer to the next right path"] + /// pointer to the next right path pub rnext: *mut mecab_path_t, - #[doc = " pointer to the left node"] + /// pointer to the left node pub lnode: *mut mecab_node_t, - #[doc = " pointer to the next left path"] + /// pointer to the next left path pub lnext: *mut mecab_path_t, - #[doc = " local cost"] + /// local cost pub cost: ::std::os::raw::c_int, - #[doc = " marginal probability"] + /// marginal probability pub prob: f32, } -#[test] -fn bindgen_test_layout_mecab_path_t() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(mecab_path_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(mecab_path_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rnode) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(mecab_path_t), - "::", - stringify!(rnode) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rnext) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(mecab_path_t), - "::", - stringify!(rnext) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lnode) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(mecab_path_t), - "::", - stringify!(lnode) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lnext) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(mecab_path_t), - "::", - stringify!(lnext) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cost) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(mecab_path_t), - "::", - stringify!(cost) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prob) as usize - ptr as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(mecab_path_t), - "::", - stringify!(prob) - ) - ); -} -#[doc = " Node structure"] +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of mecab_path_t"][::std::mem::size_of::() - 24usize]; + ["Alignment of mecab_path_t"][::std::mem::align_of::() - 4usize]; + [ + "Offset of field: mecab_path_t::rnode", + ][::std::mem::offset_of!(mecab_path_t, rnode) - 0usize]; + [ + "Offset of field: mecab_path_t::rnext", + ][::std::mem::offset_of!(mecab_path_t, rnext) - 4usize]; + [ + "Offset of field: mecab_path_t::lnode", + ][::std::mem::offset_of!(mecab_path_t, lnode) - 8usize]; + [ + "Offset of field: mecab_path_t::lnext", + ][::std::mem::offset_of!(mecab_path_t, lnext) - 12usize]; + [ + "Offset of field: mecab_path_t::cost", + ][::std::mem::offset_of!(mecab_path_t, cost) - 16usize]; + [ + "Offset of field: mecab_path_t::prob", + ][::std::mem::offset_of!(mecab_path_t, prob) - 20usize]; +}; +/// Node structure #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct mecab_node_t { - #[doc = " pointer to the previous node."] + /// pointer to the previous node. pub prev: *mut mecab_node_t, - #[doc = " pointer to the next node."] + /// pointer to the next node. pub next: *mut mecab_node_t, - #[doc = " pointer to the node which ends at the same position."] + /// pointer to the node which ends at the same position. pub enext: *mut mecab_node_t, - #[doc = " pointer to the node which starts at the same position."] + /// pointer to the node which starts at the same position. pub bnext: *mut mecab_node_t, - #[doc = " pointer to the right path."] - #[doc = " this value is NULL if MECAB_ONE_BEST mode."] + /** pointer to the right path. + this value is NULL if MECAB_ONE_BEST mode.*/ pub rpath: *mut mecab_path_t, - #[doc = " pointer to the right path."] - #[doc = " this value is NULL if MECAB_ONE_BEST mode."] + /** pointer to the right path. + this value is NULL if MECAB_ONE_BEST mode.*/ pub lpath: *mut mecab_path_t, - #[doc = " surface string."] - #[doc = " this value is not 0 terminated."] - #[doc = " You can get the length with length/rlength members."] + /** surface string. + this value is not 0 terminated. + You can get the length with length/rlength members.*/ pub surface: *const ::std::os::raw::c_char, - #[doc = " feature string"] + /// feature string pub feature: *const ::std::os::raw::c_char, - #[doc = " unique node id"] + /// unique node id pub id: ::std::os::raw::c_uint, - #[doc = " length of the surface form."] + /// length of the surface form. pub length: ::std::os::raw::c_ushort, - #[doc = " length of the surface form including white space before the morph."] + /// length of the surface form including white space before the morph. pub rlength: ::std::os::raw::c_ushort, - #[doc = " right attribute id"] + /// right attribute id pub rcAttr: ::std::os::raw::c_ushort, - #[doc = " left attribute id"] + /// left attribute id pub lcAttr: ::std::os::raw::c_ushort, - #[doc = " unique part of speech id. This value is defined in \"pos.def\" file."] + /// unique part of speech id. This value is defined in "pos.def" file. pub posid: ::std::os::raw::c_ushort, - #[doc = " character type"] + /// character type pub char_type: ::std::os::raw::c_uchar, - #[doc = " status of this model."] - #[doc = " This value is MECAB_NOR_NODE, MECAB_UNK_NODE, MECAB_BOS_NODE, MECAB_EOS_NODE, or MECAB_EON_NODE."] + /** status of this model. + This value is MECAB_NOR_NODE, MECAB_UNK_NODE, MECAB_BOS_NODE, MECAB_EOS_NODE, or MECAB_EON_NODE.*/ pub stat: ::std::os::raw::c_uchar, - #[doc = " set 1 if this node is best node."] + /// set 1 if this node is best node. pub isbest: ::std::os::raw::c_uchar, - #[doc = " forward accumulative log summation."] - #[doc = " This value is only available when MECAB_MARGINAL_PROB is passed."] + /** forward accumulative log summation. + This value is only available when MECAB_MARGINAL_PROB is passed.*/ pub alpha: f32, - #[doc = " backward accumulative log summation."] - #[doc = " This value is only available when MECAB_MARGINAL_PROB is passed."] + /** backward accumulative log summation. + This value is only available when MECAB_MARGINAL_PROB is passed.*/ pub beta: f32, - #[doc = " marginal probability."] - #[doc = " This value is only available when MECAB_MARGINAL_PROB is passed."] + /** marginal probability. + This value is only available when MECAB_MARGINAL_PROB is passed.*/ pub prob: f32, - #[doc = " word cost."] + /// word cost. pub wcost: ::std::os::raw::c_short, - #[doc = " best accumulative cost from bos node to this node."] + /// best accumulative cost from bos node to this node. pub cost: ::std::os::raw::c_long, } -#[test] -fn bindgen_test_layout_mecab_node_t() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 72usize, - concat!("Size of: ", stringify!(mecab_node_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(mecab_node_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(prev) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(next) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).enext) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(enext) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).bnext) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(bnext) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rpath) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(rpath) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lpath) as usize - ptr as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(lpath) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).surface) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(surface) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).feature) as usize - ptr as usize }, - 28usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(feature) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).id) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(id) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).length) as usize - ptr as usize }, - 36usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(length) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rlength) as usize - ptr as usize }, - 38usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(rlength) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rcAttr) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(rcAttr) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lcAttr) as usize - ptr as usize }, - 42usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(lcAttr) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).posid) as usize - ptr as usize }, - 44usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(posid) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).char_type) as usize - ptr as usize }, - 46usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(char_type) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).stat) as usize - ptr as usize }, - 47usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(stat) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).isbest) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(isbest) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).alpha) as usize - ptr as usize }, - 52usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(alpha) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).beta) as usize - ptr as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(beta) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prob) as usize - ptr as usize }, - 60usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(prob) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).wcost) as usize - ptr as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(wcost) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cost) as usize - ptr as usize }, - 68usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(cost) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of mecab_node_t"][::std::mem::size_of::() - 72usize]; + ["Alignment of mecab_node_t"][::std::mem::align_of::() - 4usize]; + [ + "Offset of field: mecab_node_t::prev", + ][::std::mem::offset_of!(mecab_node_t, prev) - 0usize]; + [ + "Offset of field: mecab_node_t::next", + ][::std::mem::offset_of!(mecab_node_t, next) - 4usize]; + [ + "Offset of field: mecab_node_t::enext", + ][::std::mem::offset_of!(mecab_node_t, enext) - 8usize]; + [ + "Offset of field: mecab_node_t::bnext", + ][::std::mem::offset_of!(mecab_node_t, bnext) - 12usize]; + [ + "Offset of field: mecab_node_t::rpath", + ][::std::mem::offset_of!(mecab_node_t, rpath) - 16usize]; + [ + "Offset of field: mecab_node_t::lpath", + ][::std::mem::offset_of!(mecab_node_t, lpath) - 20usize]; + [ + "Offset of field: mecab_node_t::surface", + ][::std::mem::offset_of!(mecab_node_t, surface) - 24usize]; + [ + "Offset of field: mecab_node_t::feature", + ][::std::mem::offset_of!(mecab_node_t, feature) - 28usize]; + [ + "Offset of field: mecab_node_t::id", + ][::std::mem::offset_of!(mecab_node_t, id) - 32usize]; + [ + "Offset of field: mecab_node_t::length", + ][::std::mem::offset_of!(mecab_node_t, length) - 36usize]; + [ + "Offset of field: mecab_node_t::rlength", + ][::std::mem::offset_of!(mecab_node_t, rlength) - 38usize]; + [ + "Offset of field: mecab_node_t::rcAttr", + ][::std::mem::offset_of!(mecab_node_t, rcAttr) - 40usize]; + [ + "Offset of field: mecab_node_t::lcAttr", + ][::std::mem::offset_of!(mecab_node_t, lcAttr) - 42usize]; + [ + "Offset of field: mecab_node_t::posid", + ][::std::mem::offset_of!(mecab_node_t, posid) - 44usize]; + [ + "Offset of field: mecab_node_t::char_type", + ][::std::mem::offset_of!(mecab_node_t, char_type) - 46usize]; + [ + "Offset of field: mecab_node_t::stat", + ][::std::mem::offset_of!(mecab_node_t, stat) - 47usize]; + [ + "Offset of field: mecab_node_t::isbest", + ][::std::mem::offset_of!(mecab_node_t, isbest) - 48usize]; + [ + "Offset of field: mecab_node_t::alpha", + ][::std::mem::offset_of!(mecab_node_t, alpha) - 52usize]; + [ + "Offset of field: mecab_node_t::beta", + ][::std::mem::offset_of!(mecab_node_t, beta) - 56usize]; + [ + "Offset of field: mecab_node_t::prob", + ][::std::mem::offset_of!(mecab_node_t, prob) - 60usize]; + [ + "Offset of field: mecab_node_t::wcost", + ][::std::mem::offset_of!(mecab_node_t, wcost) - 64usize]; + [ + "Offset of field: mecab_node_t::cost", + ][::std::mem::offset_of!(mecab_node_t, cost) - 68usize]; +}; pub const MECAB_NOR_NODE: _bindgen_ty_3 = _bindgen_ty_3::MECAB_NOR_NODE; pub const MECAB_UNK_NODE: _bindgen_ty_3 = _bindgen_ty_3::MECAB_UNK_NODE; pub const MECAB_BOS_NODE: _bindgen_ty_3 = _bindgen_ty_3::MECAB_BOS_NODE; pub const MECAB_EOS_NODE: _bindgen_ty_3 = _bindgen_ty_3::MECAB_EOS_NODE; pub const MECAB_EON_NODE: _bindgen_ty_3 = _bindgen_ty_3::MECAB_EON_NODE; #[repr(i32)] -#[doc = " Parameters for MeCab::Node::stat"] +/// Parameters for MeCab::Node::stat #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum _bindgen_ty_3 { - #[doc = " Normal node defined in the dictionary."] + /// Normal node defined in the dictionary. MECAB_NOR_NODE = 0, - #[doc = " Unknown node not defined in the dictionary."] + /// Unknown node not defined in the dictionary. MECAB_UNK_NODE = 1, - #[doc = " Virtual node representing a beginning of the sentence."] + /// Virtual node representing a beginning of the sentence. MECAB_BOS_NODE = 2, - #[doc = " Virtual node representing a end of the sentence."] + /// Virtual node representing a end of the sentence. MECAB_EOS_NODE = 3, - #[doc = " Virtual node representing a end of the N-best enumeration."] + /// Virtual node representing a end of the N-best enumeration. MECAB_EON_NODE = 4, } pub const MECAB_SYS_DIC: _bindgen_ty_4 = _bindgen_ty_4::MECAB_SYS_DIC; pub const MECAB_USR_DIC: _bindgen_ty_4 = _bindgen_ty_4::MECAB_USR_DIC; pub const MECAB_UNK_DIC: _bindgen_ty_4 = _bindgen_ty_4::MECAB_UNK_DIC; #[repr(i32)] -#[doc = " Parameters for MeCab::DictionaryInfo::type"] +/// Parameters for MeCab::DictionaryInfo::type #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum _bindgen_ty_4 { - #[doc = " This is a system dictionary."] + /// This is a system dictionary. MECAB_SYS_DIC = 0, - #[doc = " This is a user dictionary."] + /// This is a user dictionary. MECAB_USR_DIC = 1, - #[doc = " This is a unknown word dictionary."] + /// This is a unknown word dictionary. MECAB_UNK_DIC = 2, } pub const MECAB_ONE_BEST: _bindgen_ty_5 = _bindgen_ty_5::MECAB_ONE_BEST; @@ -545,43 +266,43 @@ pub const MECAB_ALTERNATIVE: _bindgen_ty_5 = _bindgen_ty_5::MECAB_ALTERNATIVE; pub const MECAB_ALL_MORPHS: _bindgen_ty_5 = _bindgen_ty_5::MECAB_ALL_MORPHS; pub const MECAB_ALLOCATE_SENTENCE: _bindgen_ty_5 = _bindgen_ty_5::MECAB_ALLOCATE_SENTENCE; #[repr(i32)] -#[doc = " Parameters for MeCab::Lattice::request_type"] +/// Parameters for MeCab::Lattice::request_type #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum _bindgen_ty_5 { - #[doc = " One best result is obtained (default mode)"] + /// One best result is obtained (default mode) MECAB_ONE_BEST = 1, - #[doc = " Set this flag if you want to obtain N best results."] + /// Set this flag if you want to obtain N best results. MECAB_NBEST = 2, - #[doc = " Set this flag if you want to enable a partial parsing mode."] - #[doc = " When this flag is set, the input |sentence| needs to be written"] - #[doc = " in partial parsing format."] + /** Set this flag if you want to enable a partial parsing mode. + When this flag is set, the input |sentence| needs to be written + in partial parsing format.*/ MECAB_PARTIAL = 4, - #[doc = " Set this flag if you want to obtain marginal probabilities."] - #[doc = " Marginal probability is set in MeCab::Node::prob."] - #[doc = " The parsing speed will get 3-5 times slower than the default mode."] + /** Set this flag if you want to obtain marginal probabilities. + Marginal probability is set in MeCab::Node::prob. + The parsing speed will get 3-5 times slower than the default mode.*/ MECAB_MARGINAL_PROB = 8, - #[doc = " Set this flag if you want to obtain alternative results."] - #[doc = " Not implemented."] + /** Set this flag if you want to obtain alternative results. + Not implemented.*/ MECAB_ALTERNATIVE = 16, - #[doc = " When this flag is set, the result linked-list (Node::next/prev)"] - #[doc = " traverses all nodes in the lattice."] + /** When this flag is set, the result linked-list (Node::next/prev) + traverses all nodes in the lattice.*/ MECAB_ALL_MORPHS = 32, - #[doc = " When this flag is set, tagger internally copies the body of passed"] - #[doc = " sentence into internal buffer."] + /** When this flag is set, tagger internally copies the body of passed + sentence into internal buffer.*/ MECAB_ALLOCATE_SENTENCE = 64, } pub const MECAB_ANY_BOUNDARY: _bindgen_ty_6 = _bindgen_ty_6::MECAB_ANY_BOUNDARY; pub const MECAB_TOKEN_BOUNDARY: _bindgen_ty_6 = _bindgen_ty_6::MECAB_TOKEN_BOUNDARY; pub const MECAB_INSIDE_TOKEN: _bindgen_ty_6 = _bindgen_ty_6::MECAB_INSIDE_TOKEN; #[repr(i32)] -#[doc = " Parameters for MeCab::Lattice::boundary_constraint_type"] +/// Parameters for MeCab::Lattice::boundary_constraint_type #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum _bindgen_ty_6 { - #[doc = " The token boundary is not specified."] + /// The token boundary is not specified. MECAB_ANY_BOUNDARY = 0, - #[doc = " The position is a strong token boundary."] + /// The position is a strong token boundary. MECAB_TOKEN_BOUNDARY = 1, - #[doc = " The position is not a token boundary."] + /// The position is not a token boundary. MECAB_INSIDE_TOKEN = 2, } #[repr(C)] @@ -589,31 +310,14 @@ pub enum _bindgen_ty_6 { pub struct _iobuf { pub _Placeholder: *mut ::std::os::raw::c_void, } -#[test] -fn bindgen_test_layout__iobuf() { - const UNINIT: ::std::mem::MaybeUninit<_iobuf> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_iobuf>(), - 4usize, - concat!("Size of: ", stringify!(_iobuf)) - ); - assert_eq!( - ::std::mem::align_of::<_iobuf>(), - 4usize, - concat!("Alignment of ", stringify!(_iobuf)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._Placeholder) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_iobuf), - "::", - stringify!(_Placeholder) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _iobuf"][::std::mem::size_of::<_iobuf>() - 4usize]; + ["Alignment of _iobuf"][::std::mem::align_of::<_iobuf>() - 4usize]; + [ + "Offset of field: _iobuf::_Placeholder", + ][::std::mem::offset_of!(_iobuf, _Placeholder) - 0usize]; +}; pub type FILE = _iobuf; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -631,76 +335,76 @@ pub struct mecab_lattice_t { _unused: [u8; 0], } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::create(argc, argv)"] + /// C wrapper of MeCab::Tagger::create(argc, argv) pub fn mecab_new( argc: ::std::os::raw::c_int, argv: *mut *mut ::std::os::raw::c_char, ) -> *mut mecab_t; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::create(arg)"] + /// C wrapper of MeCab::Tagger::create(arg) pub fn mecab_new2(arg: *const ::std::os::raw::c_char) -> *mut mecab_t; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::version()"] + /// C wrapper of MeCab::Tagger::version() pub fn mecab_version() -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::getLastError()"] + /// C wrapper of MeCab::getLastError() pub fn mecab_strerror(mecab: *mut mecab_t) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::deleteTagger(tagger)"] + /// C wrapper of MeCab::deleteTagger(tagger) pub fn mecab_destroy(mecab: *mut mecab_t); } extern "C" { - #[doc = " C wrapper of MeCab::Tagger:set_partial()"] + /// C wrapper of MeCab::Tagger:set_partial() pub fn mecab_get_partial(mecab: *mut mecab_t) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::partial()"] + /// C wrapper of MeCab::Tagger::partial() pub fn mecab_set_partial(mecab: *mut mecab_t, partial: ::std::os::raw::c_int); } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::theta()"] + /// C wrapper of MeCab::Tagger::theta() pub fn mecab_get_theta(mecab: *mut mecab_t) -> f32; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::set_theta()"] + /// C wrapper of MeCab::Tagger::set_theta() pub fn mecab_set_theta(mecab: *mut mecab_t, theta: f32); } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::lattice_level()"] + /// C wrapper of MeCab::Tagger::lattice_level() pub fn mecab_get_lattice_level(mecab: *mut mecab_t) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::set_lattice_level()"] + /// C wrapper of MeCab::Tagger::set_lattice_level() pub fn mecab_set_lattice_level(mecab: *mut mecab_t, level: ::std::os::raw::c_int); } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::all_morphs()"] + /// C wrapper of MeCab::Tagger::all_morphs() pub fn mecab_get_all_morphs(mecab: *mut mecab_t) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::set_all_moprhs()"] + /// C wrapper of MeCab::Tagger::set_all_moprhs() pub fn mecab_set_all_morphs(mecab: *mut mecab_t, all_morphs: ::std::os::raw::c_int); } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parse(MeCab::Lattice *lattice)"] + /// C wrapper of MeCab::Tagger::parse(MeCab::Lattice *lattice) pub fn mecab_parse_lattice( mecab: *mut mecab_t, lattice: *mut mecab_lattice_t, ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parse(const char *str)"] + /// C wrapper of MeCab::Tagger::parse(const char *str) pub fn mecab_sparse_tostr( mecab: *mut mecab_t, str_: *const ::std::os::raw::c_char, ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parse(const char *str, size_t len)"] + /// C wrapper of MeCab::Tagger::parse(const char *str, size_t len) pub fn mecab_sparse_tostr2( mecab: *mut mecab_t, str_: *const ::std::os::raw::c_char, @@ -708,7 +412,7 @@ extern "C" { ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parse(const char *str, char *ostr, size_t olen)"] + /// C wrapper of MeCab::Tagger::parse(const char *str, char *ostr, size_t olen) pub fn mecab_sparse_tostr3( mecab: *mut mecab_t, str_: *const ::std::os::raw::c_char, @@ -718,14 +422,14 @@ extern "C" { ) -> *mut ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parseToNode(const char *str)"] + /// C wrapper of MeCab::Tagger::parseToNode(const char *str) pub fn mecab_sparse_tonode( mecab: *mut mecab_t, arg1: *const ::std::os::raw::c_char, ) -> *const mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parseToNode(const char *str, size_t len)"] + /// C wrapper of MeCab::Tagger::parseToNode(const char *str, size_t len) pub fn mecab_sparse_tonode2( mecab: *mut mecab_t, arg1: *const ::std::os::raw::c_char, @@ -733,7 +437,7 @@ extern "C" { ) -> *const mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parseNBest(size_t N, const char *str)"] + /// C wrapper of MeCab::Tagger::parseNBest(size_t N, const char *str) pub fn mecab_nbest_sparse_tostr( mecab: *mut mecab_t, N: usize, @@ -741,7 +445,7 @@ extern "C" { ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parseNBest(size_t N, const char *str, size_t len)"] + /// C wrapper of MeCab::Tagger::parseNBest(size_t N, const char *str, size_t len) pub fn mecab_nbest_sparse_tostr2( mecab: *mut mecab_t, N: usize, @@ -750,7 +454,7 @@ extern "C" { ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parseNBest(size_t N, const char *str, char *ostr, size_t olen)"] + /// C wrapper of MeCab::Tagger::parseNBest(size_t N, const char *str, char *ostr, size_t olen) pub fn mecab_nbest_sparse_tostr3( mecab: *mut mecab_t, N: usize, @@ -761,14 +465,14 @@ extern "C" { ) -> *mut ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parseNBestInit(const char *str)"] + /// C wrapper of MeCab::Tagger::parseNBestInit(const char *str) pub fn mecab_nbest_init( mecab: *mut mecab_t, str_: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parseNBestInit(const char *str, size_t len)"] + /// C wrapper of MeCab::Tagger::parseNBestInit(const char *str, size_t len) pub fn mecab_nbest_init2( mecab: *mut mecab_t, str_: *const ::std::os::raw::c_char, @@ -776,11 +480,11 @@ extern "C" { ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::next()"] + /// C wrapper of MeCab::Tagger::next() pub fn mecab_nbest_next_tostr(mecab: *mut mecab_t) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::next(char *ostr, size_t olen)"] + /// C wrapper of MeCab::Tagger::next(char *ostr, size_t olen) pub fn mecab_nbest_next_tostr2( mecab: *mut mecab_t, ostr: *mut ::std::os::raw::c_char, @@ -788,84 +492,91 @@ extern "C" { ) -> *mut ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::nextNode()"] + /// C wrapper of MeCab::Tagger::nextNode() pub fn mecab_nbest_next_tonode(mecab: *mut mecab_t) -> *const mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::formatNode(const Node *node)"] + /// C wrapper of MeCab::Tagger::formatNode(const Node *node) pub fn mecab_format_node( mecab: *mut mecab_t, node: *const mecab_node_t, ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::dictionary_info()"] + /// C wrapper of MeCab::Tagger::dictionary_info() pub fn mecab_dictionary_info(mecab: *mut mecab_t) -> *const mecab_dictionary_info_t; } extern "C" { - #[doc = " C wrapper of MeCab::createLattice()"] + /// C wrapper of MeCab::createLattice() pub fn mecab_lattice_new() -> *mut mecab_lattice_t; } extern "C" { - #[doc = " C wrapper of MeCab::deleteLattice(lattice)"] + /// C wrapper of MeCab::deleteLattice(lattice) pub fn mecab_lattice_destroy(lattice: *mut mecab_lattice_t); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::clear()"] + /// C wrapper of MeCab::Lattice::clear() pub fn mecab_lattice_clear(lattice: *mut mecab_lattice_t); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::is_available()"] - pub fn mecab_lattice_is_available(lattice: *mut mecab_lattice_t) -> ::std::os::raw::c_int; + /// C wrapper of MeCab::Lattice::is_available() + pub fn mecab_lattice_is_available( + lattice: *mut mecab_lattice_t, + ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::bos_node()"] - pub fn mecab_lattice_get_bos_node(lattice: *mut mecab_lattice_t) -> *mut mecab_node_t; + /// C wrapper of MeCab::Lattice::bos_node() + pub fn mecab_lattice_get_bos_node( + lattice: *mut mecab_lattice_t, + ) -> *mut mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::eos_node()"] - pub fn mecab_lattice_get_eos_node(lattice: *mut mecab_lattice_t) -> *mut mecab_node_t; + /// C wrapper of MeCab::Lattice::eos_node() + pub fn mecab_lattice_get_eos_node( + lattice: *mut mecab_lattice_t, + ) -> *mut mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::begin_nodes()"] + /// C wrapper of MeCab::Lattice::begin_nodes() pub fn mecab_lattice_get_all_begin_nodes( lattice: *mut mecab_lattice_t, ) -> *mut *mut mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::end_nodes()"] - pub fn mecab_lattice_get_all_end_nodes(lattice: *mut mecab_lattice_t) - -> *mut *mut mecab_node_t; + /// C wrapper of MeCab::Lattice::end_nodes() + pub fn mecab_lattice_get_all_end_nodes( + lattice: *mut mecab_lattice_t, + ) -> *mut *mut mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::begin_nodes(pos)"] + /// C wrapper of MeCab::Lattice::begin_nodes(pos) pub fn mecab_lattice_get_begin_nodes( lattice: *mut mecab_lattice_t, pos: usize, ) -> *mut mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::end_nodes(pos)"] + /// C wrapper of MeCab::Lattice::end_nodes(pos) pub fn mecab_lattice_get_end_nodes( lattice: *mut mecab_lattice_t, pos: usize, ) -> *mut mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::sentence()"] + /// C wrapper of MeCab::Lattice::sentence() pub fn mecab_lattice_get_sentence( lattice: *mut mecab_lattice_t, ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::set_sentence(sentence)"] + /// C wrapper of MeCab::Lattice::set_sentence(sentence) pub fn mecab_lattice_set_sentence( lattice: *mut mecab_lattice_t, sentence: *const ::std::os::raw::c_char, ); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::set_sentence(sentence, len)"] + /// C wrapper of MeCab::Lattice::set_sentence(sentence, len) pub fn mecab_lattice_set_sentence2( lattice: *mut mecab_lattice_t, sentence: *const ::std::os::raw::c_char, @@ -873,71 +584,75 @@ extern "C" { ); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::size()"] + /// C wrapper of MeCab::Lattice::size() pub fn mecab_lattice_get_size(lattice: *mut mecab_lattice_t) -> usize; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::Z()"] + /// C wrapper of MeCab::Lattice::Z() pub fn mecab_lattice_get_z(lattice: *mut mecab_lattice_t) -> f64; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::set_Z()"] + /// C wrapper of MeCab::Lattice::set_Z() pub fn mecab_lattice_set_z(lattice: *mut mecab_lattice_t, Z: f64); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::theta()"] + /// C wrapper of MeCab::Lattice::theta() pub fn mecab_lattice_get_theta(lattice: *mut mecab_lattice_t) -> f64; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::set_theta()"] + /// C wrapper of MeCab::Lattice::set_theta() pub fn mecab_lattice_set_theta(lattice: *mut mecab_lattice_t, theta: f64); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::next()"] + /// C wrapper of MeCab::Lattice::next() pub fn mecab_lattice_next(lattice: *mut mecab_lattice_t) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::request_type()"] - pub fn mecab_lattice_get_request_type(lattice: *mut mecab_lattice_t) -> ::std::os::raw::c_int; + /// C wrapper of MeCab::Lattice::request_type() + pub fn mecab_lattice_get_request_type( + lattice: *mut mecab_lattice_t, + ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::has_request_type()"] + /// C wrapper of MeCab::Lattice::has_request_type() pub fn mecab_lattice_has_request_type( lattice: *mut mecab_lattice_t, request_type: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::set_request_type()"] + /// C wrapper of MeCab::Lattice::set_request_type() pub fn mecab_lattice_set_request_type( lattice: *mut mecab_lattice_t, request_type: ::std::os::raw::c_int, ); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::add_request_type()"] + /// C wrapper of MeCab::Lattice::add_request_type() pub fn mecab_lattice_add_request_type( lattice: *mut mecab_lattice_t, request_type: ::std::os::raw::c_int, ); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::remove_request_type()"] + /// C wrapper of MeCab::Lattice::remove_request_type() pub fn mecab_lattice_remove_request_type( lattice: *mut mecab_lattice_t, request_type: ::std::os::raw::c_int, ); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::newNode();"] + /// C wrapper of MeCab::Lattice::newNode(); pub fn mecab_lattice_new_node(lattice: *mut mecab_lattice_t) -> *mut mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::toString()"] - pub fn mecab_lattice_tostr(lattice: *mut mecab_lattice_t) -> *const ::std::os::raw::c_char; + /// C wrapper of MeCab::Lattice::toString() + pub fn mecab_lattice_tostr( + lattice: *mut mecab_lattice_t, + ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::toString(buf, size)"] + /// C wrapper of MeCab::Lattice::toString(buf, size) pub fn mecab_lattice_tostr2( lattice: *mut mecab_lattice_t, buf: *mut ::std::os::raw::c_char, @@ -945,14 +660,14 @@ extern "C" { ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::enumNBestAsString(N)"] + /// C wrapper of MeCab::Lattice::enumNBestAsString(N) pub fn mecab_lattice_nbest_tostr( lattice: *mut mecab_lattice_t, N: usize, ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::enumNBestAsString(N, buf, size)"] + /// C wrapper of MeCab::Lattice::enumNBestAsString(N, buf, size) pub fn mecab_lattice_nbest_tostr2( lattice: *mut mecab_lattice_t, N: usize, @@ -961,25 +676,27 @@ extern "C" { ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::has_constraint()"] - pub fn mecab_lattice_has_constraint(lattice: *mut mecab_lattice_t) -> ::std::os::raw::c_int; + /// C wrapper of MeCab::Lattice::has_constraint() + pub fn mecab_lattice_has_constraint( + lattice: *mut mecab_lattice_t, + ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::boundary_constraint(pos)"] + /// C wrapper of MeCab::Lattice::boundary_constraint(pos) pub fn mecab_lattice_get_boundary_constraint( lattice: *mut mecab_lattice_t, pos: usize, ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::feature_constraint(pos)"] + /// C wrapper of MeCab::Lattice::feature_constraint(pos) pub fn mecab_lattice_get_feature_constraint( lattice: *mut mecab_lattice_t, pos: usize, ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::boundary_constraint(pos, type)"] + /// C wrapper of MeCab::Lattice::boundary_constraint(pos, type) pub fn mecab_lattice_set_boundary_constraint( lattice: *mut mecab_lattice_t, pos: usize, @@ -987,7 +704,7 @@ extern "C" { ); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::set_feature_constraint(begin_pos, end_pos, feature)"] + /// C wrapper of MeCab::Lattice::set_feature_constraint(begin_pos, end_pos, feature) pub fn mecab_lattice_set_feature_constraint( lattice: *mut mecab_lattice_t, begin_pos: usize, @@ -996,53 +713,56 @@ extern "C" { ); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::set_result(result);"] + /// C wrapper of MeCab::Lattice::set_result(result); pub fn mecab_lattice_set_result( lattice: *mut mecab_lattice_t, result: *const ::std::os::raw::c_char, ); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::what()"] - pub fn mecab_lattice_strerror(lattice: *mut mecab_lattice_t) -> *const ::std::os::raw::c_char; + /// C wrapper of MeCab::Lattice::what() + pub fn mecab_lattice_strerror( + lattice: *mut mecab_lattice_t, + ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wapper of MeCab::Model::create(argc, argv)"] + /// C wapper of MeCab::Model::create(argc, argv) pub fn mecab_model_new( argc: ::std::os::raw::c_int, argv: *mut *mut ::std::os::raw::c_char, ) -> *mut mecab_model_t; } extern "C" { - #[doc = " C wapper of MeCab::Model::create(arg)"] + /// C wapper of MeCab::Model::create(arg) pub fn mecab_model_new2(arg: *const ::std::os::raw::c_char) -> *mut mecab_model_t; } extern "C" { - #[doc = " C wapper of MeCab::deleteModel(model)"] + /// C wapper of MeCab::deleteModel(model) pub fn mecab_model_destroy(model: *mut mecab_model_t); } extern "C" { - #[doc = " C wapper of MeCab::Model::createTagger()"] + /// C wapper of MeCab::Model::createTagger() pub fn mecab_model_new_tagger(model: *mut mecab_model_t) -> *mut mecab_t; } extern "C" { - #[doc = " C wapper of MeCab::Model::createLattice()"] + /// C wapper of MeCab::Model::createLattice() pub fn mecab_model_new_lattice(model: *mut mecab_model_t) -> *mut mecab_lattice_t; } extern "C" { - #[doc = " C wrapper of MeCab::Model::swap()"] + /// C wrapper of MeCab::Model::swap() pub fn mecab_model_swap( model: *mut mecab_model_t, new_model: *mut mecab_model_t, ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wapper of MeCab::Model::dictionary_info()"] - pub fn mecab_model_dictionary_info(model: *mut mecab_model_t) - -> *const mecab_dictionary_info_t; + /// C wapper of MeCab::Model::dictionary_info() + pub fn mecab_model_dictionary_info( + model: *mut mecab_model_t, + ) -> *const mecab_dictionary_info_t; } extern "C" { - #[doc = " C wrapper of MeCab::Model::transition_cost()"] + /// C wrapper of MeCab::Model::transition_cost() pub fn mecab_model_transition_cost( model: *mut mecab_model_t, rcAttr: ::std::os::raw::c_ushort, @@ -1050,7 +770,7 @@ extern "C" { ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Model::lookup()"] + /// C wrapper of MeCab::Model::lookup() pub fn mecab_model_lookup( model: *mut mecab_model_t, begin: *const ::std::os::raw::c_char, @@ -1094,11 +814,11 @@ extern "C" { argv: *mut *mut ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } -#[doc = " DictionaryInfo structure"] +/// DictionaryInfo structure pub type MeCab_DictionaryInfo = mecab_dictionary_info_t; -#[doc = " Path structure"] +/// Path structure pub type MeCab_Path = mecab_path_t; -#[doc = " Node structure"] +/// Node structure pub type MeCab_Node = mecab_node_t; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -1107,71 +827,55 @@ pub struct MeCab_Allocator { } #[repr(C)] pub struct MeCab_Lattice__bindgen_vtable(::std::os::raw::c_void); -#[doc = " Lattice class"] +/// Lattice class #[repr(C)] #[derive(Debug)] pub struct MeCab_Lattice { pub vtable_: *const MeCab_Lattice__bindgen_vtable, } -#[test] -fn bindgen_test_layout_MeCab_Lattice() { - assert_eq!( - ::std::mem::size_of::(), - 4usize, - concat!("Size of: ", stringify!(MeCab_Lattice)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(MeCab_Lattice)) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of MeCab_Lattice"][::std::mem::size_of::() - 4usize]; + ["Alignment of MeCab_Lattice"][::std::mem::align_of::() - 4usize]; +}; extern "C" { - #[doc = " Create new Lattice object"] - #[doc = " @return new Lattice object"] + /** Create new Lattice object + @return new Lattice object*/ #[link_name = "\u{1}?create@Lattice@MeCab@@SAPAV12@XZ"] pub fn MeCab_Lattice_create() -> *mut MeCab_Lattice; } impl MeCab_Lattice { #[inline] pub unsafe fn create() -> *mut MeCab_Lattice { - unsafe { MeCab_Lattice_create() } + MeCab_Lattice_create() } } #[repr(C)] pub struct MeCab_Model__bindgen_vtable(::std::os::raw::c_void); -#[doc = " Model class"] +/// Model class #[repr(C)] #[derive(Debug)] pub struct MeCab_Model { pub vtable_: *const MeCab_Model__bindgen_vtable, } -#[test] -fn bindgen_test_layout_MeCab_Model() { - assert_eq!( - ::std::mem::size_of::(), - 4usize, - concat!("Size of: ", stringify!(MeCab_Model)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(MeCab_Model)) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of MeCab_Model"][::std::mem::size_of::() - 4usize]; + ["Alignment of MeCab_Model"][::std::mem::align_of::() - 4usize]; +}; extern "C" { - #[doc = " Return a version string"] - #[doc = " @return version string"] + /** Return a version string + @return version string*/ #[link_name = "\u{1}?version@Model@MeCab@@SAPBDXZ"] pub fn MeCab_Model_version() -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " Factory method to create a new Model with a specified main's argc/argv-style parameters."] - #[doc = " Return NULL if new model cannot be initialized. Use MeCab::getLastError() to obtain the"] - #[doc = " cause of the errors."] - #[doc = " @return new Model object"] - #[doc = " @param argc number of parameters"] - #[doc = " @param argv parameter list"] + /** Factory method to create a new Model with a specified main's argc/argv-style parameters. + Return NULL if new model cannot be initialized. Use MeCab::getLastError() to obtain the + cause of the errors. + @return new Model object + @param argc number of parameters + @param argv parameter list*/ #[link_name = "\u{1}?create@Model@MeCab@@SAPAV12@HPAPAD@Z"] pub fn MeCab_Model_create( argc: ::std::os::raw::c_int, @@ -1179,74 +883,69 @@ extern "C" { ) -> *mut MeCab_Model; } extern "C" { - #[doc = " Factory method to create a new Model with a string parameter representation, i.e.,"] - #[doc = " \"-d /user/local/mecab/dic/ipadic -Ochasen\"."] - #[doc = " Return NULL if new model cannot be initialized. Use MeCab::getLastError() to obtain the"] - #[doc = " cause of the errors."] - #[doc = " @return new Model object"] - #[doc = " @param arg single string representation of the argment."] + /** Factory method to create a new Model with a string parameter representation, i.e., + "-d /user/local/mecab/dic/ipadic -Ochasen". + Return NULL if new model cannot be initialized. Use MeCab::getLastError() to obtain the + cause of the errors. + @return new Model object + @param arg single string representation of the argment.*/ #[link_name = "\u{1}?create@Model@MeCab@@SAPAV12@PBD@Z"] pub fn MeCab_Model_create1(arg: *const ::std::os::raw::c_char) -> *mut MeCab_Model; } impl MeCab_Model { #[inline] pub unsafe fn version() -> *const ::std::os::raw::c_char { - unsafe { MeCab_Model_version() } + MeCab_Model_version() } #[inline] pub unsafe fn create( argc: ::std::os::raw::c_int, argv: *mut *mut ::std::os::raw::c_char, ) -> *mut MeCab_Model { - unsafe { MeCab_Model_create(argc, argv) } + MeCab_Model_create(argc, argv) } #[inline] pub unsafe fn create1(arg: *const ::std::os::raw::c_char) -> *mut MeCab_Model { - unsafe { MeCab_Model_create1(arg) } + MeCab_Model_create1(arg) } } #[repr(C)] pub struct MeCab_Tagger__bindgen_vtable(::std::os::raw::c_void); -#[doc = " Tagger class"] +/// Tagger class #[repr(C)] #[derive(Debug)] pub struct MeCab_Tagger { pub vtable_: *const MeCab_Tagger__bindgen_vtable, } -#[test] -fn bindgen_test_layout_MeCab_Tagger() { - assert_eq!( - ::std::mem::size_of::(), - 4usize, - concat!("Size of: ", stringify!(MeCab_Tagger)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(MeCab_Tagger)) - ); -} -extern "C" { - #[doc = " Handy static method."] - #[doc = " Return true if lattice is parsed successfully."] - #[doc = " This function is equivalent to"] - #[doc = " {"] - #[doc = " Tagger *tagger = model.createModel();"] - #[doc = " cosnt bool result = tagger->parse(lattice);"] - #[doc = " delete tagger;"] - #[doc = " return result;"] - #[doc = " }"] - #[doc = " @return boolean"] +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of MeCab_Tagger"][::std::mem::size_of::() - 4usize]; + ["Alignment of MeCab_Tagger"][::std::mem::align_of::() - 4usize]; +}; +extern "C" { + /** Handy static method. + Return true if lattice is parsed successfully. + This function is equivalent to + { + Tagger *tagger = model.createModel(); + cosnt bool result = tagger->parse(lattice); + delete tagger; + return result; + } + @return boolean*/ #[link_name = "\u{1}?parse@Tagger@MeCab@@SA_NABVModel@2@PAVLattice@2@@Z"] - pub fn MeCab_Tagger_parse(model: *const MeCab_Model, lattice: *mut MeCab_Lattice) -> bool; -} -extern "C" { - #[doc = " Factory method to create a new Tagger with a specified main's argc/argv-style parameters."] - #[doc = " Return NULL if new model cannot be initialized. Use MeCab::getLastError() to obtain the"] - #[doc = " cause of the errors."] - #[doc = " @return new Tagger object"] - #[doc = " @param argc number of parameters"] - #[doc = " @param argv parameter list"] + pub fn MeCab_Tagger_parse( + model: *const MeCab_Model, + lattice: *mut MeCab_Lattice, + ) -> bool; +} +extern "C" { + /** Factory method to create a new Tagger with a specified main's argc/argv-style parameters. + Return NULL if new model cannot be initialized. Use MeCab::getLastError() to obtain the + cause of the errors. + @return new Tagger object + @param argc number of parameters + @param argv parameter list*/ #[link_name = "\u{1}?create@Tagger@MeCab@@SAPAV12@HPAPAD@Z"] pub fn MeCab_Tagger_create( argc: ::std::os::raw::c_int, @@ -1254,49 +953,49 @@ extern "C" { ) -> *mut MeCab_Tagger; } extern "C" { - #[doc = " Factory method to create a new Tagger with a string parameter representation, i.e.,"] - #[doc = " \"-d /user/local/mecab/dic/ipadic -Ochasen\"."] - #[doc = " Return NULL if new model cannot be initialized. Use MeCab::getLastError() to obtain the"] - #[doc = " cause of the errors."] - #[doc = " @return new Model object"] - #[doc = " @param arg single string representation of the argment."] + /** Factory method to create a new Tagger with a string parameter representation, i.e., + "-d /user/local/mecab/dic/ipadic -Ochasen". + Return NULL if new model cannot be initialized. Use MeCab::getLastError() to obtain the + cause of the errors. + @return new Model object + @param arg single string representation of the argment.*/ #[link_name = "\u{1}?create@Tagger@MeCab@@SAPAV12@PBD@Z"] pub fn MeCab_Tagger_create1(arg: *const ::std::os::raw::c_char) -> *mut MeCab_Tagger; } extern "C" { - #[doc = " Return a version string"] - #[doc = " @return version string"] + /** Return a version string + @return version string*/ #[link_name = "\u{1}?version@Tagger@MeCab@@SAPBDXZ"] pub fn MeCab_Tagger_version() -> *const ::std::os::raw::c_char; } impl MeCab_Tagger { #[inline] pub unsafe fn parse(model: *const MeCab_Model, lattice: *mut MeCab_Lattice) -> bool { - unsafe { MeCab_Tagger_parse(model, lattice) } + MeCab_Tagger_parse(model, lattice) } #[inline] pub unsafe fn create( argc: ::std::os::raw::c_int, argv: *mut *mut ::std::os::raw::c_char, ) -> *mut MeCab_Tagger { - unsafe { MeCab_Tagger_create(argc, argv) } + MeCab_Tagger_create(argc, argv) } #[inline] pub unsafe fn create1(arg: *const ::std::os::raw::c_char) -> *mut MeCab_Tagger { - unsafe { MeCab_Tagger_create1(arg) } + MeCab_Tagger_create1(arg) } #[inline] pub unsafe fn version() -> *const ::std::os::raw::c_char { - unsafe { MeCab_Tagger_version() } + MeCab_Tagger_version() } } extern "C" { - #[doc = " Alias of Lattice::create()"] + /// Alias of Lattice::create() #[link_name = "\u{1}?createLattice@MeCab@@YAPAVLattice@1@XZ"] pub fn MeCab_createLattice() -> *mut MeCab_Lattice; } extern "C" { - #[doc = " Alias of Mode::create(argc, argv)"] + /// Alias of Mode::create(argc, argv) #[link_name = "\u{1}?createModel@MeCab@@YAPAVModel@1@HPAPAD@Z"] pub fn MeCab_createModel( argc: ::std::os::raw::c_int, @@ -1304,12 +1003,12 @@ extern "C" { ) -> *mut MeCab_Model; } extern "C" { - #[doc = " Alias of Mode::create(arg)"] + /// Alias of Mode::create(arg) #[link_name = "\u{1}?createModel@MeCab@@YAPAVModel@1@PBD@Z"] pub fn MeCab_createModel1(arg: *const ::std::os::raw::c_char) -> *mut MeCab_Model; } extern "C" { - #[doc = " Alias of Tagger::create(argc, argv)"] + /// Alias of Tagger::create(argc, argv) #[link_name = "\u{1}?createTagger@MeCab@@YAPAVTagger@1@HPAPAD@Z"] pub fn MeCab_createTagger( argc: ::std::os::raw::c_int, @@ -1317,44 +1016,44 @@ extern "C" { ) -> *mut MeCab_Tagger; } extern "C" { - #[doc = " Alias of Tagger::create(arg)"] + /// Alias of Tagger::create(arg) #[link_name = "\u{1}?createTagger@MeCab@@YAPAVTagger@1@PBD@Z"] pub fn MeCab_createTagger1(arg: *const ::std::os::raw::c_char) -> *mut MeCab_Tagger; } extern "C" { - #[doc = " delete Lattice object."] - #[doc = " This method calles \"delete lattice\"."] - #[doc = " In some environment, e.g., MS-Windows, an object allocated inside a DLL must be deleted in the same DLL too."] - #[doc = " @param lattice lattice object"] + /** delete Lattice object. + This method calles "delete lattice". + In some environment, e.g., MS-Windows, an object allocated inside a DLL must be deleted in the same DLL too. + @param lattice lattice object*/ #[link_name = "\u{1}?deleteLattice@MeCab@@YAXPAVLattice@1@@Z"] pub fn MeCab_deleteLattice(lattice: *mut MeCab_Lattice); } extern "C" { - #[doc = " delete Model object."] - #[doc = " This method calles \"delete model\"."] - #[doc = " In some environment, e.g., MS-Windows, an object allocated inside a DLL must be deleted in the same DLL too."] - #[doc = " @param model model object"] + /** delete Model object. + This method calles "delete model". + In some environment, e.g., MS-Windows, an object allocated inside a DLL must be deleted in the same DLL too. + @param model model object*/ #[link_name = "\u{1}?deleteModel@MeCab@@YAXPAVModel@1@@Z"] pub fn MeCab_deleteModel(model: *mut MeCab_Model); } extern "C" { - #[doc = " delete Tagger object."] - #[doc = " This method calles \"delete tagger\"."] - #[doc = " In some environment, e.g., MS-Windows, an object allocated inside a DLL must be deleted in the same DLL too."] - #[doc = " @param tagger tagger object"] + /** delete Tagger object. + This method calles "delete tagger". + In some environment, e.g., MS-Windows, an object allocated inside a DLL must be deleted in the same DLL too. + @param tagger tagger object*/ #[link_name = "\u{1}?deleteTagger@MeCab@@YAXPAVTagger@1@@Z"] pub fn MeCab_deleteTagger(tagger: *mut MeCab_Tagger); } extern "C" { - #[doc = " Return last error string."] - #[doc = " @return error string"] + /** Return last error string. + @return error string*/ #[link_name = "\u{1}?getLastError@MeCab@@YAPBDXZ"] pub fn MeCab_getLastError() -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " An alias of getLastError."] - #[doc = " It is kept for backward compatibility."] - #[doc = " @return error string"] + /** An alias of getLastError. + It is kept for backward compatibility. + @return error string*/ #[link_name = "\u{1}?getTaggerError@MeCab@@YAPBDXZ"] pub fn MeCab_getTaggerError() -> *const ::std::os::raw::c_char; } @@ -1367,71 +1066,22 @@ pub struct _Mecab { pub tagger: *mut ::std::os::raw::c_void, pub lattice: *mut ::std::os::raw::c_void, } -#[test] -fn bindgen_test_layout__Mecab() { - const UNINIT: ::std::mem::MaybeUninit<_Mecab> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_Mecab>(), - 20usize, - concat!("Size of: ", stringify!(_Mecab)) - ); - assert_eq!( - ::std::mem::align_of::<_Mecab>(), - 4usize, - concat!("Alignment of ", stringify!(_Mecab)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).feature) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_Mecab), - "::", - stringify!(feature) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(_Mecab), - "::", - stringify!(size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).model) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_Mecab), - "::", - stringify!(model) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tagger) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(_Mecab), - "::", - stringify!(tagger) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lattice) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_Mecab), - "::", - stringify!(lattice) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _Mecab"][::std::mem::size_of::<_Mecab>() - 20usize]; + ["Alignment of _Mecab"][::std::mem::align_of::<_Mecab>() - 4usize]; + [ + "Offset of field: _Mecab::feature", + ][::std::mem::offset_of!(_Mecab, feature) - 0usize]; + ["Offset of field: _Mecab::size"][::std::mem::offset_of!(_Mecab, size) - 4usize]; + ["Offset of field: _Mecab::model"][::std::mem::offset_of!(_Mecab, model) - 8usize]; + [ + "Offset of field: _Mecab::tagger", + ][::std::mem::offset_of!(_Mecab, tagger) - 12usize]; + [ + "Offset of field: _Mecab::lattice", + ][::std::mem::offset_of!(_Mecab, lattice) - 16usize]; +}; pub type Mecab = _Mecab; extern "C" { pub fn Mecab_initialize(m: *mut Mecab) -> ::std::os::raw::c_int; @@ -1490,181 +1140,55 @@ pub struct _NJDNode { pub prev: *mut _NJDNode, pub next: *mut _NJDNode, } -#[test] -fn bindgen_test_layout__NJDNode() { - const UNINIT: ::std::mem::MaybeUninit<_NJDNode> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_NJDNode>(), - 64usize, - concat!("Size of: ", stringify!(_NJDNode)) - ); - assert_eq!( - ::std::mem::align_of::<_NJDNode>(), - 4usize, - concat!("Alignment of ", stringify!(_NJDNode)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).string) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(string) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pos) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(pos) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pos_group1) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(pos_group1) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pos_group2) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(pos_group2) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pos_group3) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(pos_group3) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ctype) as usize - ptr as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(ctype) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cform) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(cform) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).orig) as usize - ptr as usize }, - 28usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(orig) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).read) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(read) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pron) as usize - ptr as usize }, - 36usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(pron) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).acc) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(acc) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mora_size) as usize - ptr as usize }, - 44usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(mora_size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).chain_rule) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(chain_rule) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).chain_flag) as usize - ptr as usize }, - 52usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(chain_flag) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(prev) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 60usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(next) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _NJDNode"][::std::mem::size_of::<_NJDNode>() - 64usize]; + ["Alignment of _NJDNode"][::std::mem::align_of::<_NJDNode>() - 4usize]; + [ + "Offset of field: _NJDNode::string", + ][::std::mem::offset_of!(_NJDNode, string) - 0usize]; + ["Offset of field: _NJDNode::pos"][::std::mem::offset_of!(_NJDNode, pos) - 4usize]; + [ + "Offset of field: _NJDNode::pos_group1", + ][::std::mem::offset_of!(_NJDNode, pos_group1) - 8usize]; + [ + "Offset of field: _NJDNode::pos_group2", + ][::std::mem::offset_of!(_NJDNode, pos_group2) - 12usize]; + [ + "Offset of field: _NJDNode::pos_group3", + ][::std::mem::offset_of!(_NJDNode, pos_group3) - 16usize]; + [ + "Offset of field: _NJDNode::ctype", + ][::std::mem::offset_of!(_NJDNode, ctype) - 20usize]; + [ + "Offset of field: _NJDNode::cform", + ][::std::mem::offset_of!(_NJDNode, cform) - 24usize]; + [ + "Offset of field: _NJDNode::orig", + ][::std::mem::offset_of!(_NJDNode, orig) - 28usize]; + [ + "Offset of field: _NJDNode::read", + ][::std::mem::offset_of!(_NJDNode, read) - 32usize]; + [ + "Offset of field: _NJDNode::pron", + ][::std::mem::offset_of!(_NJDNode, pron) - 36usize]; + ["Offset of field: _NJDNode::acc"][::std::mem::offset_of!(_NJDNode, acc) - 40usize]; + [ + "Offset of field: _NJDNode::mora_size", + ][::std::mem::offset_of!(_NJDNode, mora_size) - 44usize]; + [ + "Offset of field: _NJDNode::chain_rule", + ][::std::mem::offset_of!(_NJDNode, chain_rule) - 48usize]; + [ + "Offset of field: _NJDNode::chain_flag", + ][::std::mem::offset_of!(_NJDNode, chain_flag) - 52usize]; + [ + "Offset of field: _NJDNode::prev", + ][::std::mem::offset_of!(_NJDNode, prev) - 56usize]; + [ + "Offset of field: _NJDNode::next", + ][::std::mem::offset_of!(_NJDNode, next) - 60usize]; +}; pub type NJDNode = _NJDNode; extern "C" { pub fn NJDNode_initialize(node: *mut NJDNode); @@ -1676,13 +1200,22 @@ extern "C" { pub fn NJDNode_set_pos(node: *mut NJDNode, str_: *const ::std::os::raw::c_char); } extern "C" { - pub fn NJDNode_set_pos_group1(node: *mut NJDNode, str_: *const ::std::os::raw::c_char); + pub fn NJDNode_set_pos_group1( + node: *mut NJDNode, + str_: *const ::std::os::raw::c_char, + ); } extern "C" { - pub fn NJDNode_set_pos_group2(node: *mut NJDNode, str_: *const ::std::os::raw::c_char); + pub fn NJDNode_set_pos_group2( + node: *mut NJDNode, + str_: *const ::std::os::raw::c_char, + ); } extern "C" { - pub fn NJDNode_set_pos_group3(node: *mut NJDNode, str_: *const ::std::os::raw::c_char); + pub fn NJDNode_set_pos_group3( + node: *mut NJDNode, + str_: *const ::std::os::raw::c_char, + ); } extern "C" { pub fn NJDNode_set_ctype(node: *mut NJDNode, str_: *const ::std::os::raw::c_char); @@ -1706,7 +1239,10 @@ extern "C" { pub fn NJDNode_set_mora_size(node: *mut NJDNode, size: ::std::os::raw::c_int); } extern "C" { - pub fn NJDNode_set_chain_rule(node: *mut NJDNode, str_: *const ::std::os::raw::c_char); + pub fn NJDNode_set_chain_rule( + node: *mut NJDNode, + str_: *const ::std::os::raw::c_char, + ); } extern "C" { pub fn NJDNode_set_chain_flag(node: *mut NJDNode, flag: ::std::os::raw::c_int); @@ -1806,41 +1342,13 @@ pub struct _NJD { pub head: *mut NJDNode, pub tail: *mut NJDNode, } -#[test] -fn bindgen_test_layout__NJD() { - const UNINIT: ::std::mem::MaybeUninit<_NJD> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_NJD>(), - 8usize, - concat!("Size of: ", stringify!(_NJD)) - ); - assert_eq!( - ::std::mem::align_of::<_NJD>(), - 4usize, - concat!("Alignment of ", stringify!(_NJD)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).head) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_NJD), - "::", - stringify!(head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tail) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(_NJD), - "::", - stringify!(tail) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _NJD"][::std::mem::size_of::<_NJD>() - 8usize]; + ["Alignment of _NJD"][::std::mem::align_of::<_NJD>() - 4usize]; + ["Offset of field: _NJD::head"][::std::mem::offset_of!(_NJD, head) - 0usize]; + ["Offset of field: _NJD::tail"][::std::mem::offset_of!(_NJD, tail) - 4usize]; +}; pub type NJD = _NJD; extern "C" { pub fn NJD_initialize(njd: *mut NJD); @@ -1890,62 +1398,27 @@ pub struct _JPCommonLabelPhoneme { pub next: *mut _JPCommonLabelPhoneme, pub up: *mut _JPCommonLabelMora, } -#[test] -fn bindgen_test_layout__JPCommonLabelPhoneme() { - const UNINIT: ::std::mem::MaybeUninit<_JPCommonLabelPhoneme> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_JPCommonLabelPhoneme>(), - 16usize, - concat!("Size of: ", stringify!(_JPCommonLabelPhoneme)) - ); - assert_eq!( - ::std::mem::align_of::<_JPCommonLabelPhoneme>(), - 4usize, - concat!("Alignment of ", stringify!(_JPCommonLabelPhoneme)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).phoneme) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelPhoneme), - "::", - stringify!(phoneme) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelPhoneme), - "::", - stringify!(prev) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelPhoneme), - "::", - stringify!(next) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).up) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelPhoneme), - "::", - stringify!(up) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + [ + "Size of _JPCommonLabelPhoneme", + ][::std::mem::size_of::<_JPCommonLabelPhoneme>() - 16usize]; + [ + "Alignment of _JPCommonLabelPhoneme", + ][::std::mem::align_of::<_JPCommonLabelPhoneme>() - 4usize]; + [ + "Offset of field: _JPCommonLabelPhoneme::phoneme", + ][::std::mem::offset_of!(_JPCommonLabelPhoneme, phoneme) - 0usize]; + [ + "Offset of field: _JPCommonLabelPhoneme::prev", + ][::std::mem::offset_of!(_JPCommonLabelPhoneme, prev) - 4usize]; + [ + "Offset of field: _JPCommonLabelPhoneme::next", + ][::std::mem::offset_of!(_JPCommonLabelPhoneme, next) - 8usize]; + [ + "Offset of field: _JPCommonLabelPhoneme::up", + ][::std::mem::offset_of!(_JPCommonLabelPhoneme, up) - 12usize]; +}; pub type JPCommonLabelPhoneme = _JPCommonLabelPhoneme; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -1957,81 +1430,33 @@ pub struct _JPCommonLabelMora { pub next: *mut _JPCommonLabelMora, pub up: *mut _JPCommonLabelWord, } -#[test] -fn bindgen_test_layout__JPCommonLabelMora() { - const UNINIT: ::std::mem::MaybeUninit<_JPCommonLabelMora> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_JPCommonLabelMora>(), - 24usize, - concat!("Size of: ", stringify!(_JPCommonLabelMora)) - ); - assert_eq!( - ::std::mem::align_of::<_JPCommonLabelMora>(), - 4usize, - concat!("Alignment of ", stringify!(_JPCommonLabelMora)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mora) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelMora), - "::", - stringify!(mora) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).head) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelMora), - "::", - stringify!(head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tail) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelMora), - "::", - stringify!(tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelMora), - "::", - stringify!(prev) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelMora), - "::", - stringify!(next) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).up) as usize - ptr as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelMora), - "::", - stringify!(up) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + [ + "Size of _JPCommonLabelMora", + ][::std::mem::size_of::<_JPCommonLabelMora>() - 24usize]; + [ + "Alignment of _JPCommonLabelMora", + ][::std::mem::align_of::<_JPCommonLabelMora>() - 4usize]; + [ + "Offset of field: _JPCommonLabelMora::mora", + ][::std::mem::offset_of!(_JPCommonLabelMora, mora) - 0usize]; + [ + "Offset of field: _JPCommonLabelMora::head", + ][::std::mem::offset_of!(_JPCommonLabelMora, head) - 4usize]; + [ + "Offset of field: _JPCommonLabelMora::tail", + ][::std::mem::offset_of!(_JPCommonLabelMora, tail) - 8usize]; + [ + "Offset of field: _JPCommonLabelMora::prev", + ][::std::mem::offset_of!(_JPCommonLabelMora, prev) - 12usize]; + [ + "Offset of field: _JPCommonLabelMora::next", + ][::std::mem::offset_of!(_JPCommonLabelMora, next) - 16usize]; + [ + "Offset of field: _JPCommonLabelMora::up", + ][::std::mem::offset_of!(_JPCommonLabelMora, up) - 20usize]; +}; pub type JPCommonLabelMora = _JPCommonLabelMora; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -2046,111 +1471,42 @@ pub struct _JPCommonLabelWord { pub next: *mut _JPCommonLabelWord, pub up: *mut _JPCommonLabelAccentPhrase, } -#[test] -fn bindgen_test_layout__JPCommonLabelWord() { - const UNINIT: ::std::mem::MaybeUninit<_JPCommonLabelWord> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_JPCommonLabelWord>(), - 36usize, - concat!("Size of: ", stringify!(_JPCommonLabelWord)) - ); - assert_eq!( - ::std::mem::align_of::<_JPCommonLabelWord>(), - 4usize, - concat!("Alignment of ", stringify!(_JPCommonLabelWord)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pron) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(pron) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pos) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(pos) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ctype) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(ctype) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cform) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(cform) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).head) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tail) as usize - ptr as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(prev) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 28usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(next) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).up) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(up) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + [ + "Size of _JPCommonLabelWord", + ][::std::mem::size_of::<_JPCommonLabelWord>() - 36usize]; + [ + "Alignment of _JPCommonLabelWord", + ][::std::mem::align_of::<_JPCommonLabelWord>() - 4usize]; + [ + "Offset of field: _JPCommonLabelWord::pron", + ][::std::mem::offset_of!(_JPCommonLabelWord, pron) - 0usize]; + [ + "Offset of field: _JPCommonLabelWord::pos", + ][::std::mem::offset_of!(_JPCommonLabelWord, pos) - 4usize]; + [ + "Offset of field: _JPCommonLabelWord::ctype", + ][::std::mem::offset_of!(_JPCommonLabelWord, ctype) - 8usize]; + [ + "Offset of field: _JPCommonLabelWord::cform", + ][::std::mem::offset_of!(_JPCommonLabelWord, cform) - 12usize]; + [ + "Offset of field: _JPCommonLabelWord::head", + ][::std::mem::offset_of!(_JPCommonLabelWord, head) - 16usize]; + [ + "Offset of field: _JPCommonLabelWord::tail", + ][::std::mem::offset_of!(_JPCommonLabelWord, tail) - 20usize]; + [ + "Offset of field: _JPCommonLabelWord::prev", + ][::std::mem::offset_of!(_JPCommonLabelWord, prev) - 24usize]; + [ + "Offset of field: _JPCommonLabelWord::next", + ][::std::mem::offset_of!(_JPCommonLabelWord, next) - 28usize]; + [ + "Offset of field: _JPCommonLabelWord::up", + ][::std::mem::offset_of!(_JPCommonLabelWord, up) - 32usize]; +}; pub type JPCommonLabelWord = _JPCommonLabelWord; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -2163,92 +1519,36 @@ pub struct _JPCommonLabelAccentPhrase { pub next: *mut _JPCommonLabelAccentPhrase, pub up: *mut _JPCommonLabelBreathGroup, } -#[test] -fn bindgen_test_layout__JPCommonLabelAccentPhrase() { - const UNINIT: ::std::mem::MaybeUninit<_JPCommonLabelAccentPhrase> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_JPCommonLabelAccentPhrase>(), - 28usize, - concat!("Size of: ", stringify!(_JPCommonLabelAccentPhrase)) - ); - assert_eq!( - ::std::mem::align_of::<_JPCommonLabelAccentPhrase>(), - 4usize, - concat!("Alignment of ", stringify!(_JPCommonLabelAccentPhrase)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).accent) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelAccentPhrase), - "::", - stringify!(accent) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).emotion) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelAccentPhrase), - "::", - stringify!(emotion) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).head) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelAccentPhrase), - "::", - stringify!(head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tail) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelAccentPhrase), - "::", - stringify!(tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelAccentPhrase), - "::", - stringify!(prev) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelAccentPhrase), - "::", - stringify!(next) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).up) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelAccentPhrase), - "::", - stringify!(up) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + [ + "Size of _JPCommonLabelAccentPhrase", + ][::std::mem::size_of::<_JPCommonLabelAccentPhrase>() - 28usize]; + [ + "Alignment of _JPCommonLabelAccentPhrase", + ][::std::mem::align_of::<_JPCommonLabelAccentPhrase>() - 4usize]; + [ + "Offset of field: _JPCommonLabelAccentPhrase::accent", + ][::std::mem::offset_of!(_JPCommonLabelAccentPhrase, accent) - 0usize]; + [ + "Offset of field: _JPCommonLabelAccentPhrase::emotion", + ][::std::mem::offset_of!(_JPCommonLabelAccentPhrase, emotion) - 4usize]; + [ + "Offset of field: _JPCommonLabelAccentPhrase::head", + ][::std::mem::offset_of!(_JPCommonLabelAccentPhrase, head) - 8usize]; + [ + "Offset of field: _JPCommonLabelAccentPhrase::tail", + ][::std::mem::offset_of!(_JPCommonLabelAccentPhrase, tail) - 12usize]; + [ + "Offset of field: _JPCommonLabelAccentPhrase::prev", + ][::std::mem::offset_of!(_JPCommonLabelAccentPhrase, prev) - 16usize]; + [ + "Offset of field: _JPCommonLabelAccentPhrase::next", + ][::std::mem::offset_of!(_JPCommonLabelAccentPhrase, next) - 20usize]; + [ + "Offset of field: _JPCommonLabelAccentPhrase::up", + ][::std::mem::offset_of!(_JPCommonLabelAccentPhrase, up) - 24usize]; +}; pub type JPCommonLabelAccentPhrase = _JPCommonLabelAccentPhrase; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -2258,62 +1558,27 @@ pub struct _JPCommonLabelBreathGroup { pub prev: *mut _JPCommonLabelBreathGroup, pub next: *mut _JPCommonLabelBreathGroup, } -#[test] -fn bindgen_test_layout__JPCommonLabelBreathGroup() { - const UNINIT: ::std::mem::MaybeUninit<_JPCommonLabelBreathGroup> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_JPCommonLabelBreathGroup>(), - 16usize, - concat!("Size of: ", stringify!(_JPCommonLabelBreathGroup)) - ); - assert_eq!( - ::std::mem::align_of::<_JPCommonLabelBreathGroup>(), - 4usize, - concat!("Alignment of ", stringify!(_JPCommonLabelBreathGroup)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).head) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelBreathGroup), - "::", - stringify!(head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tail) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelBreathGroup), - "::", - stringify!(tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelBreathGroup), - "::", - stringify!(prev) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelBreathGroup), - "::", - stringify!(next) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + [ + "Size of _JPCommonLabelBreathGroup", + ][::std::mem::size_of::<_JPCommonLabelBreathGroup>() - 16usize]; + [ + "Alignment of _JPCommonLabelBreathGroup", + ][::std::mem::align_of::<_JPCommonLabelBreathGroup>() - 4usize]; + [ + "Offset of field: _JPCommonLabelBreathGroup::head", + ][::std::mem::offset_of!(_JPCommonLabelBreathGroup, head) - 0usize]; + [ + "Offset of field: _JPCommonLabelBreathGroup::tail", + ][::std::mem::offset_of!(_JPCommonLabelBreathGroup, tail) - 4usize]; + [ + "Offset of field: _JPCommonLabelBreathGroup::prev", + ][::std::mem::offset_of!(_JPCommonLabelBreathGroup, prev) - 8usize]; + [ + "Offset of field: _JPCommonLabelBreathGroup::next", + ][::std::mem::offset_of!(_JPCommonLabelBreathGroup, next) - 12usize]; +}; pub type JPCommonLabelBreathGroup = _JPCommonLabelBreathGroup; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -2332,151 +1597,50 @@ pub struct _JPCommonLabel { pub phoneme_tail: *mut JPCommonLabelPhoneme, pub short_pause_flag: ::std::os::raw::c_int, } -#[test] -fn bindgen_test_layout__JPCommonLabel() { - const UNINIT: ::std::mem::MaybeUninit<_JPCommonLabel> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_JPCommonLabel>(), - 52usize, - concat!("Size of: ", stringify!(_JPCommonLabel)) - ); - assert_eq!( - ::std::mem::align_of::<_JPCommonLabel>(), - 4usize, - concat!("Alignment of ", stringify!(_JPCommonLabel)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).feature) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(feature) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).breath_head) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(breath_head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).breath_tail) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(breath_tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).accent_head) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(accent_head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).accent_tail) as usize - ptr as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(accent_tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).word_head) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(word_head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).word_tail) as usize - ptr as usize }, - 28usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(word_tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mora_head) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(mora_head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mora_tail) as usize - ptr as usize }, - 36usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(mora_tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).phoneme_head) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(phoneme_head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).phoneme_tail) as usize - ptr as usize }, - 44usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(phoneme_tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).short_pause_flag) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(short_pause_flag) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _JPCommonLabel"][::std::mem::size_of::<_JPCommonLabel>() - 52usize]; + ["Alignment of _JPCommonLabel"][::std::mem::align_of::<_JPCommonLabel>() - 4usize]; + [ + "Offset of field: _JPCommonLabel::size", + ][::std::mem::offset_of!(_JPCommonLabel, size) - 0usize]; + [ + "Offset of field: _JPCommonLabel::feature", + ][::std::mem::offset_of!(_JPCommonLabel, feature) - 4usize]; + [ + "Offset of field: _JPCommonLabel::breath_head", + ][::std::mem::offset_of!(_JPCommonLabel, breath_head) - 8usize]; + [ + "Offset of field: _JPCommonLabel::breath_tail", + ][::std::mem::offset_of!(_JPCommonLabel, breath_tail) - 12usize]; + [ + "Offset of field: _JPCommonLabel::accent_head", + ][::std::mem::offset_of!(_JPCommonLabel, accent_head) - 16usize]; + [ + "Offset of field: _JPCommonLabel::accent_tail", + ][::std::mem::offset_of!(_JPCommonLabel, accent_tail) - 20usize]; + [ + "Offset of field: _JPCommonLabel::word_head", + ][::std::mem::offset_of!(_JPCommonLabel, word_head) - 24usize]; + [ + "Offset of field: _JPCommonLabel::word_tail", + ][::std::mem::offset_of!(_JPCommonLabel, word_tail) - 28usize]; + [ + "Offset of field: _JPCommonLabel::mora_head", + ][::std::mem::offset_of!(_JPCommonLabel, mora_head) - 32usize]; + [ + "Offset of field: _JPCommonLabel::mora_tail", + ][::std::mem::offset_of!(_JPCommonLabel, mora_tail) - 36usize]; + [ + "Offset of field: _JPCommonLabel::phoneme_head", + ][::std::mem::offset_of!(_JPCommonLabel, phoneme_head) - 40usize]; + [ + "Offset of field: _JPCommonLabel::phoneme_tail", + ][::std::mem::offset_of!(_JPCommonLabel, phoneme_tail) - 44usize]; + [ + "Offset of field: _JPCommonLabel::short_pause_flag", + ][::std::mem::offset_of!(_JPCommonLabel, short_pause_flag) - 48usize]; +}; pub type JPCommonLabel = _JPCommonLabel; extern "C" { pub fn JPCommonLabel_initialize(label: *mut JPCommonLabel); @@ -2499,8 +1663,9 @@ extern "C" { pub fn JPCommonLabel_get_size(label: *mut JPCommonLabel) -> ::std::os::raw::c_int; } extern "C" { - pub fn JPCommonLabel_get_feature(label: *mut JPCommonLabel) - -> *mut *mut ::std::os::raw::c_char; + pub fn JPCommonLabel_get_feature( + label: *mut JPCommonLabel, + ) -> *mut *mut ::std::os::raw::c_char; } extern "C" { pub fn JPCommonLabel_print(label: *mut JPCommonLabel); @@ -2523,134 +1688,91 @@ pub struct _JPCommonNode { pub prev: *mut _JPCommonNode, pub next: *mut _JPCommonNode, } -#[test] -fn bindgen_test_layout__JPCommonNode() { - const UNINIT: ::std::mem::MaybeUninit<_JPCommonNode> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_JPCommonNode>(), - 32usize, - concat!("Size of: ", stringify!(_JPCommonNode)) - ); - assert_eq!( - ::std::mem::align_of::<_JPCommonNode>(), - 4usize, - concat!("Alignment of ", stringify!(_JPCommonNode)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pron) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonNode), - "::", - stringify!(pron) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pos) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonNode), - "::", - stringify!(pos) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ctype) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonNode), - "::", - stringify!(ctype) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cform) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonNode), - "::", - stringify!(cform) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).acc) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonNode), - "::", - stringify!(acc) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).chain_flag) as usize - ptr as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonNode), - "::", - stringify!(chain_flag) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonNode), - "::", - stringify!(prev) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 28usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonNode), - "::", - stringify!(next) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _JPCommonNode"][::std::mem::size_of::<_JPCommonNode>() - 32usize]; + ["Alignment of _JPCommonNode"][::std::mem::align_of::<_JPCommonNode>() - 4usize]; + [ + "Offset of field: _JPCommonNode::pron", + ][::std::mem::offset_of!(_JPCommonNode, pron) - 0usize]; + [ + "Offset of field: _JPCommonNode::pos", + ][::std::mem::offset_of!(_JPCommonNode, pos) - 4usize]; + [ + "Offset of field: _JPCommonNode::ctype", + ][::std::mem::offset_of!(_JPCommonNode, ctype) - 8usize]; + [ + "Offset of field: _JPCommonNode::cform", + ][::std::mem::offset_of!(_JPCommonNode, cform) - 12usize]; + [ + "Offset of field: _JPCommonNode::acc", + ][::std::mem::offset_of!(_JPCommonNode, acc) - 16usize]; + [ + "Offset of field: _JPCommonNode::chain_flag", + ][::std::mem::offset_of!(_JPCommonNode, chain_flag) - 20usize]; + [ + "Offset of field: _JPCommonNode::prev", + ][::std::mem::offset_of!(_JPCommonNode, prev) - 24usize]; + [ + "Offset of field: _JPCommonNode::next", + ][::std::mem::offset_of!(_JPCommonNode, next) - 28usize]; +}; pub type JPCommonNode = _JPCommonNode; extern "C" { pub fn JPCommonNode_initialize(node: *mut JPCommonNode); } extern "C" { - pub fn JPCommonNode_set_pron(node: *mut JPCommonNode, str_: *const ::std::os::raw::c_char); + pub fn JPCommonNode_set_pron( + node: *mut JPCommonNode, + str_: *const ::std::os::raw::c_char, + ); } extern "C" { - pub fn JPCommonNode_set_pos(node: *mut JPCommonNode, str_: *const ::std::os::raw::c_char); + pub fn JPCommonNode_set_pos( + node: *mut JPCommonNode, + str_: *const ::std::os::raw::c_char, + ); } extern "C" { - pub fn JPCommonNode_set_ctype(node: *mut JPCommonNode, str_: *const ::std::os::raw::c_char); + pub fn JPCommonNode_set_ctype( + node: *mut JPCommonNode, + str_: *const ::std::os::raw::c_char, + ); } extern "C" { - pub fn JPCommonNode_set_cform(node: *mut JPCommonNode, str_: *const ::std::os::raw::c_char); + pub fn JPCommonNode_set_cform( + node: *mut JPCommonNode, + str_: *const ::std::os::raw::c_char, + ); } extern "C" { pub fn JPCommonNode_set_acc(node: *mut JPCommonNode, acc: ::std::os::raw::c_int); } extern "C" { - pub fn JPCommonNode_set_chain_flag(node: *mut JPCommonNode, flag: ::std::os::raw::c_int); + pub fn JPCommonNode_set_chain_flag( + node: *mut JPCommonNode, + flag: ::std::os::raw::c_int, + ); } extern "C" { - pub fn JPCommonNode_get_pron(node: *mut JPCommonNode) -> *const ::std::os::raw::c_char; + pub fn JPCommonNode_get_pron( + node: *mut JPCommonNode, + ) -> *const ::std::os::raw::c_char; } extern "C" { - pub fn JPCommonNode_get_pos(node: *mut JPCommonNode) -> *const ::std::os::raw::c_char; + pub fn JPCommonNode_get_pos( + node: *mut JPCommonNode, + ) -> *const ::std::os::raw::c_char; } extern "C" { - pub fn JPCommonNode_get_ctype(node: *mut JPCommonNode) -> *const ::std::os::raw::c_char; + pub fn JPCommonNode_get_ctype( + node: *mut JPCommonNode, + ) -> *const ::std::os::raw::c_char; } extern "C" { - pub fn JPCommonNode_get_cform(node: *mut JPCommonNode) -> *const ::std::os::raw::c_char; + pub fn JPCommonNode_get_cform( + node: *mut JPCommonNode, + ) -> *const ::std::os::raw::c_char; } extern "C" { pub fn JPCommonNode_get_acc(node: *mut JPCommonNode) -> ::std::os::raw::c_int; @@ -2674,51 +1796,20 @@ pub struct _JPCommon { pub tail: *mut JPCommonNode, pub label: *mut JPCommonLabel, } -#[test] -fn bindgen_test_layout__JPCommon() { - const UNINIT: ::std::mem::MaybeUninit<_JPCommon> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_JPCommon>(), - 12usize, - concat!("Size of: ", stringify!(_JPCommon)) - ); - assert_eq!( - ::std::mem::align_of::<_JPCommon>(), - 4usize, - concat!("Alignment of ", stringify!(_JPCommon)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).head) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_JPCommon), - "::", - stringify!(head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tail) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(_JPCommon), - "::", - stringify!(tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).label) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_JPCommon), - "::", - stringify!(label) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _JPCommon"][::std::mem::size_of::<_JPCommon>() - 12usize]; + ["Alignment of _JPCommon"][::std::mem::align_of::<_JPCommon>() - 4usize]; + [ + "Offset of field: _JPCommon::head", + ][::std::mem::offset_of!(_JPCommon, head) - 0usize]; + [ + "Offset of field: _JPCommon::tail", + ][::std::mem::offset_of!(_JPCommon, tail) - 4usize]; + [ + "Offset of field: _JPCommon::label", + ][::std::mem::offset_of!(_JPCommon, label) - 8usize]; +}; pub type JPCommon = _JPCommon; extern "C" { pub fn JPCommon_initialize(jpcommon: *mut JPCommon); @@ -2733,7 +1824,9 @@ extern "C" { pub fn JPCommon_get_label_size(jpcommon: *mut JPCommon) -> ::std::os::raw::c_int; } extern "C" { - pub fn JPCommon_get_label_feature(jpcommon: *mut JPCommon) -> *mut *mut ::std::os::raw::c_char; + pub fn JPCommon_get_label_feature( + jpcommon: *mut JPCommon, + ) -> *mut *mut ::std::os::raw::c_char; } extern "C" { pub fn JPCommon_print(jpcommon: *mut JPCommon); diff --git a/crates/open_jtalk-sys/src/generated/windows/x86_64/bindings.rs b/crates/open_jtalk-sys/src/generated/windows/x86_64/bindings.rs index b565aca..46a445b 100644 --- a/crates/open_jtalk-sys/src/generated/windows/x86_64/bindings.rs +++ b/crates/open_jtalk-sys/src/generated/windows/x86_64/bindings.rs @@ -1,540 +1,261 @@ -/* automatically generated by rust-bindgen 0.62.0 */ +/* automatically generated by rust-bindgen 0.70.1 */ -#[doc = " DictionaryInfo structure"] +/// DictionaryInfo structure #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct mecab_dictionary_info_t { - #[doc = " filename of dictionary"] - #[doc = " On Windows, filename is stored in UTF-8 encoding"] + /** filename of dictionary + On Windows, filename is stored in UTF-8 encoding*/ pub filename: *const ::std::os::raw::c_char, - #[doc = " character set of the dictionary. e.g., \"SHIFT-JIS\", \"UTF-8\""] + /// character set of the dictionary. e.g., "SHIFT-JIS", "UTF-8" pub charset: *const ::std::os::raw::c_char, - #[doc = " How many words are registered in this dictionary."] + /// How many words are registered in this dictionary. pub size: ::std::os::raw::c_uint, - #[doc = " dictionary type"] - #[doc = " this value should be MECAB_USR_DIC, MECAB_SYS_DIC, or MECAB_UNK_DIC."] + /** dictionary type + this value should be MECAB_USR_DIC, MECAB_SYS_DIC, or MECAB_UNK_DIC.*/ pub type_: ::std::os::raw::c_int, - #[doc = " left attributes size"] + /// left attributes size pub lsize: ::std::os::raw::c_uint, - #[doc = " right attributes size"] + /// right attributes size pub rsize: ::std::os::raw::c_uint, - #[doc = " version of this dictionary"] + /// version of this dictionary pub version: ::std::os::raw::c_ushort, - #[doc = " pointer to the next dictionary info."] + /// pointer to the next dictionary info. pub next: *mut mecab_dictionary_info_t, } -#[test] -fn bindgen_test_layout_mecab_dictionary_info_t() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 48usize, - concat!("Size of: ", stringify!(mecab_dictionary_info_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(mecab_dictionary_info_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).filename) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(mecab_dictionary_info_t), - "::", - stringify!(filename) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).charset) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(mecab_dictionary_info_t), - "::", - stringify!(charset) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(mecab_dictionary_info_t), - "::", - stringify!(size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(mecab_dictionary_info_t), - "::", - stringify!(type_) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lsize) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(mecab_dictionary_info_t), - "::", - stringify!(lsize) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rsize) as usize - ptr as usize }, - 28usize, - concat!( - "Offset of field: ", - stringify!(mecab_dictionary_info_t), - "::", - stringify!(rsize) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).version) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(mecab_dictionary_info_t), - "::", - stringify!(version) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(mecab_dictionary_info_t), - "::", - stringify!(next) - ) - ); -} -#[doc = " Path structure"] +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + [ + "Size of mecab_dictionary_info_t", + ][::std::mem::size_of::() - 48usize]; + [ + "Alignment of mecab_dictionary_info_t", + ][::std::mem::align_of::() - 8usize]; + [ + "Offset of field: mecab_dictionary_info_t::filename", + ][::std::mem::offset_of!(mecab_dictionary_info_t, filename) - 0usize]; + [ + "Offset of field: mecab_dictionary_info_t::charset", + ][::std::mem::offset_of!(mecab_dictionary_info_t, charset) - 8usize]; + [ + "Offset of field: mecab_dictionary_info_t::size", + ][::std::mem::offset_of!(mecab_dictionary_info_t, size) - 16usize]; + [ + "Offset of field: mecab_dictionary_info_t::type_", + ][::std::mem::offset_of!(mecab_dictionary_info_t, type_) - 20usize]; + [ + "Offset of field: mecab_dictionary_info_t::lsize", + ][::std::mem::offset_of!(mecab_dictionary_info_t, lsize) - 24usize]; + [ + "Offset of field: mecab_dictionary_info_t::rsize", + ][::std::mem::offset_of!(mecab_dictionary_info_t, rsize) - 28usize]; + [ + "Offset of field: mecab_dictionary_info_t::version", + ][::std::mem::offset_of!(mecab_dictionary_info_t, version) - 32usize]; + [ + "Offset of field: mecab_dictionary_info_t::next", + ][::std::mem::offset_of!(mecab_dictionary_info_t, next) - 40usize]; +}; +/// Path structure #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct mecab_path_t { - #[doc = " pointer to the right node"] + /// pointer to the right node pub rnode: *mut mecab_node_t, - #[doc = " pointer to the next right path"] + /// pointer to the next right path pub rnext: *mut mecab_path_t, - #[doc = " pointer to the left node"] + /// pointer to the left node pub lnode: *mut mecab_node_t, - #[doc = " pointer to the next left path"] + /// pointer to the next left path pub lnext: *mut mecab_path_t, - #[doc = " local cost"] + /// local cost pub cost: ::std::os::raw::c_int, - #[doc = " marginal probability"] + /// marginal probability pub prob: f32, } -#[test] -fn bindgen_test_layout_mecab_path_t() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 40usize, - concat!("Size of: ", stringify!(mecab_path_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(mecab_path_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rnode) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(mecab_path_t), - "::", - stringify!(rnode) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rnext) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(mecab_path_t), - "::", - stringify!(rnext) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lnode) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(mecab_path_t), - "::", - stringify!(lnode) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lnext) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(mecab_path_t), - "::", - stringify!(lnext) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cost) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(mecab_path_t), - "::", - stringify!(cost) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prob) as usize - ptr as usize }, - 36usize, - concat!( - "Offset of field: ", - stringify!(mecab_path_t), - "::", - stringify!(prob) - ) - ); -} -#[doc = " Node structure"] +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of mecab_path_t"][::std::mem::size_of::() - 40usize]; + ["Alignment of mecab_path_t"][::std::mem::align_of::() - 8usize]; + [ + "Offset of field: mecab_path_t::rnode", + ][::std::mem::offset_of!(mecab_path_t, rnode) - 0usize]; + [ + "Offset of field: mecab_path_t::rnext", + ][::std::mem::offset_of!(mecab_path_t, rnext) - 8usize]; + [ + "Offset of field: mecab_path_t::lnode", + ][::std::mem::offset_of!(mecab_path_t, lnode) - 16usize]; + [ + "Offset of field: mecab_path_t::lnext", + ][::std::mem::offset_of!(mecab_path_t, lnext) - 24usize]; + [ + "Offset of field: mecab_path_t::cost", + ][::std::mem::offset_of!(mecab_path_t, cost) - 32usize]; + [ + "Offset of field: mecab_path_t::prob", + ][::std::mem::offset_of!(mecab_path_t, prob) - 36usize]; +}; +/// Node structure #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct mecab_node_t { - #[doc = " pointer to the previous node."] + /// pointer to the previous node. pub prev: *mut mecab_node_t, - #[doc = " pointer to the next node."] + /// pointer to the next node. pub next: *mut mecab_node_t, - #[doc = " pointer to the node which ends at the same position."] + /// pointer to the node which ends at the same position. pub enext: *mut mecab_node_t, - #[doc = " pointer to the node which starts at the same position."] + /// pointer to the node which starts at the same position. pub bnext: *mut mecab_node_t, - #[doc = " pointer to the right path."] - #[doc = " this value is NULL if MECAB_ONE_BEST mode."] + /** pointer to the right path. + this value is NULL if MECAB_ONE_BEST mode.*/ pub rpath: *mut mecab_path_t, - #[doc = " pointer to the right path."] - #[doc = " this value is NULL if MECAB_ONE_BEST mode."] + /** pointer to the right path. + this value is NULL if MECAB_ONE_BEST mode.*/ pub lpath: *mut mecab_path_t, - #[doc = " surface string."] - #[doc = " this value is not 0 terminated."] - #[doc = " You can get the length with length/rlength members."] + /** surface string. + this value is not 0 terminated. + You can get the length with length/rlength members.*/ pub surface: *const ::std::os::raw::c_char, - #[doc = " feature string"] + /// feature string pub feature: *const ::std::os::raw::c_char, - #[doc = " unique node id"] + /// unique node id pub id: ::std::os::raw::c_uint, - #[doc = " length of the surface form."] + /// length of the surface form. pub length: ::std::os::raw::c_ushort, - #[doc = " length of the surface form including white space before the morph."] + /// length of the surface form including white space before the morph. pub rlength: ::std::os::raw::c_ushort, - #[doc = " right attribute id"] + /// right attribute id pub rcAttr: ::std::os::raw::c_ushort, - #[doc = " left attribute id"] + /// left attribute id pub lcAttr: ::std::os::raw::c_ushort, - #[doc = " unique part of speech id. This value is defined in \"pos.def\" file."] + /// unique part of speech id. This value is defined in "pos.def" file. pub posid: ::std::os::raw::c_ushort, - #[doc = " character type"] + /// character type pub char_type: ::std::os::raw::c_uchar, - #[doc = " status of this model."] - #[doc = " This value is MECAB_NOR_NODE, MECAB_UNK_NODE, MECAB_BOS_NODE, MECAB_EOS_NODE, or MECAB_EON_NODE."] + /** status of this model. + This value is MECAB_NOR_NODE, MECAB_UNK_NODE, MECAB_BOS_NODE, MECAB_EOS_NODE, or MECAB_EON_NODE.*/ pub stat: ::std::os::raw::c_uchar, - #[doc = " set 1 if this node is best node."] + /// set 1 if this node is best node. pub isbest: ::std::os::raw::c_uchar, - #[doc = " forward accumulative log summation."] - #[doc = " This value is only available when MECAB_MARGINAL_PROB is passed."] + /** forward accumulative log summation. + This value is only available when MECAB_MARGINAL_PROB is passed.*/ pub alpha: f32, - #[doc = " backward accumulative log summation."] - #[doc = " This value is only available when MECAB_MARGINAL_PROB is passed."] + /** backward accumulative log summation. + This value is only available when MECAB_MARGINAL_PROB is passed.*/ pub beta: f32, - #[doc = " marginal probability."] - #[doc = " This value is only available when MECAB_MARGINAL_PROB is passed."] + /** marginal probability. + This value is only available when MECAB_MARGINAL_PROB is passed.*/ pub prob: f32, - #[doc = " word cost."] + /// word cost. pub wcost: ::std::os::raw::c_short, - #[doc = " best accumulative cost from bos node to this node."] + /// best accumulative cost from bos node to this node. pub cost: ::std::os::raw::c_long, } -#[test] -fn bindgen_test_layout_mecab_node_t() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 104usize, - concat!("Size of: ", stringify!(mecab_node_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(mecab_node_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(prev) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(next) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).enext) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(enext) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).bnext) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(bnext) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rpath) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(rpath) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lpath) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(lpath) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).surface) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(surface) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).feature) as usize - ptr as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(feature) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).id) as usize - ptr as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(id) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).length) as usize - ptr as usize }, - 68usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(length) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rlength) as usize - ptr as usize }, - 70usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(rlength) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rcAttr) as usize - ptr as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(rcAttr) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lcAttr) as usize - ptr as usize }, - 74usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(lcAttr) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).posid) as usize - ptr as usize }, - 76usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(posid) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).char_type) as usize - ptr as usize }, - 78usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(char_type) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).stat) as usize - ptr as usize }, - 79usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(stat) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).isbest) as usize - ptr as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(isbest) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).alpha) as usize - ptr as usize }, - 84usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(alpha) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).beta) as usize - ptr as usize }, - 88usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(beta) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prob) as usize - ptr as usize }, - 92usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(prob) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).wcost) as usize - ptr as usize }, - 96usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(wcost) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cost) as usize - ptr as usize }, - 100usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(cost) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of mecab_node_t"][::std::mem::size_of::() - 104usize]; + ["Alignment of mecab_node_t"][::std::mem::align_of::() - 8usize]; + [ + "Offset of field: mecab_node_t::prev", + ][::std::mem::offset_of!(mecab_node_t, prev) - 0usize]; + [ + "Offset of field: mecab_node_t::next", + ][::std::mem::offset_of!(mecab_node_t, next) - 8usize]; + [ + "Offset of field: mecab_node_t::enext", + ][::std::mem::offset_of!(mecab_node_t, enext) - 16usize]; + [ + "Offset of field: mecab_node_t::bnext", + ][::std::mem::offset_of!(mecab_node_t, bnext) - 24usize]; + [ + "Offset of field: mecab_node_t::rpath", + ][::std::mem::offset_of!(mecab_node_t, rpath) - 32usize]; + [ + "Offset of field: mecab_node_t::lpath", + ][::std::mem::offset_of!(mecab_node_t, lpath) - 40usize]; + [ + "Offset of field: mecab_node_t::surface", + ][::std::mem::offset_of!(mecab_node_t, surface) - 48usize]; + [ + "Offset of field: mecab_node_t::feature", + ][::std::mem::offset_of!(mecab_node_t, feature) - 56usize]; + [ + "Offset of field: mecab_node_t::id", + ][::std::mem::offset_of!(mecab_node_t, id) - 64usize]; + [ + "Offset of field: mecab_node_t::length", + ][::std::mem::offset_of!(mecab_node_t, length) - 68usize]; + [ + "Offset of field: mecab_node_t::rlength", + ][::std::mem::offset_of!(mecab_node_t, rlength) - 70usize]; + [ + "Offset of field: mecab_node_t::rcAttr", + ][::std::mem::offset_of!(mecab_node_t, rcAttr) - 72usize]; + [ + "Offset of field: mecab_node_t::lcAttr", + ][::std::mem::offset_of!(mecab_node_t, lcAttr) - 74usize]; + [ + "Offset of field: mecab_node_t::posid", + ][::std::mem::offset_of!(mecab_node_t, posid) - 76usize]; + [ + "Offset of field: mecab_node_t::char_type", + ][::std::mem::offset_of!(mecab_node_t, char_type) - 78usize]; + [ + "Offset of field: mecab_node_t::stat", + ][::std::mem::offset_of!(mecab_node_t, stat) - 79usize]; + [ + "Offset of field: mecab_node_t::isbest", + ][::std::mem::offset_of!(mecab_node_t, isbest) - 80usize]; + [ + "Offset of field: mecab_node_t::alpha", + ][::std::mem::offset_of!(mecab_node_t, alpha) - 84usize]; + [ + "Offset of field: mecab_node_t::beta", + ][::std::mem::offset_of!(mecab_node_t, beta) - 88usize]; + [ + "Offset of field: mecab_node_t::prob", + ][::std::mem::offset_of!(mecab_node_t, prob) - 92usize]; + [ + "Offset of field: mecab_node_t::wcost", + ][::std::mem::offset_of!(mecab_node_t, wcost) - 96usize]; + [ + "Offset of field: mecab_node_t::cost", + ][::std::mem::offset_of!(mecab_node_t, cost) - 100usize]; +}; pub const MECAB_NOR_NODE: _bindgen_ty_3 = _bindgen_ty_3::MECAB_NOR_NODE; pub const MECAB_UNK_NODE: _bindgen_ty_3 = _bindgen_ty_3::MECAB_UNK_NODE; pub const MECAB_BOS_NODE: _bindgen_ty_3 = _bindgen_ty_3::MECAB_BOS_NODE; pub const MECAB_EOS_NODE: _bindgen_ty_3 = _bindgen_ty_3::MECAB_EOS_NODE; pub const MECAB_EON_NODE: _bindgen_ty_3 = _bindgen_ty_3::MECAB_EON_NODE; #[repr(i32)] -#[doc = " Parameters for MeCab::Node::stat"] +/// Parameters for MeCab::Node::stat #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum _bindgen_ty_3 { - #[doc = " Normal node defined in the dictionary."] + /// Normal node defined in the dictionary. MECAB_NOR_NODE = 0, - #[doc = " Unknown node not defined in the dictionary."] + /// Unknown node not defined in the dictionary. MECAB_UNK_NODE = 1, - #[doc = " Virtual node representing a beginning of the sentence."] + /// Virtual node representing a beginning of the sentence. MECAB_BOS_NODE = 2, - #[doc = " Virtual node representing a end of the sentence."] + /// Virtual node representing a end of the sentence. MECAB_EOS_NODE = 3, - #[doc = " Virtual node representing a end of the N-best enumeration."] + /// Virtual node representing a end of the N-best enumeration. MECAB_EON_NODE = 4, } pub const MECAB_SYS_DIC: _bindgen_ty_4 = _bindgen_ty_4::MECAB_SYS_DIC; pub const MECAB_USR_DIC: _bindgen_ty_4 = _bindgen_ty_4::MECAB_USR_DIC; pub const MECAB_UNK_DIC: _bindgen_ty_4 = _bindgen_ty_4::MECAB_UNK_DIC; #[repr(i32)] -#[doc = " Parameters for MeCab::DictionaryInfo::type"] +/// Parameters for MeCab::DictionaryInfo::type #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum _bindgen_ty_4 { - #[doc = " This is a system dictionary."] + /// This is a system dictionary. MECAB_SYS_DIC = 0, - #[doc = " This is a user dictionary."] + /// This is a user dictionary. MECAB_USR_DIC = 1, - #[doc = " This is a unknown word dictionary."] + /// This is a unknown word dictionary. MECAB_UNK_DIC = 2, } pub const MECAB_ONE_BEST: _bindgen_ty_5 = _bindgen_ty_5::MECAB_ONE_BEST; @@ -545,43 +266,43 @@ pub const MECAB_ALTERNATIVE: _bindgen_ty_5 = _bindgen_ty_5::MECAB_ALTERNATIVE; pub const MECAB_ALL_MORPHS: _bindgen_ty_5 = _bindgen_ty_5::MECAB_ALL_MORPHS; pub const MECAB_ALLOCATE_SENTENCE: _bindgen_ty_5 = _bindgen_ty_5::MECAB_ALLOCATE_SENTENCE; #[repr(i32)] -#[doc = " Parameters for MeCab::Lattice::request_type"] +/// Parameters for MeCab::Lattice::request_type #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum _bindgen_ty_5 { - #[doc = " One best result is obtained (default mode)"] + /// One best result is obtained (default mode) MECAB_ONE_BEST = 1, - #[doc = " Set this flag if you want to obtain N best results."] + /// Set this flag if you want to obtain N best results. MECAB_NBEST = 2, - #[doc = " Set this flag if you want to enable a partial parsing mode."] - #[doc = " When this flag is set, the input |sentence| needs to be written"] - #[doc = " in partial parsing format."] + /** Set this flag if you want to enable a partial parsing mode. + When this flag is set, the input |sentence| needs to be written + in partial parsing format.*/ MECAB_PARTIAL = 4, - #[doc = " Set this flag if you want to obtain marginal probabilities."] - #[doc = " Marginal probability is set in MeCab::Node::prob."] - #[doc = " The parsing speed will get 3-5 times slower than the default mode."] + /** Set this flag if you want to obtain marginal probabilities. + Marginal probability is set in MeCab::Node::prob. + The parsing speed will get 3-5 times slower than the default mode.*/ MECAB_MARGINAL_PROB = 8, - #[doc = " Set this flag if you want to obtain alternative results."] - #[doc = " Not implemented."] + /** Set this flag if you want to obtain alternative results. + Not implemented.*/ MECAB_ALTERNATIVE = 16, - #[doc = " When this flag is set, the result linked-list (Node::next/prev)"] - #[doc = " traverses all nodes in the lattice."] + /** When this flag is set, the result linked-list (Node::next/prev) + traverses all nodes in the lattice.*/ MECAB_ALL_MORPHS = 32, - #[doc = " When this flag is set, tagger internally copies the body of passed"] - #[doc = " sentence into internal buffer."] + /** When this flag is set, tagger internally copies the body of passed + sentence into internal buffer.*/ MECAB_ALLOCATE_SENTENCE = 64, } pub const MECAB_ANY_BOUNDARY: _bindgen_ty_6 = _bindgen_ty_6::MECAB_ANY_BOUNDARY; pub const MECAB_TOKEN_BOUNDARY: _bindgen_ty_6 = _bindgen_ty_6::MECAB_TOKEN_BOUNDARY; pub const MECAB_INSIDE_TOKEN: _bindgen_ty_6 = _bindgen_ty_6::MECAB_INSIDE_TOKEN; #[repr(i32)] -#[doc = " Parameters for MeCab::Lattice::boundary_constraint_type"] +/// Parameters for MeCab::Lattice::boundary_constraint_type #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum _bindgen_ty_6 { - #[doc = " The token boundary is not specified."] + /// The token boundary is not specified. MECAB_ANY_BOUNDARY = 0, - #[doc = " The position is a strong token boundary."] + /// The position is a strong token boundary. MECAB_TOKEN_BOUNDARY = 1, - #[doc = " The position is not a token boundary."] + /// The position is not a token boundary. MECAB_INSIDE_TOKEN = 2, } #[repr(C)] @@ -589,31 +310,14 @@ pub enum _bindgen_ty_6 { pub struct _iobuf { pub _Placeholder: *mut ::std::os::raw::c_void, } -#[test] -fn bindgen_test_layout__iobuf() { - const UNINIT: ::std::mem::MaybeUninit<_iobuf> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_iobuf>(), - 8usize, - concat!("Size of: ", stringify!(_iobuf)) - ); - assert_eq!( - ::std::mem::align_of::<_iobuf>(), - 8usize, - concat!("Alignment of ", stringify!(_iobuf)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._Placeholder) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_iobuf), - "::", - stringify!(_Placeholder) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _iobuf"][::std::mem::size_of::<_iobuf>() - 8usize]; + ["Alignment of _iobuf"][::std::mem::align_of::<_iobuf>() - 8usize]; + [ + "Offset of field: _iobuf::_Placeholder", + ][::std::mem::offset_of!(_iobuf, _Placeholder) - 0usize]; +}; pub type FILE = _iobuf; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -631,76 +335,76 @@ pub struct mecab_lattice_t { _unused: [u8; 0], } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::create(argc, argv)"] + /// C wrapper of MeCab::Tagger::create(argc, argv) pub fn mecab_new( argc: ::std::os::raw::c_int, argv: *mut *mut ::std::os::raw::c_char, ) -> *mut mecab_t; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::create(arg)"] + /// C wrapper of MeCab::Tagger::create(arg) pub fn mecab_new2(arg: *const ::std::os::raw::c_char) -> *mut mecab_t; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::version()"] + /// C wrapper of MeCab::Tagger::version() pub fn mecab_version() -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::getLastError()"] + /// C wrapper of MeCab::getLastError() pub fn mecab_strerror(mecab: *mut mecab_t) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::deleteTagger(tagger)"] + /// C wrapper of MeCab::deleteTagger(tagger) pub fn mecab_destroy(mecab: *mut mecab_t); } extern "C" { - #[doc = " C wrapper of MeCab::Tagger:set_partial()"] + /// C wrapper of MeCab::Tagger:set_partial() pub fn mecab_get_partial(mecab: *mut mecab_t) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::partial()"] + /// C wrapper of MeCab::Tagger::partial() pub fn mecab_set_partial(mecab: *mut mecab_t, partial: ::std::os::raw::c_int); } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::theta()"] + /// C wrapper of MeCab::Tagger::theta() pub fn mecab_get_theta(mecab: *mut mecab_t) -> f32; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::set_theta()"] + /// C wrapper of MeCab::Tagger::set_theta() pub fn mecab_set_theta(mecab: *mut mecab_t, theta: f32); } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::lattice_level()"] + /// C wrapper of MeCab::Tagger::lattice_level() pub fn mecab_get_lattice_level(mecab: *mut mecab_t) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::set_lattice_level()"] + /// C wrapper of MeCab::Tagger::set_lattice_level() pub fn mecab_set_lattice_level(mecab: *mut mecab_t, level: ::std::os::raw::c_int); } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::all_morphs()"] + /// C wrapper of MeCab::Tagger::all_morphs() pub fn mecab_get_all_morphs(mecab: *mut mecab_t) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::set_all_moprhs()"] + /// C wrapper of MeCab::Tagger::set_all_moprhs() pub fn mecab_set_all_morphs(mecab: *mut mecab_t, all_morphs: ::std::os::raw::c_int); } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parse(MeCab::Lattice *lattice)"] + /// C wrapper of MeCab::Tagger::parse(MeCab::Lattice *lattice) pub fn mecab_parse_lattice( mecab: *mut mecab_t, lattice: *mut mecab_lattice_t, ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parse(const char *str)"] + /// C wrapper of MeCab::Tagger::parse(const char *str) pub fn mecab_sparse_tostr( mecab: *mut mecab_t, str_: *const ::std::os::raw::c_char, ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parse(const char *str, size_t len)"] + /// C wrapper of MeCab::Tagger::parse(const char *str, size_t len) pub fn mecab_sparse_tostr2( mecab: *mut mecab_t, str_: *const ::std::os::raw::c_char, @@ -708,7 +412,7 @@ extern "C" { ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parse(const char *str, char *ostr, size_t olen)"] + /// C wrapper of MeCab::Tagger::parse(const char *str, char *ostr, size_t olen) pub fn mecab_sparse_tostr3( mecab: *mut mecab_t, str_: *const ::std::os::raw::c_char, @@ -718,14 +422,14 @@ extern "C" { ) -> *mut ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parseToNode(const char *str)"] + /// C wrapper of MeCab::Tagger::parseToNode(const char *str) pub fn mecab_sparse_tonode( mecab: *mut mecab_t, arg1: *const ::std::os::raw::c_char, ) -> *const mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parseToNode(const char *str, size_t len)"] + /// C wrapper of MeCab::Tagger::parseToNode(const char *str, size_t len) pub fn mecab_sparse_tonode2( mecab: *mut mecab_t, arg1: *const ::std::os::raw::c_char, @@ -733,7 +437,7 @@ extern "C" { ) -> *const mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parseNBest(size_t N, const char *str)"] + /// C wrapper of MeCab::Tagger::parseNBest(size_t N, const char *str) pub fn mecab_nbest_sparse_tostr( mecab: *mut mecab_t, N: usize, @@ -741,7 +445,7 @@ extern "C" { ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parseNBest(size_t N, const char *str, size_t len)"] + /// C wrapper of MeCab::Tagger::parseNBest(size_t N, const char *str, size_t len) pub fn mecab_nbest_sparse_tostr2( mecab: *mut mecab_t, N: usize, @@ -750,7 +454,7 @@ extern "C" { ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parseNBest(size_t N, const char *str, char *ostr, size_t olen)"] + /// C wrapper of MeCab::Tagger::parseNBest(size_t N, const char *str, char *ostr, size_t olen) pub fn mecab_nbest_sparse_tostr3( mecab: *mut mecab_t, N: usize, @@ -761,14 +465,14 @@ extern "C" { ) -> *mut ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parseNBestInit(const char *str)"] + /// C wrapper of MeCab::Tagger::parseNBestInit(const char *str) pub fn mecab_nbest_init( mecab: *mut mecab_t, str_: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::parseNBestInit(const char *str, size_t len)"] + /// C wrapper of MeCab::Tagger::parseNBestInit(const char *str, size_t len) pub fn mecab_nbest_init2( mecab: *mut mecab_t, str_: *const ::std::os::raw::c_char, @@ -776,11 +480,11 @@ extern "C" { ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::next()"] + /// C wrapper of MeCab::Tagger::next() pub fn mecab_nbest_next_tostr(mecab: *mut mecab_t) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::next(char *ostr, size_t olen)"] + /// C wrapper of MeCab::Tagger::next(char *ostr, size_t olen) pub fn mecab_nbest_next_tostr2( mecab: *mut mecab_t, ostr: *mut ::std::os::raw::c_char, @@ -788,84 +492,91 @@ extern "C" { ) -> *mut ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::nextNode()"] + /// C wrapper of MeCab::Tagger::nextNode() pub fn mecab_nbest_next_tonode(mecab: *mut mecab_t) -> *const mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::formatNode(const Node *node)"] + /// C wrapper of MeCab::Tagger::formatNode(const Node *node) pub fn mecab_format_node( mecab: *mut mecab_t, node: *const mecab_node_t, ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Tagger::dictionary_info()"] + /// C wrapper of MeCab::Tagger::dictionary_info() pub fn mecab_dictionary_info(mecab: *mut mecab_t) -> *const mecab_dictionary_info_t; } extern "C" { - #[doc = " C wrapper of MeCab::createLattice()"] + /// C wrapper of MeCab::createLattice() pub fn mecab_lattice_new() -> *mut mecab_lattice_t; } extern "C" { - #[doc = " C wrapper of MeCab::deleteLattice(lattice)"] + /// C wrapper of MeCab::deleteLattice(lattice) pub fn mecab_lattice_destroy(lattice: *mut mecab_lattice_t); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::clear()"] + /// C wrapper of MeCab::Lattice::clear() pub fn mecab_lattice_clear(lattice: *mut mecab_lattice_t); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::is_available()"] - pub fn mecab_lattice_is_available(lattice: *mut mecab_lattice_t) -> ::std::os::raw::c_int; + /// C wrapper of MeCab::Lattice::is_available() + pub fn mecab_lattice_is_available( + lattice: *mut mecab_lattice_t, + ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::bos_node()"] - pub fn mecab_lattice_get_bos_node(lattice: *mut mecab_lattice_t) -> *mut mecab_node_t; + /// C wrapper of MeCab::Lattice::bos_node() + pub fn mecab_lattice_get_bos_node( + lattice: *mut mecab_lattice_t, + ) -> *mut mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::eos_node()"] - pub fn mecab_lattice_get_eos_node(lattice: *mut mecab_lattice_t) -> *mut mecab_node_t; + /// C wrapper of MeCab::Lattice::eos_node() + pub fn mecab_lattice_get_eos_node( + lattice: *mut mecab_lattice_t, + ) -> *mut mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::begin_nodes()"] + /// C wrapper of MeCab::Lattice::begin_nodes() pub fn mecab_lattice_get_all_begin_nodes( lattice: *mut mecab_lattice_t, ) -> *mut *mut mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::end_nodes()"] - pub fn mecab_lattice_get_all_end_nodes(lattice: *mut mecab_lattice_t) - -> *mut *mut mecab_node_t; + /// C wrapper of MeCab::Lattice::end_nodes() + pub fn mecab_lattice_get_all_end_nodes( + lattice: *mut mecab_lattice_t, + ) -> *mut *mut mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::begin_nodes(pos)"] + /// C wrapper of MeCab::Lattice::begin_nodes(pos) pub fn mecab_lattice_get_begin_nodes( lattice: *mut mecab_lattice_t, pos: usize, ) -> *mut mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::end_nodes(pos)"] + /// C wrapper of MeCab::Lattice::end_nodes(pos) pub fn mecab_lattice_get_end_nodes( lattice: *mut mecab_lattice_t, pos: usize, ) -> *mut mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::sentence()"] + /// C wrapper of MeCab::Lattice::sentence() pub fn mecab_lattice_get_sentence( lattice: *mut mecab_lattice_t, ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::set_sentence(sentence)"] + /// C wrapper of MeCab::Lattice::set_sentence(sentence) pub fn mecab_lattice_set_sentence( lattice: *mut mecab_lattice_t, sentence: *const ::std::os::raw::c_char, ); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::set_sentence(sentence, len)"] + /// C wrapper of MeCab::Lattice::set_sentence(sentence, len) pub fn mecab_lattice_set_sentence2( lattice: *mut mecab_lattice_t, sentence: *const ::std::os::raw::c_char, @@ -873,71 +584,75 @@ extern "C" { ); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::size()"] + /// C wrapper of MeCab::Lattice::size() pub fn mecab_lattice_get_size(lattice: *mut mecab_lattice_t) -> usize; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::Z()"] + /// C wrapper of MeCab::Lattice::Z() pub fn mecab_lattice_get_z(lattice: *mut mecab_lattice_t) -> f64; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::set_Z()"] + /// C wrapper of MeCab::Lattice::set_Z() pub fn mecab_lattice_set_z(lattice: *mut mecab_lattice_t, Z: f64); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::theta()"] + /// C wrapper of MeCab::Lattice::theta() pub fn mecab_lattice_get_theta(lattice: *mut mecab_lattice_t) -> f64; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::set_theta()"] + /// C wrapper of MeCab::Lattice::set_theta() pub fn mecab_lattice_set_theta(lattice: *mut mecab_lattice_t, theta: f64); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::next()"] + /// C wrapper of MeCab::Lattice::next() pub fn mecab_lattice_next(lattice: *mut mecab_lattice_t) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::request_type()"] - pub fn mecab_lattice_get_request_type(lattice: *mut mecab_lattice_t) -> ::std::os::raw::c_int; + /// C wrapper of MeCab::Lattice::request_type() + pub fn mecab_lattice_get_request_type( + lattice: *mut mecab_lattice_t, + ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::has_request_type()"] + /// C wrapper of MeCab::Lattice::has_request_type() pub fn mecab_lattice_has_request_type( lattice: *mut mecab_lattice_t, request_type: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::set_request_type()"] + /// C wrapper of MeCab::Lattice::set_request_type() pub fn mecab_lattice_set_request_type( lattice: *mut mecab_lattice_t, request_type: ::std::os::raw::c_int, ); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::add_request_type()"] + /// C wrapper of MeCab::Lattice::add_request_type() pub fn mecab_lattice_add_request_type( lattice: *mut mecab_lattice_t, request_type: ::std::os::raw::c_int, ); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::remove_request_type()"] + /// C wrapper of MeCab::Lattice::remove_request_type() pub fn mecab_lattice_remove_request_type( lattice: *mut mecab_lattice_t, request_type: ::std::os::raw::c_int, ); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::newNode();"] + /// C wrapper of MeCab::Lattice::newNode(); pub fn mecab_lattice_new_node(lattice: *mut mecab_lattice_t) -> *mut mecab_node_t; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::toString()"] - pub fn mecab_lattice_tostr(lattice: *mut mecab_lattice_t) -> *const ::std::os::raw::c_char; + /// C wrapper of MeCab::Lattice::toString() + pub fn mecab_lattice_tostr( + lattice: *mut mecab_lattice_t, + ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::toString(buf, size)"] + /// C wrapper of MeCab::Lattice::toString(buf, size) pub fn mecab_lattice_tostr2( lattice: *mut mecab_lattice_t, buf: *mut ::std::os::raw::c_char, @@ -945,14 +660,14 @@ extern "C" { ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::enumNBestAsString(N)"] + /// C wrapper of MeCab::Lattice::enumNBestAsString(N) pub fn mecab_lattice_nbest_tostr( lattice: *mut mecab_lattice_t, N: usize, ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::enumNBestAsString(N, buf, size)"] + /// C wrapper of MeCab::Lattice::enumNBestAsString(N, buf, size) pub fn mecab_lattice_nbest_tostr2( lattice: *mut mecab_lattice_t, N: usize, @@ -961,25 +676,27 @@ extern "C" { ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::has_constraint()"] - pub fn mecab_lattice_has_constraint(lattice: *mut mecab_lattice_t) -> ::std::os::raw::c_int; + /// C wrapper of MeCab::Lattice::has_constraint() + pub fn mecab_lattice_has_constraint( + lattice: *mut mecab_lattice_t, + ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::boundary_constraint(pos)"] + /// C wrapper of MeCab::Lattice::boundary_constraint(pos) pub fn mecab_lattice_get_boundary_constraint( lattice: *mut mecab_lattice_t, pos: usize, ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::feature_constraint(pos)"] + /// C wrapper of MeCab::Lattice::feature_constraint(pos) pub fn mecab_lattice_get_feature_constraint( lattice: *mut mecab_lattice_t, pos: usize, ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::boundary_constraint(pos, type)"] + /// C wrapper of MeCab::Lattice::boundary_constraint(pos, type) pub fn mecab_lattice_set_boundary_constraint( lattice: *mut mecab_lattice_t, pos: usize, @@ -987,7 +704,7 @@ extern "C" { ); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::set_feature_constraint(begin_pos, end_pos, feature)"] + /// C wrapper of MeCab::Lattice::set_feature_constraint(begin_pos, end_pos, feature) pub fn mecab_lattice_set_feature_constraint( lattice: *mut mecab_lattice_t, begin_pos: usize, @@ -996,53 +713,56 @@ extern "C" { ); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::set_result(result);"] + /// C wrapper of MeCab::Lattice::set_result(result); pub fn mecab_lattice_set_result( lattice: *mut mecab_lattice_t, result: *const ::std::os::raw::c_char, ); } extern "C" { - #[doc = " C wrapper of MeCab::Lattice::what()"] - pub fn mecab_lattice_strerror(lattice: *mut mecab_lattice_t) -> *const ::std::os::raw::c_char; + /// C wrapper of MeCab::Lattice::what() + pub fn mecab_lattice_strerror( + lattice: *mut mecab_lattice_t, + ) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " C wapper of MeCab::Model::create(argc, argv)"] + /// C wapper of MeCab::Model::create(argc, argv) pub fn mecab_model_new( argc: ::std::os::raw::c_int, argv: *mut *mut ::std::os::raw::c_char, ) -> *mut mecab_model_t; } extern "C" { - #[doc = " C wapper of MeCab::Model::create(arg)"] + /// C wapper of MeCab::Model::create(arg) pub fn mecab_model_new2(arg: *const ::std::os::raw::c_char) -> *mut mecab_model_t; } extern "C" { - #[doc = " C wapper of MeCab::deleteModel(model)"] + /// C wapper of MeCab::deleteModel(model) pub fn mecab_model_destroy(model: *mut mecab_model_t); } extern "C" { - #[doc = " C wapper of MeCab::Model::createTagger()"] + /// C wapper of MeCab::Model::createTagger() pub fn mecab_model_new_tagger(model: *mut mecab_model_t) -> *mut mecab_t; } extern "C" { - #[doc = " C wapper of MeCab::Model::createLattice()"] + /// C wapper of MeCab::Model::createLattice() pub fn mecab_model_new_lattice(model: *mut mecab_model_t) -> *mut mecab_lattice_t; } extern "C" { - #[doc = " C wrapper of MeCab::Model::swap()"] + /// C wrapper of MeCab::Model::swap() pub fn mecab_model_swap( model: *mut mecab_model_t, new_model: *mut mecab_model_t, ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wapper of MeCab::Model::dictionary_info()"] - pub fn mecab_model_dictionary_info(model: *mut mecab_model_t) - -> *const mecab_dictionary_info_t; + /// C wapper of MeCab::Model::dictionary_info() + pub fn mecab_model_dictionary_info( + model: *mut mecab_model_t, + ) -> *const mecab_dictionary_info_t; } extern "C" { - #[doc = " C wrapper of MeCab::Model::transition_cost()"] + /// C wrapper of MeCab::Model::transition_cost() pub fn mecab_model_transition_cost( model: *mut mecab_model_t, rcAttr: ::std::os::raw::c_ushort, @@ -1050,7 +770,7 @@ extern "C" { ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " C wrapper of MeCab::Model::lookup()"] + /// C wrapper of MeCab::Model::lookup() pub fn mecab_model_lookup( model: *mut mecab_model_t, begin: *const ::std::os::raw::c_char, @@ -1094,11 +814,11 @@ extern "C" { argv: *mut *mut ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } -#[doc = " DictionaryInfo structure"] +/// DictionaryInfo structure pub type MeCab_DictionaryInfo = mecab_dictionary_info_t; -#[doc = " Path structure"] +/// Path structure pub type MeCab_Path = mecab_path_t; -#[doc = " Node structure"] +/// Node structure pub type MeCab_Node = mecab_node_t; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -1107,71 +827,55 @@ pub struct MeCab_Allocator { } #[repr(C)] pub struct MeCab_Lattice__bindgen_vtable(::std::os::raw::c_void); -#[doc = " Lattice class"] +/// Lattice class #[repr(C)] #[derive(Debug)] pub struct MeCab_Lattice { pub vtable_: *const MeCab_Lattice__bindgen_vtable, } -#[test] -fn bindgen_test_layout_MeCab_Lattice() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(MeCab_Lattice)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(MeCab_Lattice)) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of MeCab_Lattice"][::std::mem::size_of::() - 8usize]; + ["Alignment of MeCab_Lattice"][::std::mem::align_of::() - 8usize]; +}; extern "C" { - #[doc = " Create new Lattice object"] - #[doc = " @return new Lattice object"] + /** Create new Lattice object + @return new Lattice object*/ #[link_name = "\u{1}?create@Lattice@MeCab@@SAPEAV12@XZ"] pub fn MeCab_Lattice_create() -> *mut MeCab_Lattice; } impl MeCab_Lattice { #[inline] pub unsafe fn create() -> *mut MeCab_Lattice { - unsafe { MeCab_Lattice_create() } + MeCab_Lattice_create() } } #[repr(C)] pub struct MeCab_Model__bindgen_vtable(::std::os::raw::c_void); -#[doc = " Model class"] +/// Model class #[repr(C)] #[derive(Debug)] pub struct MeCab_Model { pub vtable_: *const MeCab_Model__bindgen_vtable, } -#[test] -fn bindgen_test_layout_MeCab_Model() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(MeCab_Model)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(MeCab_Model)) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of MeCab_Model"][::std::mem::size_of::() - 8usize]; + ["Alignment of MeCab_Model"][::std::mem::align_of::() - 8usize]; +}; extern "C" { - #[doc = " Return a version string"] - #[doc = " @return version string"] + /** Return a version string + @return version string*/ #[link_name = "\u{1}?version@Model@MeCab@@SAPEBDXZ"] pub fn MeCab_Model_version() -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " Factory method to create a new Model with a specified main's argc/argv-style parameters."] - #[doc = " Return NULL if new model cannot be initialized. Use MeCab::getLastError() to obtain the"] - #[doc = " cause of the errors."] - #[doc = " @return new Model object"] - #[doc = " @param argc number of parameters"] - #[doc = " @param argv parameter list"] + /** Factory method to create a new Model with a specified main's argc/argv-style parameters. + Return NULL if new model cannot be initialized. Use MeCab::getLastError() to obtain the + cause of the errors. + @return new Model object + @param argc number of parameters + @param argv parameter list*/ #[link_name = "\u{1}?create@Model@MeCab@@SAPEAV12@HPEAPEAD@Z"] pub fn MeCab_Model_create( argc: ::std::os::raw::c_int, @@ -1179,74 +883,69 @@ extern "C" { ) -> *mut MeCab_Model; } extern "C" { - #[doc = " Factory method to create a new Model with a string parameter representation, i.e.,"] - #[doc = " \"-d /user/local/mecab/dic/ipadic -Ochasen\"."] - #[doc = " Return NULL if new model cannot be initialized. Use MeCab::getLastError() to obtain the"] - #[doc = " cause of the errors."] - #[doc = " @return new Model object"] - #[doc = " @param arg single string representation of the argment."] + /** Factory method to create a new Model with a string parameter representation, i.e., + "-d /user/local/mecab/dic/ipadic -Ochasen". + Return NULL if new model cannot be initialized. Use MeCab::getLastError() to obtain the + cause of the errors. + @return new Model object + @param arg single string representation of the argment.*/ #[link_name = "\u{1}?create@Model@MeCab@@SAPEAV12@PEBD@Z"] pub fn MeCab_Model_create1(arg: *const ::std::os::raw::c_char) -> *mut MeCab_Model; } impl MeCab_Model { #[inline] pub unsafe fn version() -> *const ::std::os::raw::c_char { - unsafe { MeCab_Model_version() } + MeCab_Model_version() } #[inline] pub unsafe fn create( argc: ::std::os::raw::c_int, argv: *mut *mut ::std::os::raw::c_char, ) -> *mut MeCab_Model { - unsafe { MeCab_Model_create(argc, argv) } + MeCab_Model_create(argc, argv) } #[inline] pub unsafe fn create1(arg: *const ::std::os::raw::c_char) -> *mut MeCab_Model { - unsafe { MeCab_Model_create1(arg) } + MeCab_Model_create1(arg) } } #[repr(C)] pub struct MeCab_Tagger__bindgen_vtable(::std::os::raw::c_void); -#[doc = " Tagger class"] +/// Tagger class #[repr(C)] #[derive(Debug)] pub struct MeCab_Tagger { pub vtable_: *const MeCab_Tagger__bindgen_vtable, } -#[test] -fn bindgen_test_layout_MeCab_Tagger() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(MeCab_Tagger)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(MeCab_Tagger)) - ); -} -extern "C" { - #[doc = " Handy static method."] - #[doc = " Return true if lattice is parsed successfully."] - #[doc = " This function is equivalent to"] - #[doc = " {"] - #[doc = " Tagger *tagger = model.createModel();"] - #[doc = " cosnt bool result = tagger->parse(lattice);"] - #[doc = " delete tagger;"] - #[doc = " return result;"] - #[doc = " }"] - #[doc = " @return boolean"] +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of MeCab_Tagger"][::std::mem::size_of::() - 8usize]; + ["Alignment of MeCab_Tagger"][::std::mem::align_of::() - 8usize]; +}; +extern "C" { + /** Handy static method. + Return true if lattice is parsed successfully. + This function is equivalent to + { + Tagger *tagger = model.createModel(); + cosnt bool result = tagger->parse(lattice); + delete tagger; + return result; + } + @return boolean*/ #[link_name = "\u{1}?parse@Tagger@MeCab@@SA_NAEBVModel@2@PEAVLattice@2@@Z"] - pub fn MeCab_Tagger_parse(model: *const MeCab_Model, lattice: *mut MeCab_Lattice) -> bool; -} -extern "C" { - #[doc = " Factory method to create a new Tagger with a specified main's argc/argv-style parameters."] - #[doc = " Return NULL if new model cannot be initialized. Use MeCab::getLastError() to obtain the"] - #[doc = " cause of the errors."] - #[doc = " @return new Tagger object"] - #[doc = " @param argc number of parameters"] - #[doc = " @param argv parameter list"] + pub fn MeCab_Tagger_parse( + model: *const MeCab_Model, + lattice: *mut MeCab_Lattice, + ) -> bool; +} +extern "C" { + /** Factory method to create a new Tagger with a specified main's argc/argv-style parameters. + Return NULL if new model cannot be initialized. Use MeCab::getLastError() to obtain the + cause of the errors. + @return new Tagger object + @param argc number of parameters + @param argv parameter list*/ #[link_name = "\u{1}?create@Tagger@MeCab@@SAPEAV12@HPEAPEAD@Z"] pub fn MeCab_Tagger_create( argc: ::std::os::raw::c_int, @@ -1254,49 +953,49 @@ extern "C" { ) -> *mut MeCab_Tagger; } extern "C" { - #[doc = " Factory method to create a new Tagger with a string parameter representation, i.e.,"] - #[doc = " \"-d /user/local/mecab/dic/ipadic -Ochasen\"."] - #[doc = " Return NULL if new model cannot be initialized. Use MeCab::getLastError() to obtain the"] - #[doc = " cause of the errors."] - #[doc = " @return new Model object"] - #[doc = " @param arg single string representation of the argment."] + /** Factory method to create a new Tagger with a string parameter representation, i.e., + "-d /user/local/mecab/dic/ipadic -Ochasen". + Return NULL if new model cannot be initialized. Use MeCab::getLastError() to obtain the + cause of the errors. + @return new Model object + @param arg single string representation of the argment.*/ #[link_name = "\u{1}?create@Tagger@MeCab@@SAPEAV12@PEBD@Z"] pub fn MeCab_Tagger_create1(arg: *const ::std::os::raw::c_char) -> *mut MeCab_Tagger; } extern "C" { - #[doc = " Return a version string"] - #[doc = " @return version string"] + /** Return a version string + @return version string*/ #[link_name = "\u{1}?version@Tagger@MeCab@@SAPEBDXZ"] pub fn MeCab_Tagger_version() -> *const ::std::os::raw::c_char; } impl MeCab_Tagger { #[inline] pub unsafe fn parse(model: *const MeCab_Model, lattice: *mut MeCab_Lattice) -> bool { - unsafe { MeCab_Tagger_parse(model, lattice) } + MeCab_Tagger_parse(model, lattice) } #[inline] pub unsafe fn create( argc: ::std::os::raw::c_int, argv: *mut *mut ::std::os::raw::c_char, ) -> *mut MeCab_Tagger { - unsafe { MeCab_Tagger_create(argc, argv) } + MeCab_Tagger_create(argc, argv) } #[inline] pub unsafe fn create1(arg: *const ::std::os::raw::c_char) -> *mut MeCab_Tagger { - unsafe { MeCab_Tagger_create1(arg) } + MeCab_Tagger_create1(arg) } #[inline] pub unsafe fn version() -> *const ::std::os::raw::c_char { - unsafe { MeCab_Tagger_version() } + MeCab_Tagger_version() } } extern "C" { - #[doc = " Alias of Lattice::create()"] + /// Alias of Lattice::create() #[link_name = "\u{1}?createLattice@MeCab@@YAPEAVLattice@1@XZ"] pub fn MeCab_createLattice() -> *mut MeCab_Lattice; } extern "C" { - #[doc = " Alias of Mode::create(argc, argv)"] + /// Alias of Mode::create(argc, argv) #[link_name = "\u{1}?createModel@MeCab@@YAPEAVModel@1@HPEAPEAD@Z"] pub fn MeCab_createModel( argc: ::std::os::raw::c_int, @@ -1304,12 +1003,12 @@ extern "C" { ) -> *mut MeCab_Model; } extern "C" { - #[doc = " Alias of Mode::create(arg)"] + /// Alias of Mode::create(arg) #[link_name = "\u{1}?createModel@MeCab@@YAPEAVModel@1@PEBD@Z"] pub fn MeCab_createModel1(arg: *const ::std::os::raw::c_char) -> *mut MeCab_Model; } extern "C" { - #[doc = " Alias of Tagger::create(argc, argv)"] + /// Alias of Tagger::create(argc, argv) #[link_name = "\u{1}?createTagger@MeCab@@YAPEAVTagger@1@HPEAPEAD@Z"] pub fn MeCab_createTagger( argc: ::std::os::raw::c_int, @@ -1317,44 +1016,44 @@ extern "C" { ) -> *mut MeCab_Tagger; } extern "C" { - #[doc = " Alias of Tagger::create(arg)"] + /// Alias of Tagger::create(arg) #[link_name = "\u{1}?createTagger@MeCab@@YAPEAVTagger@1@PEBD@Z"] pub fn MeCab_createTagger1(arg: *const ::std::os::raw::c_char) -> *mut MeCab_Tagger; } extern "C" { - #[doc = " delete Lattice object."] - #[doc = " This method calles \"delete lattice\"."] - #[doc = " In some environment, e.g., MS-Windows, an object allocated inside a DLL must be deleted in the same DLL too."] - #[doc = " @param lattice lattice object"] + /** delete Lattice object. + This method calles "delete lattice". + In some environment, e.g., MS-Windows, an object allocated inside a DLL must be deleted in the same DLL too. + @param lattice lattice object*/ #[link_name = "\u{1}?deleteLattice@MeCab@@YAXPEAVLattice@1@@Z"] pub fn MeCab_deleteLattice(lattice: *mut MeCab_Lattice); } extern "C" { - #[doc = " delete Model object."] - #[doc = " This method calles \"delete model\"."] - #[doc = " In some environment, e.g., MS-Windows, an object allocated inside a DLL must be deleted in the same DLL too."] - #[doc = " @param model model object"] + /** delete Model object. + This method calles "delete model". + In some environment, e.g., MS-Windows, an object allocated inside a DLL must be deleted in the same DLL too. + @param model model object*/ #[link_name = "\u{1}?deleteModel@MeCab@@YAXPEAVModel@1@@Z"] pub fn MeCab_deleteModel(model: *mut MeCab_Model); } extern "C" { - #[doc = " delete Tagger object."] - #[doc = " This method calles \"delete tagger\"."] - #[doc = " In some environment, e.g., MS-Windows, an object allocated inside a DLL must be deleted in the same DLL too."] - #[doc = " @param tagger tagger object"] + /** delete Tagger object. + This method calles "delete tagger". + In some environment, e.g., MS-Windows, an object allocated inside a DLL must be deleted in the same DLL too. + @param tagger tagger object*/ #[link_name = "\u{1}?deleteTagger@MeCab@@YAXPEAVTagger@1@@Z"] pub fn MeCab_deleteTagger(tagger: *mut MeCab_Tagger); } extern "C" { - #[doc = " Return last error string."] - #[doc = " @return error string"] + /** Return last error string. + @return error string*/ #[link_name = "\u{1}?getLastError@MeCab@@YAPEBDXZ"] pub fn MeCab_getLastError() -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " An alias of getLastError."] - #[doc = " It is kept for backward compatibility."] - #[doc = " @return error string"] + /** An alias of getLastError. + It is kept for backward compatibility. + @return error string*/ #[link_name = "\u{1}?getTaggerError@MeCab@@YAPEBDXZ"] pub fn MeCab_getTaggerError() -> *const ::std::os::raw::c_char; } @@ -1367,71 +1066,22 @@ pub struct _Mecab { pub tagger: *mut ::std::os::raw::c_void, pub lattice: *mut ::std::os::raw::c_void, } -#[test] -fn bindgen_test_layout__Mecab() { - const UNINIT: ::std::mem::MaybeUninit<_Mecab> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_Mecab>(), - 40usize, - concat!("Size of: ", stringify!(_Mecab)) - ); - assert_eq!( - ::std::mem::align_of::<_Mecab>(), - 8usize, - concat!("Alignment of ", stringify!(_Mecab)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).feature) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_Mecab), - "::", - stringify!(feature) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_Mecab), - "::", - stringify!(size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).model) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_Mecab), - "::", - stringify!(model) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tagger) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_Mecab), - "::", - stringify!(tagger) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lattice) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_Mecab), - "::", - stringify!(lattice) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _Mecab"][::std::mem::size_of::<_Mecab>() - 40usize]; + ["Alignment of _Mecab"][::std::mem::align_of::<_Mecab>() - 8usize]; + [ + "Offset of field: _Mecab::feature", + ][::std::mem::offset_of!(_Mecab, feature) - 0usize]; + ["Offset of field: _Mecab::size"][::std::mem::offset_of!(_Mecab, size) - 8usize]; + ["Offset of field: _Mecab::model"][::std::mem::offset_of!(_Mecab, model) - 16usize]; + [ + "Offset of field: _Mecab::tagger", + ][::std::mem::offset_of!(_Mecab, tagger) - 24usize]; + [ + "Offset of field: _Mecab::lattice", + ][::std::mem::offset_of!(_Mecab, lattice) - 32usize]; +}; pub type Mecab = _Mecab; extern "C" { pub fn Mecab_initialize(m: *mut Mecab) -> ::std::os::raw::c_int; @@ -1490,181 +1140,55 @@ pub struct _NJDNode { pub prev: *mut _NJDNode, pub next: *mut _NJDNode, } -#[test] -fn bindgen_test_layout__NJDNode() { - const UNINIT: ::std::mem::MaybeUninit<_NJDNode> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_NJDNode>(), - 120usize, - concat!("Size of: ", stringify!(_NJDNode)) - ); - assert_eq!( - ::std::mem::align_of::<_NJDNode>(), - 8usize, - concat!("Alignment of ", stringify!(_NJDNode)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).string) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(string) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pos) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(pos) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pos_group1) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(pos_group1) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pos_group2) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(pos_group2) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pos_group3) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(pos_group3) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ctype) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(ctype) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cform) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(cform) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).orig) as usize - ptr as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(orig) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).read) as usize - ptr as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(read) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pron) as usize - ptr as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(pron) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).acc) as usize - ptr as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(acc) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mora_size) as usize - ptr as usize }, - 84usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(mora_size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).chain_rule) as usize - ptr as usize }, - 88usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(chain_rule) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).chain_flag) as usize - ptr as usize }, - 96usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(chain_flag) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize }, - 104usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(prev) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 112usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(next) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _NJDNode"][::std::mem::size_of::<_NJDNode>() - 120usize]; + ["Alignment of _NJDNode"][::std::mem::align_of::<_NJDNode>() - 8usize]; + [ + "Offset of field: _NJDNode::string", + ][::std::mem::offset_of!(_NJDNode, string) - 0usize]; + ["Offset of field: _NJDNode::pos"][::std::mem::offset_of!(_NJDNode, pos) - 8usize]; + [ + "Offset of field: _NJDNode::pos_group1", + ][::std::mem::offset_of!(_NJDNode, pos_group1) - 16usize]; + [ + "Offset of field: _NJDNode::pos_group2", + ][::std::mem::offset_of!(_NJDNode, pos_group2) - 24usize]; + [ + "Offset of field: _NJDNode::pos_group3", + ][::std::mem::offset_of!(_NJDNode, pos_group3) - 32usize]; + [ + "Offset of field: _NJDNode::ctype", + ][::std::mem::offset_of!(_NJDNode, ctype) - 40usize]; + [ + "Offset of field: _NJDNode::cform", + ][::std::mem::offset_of!(_NJDNode, cform) - 48usize]; + [ + "Offset of field: _NJDNode::orig", + ][::std::mem::offset_of!(_NJDNode, orig) - 56usize]; + [ + "Offset of field: _NJDNode::read", + ][::std::mem::offset_of!(_NJDNode, read) - 64usize]; + [ + "Offset of field: _NJDNode::pron", + ][::std::mem::offset_of!(_NJDNode, pron) - 72usize]; + ["Offset of field: _NJDNode::acc"][::std::mem::offset_of!(_NJDNode, acc) - 80usize]; + [ + "Offset of field: _NJDNode::mora_size", + ][::std::mem::offset_of!(_NJDNode, mora_size) - 84usize]; + [ + "Offset of field: _NJDNode::chain_rule", + ][::std::mem::offset_of!(_NJDNode, chain_rule) - 88usize]; + [ + "Offset of field: _NJDNode::chain_flag", + ][::std::mem::offset_of!(_NJDNode, chain_flag) - 96usize]; + [ + "Offset of field: _NJDNode::prev", + ][::std::mem::offset_of!(_NJDNode, prev) - 104usize]; + [ + "Offset of field: _NJDNode::next", + ][::std::mem::offset_of!(_NJDNode, next) - 112usize]; +}; pub type NJDNode = _NJDNode; extern "C" { pub fn NJDNode_initialize(node: *mut NJDNode); @@ -1676,13 +1200,22 @@ extern "C" { pub fn NJDNode_set_pos(node: *mut NJDNode, str_: *const ::std::os::raw::c_char); } extern "C" { - pub fn NJDNode_set_pos_group1(node: *mut NJDNode, str_: *const ::std::os::raw::c_char); + pub fn NJDNode_set_pos_group1( + node: *mut NJDNode, + str_: *const ::std::os::raw::c_char, + ); } extern "C" { - pub fn NJDNode_set_pos_group2(node: *mut NJDNode, str_: *const ::std::os::raw::c_char); + pub fn NJDNode_set_pos_group2( + node: *mut NJDNode, + str_: *const ::std::os::raw::c_char, + ); } extern "C" { - pub fn NJDNode_set_pos_group3(node: *mut NJDNode, str_: *const ::std::os::raw::c_char); + pub fn NJDNode_set_pos_group3( + node: *mut NJDNode, + str_: *const ::std::os::raw::c_char, + ); } extern "C" { pub fn NJDNode_set_ctype(node: *mut NJDNode, str_: *const ::std::os::raw::c_char); @@ -1706,7 +1239,10 @@ extern "C" { pub fn NJDNode_set_mora_size(node: *mut NJDNode, size: ::std::os::raw::c_int); } extern "C" { - pub fn NJDNode_set_chain_rule(node: *mut NJDNode, str_: *const ::std::os::raw::c_char); + pub fn NJDNode_set_chain_rule( + node: *mut NJDNode, + str_: *const ::std::os::raw::c_char, + ); } extern "C" { pub fn NJDNode_set_chain_flag(node: *mut NJDNode, flag: ::std::os::raw::c_int); @@ -1806,41 +1342,13 @@ pub struct _NJD { pub head: *mut NJDNode, pub tail: *mut NJDNode, } -#[test] -fn bindgen_test_layout__NJD() { - const UNINIT: ::std::mem::MaybeUninit<_NJD> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_NJD>(), - 16usize, - concat!("Size of: ", stringify!(_NJD)) - ); - assert_eq!( - ::std::mem::align_of::<_NJD>(), - 8usize, - concat!("Alignment of ", stringify!(_NJD)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).head) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_NJD), - "::", - stringify!(head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tail) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_NJD), - "::", - stringify!(tail) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _NJD"][::std::mem::size_of::<_NJD>() - 16usize]; + ["Alignment of _NJD"][::std::mem::align_of::<_NJD>() - 8usize]; + ["Offset of field: _NJD::head"][::std::mem::offset_of!(_NJD, head) - 0usize]; + ["Offset of field: _NJD::tail"][::std::mem::offset_of!(_NJD, tail) - 8usize]; +}; pub type NJD = _NJD; extern "C" { pub fn NJD_initialize(njd: *mut NJD); @@ -1890,62 +1398,27 @@ pub struct _JPCommonLabelPhoneme { pub next: *mut _JPCommonLabelPhoneme, pub up: *mut _JPCommonLabelMora, } -#[test] -fn bindgen_test_layout__JPCommonLabelPhoneme() { - const UNINIT: ::std::mem::MaybeUninit<_JPCommonLabelPhoneme> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_JPCommonLabelPhoneme>(), - 32usize, - concat!("Size of: ", stringify!(_JPCommonLabelPhoneme)) - ); - assert_eq!( - ::std::mem::align_of::<_JPCommonLabelPhoneme>(), - 8usize, - concat!("Alignment of ", stringify!(_JPCommonLabelPhoneme)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).phoneme) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelPhoneme), - "::", - stringify!(phoneme) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelPhoneme), - "::", - stringify!(prev) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelPhoneme), - "::", - stringify!(next) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).up) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelPhoneme), - "::", - stringify!(up) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + [ + "Size of _JPCommonLabelPhoneme", + ][::std::mem::size_of::<_JPCommonLabelPhoneme>() - 32usize]; + [ + "Alignment of _JPCommonLabelPhoneme", + ][::std::mem::align_of::<_JPCommonLabelPhoneme>() - 8usize]; + [ + "Offset of field: _JPCommonLabelPhoneme::phoneme", + ][::std::mem::offset_of!(_JPCommonLabelPhoneme, phoneme) - 0usize]; + [ + "Offset of field: _JPCommonLabelPhoneme::prev", + ][::std::mem::offset_of!(_JPCommonLabelPhoneme, prev) - 8usize]; + [ + "Offset of field: _JPCommonLabelPhoneme::next", + ][::std::mem::offset_of!(_JPCommonLabelPhoneme, next) - 16usize]; + [ + "Offset of field: _JPCommonLabelPhoneme::up", + ][::std::mem::offset_of!(_JPCommonLabelPhoneme, up) - 24usize]; +}; pub type JPCommonLabelPhoneme = _JPCommonLabelPhoneme; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -1957,81 +1430,33 @@ pub struct _JPCommonLabelMora { pub next: *mut _JPCommonLabelMora, pub up: *mut _JPCommonLabelWord, } -#[test] -fn bindgen_test_layout__JPCommonLabelMora() { - const UNINIT: ::std::mem::MaybeUninit<_JPCommonLabelMora> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_JPCommonLabelMora>(), - 48usize, - concat!("Size of: ", stringify!(_JPCommonLabelMora)) - ); - assert_eq!( - ::std::mem::align_of::<_JPCommonLabelMora>(), - 8usize, - concat!("Alignment of ", stringify!(_JPCommonLabelMora)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mora) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelMora), - "::", - stringify!(mora) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).head) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelMora), - "::", - stringify!(head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tail) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelMora), - "::", - stringify!(tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelMora), - "::", - stringify!(prev) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelMora), - "::", - stringify!(next) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).up) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelMora), - "::", - stringify!(up) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + [ + "Size of _JPCommonLabelMora", + ][::std::mem::size_of::<_JPCommonLabelMora>() - 48usize]; + [ + "Alignment of _JPCommonLabelMora", + ][::std::mem::align_of::<_JPCommonLabelMora>() - 8usize]; + [ + "Offset of field: _JPCommonLabelMora::mora", + ][::std::mem::offset_of!(_JPCommonLabelMora, mora) - 0usize]; + [ + "Offset of field: _JPCommonLabelMora::head", + ][::std::mem::offset_of!(_JPCommonLabelMora, head) - 8usize]; + [ + "Offset of field: _JPCommonLabelMora::tail", + ][::std::mem::offset_of!(_JPCommonLabelMora, tail) - 16usize]; + [ + "Offset of field: _JPCommonLabelMora::prev", + ][::std::mem::offset_of!(_JPCommonLabelMora, prev) - 24usize]; + [ + "Offset of field: _JPCommonLabelMora::next", + ][::std::mem::offset_of!(_JPCommonLabelMora, next) - 32usize]; + [ + "Offset of field: _JPCommonLabelMora::up", + ][::std::mem::offset_of!(_JPCommonLabelMora, up) - 40usize]; +}; pub type JPCommonLabelMora = _JPCommonLabelMora; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -2046,111 +1471,42 @@ pub struct _JPCommonLabelWord { pub next: *mut _JPCommonLabelWord, pub up: *mut _JPCommonLabelAccentPhrase, } -#[test] -fn bindgen_test_layout__JPCommonLabelWord() { - const UNINIT: ::std::mem::MaybeUninit<_JPCommonLabelWord> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_JPCommonLabelWord>(), - 72usize, - concat!("Size of: ", stringify!(_JPCommonLabelWord)) - ); - assert_eq!( - ::std::mem::align_of::<_JPCommonLabelWord>(), - 8usize, - concat!("Alignment of ", stringify!(_JPCommonLabelWord)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pron) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(pron) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pos) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(pos) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ctype) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(ctype) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cform) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(cform) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).head) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tail) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(prev) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(next) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).up) as usize - ptr as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(up) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + [ + "Size of _JPCommonLabelWord", + ][::std::mem::size_of::<_JPCommonLabelWord>() - 72usize]; + [ + "Alignment of _JPCommonLabelWord", + ][::std::mem::align_of::<_JPCommonLabelWord>() - 8usize]; + [ + "Offset of field: _JPCommonLabelWord::pron", + ][::std::mem::offset_of!(_JPCommonLabelWord, pron) - 0usize]; + [ + "Offset of field: _JPCommonLabelWord::pos", + ][::std::mem::offset_of!(_JPCommonLabelWord, pos) - 8usize]; + [ + "Offset of field: _JPCommonLabelWord::ctype", + ][::std::mem::offset_of!(_JPCommonLabelWord, ctype) - 16usize]; + [ + "Offset of field: _JPCommonLabelWord::cform", + ][::std::mem::offset_of!(_JPCommonLabelWord, cform) - 24usize]; + [ + "Offset of field: _JPCommonLabelWord::head", + ][::std::mem::offset_of!(_JPCommonLabelWord, head) - 32usize]; + [ + "Offset of field: _JPCommonLabelWord::tail", + ][::std::mem::offset_of!(_JPCommonLabelWord, tail) - 40usize]; + [ + "Offset of field: _JPCommonLabelWord::prev", + ][::std::mem::offset_of!(_JPCommonLabelWord, prev) - 48usize]; + [ + "Offset of field: _JPCommonLabelWord::next", + ][::std::mem::offset_of!(_JPCommonLabelWord, next) - 56usize]; + [ + "Offset of field: _JPCommonLabelWord::up", + ][::std::mem::offset_of!(_JPCommonLabelWord, up) - 64usize]; +}; pub type JPCommonLabelWord = _JPCommonLabelWord; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -2163,92 +1519,36 @@ pub struct _JPCommonLabelAccentPhrase { pub next: *mut _JPCommonLabelAccentPhrase, pub up: *mut _JPCommonLabelBreathGroup, } -#[test] -fn bindgen_test_layout__JPCommonLabelAccentPhrase() { - const UNINIT: ::std::mem::MaybeUninit<_JPCommonLabelAccentPhrase> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_JPCommonLabelAccentPhrase>(), - 56usize, - concat!("Size of: ", stringify!(_JPCommonLabelAccentPhrase)) - ); - assert_eq!( - ::std::mem::align_of::<_JPCommonLabelAccentPhrase>(), - 8usize, - concat!("Alignment of ", stringify!(_JPCommonLabelAccentPhrase)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).accent) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelAccentPhrase), - "::", - stringify!(accent) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).emotion) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelAccentPhrase), - "::", - stringify!(emotion) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).head) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelAccentPhrase), - "::", - stringify!(head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tail) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelAccentPhrase), - "::", - stringify!(tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelAccentPhrase), - "::", - stringify!(prev) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelAccentPhrase), - "::", - stringify!(next) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).up) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelAccentPhrase), - "::", - stringify!(up) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + [ + "Size of _JPCommonLabelAccentPhrase", + ][::std::mem::size_of::<_JPCommonLabelAccentPhrase>() - 56usize]; + [ + "Alignment of _JPCommonLabelAccentPhrase", + ][::std::mem::align_of::<_JPCommonLabelAccentPhrase>() - 8usize]; + [ + "Offset of field: _JPCommonLabelAccentPhrase::accent", + ][::std::mem::offset_of!(_JPCommonLabelAccentPhrase, accent) - 0usize]; + [ + "Offset of field: _JPCommonLabelAccentPhrase::emotion", + ][::std::mem::offset_of!(_JPCommonLabelAccentPhrase, emotion) - 8usize]; + [ + "Offset of field: _JPCommonLabelAccentPhrase::head", + ][::std::mem::offset_of!(_JPCommonLabelAccentPhrase, head) - 16usize]; + [ + "Offset of field: _JPCommonLabelAccentPhrase::tail", + ][::std::mem::offset_of!(_JPCommonLabelAccentPhrase, tail) - 24usize]; + [ + "Offset of field: _JPCommonLabelAccentPhrase::prev", + ][::std::mem::offset_of!(_JPCommonLabelAccentPhrase, prev) - 32usize]; + [ + "Offset of field: _JPCommonLabelAccentPhrase::next", + ][::std::mem::offset_of!(_JPCommonLabelAccentPhrase, next) - 40usize]; + [ + "Offset of field: _JPCommonLabelAccentPhrase::up", + ][::std::mem::offset_of!(_JPCommonLabelAccentPhrase, up) - 48usize]; +}; pub type JPCommonLabelAccentPhrase = _JPCommonLabelAccentPhrase; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -2258,62 +1558,27 @@ pub struct _JPCommonLabelBreathGroup { pub prev: *mut _JPCommonLabelBreathGroup, pub next: *mut _JPCommonLabelBreathGroup, } -#[test] -fn bindgen_test_layout__JPCommonLabelBreathGroup() { - const UNINIT: ::std::mem::MaybeUninit<_JPCommonLabelBreathGroup> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_JPCommonLabelBreathGroup>(), - 32usize, - concat!("Size of: ", stringify!(_JPCommonLabelBreathGroup)) - ); - assert_eq!( - ::std::mem::align_of::<_JPCommonLabelBreathGroup>(), - 8usize, - concat!("Alignment of ", stringify!(_JPCommonLabelBreathGroup)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).head) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelBreathGroup), - "::", - stringify!(head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tail) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelBreathGroup), - "::", - stringify!(tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelBreathGroup), - "::", - stringify!(prev) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelBreathGroup), - "::", - stringify!(next) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + [ + "Size of _JPCommonLabelBreathGroup", + ][::std::mem::size_of::<_JPCommonLabelBreathGroup>() - 32usize]; + [ + "Alignment of _JPCommonLabelBreathGroup", + ][::std::mem::align_of::<_JPCommonLabelBreathGroup>() - 8usize]; + [ + "Offset of field: _JPCommonLabelBreathGroup::head", + ][::std::mem::offset_of!(_JPCommonLabelBreathGroup, head) - 0usize]; + [ + "Offset of field: _JPCommonLabelBreathGroup::tail", + ][::std::mem::offset_of!(_JPCommonLabelBreathGroup, tail) - 8usize]; + [ + "Offset of field: _JPCommonLabelBreathGroup::prev", + ][::std::mem::offset_of!(_JPCommonLabelBreathGroup, prev) - 16usize]; + [ + "Offset of field: _JPCommonLabelBreathGroup::next", + ][::std::mem::offset_of!(_JPCommonLabelBreathGroup, next) - 24usize]; +}; pub type JPCommonLabelBreathGroup = _JPCommonLabelBreathGroup; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -2332,151 +1597,50 @@ pub struct _JPCommonLabel { pub phoneme_tail: *mut JPCommonLabelPhoneme, pub short_pause_flag: ::std::os::raw::c_int, } -#[test] -fn bindgen_test_layout__JPCommonLabel() { - const UNINIT: ::std::mem::MaybeUninit<_JPCommonLabel> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_JPCommonLabel>(), - 104usize, - concat!("Size of: ", stringify!(_JPCommonLabel)) - ); - assert_eq!( - ::std::mem::align_of::<_JPCommonLabel>(), - 8usize, - concat!("Alignment of ", stringify!(_JPCommonLabel)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).feature) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(feature) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).breath_head) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(breath_head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).breath_tail) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(breath_tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).accent_head) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(accent_head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).accent_tail) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(accent_tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).word_head) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(word_head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).word_tail) as usize - ptr as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(word_tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mora_head) as usize - ptr as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(mora_head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mora_tail) as usize - ptr as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(mora_tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).phoneme_head) as usize - ptr as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(phoneme_head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).phoneme_tail) as usize - ptr as usize }, - 88usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(phoneme_tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).short_pause_flag) as usize - ptr as usize }, - 96usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(short_pause_flag) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _JPCommonLabel"][::std::mem::size_of::<_JPCommonLabel>() - 104usize]; + ["Alignment of _JPCommonLabel"][::std::mem::align_of::<_JPCommonLabel>() - 8usize]; + [ + "Offset of field: _JPCommonLabel::size", + ][::std::mem::offset_of!(_JPCommonLabel, size) - 0usize]; + [ + "Offset of field: _JPCommonLabel::feature", + ][::std::mem::offset_of!(_JPCommonLabel, feature) - 8usize]; + [ + "Offset of field: _JPCommonLabel::breath_head", + ][::std::mem::offset_of!(_JPCommonLabel, breath_head) - 16usize]; + [ + "Offset of field: _JPCommonLabel::breath_tail", + ][::std::mem::offset_of!(_JPCommonLabel, breath_tail) - 24usize]; + [ + "Offset of field: _JPCommonLabel::accent_head", + ][::std::mem::offset_of!(_JPCommonLabel, accent_head) - 32usize]; + [ + "Offset of field: _JPCommonLabel::accent_tail", + ][::std::mem::offset_of!(_JPCommonLabel, accent_tail) - 40usize]; + [ + "Offset of field: _JPCommonLabel::word_head", + ][::std::mem::offset_of!(_JPCommonLabel, word_head) - 48usize]; + [ + "Offset of field: _JPCommonLabel::word_tail", + ][::std::mem::offset_of!(_JPCommonLabel, word_tail) - 56usize]; + [ + "Offset of field: _JPCommonLabel::mora_head", + ][::std::mem::offset_of!(_JPCommonLabel, mora_head) - 64usize]; + [ + "Offset of field: _JPCommonLabel::mora_tail", + ][::std::mem::offset_of!(_JPCommonLabel, mora_tail) - 72usize]; + [ + "Offset of field: _JPCommonLabel::phoneme_head", + ][::std::mem::offset_of!(_JPCommonLabel, phoneme_head) - 80usize]; + [ + "Offset of field: _JPCommonLabel::phoneme_tail", + ][::std::mem::offset_of!(_JPCommonLabel, phoneme_tail) - 88usize]; + [ + "Offset of field: _JPCommonLabel::short_pause_flag", + ][::std::mem::offset_of!(_JPCommonLabel, short_pause_flag) - 96usize]; +}; pub type JPCommonLabel = _JPCommonLabel; extern "C" { pub fn JPCommonLabel_initialize(label: *mut JPCommonLabel); @@ -2499,8 +1663,9 @@ extern "C" { pub fn JPCommonLabel_get_size(label: *mut JPCommonLabel) -> ::std::os::raw::c_int; } extern "C" { - pub fn JPCommonLabel_get_feature(label: *mut JPCommonLabel) - -> *mut *mut ::std::os::raw::c_char; + pub fn JPCommonLabel_get_feature( + label: *mut JPCommonLabel, + ) -> *mut *mut ::std::os::raw::c_char; } extern "C" { pub fn JPCommonLabel_print(label: *mut JPCommonLabel); @@ -2523,134 +1688,91 @@ pub struct _JPCommonNode { pub prev: *mut _JPCommonNode, pub next: *mut _JPCommonNode, } -#[test] -fn bindgen_test_layout__JPCommonNode() { - const UNINIT: ::std::mem::MaybeUninit<_JPCommonNode> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_JPCommonNode>(), - 56usize, - concat!("Size of: ", stringify!(_JPCommonNode)) - ); - assert_eq!( - ::std::mem::align_of::<_JPCommonNode>(), - 8usize, - concat!("Alignment of ", stringify!(_JPCommonNode)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pron) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonNode), - "::", - stringify!(pron) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pos) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonNode), - "::", - stringify!(pos) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ctype) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonNode), - "::", - stringify!(ctype) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cform) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonNode), - "::", - stringify!(cform) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).acc) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonNode), - "::", - stringify!(acc) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).chain_flag) as usize - ptr as usize }, - 36usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonNode), - "::", - stringify!(chain_flag) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonNode), - "::", - stringify!(prev) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonNode), - "::", - stringify!(next) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _JPCommonNode"][::std::mem::size_of::<_JPCommonNode>() - 56usize]; + ["Alignment of _JPCommonNode"][::std::mem::align_of::<_JPCommonNode>() - 8usize]; + [ + "Offset of field: _JPCommonNode::pron", + ][::std::mem::offset_of!(_JPCommonNode, pron) - 0usize]; + [ + "Offset of field: _JPCommonNode::pos", + ][::std::mem::offset_of!(_JPCommonNode, pos) - 8usize]; + [ + "Offset of field: _JPCommonNode::ctype", + ][::std::mem::offset_of!(_JPCommonNode, ctype) - 16usize]; + [ + "Offset of field: _JPCommonNode::cform", + ][::std::mem::offset_of!(_JPCommonNode, cform) - 24usize]; + [ + "Offset of field: _JPCommonNode::acc", + ][::std::mem::offset_of!(_JPCommonNode, acc) - 32usize]; + [ + "Offset of field: _JPCommonNode::chain_flag", + ][::std::mem::offset_of!(_JPCommonNode, chain_flag) - 36usize]; + [ + "Offset of field: _JPCommonNode::prev", + ][::std::mem::offset_of!(_JPCommonNode, prev) - 40usize]; + [ + "Offset of field: _JPCommonNode::next", + ][::std::mem::offset_of!(_JPCommonNode, next) - 48usize]; +}; pub type JPCommonNode = _JPCommonNode; extern "C" { pub fn JPCommonNode_initialize(node: *mut JPCommonNode); } extern "C" { - pub fn JPCommonNode_set_pron(node: *mut JPCommonNode, str_: *const ::std::os::raw::c_char); + pub fn JPCommonNode_set_pron( + node: *mut JPCommonNode, + str_: *const ::std::os::raw::c_char, + ); } extern "C" { - pub fn JPCommonNode_set_pos(node: *mut JPCommonNode, str_: *const ::std::os::raw::c_char); + pub fn JPCommonNode_set_pos( + node: *mut JPCommonNode, + str_: *const ::std::os::raw::c_char, + ); } extern "C" { - pub fn JPCommonNode_set_ctype(node: *mut JPCommonNode, str_: *const ::std::os::raw::c_char); + pub fn JPCommonNode_set_ctype( + node: *mut JPCommonNode, + str_: *const ::std::os::raw::c_char, + ); } extern "C" { - pub fn JPCommonNode_set_cform(node: *mut JPCommonNode, str_: *const ::std::os::raw::c_char); + pub fn JPCommonNode_set_cform( + node: *mut JPCommonNode, + str_: *const ::std::os::raw::c_char, + ); } extern "C" { pub fn JPCommonNode_set_acc(node: *mut JPCommonNode, acc: ::std::os::raw::c_int); } extern "C" { - pub fn JPCommonNode_set_chain_flag(node: *mut JPCommonNode, flag: ::std::os::raw::c_int); + pub fn JPCommonNode_set_chain_flag( + node: *mut JPCommonNode, + flag: ::std::os::raw::c_int, + ); } extern "C" { - pub fn JPCommonNode_get_pron(node: *mut JPCommonNode) -> *const ::std::os::raw::c_char; + pub fn JPCommonNode_get_pron( + node: *mut JPCommonNode, + ) -> *const ::std::os::raw::c_char; } extern "C" { - pub fn JPCommonNode_get_pos(node: *mut JPCommonNode) -> *const ::std::os::raw::c_char; + pub fn JPCommonNode_get_pos( + node: *mut JPCommonNode, + ) -> *const ::std::os::raw::c_char; } extern "C" { - pub fn JPCommonNode_get_ctype(node: *mut JPCommonNode) -> *const ::std::os::raw::c_char; + pub fn JPCommonNode_get_ctype( + node: *mut JPCommonNode, + ) -> *const ::std::os::raw::c_char; } extern "C" { - pub fn JPCommonNode_get_cform(node: *mut JPCommonNode) -> *const ::std::os::raw::c_char; + pub fn JPCommonNode_get_cform( + node: *mut JPCommonNode, + ) -> *const ::std::os::raw::c_char; } extern "C" { pub fn JPCommonNode_get_acc(node: *mut JPCommonNode) -> ::std::os::raw::c_int; @@ -2674,51 +1796,20 @@ pub struct _JPCommon { pub tail: *mut JPCommonNode, pub label: *mut JPCommonLabel, } -#[test] -fn bindgen_test_layout__JPCommon() { - const UNINIT: ::std::mem::MaybeUninit<_JPCommon> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_JPCommon>(), - 24usize, - concat!("Size of: ", stringify!(_JPCommon)) - ); - assert_eq!( - ::std::mem::align_of::<_JPCommon>(), - 8usize, - concat!("Alignment of ", stringify!(_JPCommon)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).head) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_JPCommon), - "::", - stringify!(head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tail) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_JPCommon), - "::", - stringify!(tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).label) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_JPCommon), - "::", - stringify!(label) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _JPCommon"][::std::mem::size_of::<_JPCommon>() - 24usize]; + ["Alignment of _JPCommon"][::std::mem::align_of::<_JPCommon>() - 8usize]; + [ + "Offset of field: _JPCommon::head", + ][::std::mem::offset_of!(_JPCommon, head) - 0usize]; + [ + "Offset of field: _JPCommon::tail", + ][::std::mem::offset_of!(_JPCommon, tail) - 8usize]; + [ + "Offset of field: _JPCommon::label", + ][::std::mem::offset_of!(_JPCommon, label) - 16usize]; +}; pub type JPCommon = _JPCommon; extern "C" { pub fn JPCommon_initialize(jpcommon: *mut JPCommon); @@ -2733,7 +1824,9 @@ extern "C" { pub fn JPCommon_get_label_size(jpcommon: *mut JPCommon) -> ::std::os::raw::c_int; } extern "C" { - pub fn JPCommon_get_label_feature(jpcommon: *mut JPCommon) -> *mut *mut ::std::os::raw::c_char; + pub fn JPCommon_get_label_feature( + jpcommon: *mut JPCommon, + ) -> *mut *mut ::std::os::raw::c_char; } extern "C" { pub fn JPCommon_print(jpcommon: *mut JPCommon); diff --git a/crates/open_jtalk/src/text2mecab.rs b/crates/open_jtalk/src/text2mecab.rs index bea2616..6a22270 100644 --- a/crates/open_jtalk/src/text2mecab.rs +++ b/crates/open_jtalk/src/text2mecab.rs @@ -38,7 +38,9 @@ pub fn text2mecab(input: impl AsRef) -> Result { Ok(String::from_utf8(output).unwrap()) } else { - Err(unsafe { std::mem::transmute(result) }) + Err(unsafe { + std::mem::transmute::(result) + }) } }