From 01d7c0dedfeb207e823cac64d8733f0603fcb830 Mon Sep 17 00:00:00 2001 From: Camilo Soto Valenzuela Date: Fri, 3 Jul 2020 22:45:36 +0200 Subject: [PATCH 01/37] Test mac os --- rust/ci.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/rust/ci.yml b/rust/ci.yml index 50df8633e..2f5594c0b 100644 --- a/rust/ci.yml +++ b/rust/ci.yml @@ -46,6 +46,18 @@ rust_linux: needs: - gcc_legacy +rust_mac: + extends: .rust_multiarch + variables: + TARGET: "x86_64-unknown-linux-gnu" + BUILD_DIR: "mac_os" + needs: + - mac_os + tags: + - mac-mini-runner + + + rust_win: allow_failure: true extends: .rust_multiarch From 2cce58cc327941f84719ee42aab01b28efadcd6a Mon Sep 17 00:00:00 2001 From: Camilo Soto Valenzuela Date: Sat, 4 Jul 2020 10:28:52 +0200 Subject: [PATCH 02/37] mac_os rust --- rust/ci.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/rust/ci.yml b/rust/ci.yml index 2f5594c0b..7c8705fba 100644 --- a/rust/ci.yml +++ b/rust/ci.yml @@ -53,11 +53,8 @@ rust_mac: BUILD_DIR: "mac_os" needs: - mac_os - tags: - - mac-mini-runner - rust_win: allow_failure: true extends: .rust_multiarch From e2087e26f6bac4c22573ae76688caaf0c2dc3be7 Mon Sep 17 00:00:00 2001 From: Camilo Soto Valenzuela Date: Sat, 4 Jul 2020 10:29:47 +0200 Subject: [PATCH 03/37] Remove step gcc_legacy --- c/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/c/ci.yml b/c/ci.yml index 03b9f659f..a4fdbf252 100644 --- a/c/ci.yml +++ b/c/ci.yml @@ -106,7 +106,6 @@ gcc_legacy: image: docker.slock.it/build-images/cmake:gcc-legacy extends: .conanbuild before_script: - - curl -sSL https://cmake.org/files/v3.6/cmake-3.6.1-Linux-x86_64.tar.gz | tar -xzC /opt - export PATH="/opt/cmake-3.6.1-Linux-x86_64/bin/:$PATH" variables: CONAN_OPTS: "-DUSE_CURL=false" From 07b91091974280704df3a72111a3141b956a5de5 Mon Sep 17 00:00:00 2001 From: Shoaib Ahmed Date: Sat, 4 Jul 2020 23:33:07 +0200 Subject: [PATCH 04/37] Fix .gitignore for rust --- .gitignore | 4 - rust/.gitignore | 3 + rust/in3-sys/Cargo.lock | 372 ------------------------------ rust/in3-sys/in3-core/.keep | 1 - rust/in3-sys/pre_generated/in3.rs | 3 - 5 files changed, 3 insertions(+), 380 deletions(-) create mode 100644 rust/.gitignore delete mode 100644 rust/in3-sys/Cargo.lock delete mode 100644 rust/in3-sys/in3-core/.keep delete mode 100644 rust/in3-sys/pre_generated/in3.rs diff --git a/.gitignore b/.gitignore index d9d82a39c..58c0614dc 100644 --- a/.gitignore +++ b/.gitignore @@ -33,8 +33,6 @@ bin/ *.class target/ .cproject -rust/in3-sys/in3-core/* -rust/Cargo.lock .overcommit.yml c/src/third-party/hidapi/config* c/src/third-party/hidapi/autom4te.cache/* @@ -49,5 +47,3 @@ c/src/third-party/hidapi/missing c/src/third-party/hidapi/depcomp c/src/third-party/hidapi/compile c/src/third-party/hidapi/aclocal.m4 - -rust/in3-sys/pre_generated/in3.rs diff --git a/rust/.gitignore b/rust/.gitignore new file mode 100644 index 000000000..c10d12e2c --- /dev/null +++ b/rust/.gitignore @@ -0,0 +1,3 @@ +Cargo.lock +in3-sys/in3-core/* +in3-sys/pre_generated/in3.rs diff --git a/rust/in3-sys/Cargo.lock b/rust/in3-sys/Cargo.lock deleted file mode 100644 index 995ae85ca..000000000 --- a/rust/in3-sys/Cargo.lock +++ /dev/null @@ -1,372 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -[[package]] -name = "aho-corasick" -version = "0.7.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8716408b8bc624ed7f65d223ddb9ac2d044c0547b6fa4b0d554f3a9540496ada" -dependencies = [ - "memchr", -] - -[[package]] -name = "ansi_term" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" -dependencies = [ - "winapi", -] - -[[package]] -name = "atty" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" -dependencies = [ - "hermit-abi", - "libc", - "winapi", -] - -[[package]] -name = "bindgen" -version = "0.53.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bb26d6a69a335b8cb0e7c7e9775cd5666611dc50a37177c3f2cedcfc040e8c8" -dependencies = [ - "bitflags", - "cexpr", - "cfg-if", - "clang-sys", - "clap", - "env_logger", - "lazy_static", - "lazycell", - "log", - "peeking_take_while", - "proc-macro2", - "quote", - "regex", - "rustc-hash", - "shlex", - "which", -] - -[[package]] -name = "bitflags" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" - -[[package]] -name = "cc" -version = "1.0.53" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "404b1fe4f65288577753b17e3b36a04596ee784493ec249bf81c7f2d2acd751c" - -[[package]] -name = "cexpr" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4aedb84272dbe89af497cf81375129abda4fc0a9e7c5d317498c15cc30c0d27" -dependencies = [ - "nom", -] - -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - -[[package]] -name = "clang-sys" -version = "0.29.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe6837df1d5cba2397b835c8530f51723267e16abbf83892e9e5af4f0e5dd10a" -dependencies = [ - "glob", - "libc", - "libloading", -] - -[[package]] -name = "clap" -version = "2.33.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdfa80d47f954d53a35a64987ca1422f495b8d6483c0fe9f7117b36c2a792129" -dependencies = [ - "ansi_term", - "atty", - "bitflags", - "strsim", - "textwrap", - "unicode-width", - "vec_map", -] - -[[package]] -name = "cmake" -version = "0.1.43" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f97562167906afc51aa3fd7e6c83c10a5c96d33bd18f98a4c06a1413134caa" -dependencies = [ - "cc", -] - -[[package]] -name = "env_logger" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44533bbbb3bb3c1fa17d9f2e4e38bbbaf8396ba82193c4cb1b6445d711445d36" -dependencies = [ - "atty", - "humantime", - "log", - "regex", - "termcolor", -] - -[[package]] -name = "glob" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" - -[[package]] -name = "hermit-abi" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61565ff7aaace3525556587bd2dc31d4a07071957be715e63ce7b1eccf51a8f4" -dependencies = [ - "libc", -] - -[[package]] -name = "humantime" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df004cfca50ef23c36850aaaa59ad52cc70d0e90243c3c7737a4dd32dc7a3c4f" -dependencies = [ - "quick-error", -] - -[[package]] -name = "in3-sys" -version = "0.1.0" -dependencies = [ - "bindgen", - "cmake", - "libc", -] - -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" - -[[package]] -name = "lazycell" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b294d6fa9ee409a054354afc4352b0b9ef7ca222c69b8812cbea9e7d2bf3783f" - -[[package]] -name = "libc" -version = "0.2.70" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3baa92041a6fec78c687fa0cc2b3fae8884f743d672cf551bed1d6dac6988d0f" - -[[package]] -name = "libloading" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2b111a074963af1d37a139918ac6d49ad1d0d5e47f72fd55388619691a7d753" -dependencies = [ - "cc", - "winapi", -] - -[[package]] -name = "log" -version = "0.4.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "memchr" -version = "2.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400" - -[[package]] -name = "nom" -version = "5.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b471253da97532da4b61552249c521e01e736071f71c1a4f7ebbfbf0a06aad6" -dependencies = [ - "memchr", - "version_check", -] - -[[package]] -name = "peeking_take_while" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" - -[[package]] -name = "proc-macro2" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8872cf6f48eee44265156c111456a700ab3483686b3f96df4cf5481c89157319" -dependencies = [ - "unicode-xid", -] - -[[package]] -name = "quick-error" -version = "1.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" - -[[package]] -name = "quote" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42934bc9c8ab0d3b273a16d8551c8f0fcff46be73276ca083ec2414c15c4ba5e" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "regex" -version = "1.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6020f034922e3194c711b82a627453881bc4682166cabb07134a10c26ba7692" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", - "thread_local", -] - -[[package]] -name = "regex-syntax" -version = "0.6.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fe5bd57d1d7414c6b5ed48563a2c855d995ff777729dcd91c369ec7fea395ae" - -[[package]] -name = "rustc-hash" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" - -[[package]] -name = "shlex" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fdf1b9db47230893d76faad238fd6097fd6d6a9245cd7a4d90dbd639536bbd2" - -[[package]] -name = "strsim" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" - -[[package]] -name = "termcolor" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb6bfa289a4d7c5766392812c0a1f4c1ba45afa1ad47803c11e1f407d846d75f" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "textwrap" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" -dependencies = [ - "unicode-width", -] - -[[package]] -name = "thread_local" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d40c6d1b69745a6ec6fb1ca717914848da4b44ae29d9b3080cbee91d72a69b14" -dependencies = [ - "lazy_static", -] - -[[package]] -name = "unicode-width" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "caaa9d531767d1ff2150b9332433f32a24622147e5ebb1f26409d5da67afd479" - -[[package]] -name = "unicode-xid" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" - -[[package]] -name = "vec_map" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" - -[[package]] -name = "version_check" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "078775d0255232fb988e6fccf26ddc9d1ac274299aaedcedce21c6f72cc533ce" - -[[package]] -name = "which" -version = "3.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d011071ae14a2f6671d0b74080ae0cd8ebf3a6f8c9589a2cd45f23126fe29724" -dependencies = [ - "libc", -] - -[[package]] -name = "winapi" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-util" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" -dependencies = [ - "winapi", -] - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/rust/in3-sys/in3-core/.keep b/rust/in3-sys/in3-core/.keep deleted file mode 100644 index c95e81d45..000000000 --- a/rust/in3-sys/in3-core/.keep +++ /dev/null @@ -1 +0,0 @@ -Placeholder directory expected to contain in3-core C sources. diff --git a/rust/in3-sys/pre_generated/in3.rs b/rust/in3-sys/pre_generated/in3.rs deleted file mode 100644 index 74ddfca20..000000000 --- a/rust/in3-sys/pre_generated/in3.rs +++ /dev/null @@ -1,3 +0,0 @@ -/* automatically generated by rust-bindgen */ - -# [ repr ( C ) ] # [ derive ( Copy , Clone , Debug , Default , Eq , Hash , Ord , PartialEq , PartialOrd ) ] pub struct __BindgenBitfieldUnit < Storage , Align > { storage : Storage , align : [ Align ; 0 ] , } impl < Storage , Align > __BindgenBitfieldUnit < Storage , Align > { # [ inline ] pub fn new ( storage : Storage ) -> Self { Self { storage , align : [ ] } } } impl < Storage , Align > __BindgenBitfieldUnit < Storage , Align > where Storage : AsRef < [ u8 ] > + AsMut < [ u8 ] >, { # [ inline ] pub fn get_bit ( & self , index : usize ) -> bool { debug_assert ! ( index / 8 < self . storage . as_ref ( ) . len ( ) ) ; let byte_index = index / 8 ; let byte = self . storage . as_ref ( ) [ byte_index ] ; let bit_index = if cfg ! ( target_endian = "big" ) { 7 - ( index % 8 ) } else { index % 8 } ; let mask = 1 << bit_index ; byte & mask == mask } # [ inline ] pub fn set_bit ( & mut self , index : usize , val : bool ) { debug_assert ! ( index / 8 < self . storage . as_ref ( ) . len ( ) ) ; let byte_index = index / 8 ; let byte = & mut self . storage . as_mut ( ) [ byte_index ] ; let bit_index = if cfg ! ( target_endian = "big" ) { 7 - ( index % 8 ) } else { index % 8 } ; let mask = 1 << bit_index ; if val { * byte |= mask ; } else { * byte &= ! mask ; } } # [ inline ] pub fn get ( & self , bit_offset : usize , bit_width : u8 ) -> u64 { debug_assert ! ( bit_width <= 64 ) ; debug_assert ! ( bit_offset / 8 < self . storage . as_ref ( ) . len ( ) ) ; debug_assert ! ( ( bit_offset + ( bit_width as usize ) ) / 8 <= self . storage . as_ref ( ) . len ( ) ) ; let mut val = 0 ; for i in 0 .. ( bit_width as usize ) { if self . get_bit ( i + bit_offset ) { let index = if cfg ! ( target_endian = "big" ) { bit_width as usize - 1 - i } else { i } ; val |= 1 << index ; } } val } # [ inline ] pub fn set ( & mut self , bit_offset : usize , bit_width : u8 , val : u64 ) { debug_assert ! ( bit_width <= 64 ) ; debug_assert ! ( bit_offset / 8 < self . storage . as_ref ( ) . len ( ) ) ; debug_assert ! ( ( bit_offset + ( bit_width as usize ) ) / 8 <= self . storage . as_ref ( ) . len ( ) ) ; for i in 0 .. ( bit_width as usize ) { let mask = 1 << i ; let val_bit_is_set = val & mask == mask ; let index = if cfg ! ( target_endian = "big" ) { bit_width as usize - 1 - i } else { i } ; self . set_bit ( index + bit_offset , val_bit_is_set ) ; } } } pub const __PRI_8_LENGTH_MODIFIER__ : & 'static [ u8 ; 3usize ] = b"hh\0" ; pub const __PRI_64_LENGTH_MODIFIER__ : & 'static [ u8 ; 3usize ] = b"ll\0" ; pub const __SCN_64_LENGTH_MODIFIER__ : & 'static [ u8 ; 3usize ] = b"ll\0" ; pub const __PRI_MAX_LENGTH_MODIFIER__ : & 'static [ u8 ; 2usize ] = b"j\0" ; pub const __SCN_MAX_LENGTH_MODIFIER__ : & 'static [ u8 ; 2usize ] = b"j\0" ; pub const PRId8 : & 'static [ u8 ; 4usize ] = b"hhd\0" ; pub const PRIi8 : & 'static [ u8 ; 4usize ] = b"hhi\0" ; pub const PRIo8 : & 'static [ u8 ; 4usize ] = b"hho\0" ; pub const PRIu8 : & 'static [ u8 ; 4usize ] = b"hhu\0" ; pub const PRIx8 : & 'static [ u8 ; 4usize ] = b"hhx\0" ; pub const PRIX8 : & 'static [ u8 ; 4usize ] = b"hhX\0" ; pub const PRId16 : & 'static [ u8 ; 3usize ] = b"hd\0" ; pub const PRIi16 : & 'static [ u8 ; 3usize ] = b"hi\0" ; pub const PRIo16 : & 'static [ u8 ; 3usize ] = b"ho\0" ; pub const PRIu16 : & 'static [ u8 ; 3usize ] = b"hu\0" ; pub const PRIx16 : & 'static [ u8 ; 3usize ] = b"hx\0" ; pub const PRIX16 : & 'static [ u8 ; 3usize ] = b"hX\0" ; pub const PRId32 : & 'static [ u8 ; 2usize ] = b"d\0" ; pub const PRIi32 : & 'static [ u8 ; 2usize ] = b"i\0" ; pub const PRIo32 : & 'static [ u8 ; 2usize ] = b"o\0" ; pub const PRIu32 : & 'static [ u8 ; 2usize ] = b"u\0" ; pub const PRIx32 : & 'static [ u8 ; 2usize ] = b"x\0" ; pub const PRIX32 : & 'static [ u8 ; 2usize ] = b"X\0" ; pub const PRId64 : & 'static [ u8 ; 4usize ] = b"lld\0" ; pub const PRIi64 : & 'static [ u8 ; 4usize ] = b"lli\0" ; pub const PRIo64 : & 'static [ u8 ; 4usize ] = b"llo\0" ; pub const PRIu64 : & 'static [ u8 ; 4usize ] = b"llu\0" ; pub const PRIx64 : & 'static [ u8 ; 4usize ] = b"llx\0" ; pub const PRIX64 : & 'static [ u8 ; 4usize ] = b"llX\0" ; pub const PRIdLEAST8 : & 'static [ u8 ; 4usize ] = b"hhd\0" ; pub const PRIiLEAST8 : & 'static [ u8 ; 4usize ] = b"hhi\0" ; pub const PRIoLEAST8 : & 'static [ u8 ; 4usize ] = b"hho\0" ; pub const PRIuLEAST8 : & 'static [ u8 ; 4usize ] = b"hhu\0" ; pub const PRIxLEAST8 : & 'static [ u8 ; 4usize ] = b"hhx\0" ; pub const PRIXLEAST8 : & 'static [ u8 ; 4usize ] = b"hhX\0" ; pub const PRIdLEAST16 : & 'static [ u8 ; 3usize ] = b"hd\0" ; pub const PRIiLEAST16 : & 'static [ u8 ; 3usize ] = b"hi\0" ; pub const PRIoLEAST16 : & 'static [ u8 ; 3usize ] = b"ho\0" ; pub const PRIuLEAST16 : & 'static [ u8 ; 3usize ] = b"hu\0" ; pub const PRIxLEAST16 : & 'static [ u8 ; 3usize ] = b"hx\0" ; pub const PRIXLEAST16 : & 'static [ u8 ; 3usize ] = b"hX\0" ; pub const PRIdLEAST32 : & 'static [ u8 ; 2usize ] = b"d\0" ; pub const PRIiLEAST32 : & 'static [ u8 ; 2usize ] = b"i\0" ; pub const PRIoLEAST32 : & 'static [ u8 ; 2usize ] = b"o\0" ; pub const PRIuLEAST32 : & 'static [ u8 ; 2usize ] = b"u\0" ; pub const PRIxLEAST32 : & 'static [ u8 ; 2usize ] = b"x\0" ; pub const PRIXLEAST32 : & 'static [ u8 ; 2usize ] = b"X\0" ; pub const PRIdLEAST64 : & 'static [ u8 ; 4usize ] = b"lld\0" ; pub const PRIiLEAST64 : & 'static [ u8 ; 4usize ] = b"lli\0" ; pub const PRIoLEAST64 : & 'static [ u8 ; 4usize ] = b"llo\0" ; pub const PRIuLEAST64 : & 'static [ u8 ; 4usize ] = b"llu\0" ; pub const PRIxLEAST64 : & 'static [ u8 ; 4usize ] = b"llx\0" ; pub const PRIXLEAST64 : & 'static [ u8 ; 4usize ] = b"llX\0" ; pub const PRIdFAST8 : & 'static [ u8 ; 4usize ] = b"hhd\0" ; pub const PRIiFAST8 : & 'static [ u8 ; 4usize ] = b"hhi\0" ; pub const PRIoFAST8 : & 'static [ u8 ; 4usize ] = b"hho\0" ; pub const PRIuFAST8 : & 'static [ u8 ; 4usize ] = b"hhu\0" ; pub const PRIxFAST8 : & 'static [ u8 ; 4usize ] = b"hhx\0" ; pub const PRIXFAST8 : & 'static [ u8 ; 4usize ] = b"hhX\0" ; pub const PRIdFAST16 : & 'static [ u8 ; 3usize ] = b"hd\0" ; pub const PRIiFAST16 : & 'static [ u8 ; 3usize ] = b"hi\0" ; pub const PRIoFAST16 : & 'static [ u8 ; 3usize ] = b"ho\0" ; pub const PRIuFAST16 : & 'static [ u8 ; 3usize ] = b"hu\0" ; pub const PRIxFAST16 : & 'static [ u8 ; 3usize ] = b"hx\0" ; pub const PRIXFAST16 : & 'static [ u8 ; 3usize ] = b"hX\0" ; pub const PRIdFAST32 : & 'static [ u8 ; 2usize ] = b"d\0" ; pub const PRIiFAST32 : & 'static [ u8 ; 2usize ] = b"i\0" ; pub const PRIoFAST32 : & 'static [ u8 ; 2usize ] = b"o\0" ; pub const PRIuFAST32 : & 'static [ u8 ; 2usize ] = b"u\0" ; pub const PRIxFAST32 : & 'static [ u8 ; 2usize ] = b"x\0" ; pub const PRIXFAST32 : & 'static [ u8 ; 2usize ] = b"X\0" ; pub const PRIdFAST64 : & 'static [ u8 ; 4usize ] = b"lld\0" ; pub const PRIiFAST64 : & 'static [ u8 ; 4usize ] = b"lli\0" ; pub const PRIoFAST64 : & 'static [ u8 ; 4usize ] = b"llo\0" ; pub const PRIuFAST64 : & 'static [ u8 ; 4usize ] = b"llu\0" ; pub const PRIxFAST64 : & 'static [ u8 ; 4usize ] = b"llx\0" ; pub const PRIXFAST64 : & 'static [ u8 ; 4usize ] = b"llX\0" ; pub const PRIdPTR : & 'static [ u8 ; 3usize ] = b"ld\0" ; pub const PRIiPTR : & 'static [ u8 ; 3usize ] = b"li\0" ; pub const PRIoPTR : & 'static [ u8 ; 3usize ] = b"lo\0" ; pub const PRIuPTR : & 'static [ u8 ; 3usize ] = b"lu\0" ; pub const PRIxPTR : & 'static [ u8 ; 3usize ] = b"lx\0" ; pub const PRIXPTR : & 'static [ u8 ; 3usize ] = b"lX\0" ; pub const PRIdMAX : & 'static [ u8 ; 3usize ] = b"jd\0" ; pub const PRIiMAX : & 'static [ u8 ; 3usize ] = b"ji\0" ; pub const PRIoMAX : & 'static [ u8 ; 3usize ] = b"jo\0" ; pub const PRIuMAX : & 'static [ u8 ; 3usize ] = b"ju\0" ; pub const PRIxMAX : & 'static [ u8 ; 3usize ] = b"jx\0" ; pub const PRIXMAX : & 'static [ u8 ; 3usize ] = b"jX\0" ; pub const SCNd8 : & 'static [ u8 ; 4usize ] = b"hhd\0" ; pub const SCNi8 : & 'static [ u8 ; 4usize ] = b"hhi\0" ; pub const SCNo8 : & 'static [ u8 ; 4usize ] = b"hho\0" ; pub const SCNu8 : & 'static [ u8 ; 4usize ] = b"hhu\0" ; pub const SCNx8 : & 'static [ u8 ; 4usize ] = b"hhx\0" ; pub const SCNd16 : & 'static [ u8 ; 3usize ] = b"hd\0" ; pub const SCNi16 : & 'static [ u8 ; 3usize ] = b"hi\0" ; pub const SCNo16 : & 'static [ u8 ; 3usize ] = b"ho\0" ; pub const SCNu16 : & 'static [ u8 ; 3usize ] = b"hu\0" ; pub const SCNx16 : & 'static [ u8 ; 3usize ] = b"hx\0" ; pub const SCNd32 : & 'static [ u8 ; 2usize ] = b"d\0" ; pub const SCNi32 : & 'static [ u8 ; 2usize ] = b"i\0" ; pub const SCNo32 : & 'static [ u8 ; 2usize ] = b"o\0" ; pub const SCNu32 : & 'static [ u8 ; 2usize ] = b"u\0" ; pub const SCNx32 : & 'static [ u8 ; 2usize ] = b"x\0" ; pub const SCNd64 : & 'static [ u8 ; 4usize ] = b"lld\0" ; pub const SCNi64 : & 'static [ u8 ; 4usize ] = b"lli\0" ; pub const SCNo64 : & 'static [ u8 ; 4usize ] = b"llo\0" ; pub const SCNu64 : & 'static [ u8 ; 4usize ] = b"llu\0" ; pub const SCNx64 : & 'static [ u8 ; 4usize ] = b"llx\0" ; pub const SCNdLEAST8 : & 'static [ u8 ; 4usize ] = b"hhd\0" ; pub const SCNiLEAST8 : & 'static [ u8 ; 4usize ] = b"hhi\0" ; pub const SCNoLEAST8 : & 'static [ u8 ; 4usize ] = b"hho\0" ; pub const SCNuLEAST8 : & 'static [ u8 ; 4usize ] = b"hhu\0" ; pub const SCNxLEAST8 : & 'static [ u8 ; 4usize ] = b"hhx\0" ; pub const SCNdLEAST16 : & 'static [ u8 ; 3usize ] = b"hd\0" ; pub const SCNiLEAST16 : & 'static [ u8 ; 3usize ] = b"hi\0" ; pub const SCNoLEAST16 : & 'static [ u8 ; 3usize ] = b"ho\0" ; pub const SCNuLEAST16 : & 'static [ u8 ; 3usize ] = b"hu\0" ; pub const SCNxLEAST16 : & 'static [ u8 ; 3usize ] = b"hx\0" ; pub const SCNdLEAST32 : & 'static [ u8 ; 2usize ] = b"d\0" ; pub const SCNiLEAST32 : & 'static [ u8 ; 2usize ] = b"i\0" ; pub const SCNoLEAST32 : & 'static [ u8 ; 2usize ] = b"o\0" ; pub const SCNuLEAST32 : & 'static [ u8 ; 2usize ] = b"u\0" ; pub const SCNxLEAST32 : & 'static [ u8 ; 2usize ] = b"x\0" ; pub const SCNdLEAST64 : & 'static [ u8 ; 4usize ] = b"lld\0" ; pub const SCNiLEAST64 : & 'static [ u8 ; 4usize ] = b"lli\0" ; pub const SCNoLEAST64 : & 'static [ u8 ; 4usize ] = b"llo\0" ; pub const SCNuLEAST64 : & 'static [ u8 ; 4usize ] = b"llu\0" ; pub const SCNxLEAST64 : & 'static [ u8 ; 4usize ] = b"llx\0" ; pub const SCNdFAST8 : & 'static [ u8 ; 4usize ] = b"hhd\0" ; pub const SCNiFAST8 : & 'static [ u8 ; 4usize ] = b"hhi\0" ; pub const SCNoFAST8 : & 'static [ u8 ; 4usize ] = b"hho\0" ; pub const SCNuFAST8 : & 'static [ u8 ; 4usize ] = b"hhu\0" ; pub const SCNxFAST8 : & 'static [ u8 ; 4usize ] = b"hhx\0" ; pub const SCNdFAST16 : & 'static [ u8 ; 3usize ] = b"hd\0" ; pub const SCNiFAST16 : & 'static [ u8 ; 3usize ] = b"hi\0" ; pub const SCNoFAST16 : & 'static [ u8 ; 3usize ] = b"ho\0" ; pub const SCNuFAST16 : & 'static [ u8 ; 3usize ] = b"hu\0" ; pub const SCNxFAST16 : & 'static [ u8 ; 3usize ] = b"hx\0" ; pub const SCNdFAST32 : & 'static [ u8 ; 2usize ] = b"d\0" ; pub const SCNiFAST32 : & 'static [ u8 ; 2usize ] = b"i\0" ; pub const SCNoFAST32 : & 'static [ u8 ; 2usize ] = b"o\0" ; pub const SCNuFAST32 : & 'static [ u8 ; 2usize ] = b"u\0" ; pub const SCNxFAST32 : & 'static [ u8 ; 2usize ] = b"x\0" ; pub const SCNdFAST64 : & 'static [ u8 ; 4usize ] = b"lld\0" ; pub const SCNiFAST64 : & 'static [ u8 ; 4usize ] = b"lli\0" ; pub const SCNoFAST64 : & 'static [ u8 ; 4usize ] = b"llo\0" ; pub const SCNuFAST64 : & 'static [ u8 ; 4usize ] = b"llu\0" ; pub const SCNxFAST64 : & 'static [ u8 ; 4usize ] = b"llx\0" ; pub const SCNdPTR : & 'static [ u8 ; 3usize ] = b"ld\0" ; pub const SCNiPTR : & 'static [ u8 ; 3usize ] = b"li\0" ; pub const SCNoPTR : & 'static [ u8 ; 3usize ] = b"lo\0" ; pub const SCNuPTR : & 'static [ u8 ; 3usize ] = b"lu\0" ; pub const SCNxPTR : & 'static [ u8 ; 3usize ] = b"lx\0" ; pub const SCNdMAX : & 'static [ u8 ; 3usize ] = b"jd\0" ; pub const SCNiMAX : & 'static [ u8 ; 3usize ] = b"ji\0" ; pub const SCNoMAX : & 'static [ u8 ; 3usize ] = b"jo\0" ; pub const SCNuMAX : & 'static [ u8 ; 3usize ] = b"ju\0" ; pub const SCNxMAX : & 'static [ u8 ; 3usize ] = b"jx\0" ; pub const __DARWIN_ONLY_64_BIT_INO_T : u32 = 0 ; pub const __DARWIN_ONLY_VERS_1050 : u32 = 0 ; pub const __DARWIN_ONLY_UNIX_CONFORMANCE : u32 = 1 ; pub const __DARWIN_UNIX03 : u32 = 1 ; pub const __DARWIN_64_BIT_INO_T : u32 = 1 ; pub const __DARWIN_VERS_1050 : u32 = 1 ; pub const __DARWIN_NON_CANCELABLE : u32 = 0 ; pub const __DARWIN_SUF_64_BIT_INO_T : & 'static [ u8 ; 9usize ] = b"$INODE64\0" ; pub const __DARWIN_SUF_1050 : & 'static [ u8 ; 6usize ] = b"$1050\0" ; pub const __DARWIN_SUF_EXTSN : & 'static [ u8 ; 14usize ] = b"$DARWIN_EXTSN\0" ; pub const __DARWIN_C_ANSI : u32 = 4096 ; pub const __DARWIN_C_FULL : u32 = 900000 ; pub const __DARWIN_C_LEVEL : u32 = 900000 ; pub const __STDC_WANT_LIB_EXT1__ : u32 = 1 ; pub const __DARWIN_NO_LONG_LONG : u32 = 0 ; pub const _DARWIN_FEATURE_64_BIT_INODE : u32 = 1 ; pub const _DARWIN_FEATURE_ONLY_UNIX_CONFORMANCE : u32 = 1 ; pub const _DARWIN_FEATURE_UNIX_CONFORMANCE : u32 = 3 ; pub const __API_TO_BE_DEPRECATED : u32 = 100000 ; pub const __MAC_10_0 : u32 = 1000 ; pub const __MAC_10_1 : u32 = 1010 ; pub const __MAC_10_2 : u32 = 1020 ; pub const __MAC_10_3 : u32 = 1030 ; pub const __MAC_10_4 : u32 = 1040 ; pub const __MAC_10_5 : u32 = 1050 ; pub const __MAC_10_6 : u32 = 1060 ; pub const __MAC_10_7 : u32 = 1070 ; pub const __MAC_10_8 : u32 = 1080 ; pub const __MAC_10_9 : u32 = 1090 ; pub const __MAC_10_10 : u32 = 101000 ; pub const __MAC_10_10_2 : u32 = 101002 ; pub const __MAC_10_10_3 : u32 = 101003 ; pub const __MAC_10_11 : u32 = 101100 ; pub const __MAC_10_11_2 : u32 = 101102 ; pub const __MAC_10_11_3 : u32 = 101103 ; pub const __MAC_10_11_4 : u32 = 101104 ; pub const __MAC_10_12 : u32 = 101200 ; pub const __MAC_10_12_1 : u32 = 101201 ; pub const __MAC_10_12_2 : u32 = 101202 ; pub const __MAC_10_12_4 : u32 = 101204 ; pub const __MAC_10_13 : u32 = 101300 ; pub const __MAC_10_13_1 : u32 = 101301 ; pub const __MAC_10_13_2 : u32 = 101302 ; pub const __MAC_10_13_4 : u32 = 101304 ; pub const __MAC_10_14 : u32 = 101400 ; pub const __MAC_10_14_1 : u32 = 101401 ; pub const __MAC_10_14_4 : u32 = 101404 ; pub const __MAC_10_15 : u32 = 101500 ; pub const __MAC_10_15_1 : u32 = 101501 ; pub const __IPHONE_2_0 : u32 = 20000 ; pub const __IPHONE_2_1 : u32 = 20100 ; pub const __IPHONE_2_2 : u32 = 20200 ; pub const __IPHONE_3_0 : u32 = 30000 ; pub const __IPHONE_3_1 : u32 = 30100 ; pub const __IPHONE_3_2 : u32 = 30200 ; pub const __IPHONE_4_0 : u32 = 40000 ; pub const __IPHONE_4_1 : u32 = 40100 ; pub const __IPHONE_4_2 : u32 = 40200 ; pub const __IPHONE_4_3 : u32 = 40300 ; pub const __IPHONE_5_0 : u32 = 50000 ; pub const __IPHONE_5_1 : u32 = 50100 ; pub const __IPHONE_6_0 : u32 = 60000 ; pub const __IPHONE_6_1 : u32 = 60100 ; pub const __IPHONE_7_0 : u32 = 70000 ; pub const __IPHONE_7_1 : u32 = 70100 ; pub const __IPHONE_8_0 : u32 = 80000 ; pub const __IPHONE_8_1 : u32 = 80100 ; pub const __IPHONE_8_2 : u32 = 80200 ; pub const __IPHONE_8_3 : u32 = 80300 ; pub const __IPHONE_8_4 : u32 = 80400 ; pub const __IPHONE_9_0 : u32 = 90000 ; pub const __IPHONE_9_1 : u32 = 90100 ; pub const __IPHONE_9_2 : u32 = 90200 ; pub const __IPHONE_9_3 : u32 = 90300 ; pub const __IPHONE_10_0 : u32 = 100000 ; pub const __IPHONE_10_1 : u32 = 100100 ; pub const __IPHONE_10_2 : u32 = 100200 ; pub const __IPHONE_10_3 : u32 = 100300 ; pub const __IPHONE_11_0 : u32 = 110000 ; pub const __IPHONE_11_1 : u32 = 110100 ; pub const __IPHONE_11_2 : u32 = 110200 ; pub const __IPHONE_11_3 : u32 = 110300 ; pub const __IPHONE_11_4 : u32 = 110400 ; pub const __IPHONE_12_0 : u32 = 120000 ; pub const __IPHONE_12_1 : u32 = 120100 ; pub const __IPHONE_12_2 : u32 = 120200 ; pub const __IPHONE_12_3 : u32 = 120300 ; pub const __IPHONE_13_0 : u32 = 130000 ; pub const __IPHONE_13_1 : u32 = 130100 ; pub const __IPHONE_13_2 : u32 = 130200 ; pub const __TVOS_9_0 : u32 = 90000 ; pub const __TVOS_9_1 : u32 = 90100 ; pub const __TVOS_9_2 : u32 = 90200 ; pub const __TVOS_10_0 : u32 = 100000 ; pub const __TVOS_10_0_1 : u32 = 100001 ; pub const __TVOS_10_1 : u32 = 100100 ; pub const __TVOS_10_2 : u32 = 100200 ; pub const __TVOS_11_0 : u32 = 110000 ; pub const __TVOS_11_1 : u32 = 110100 ; pub const __TVOS_11_2 : u32 = 110200 ; pub const __TVOS_11_3 : u32 = 110300 ; pub const __TVOS_11_4 : u32 = 110400 ; pub const __TVOS_12_0 : u32 = 120000 ; pub const __TVOS_12_1 : u32 = 120100 ; pub const __TVOS_12_2 : u32 = 120200 ; pub const __TVOS_12_3 : u32 = 120300 ; pub const __TVOS_13_0 : u32 = 130000 ; pub const __TVOS_13_1 : u32 = 130100 ; pub const __WATCHOS_1_0 : u32 = 10000 ; pub const __WATCHOS_2_0 : u32 = 20000 ; pub const __WATCHOS_2_1 : u32 = 20100 ; pub const __WATCHOS_2_2 : u32 = 20200 ; pub const __WATCHOS_3_0 : u32 = 30000 ; pub const __WATCHOS_3_1 : u32 = 30100 ; pub const __WATCHOS_3_1_1 : u32 = 30101 ; pub const __WATCHOS_3_2 : u32 = 30200 ; pub const __WATCHOS_4_0 : u32 = 40000 ; pub const __WATCHOS_4_1 : u32 = 40100 ; pub const __WATCHOS_4_2 : u32 = 40200 ; pub const __WATCHOS_4_3 : u32 = 40300 ; pub const __WATCHOS_5_0 : u32 = 50000 ; pub const __WATCHOS_5_1 : u32 = 50100 ; pub const __WATCHOS_5_2 : u32 = 50200 ; pub const __WATCHOS_6_0 : u32 = 60000 ; pub const __WATCHOS_6_0_1 : u32 = 60001 ; pub const __DRIVERKIT_19_0 : u32 = 190000 ; pub const __MAC_OS_X_VERSION_MAX_ALLOWED : u32 = 101500 ; pub const __ENABLE_LEGACY_MAC_AVAILABILITY : u32 = 1 ; pub const __PTHREAD_SIZE__ : u32 = 8176 ; pub const __PTHREAD_ATTR_SIZE__ : u32 = 56 ; pub const __PTHREAD_MUTEXATTR_SIZE__ : u32 = 8 ; pub const __PTHREAD_MUTEX_SIZE__ : u32 = 56 ; pub const __PTHREAD_CONDATTR_SIZE__ : u32 = 8 ; pub const __PTHREAD_COND_SIZE__ : u32 = 40 ; pub const __PTHREAD_ONCE_SIZE__ : u32 = 8 ; pub const __PTHREAD_RWLOCK_SIZE__ : u32 = 192 ; pub const __PTHREAD_RWLOCKATTR_SIZE__ : u32 = 16 ; pub const __DARWIN_WCHAR_MIN : i32 = - 2147483648 ; pub const _FORTIFY_SOURCE : u32 = 2 ; pub const __WORDSIZE : u32 = 64 ; pub const INT8_MAX : u32 = 127 ; pub const INT16_MAX : u32 = 32767 ; pub const INT32_MAX : u32 = 2147483647 ; pub const INT64_MAX : u64 = 9223372036854775807 ; pub const INT8_MIN : i32 = - 128 ; pub const INT16_MIN : i32 = - 32768 ; pub const INT32_MIN : i32 = - 2147483648 ; pub const INT64_MIN : i64 = - 9223372036854775808 ; pub const UINT8_MAX : u32 = 255 ; pub const UINT16_MAX : u32 = 65535 ; pub const UINT32_MAX : u32 = 4294967295 ; pub const UINT64_MAX : i32 = - 1 ; pub const INT_LEAST8_MIN : i32 = - 128 ; pub const INT_LEAST16_MIN : i32 = - 32768 ; pub const INT_LEAST32_MIN : i32 = - 2147483648 ; pub const INT_LEAST64_MIN : i64 = - 9223372036854775808 ; pub const INT_LEAST8_MAX : u32 = 127 ; pub const INT_LEAST16_MAX : u32 = 32767 ; pub const INT_LEAST32_MAX : u32 = 2147483647 ; pub const INT_LEAST64_MAX : u64 = 9223372036854775807 ; pub const UINT_LEAST8_MAX : u32 = 255 ; pub const UINT_LEAST16_MAX : u32 = 65535 ; pub const UINT_LEAST32_MAX : u32 = 4294967295 ; pub const UINT_LEAST64_MAX : i32 = - 1 ; pub const INT_FAST8_MIN : i32 = - 128 ; pub const INT_FAST16_MIN : i32 = - 32768 ; pub const INT_FAST32_MIN : i32 = - 2147483648 ; pub const INT_FAST64_MIN : i64 = - 9223372036854775808 ; pub const INT_FAST8_MAX : u32 = 127 ; pub const INT_FAST16_MAX : u32 = 32767 ; pub const INT_FAST32_MAX : u32 = 2147483647 ; pub const INT_FAST64_MAX : u64 = 9223372036854775807 ; pub const UINT_FAST8_MAX : u32 = 255 ; pub const UINT_FAST16_MAX : u32 = 65535 ; pub const UINT_FAST32_MAX : u32 = 4294967295 ; pub const UINT_FAST64_MAX : i32 = - 1 ; pub const INTPTR_MAX : u64 = 9223372036854775807 ; pub const INTPTR_MIN : i64 = - 9223372036854775808 ; pub const UINTPTR_MAX : i32 = - 1 ; pub const SIZE_MAX : i32 = - 1 ; pub const RSIZE_MAX : i32 = - 1 ; pub const WINT_MIN : i32 = - 2147483648 ; pub const WINT_MAX : u32 = 2147483647 ; pub const SIG_ATOMIC_MIN : i32 = - 2147483648 ; pub const SIG_ATOMIC_MAX : u32 = 2147483647 ; pub const RENAME_SECLUDE : u32 = 1 ; pub const RENAME_SWAP : u32 = 2 ; pub const RENAME_EXCL : u32 = 4 ; pub const __SLBF : u32 = 1 ; pub const __SNBF : u32 = 2 ; pub const __SRD : u32 = 4 ; pub const __SWR : u32 = 8 ; pub const __SRW : u32 = 16 ; pub const __SEOF : u32 = 32 ; pub const __SERR : u32 = 64 ; pub const __SMBF : u32 = 128 ; pub const __SAPP : u32 = 256 ; pub const __SSTR : u32 = 512 ; pub const __SOPT : u32 = 1024 ; pub const __SNPT : u32 = 2048 ; pub const __SOFF : u32 = 4096 ; pub const __SMOD : u32 = 8192 ; pub const __SALC : u32 = 16384 ; pub const __SIGN : u32 = 32768 ; pub const _IOFBF : u32 = 0 ; pub const _IOLBF : u32 = 1 ; pub const _IONBF : u32 = 2 ; pub const BUFSIZ : u32 = 1024 ; pub const EOF : i32 = - 1 ; pub const FOPEN_MAX : u32 = 20 ; pub const FILENAME_MAX : u32 = 1024 ; pub const P_tmpdir : & 'static [ u8 ; 10usize ] = b"/var/tmp/\0" ; pub const L_tmpnam : u32 = 1024 ; pub const TMP_MAX : u32 = 308915776 ; pub const SEEK_SET : u32 = 0 ; pub const SEEK_CUR : u32 = 1 ; pub const SEEK_END : u32 = 2 ; pub const L_ctermid : u32 = 1024 ; pub const _USE_FORTIFY_LEVEL : u32 = 2 ; pub const __HAS_FIXED_CHK_PROTOTYPES : u32 = 1 ; pub const CLOCKS_PER_SEC : u32 = 1000000 ; pub const TIME_UTC : u32 = 1 ; pub const true_ : u32 = 1 ; pub const false_ : u32 = 0 ; pub const __bool_true_false_are_defined : u32 = 1 ; pub const __DARWIN_NSIG : u32 = 32 ; pub const NSIG : u32 = 32 ; pub const _I386_SIGNAL_H_ : u32 = 1 ; pub const SIGHUP : u32 = 1 ; pub const SIGINT : u32 = 2 ; pub const SIGQUIT : u32 = 3 ; pub const SIGILL : u32 = 4 ; pub const SIGTRAP : u32 = 5 ; pub const SIGABRT : u32 = 6 ; pub const SIGIOT : u32 = 6 ; pub const SIGEMT : u32 = 7 ; pub const SIGFPE : u32 = 8 ; pub const SIGKILL : u32 = 9 ; pub const SIGBUS : u32 = 10 ; pub const SIGSEGV : u32 = 11 ; pub const SIGSYS : u32 = 12 ; pub const SIGPIPE : u32 = 13 ; pub const SIGALRM : u32 = 14 ; pub const SIGTERM : u32 = 15 ; pub const SIGURG : u32 = 16 ; pub const SIGSTOP : u32 = 17 ; pub const SIGTSTP : u32 = 18 ; pub const SIGCONT : u32 = 19 ; pub const SIGCHLD : u32 = 20 ; pub const SIGTTIN : u32 = 21 ; pub const SIGTTOU : u32 = 22 ; pub const SIGIO : u32 = 23 ; pub const SIGXCPU : u32 = 24 ; pub const SIGXFSZ : u32 = 25 ; pub const SIGVTALRM : u32 = 26 ; pub const SIGPROF : u32 = 27 ; pub const SIGWINCH : u32 = 28 ; pub const SIGINFO : u32 = 29 ; pub const SIGUSR1 : u32 = 30 ; pub const SIGUSR2 : u32 = 31 ; pub const FP_PREC_24B : u32 = 0 ; pub const FP_PREC_53B : u32 = 2 ; pub const FP_PREC_64B : u32 = 3 ; pub const FP_RND_NEAR : u32 = 0 ; pub const FP_RND_DOWN : u32 = 1 ; pub const FP_RND_UP : u32 = 2 ; pub const FP_CHOP : u32 = 3 ; pub const FP_STATE_BYTES : u32 = 512 ; pub const SIGEV_NONE : u32 = 0 ; pub const SIGEV_SIGNAL : u32 = 1 ; pub const SIGEV_THREAD : u32 = 3 ; pub const ILL_NOOP : u32 = 0 ; pub const ILL_ILLOPC : u32 = 1 ; pub const ILL_ILLTRP : u32 = 2 ; pub const ILL_PRVOPC : u32 = 3 ; pub const ILL_ILLOPN : u32 = 4 ; pub const ILL_ILLADR : u32 = 5 ; pub const ILL_PRVREG : u32 = 6 ; pub const ILL_COPROC : u32 = 7 ; pub const ILL_BADSTK : u32 = 8 ; pub const FPE_NOOP : u32 = 0 ; pub const FPE_FLTDIV : u32 = 1 ; pub const FPE_FLTOVF : u32 = 2 ; pub const FPE_FLTUND : u32 = 3 ; pub const FPE_FLTRES : u32 = 4 ; pub const FPE_FLTINV : u32 = 5 ; pub const FPE_FLTSUB : u32 = 6 ; pub const FPE_INTDIV : u32 = 7 ; pub const FPE_INTOVF : u32 = 8 ; pub const SEGV_NOOP : u32 = 0 ; pub const SEGV_MAPERR : u32 = 1 ; pub const SEGV_ACCERR : u32 = 2 ; pub const BUS_NOOP : u32 = 0 ; pub const BUS_ADRALN : u32 = 1 ; pub const BUS_ADRERR : u32 = 2 ; pub const BUS_OBJERR : u32 = 3 ; pub const TRAP_BRKPT : u32 = 1 ; pub const TRAP_TRACE : u32 = 2 ; pub const CLD_NOOP : u32 = 0 ; pub const CLD_EXITED : u32 = 1 ; pub const CLD_KILLED : u32 = 2 ; pub const CLD_DUMPED : u32 = 3 ; pub const CLD_TRAPPED : u32 = 4 ; pub const CLD_STOPPED : u32 = 5 ; pub const CLD_CONTINUED : u32 = 6 ; pub const POLL_IN : u32 = 1 ; pub const POLL_OUT : u32 = 2 ; pub const POLL_MSG : u32 = 3 ; pub const POLL_ERR : u32 = 4 ; pub const POLL_PRI : u32 = 5 ; pub const POLL_HUP : u32 = 6 ; pub const SA_ONSTACK : u32 = 1 ; pub const SA_RESTART : u32 = 2 ; pub const SA_RESETHAND : u32 = 4 ; pub const SA_NOCLDSTOP : u32 = 8 ; pub const SA_NODEFER : u32 = 16 ; pub const SA_NOCLDWAIT : u32 = 32 ; pub const SA_SIGINFO : u32 = 64 ; pub const SA_USERTRAMP : u32 = 256 ; pub const SA_64REGSET : u32 = 512 ; pub const SA_USERSPACE_MASK : u32 = 127 ; pub const SIG_BLOCK : u32 = 1 ; pub const SIG_UNBLOCK : u32 = 2 ; pub const SIG_SETMASK : u32 = 3 ; pub const SI_USER : u32 = 65537 ; pub const SI_QUEUE : u32 = 65538 ; pub const SI_TIMER : u32 = 65539 ; pub const SI_ASYNCIO : u32 = 65540 ; pub const SI_MESGQ : u32 = 65541 ; pub const SS_ONSTACK : u32 = 1 ; pub const SS_DISABLE : u32 = 4 ; pub const MINSIGSTKSZ : u32 = 32768 ; pub const SIGSTKSZ : u32 = 131072 ; pub const SV_ONSTACK : u32 = 1 ; pub const SV_INTERRUPT : u32 = 2 ; pub const SV_RESETHAND : u32 = 4 ; pub const SV_NODEFER : u32 = 16 ; pub const SV_NOCLDSTOP : u32 = 8 ; pub const SV_SIGINFO : u32 = 64 ; pub const PRIO_PROCESS : u32 = 0 ; pub const PRIO_PGRP : u32 = 1 ; pub const PRIO_USER : u32 = 2 ; pub const PRIO_DARWIN_THREAD : u32 = 3 ; pub const PRIO_DARWIN_PROCESS : u32 = 4 ; pub const PRIO_MIN : i32 = - 20 ; pub const PRIO_MAX : u32 = 20 ; pub const PRIO_DARWIN_BG : u32 = 4096 ; pub const PRIO_DARWIN_NONUI : u32 = 4097 ; pub const RUSAGE_SELF : u32 = 0 ; pub const RUSAGE_CHILDREN : i32 = - 1 ; pub const RUSAGE_INFO_V0 : u32 = 0 ; pub const RUSAGE_INFO_V1 : u32 = 1 ; pub const RUSAGE_INFO_V2 : u32 = 2 ; pub const RUSAGE_INFO_V3 : u32 = 3 ; pub const RUSAGE_INFO_V4 : u32 = 4 ; pub const RUSAGE_INFO_CURRENT : u32 = 4 ; pub const RLIMIT_CPU : u32 = 0 ; pub const RLIMIT_FSIZE : u32 = 1 ; pub const RLIMIT_DATA : u32 = 2 ; pub const RLIMIT_STACK : u32 = 3 ; pub const RLIMIT_CORE : u32 = 4 ; pub const RLIMIT_AS : u32 = 5 ; pub const RLIMIT_RSS : u32 = 5 ; pub const RLIMIT_MEMLOCK : u32 = 6 ; pub const RLIMIT_NPROC : u32 = 7 ; pub const RLIMIT_NOFILE : u32 = 8 ; pub const RLIM_NLIMITS : u32 = 9 ; pub const _RLIMIT_POSIX_FLAG : u32 = 4096 ; pub const RLIMIT_WAKEUPS_MONITOR : u32 = 1 ; pub const RLIMIT_CPU_USAGE_MONITOR : u32 = 2 ; pub const RLIMIT_THREAD_CPULIMITS : u32 = 3 ; pub const RLIMIT_FOOTPRINT_INTERVAL : u32 = 4 ; pub const WAKEMON_ENABLE : u32 = 1 ; pub const WAKEMON_DISABLE : u32 = 2 ; pub const WAKEMON_GET_PARAMS : u32 = 4 ; pub const WAKEMON_SET_DEFAULTS : u32 = 8 ; pub const WAKEMON_MAKE_FATAL : u32 = 16 ; pub const CPUMON_MAKE_FATAL : u32 = 4096 ; pub const FOOTPRINT_INTERVAL_RESET : u32 = 1 ; pub const IOPOL_TYPE_DISK : u32 = 0 ; pub const IOPOL_TYPE_VFS_ATIME_UPDATES : u32 = 2 ; pub const IOPOL_TYPE_VFS_MATERIALIZE_DATALESS_FILES : u32 = 3 ; pub const IOPOL_TYPE_VFS_STATFS_NO_DATA_VOLUME : u32 = 4 ; pub const IOPOL_SCOPE_PROCESS : u32 = 0 ; pub const IOPOL_SCOPE_THREAD : u32 = 1 ; pub const IOPOL_SCOPE_DARWIN_BG : u32 = 2 ; pub const IOPOL_DEFAULT : u32 = 0 ; pub const IOPOL_IMPORTANT : u32 = 1 ; pub const IOPOL_PASSIVE : u32 = 2 ; pub const IOPOL_THROTTLE : u32 = 3 ; pub const IOPOL_UTILITY : u32 = 4 ; pub const IOPOL_STANDARD : u32 = 5 ; pub const IOPOL_APPLICATION : u32 = 5 ; pub const IOPOL_NORMAL : u32 = 1 ; pub const IOPOL_ATIME_UPDATES_DEFAULT : u32 = 0 ; pub const IOPOL_ATIME_UPDATES_OFF : u32 = 1 ; pub const IOPOL_MATERIALIZE_DATALESS_FILES_DEFAULT : u32 = 0 ; pub const IOPOL_MATERIALIZE_DATALESS_FILES_OFF : u32 = 1 ; pub const IOPOL_MATERIALIZE_DATALESS_FILES_ON : u32 = 2 ; pub const IOPOL_VFS_STATFS_NO_DATA_VOLUME_DEFAULT : u32 = 0 ; pub const IOPOL_VFS_STATFS_FORCE_NO_DATA_VOLUME : u32 = 1 ; pub const WNOHANG : u32 = 1 ; pub const WUNTRACED : u32 = 2 ; pub const WCOREFLAG : u32 = 128 ; pub const _WSTOPPED : u32 = 127 ; pub const WEXITED : u32 = 4 ; pub const WSTOPPED : u32 = 8 ; pub const WCONTINUED : u32 = 16 ; pub const WNOWAIT : u32 = 32 ; pub const WAIT_ANY : i32 = - 1 ; pub const WAIT_MYPGRP : u32 = 0 ; pub const _QUAD_HIGHWORD : u32 = 1 ; pub const _QUAD_LOWWORD : u32 = 0 ; pub const __DARWIN_LITTLE_ENDIAN : u32 = 1234 ; pub const __DARWIN_BIG_ENDIAN : u32 = 4321 ; pub const __DARWIN_PDP_ENDIAN : u32 = 3412 ; pub const __DARWIN_BYTE_ORDER : u32 = 1234 ; pub const LITTLE_ENDIAN : u32 = 1234 ; pub const BIG_ENDIAN : u32 = 4321 ; pub const PDP_ENDIAN : u32 = 3412 ; pub const BYTE_ORDER : u32 = 1234 ; pub const EXIT_FAILURE : u32 = 1 ; pub const EXIT_SUCCESS : u32 = 0 ; pub const RAND_MAX : u32 = 2147483647 ; pub const DATA_DEPTH_MAX : u32 = 11 ; pub const IN3_PROTO_VER : & 'static [ u8 ; 6usize ] = b"2.1.0\0" ; pub const ETH_CHAIN_ID_MULTICHAIN : u32 = 0 ; pub const ETH_CHAIN_ID_MAINNET : u32 = 1 ; pub const ETH_CHAIN_ID_KOVAN : u32 = 42 ; pub const ETH_CHAIN_ID_TOBALABA : u32 = 1101 ; pub const ETH_CHAIN_ID_GOERLI : u32 = 5 ; pub const ETH_CHAIN_ID_EVAN : u32 = 1201 ; pub const ETH_CHAIN_ID_EWC : u32 = 246 ; pub const ETH_CHAIN_ID_IPFS : u32 = 2000 ; pub const ETH_CHAIN_ID_BTC : u32 = 153 ; pub const ETH_CHAIN_ID_LOCAL : u32 = 65535 ; pub const DEF_REPL_LATEST_BLK : u32 = 6 ; pub const IN3_SIGN_ERR_REJECTED : i32 = - 1 ; pub const IN3_SIGN_ERR_ACCOUNT_NOT_FOUND : i32 = - 2 ; pub const IN3_SIGN_ERR_INVALID_MESSAGE : i32 = - 3 ; pub const IN3_SIGN_ERR_GENERAL_ERROR : i32 = - 4 ; pub const __GNUC_VA_LIST : u32 = 1 ; pub type __int8_t = libc :: c_schar ; pub type __uint8_t = libc :: c_uchar ; pub type __int16_t = libc :: c_short ; pub type __uint16_t = libc :: c_ushort ; pub type __int32_t = libc :: c_int ; pub type __uint32_t = libc :: c_uint ; pub type __int64_t = libc :: c_longlong ; pub type __uint64_t = libc :: c_ulonglong ; pub type __darwin_intptr_t = libc :: c_long ; pub type __darwin_natural_t = libc :: c_uint ; pub type __darwin_ct_rune_t = libc :: c_int ; # [ repr ( C ) ] # [ derive ( Copy , Clone ) ] pub union __mbstate_t { pub __mbstate8 : [ libc :: c_char ; 128usize ] , pub _mbstateL : libc :: c_longlong , _bindgen_union_align : [ u64 ; 16usize ] , } # [ test ] fn bindgen_test_layout___mbstate_t ( ) { assert_eq ! ( :: core :: mem :: size_of :: < __mbstate_t > ( ) , 128usize , concat ! ( "Size of: " , stringify ! ( __mbstate_t ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < __mbstate_t > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( __mbstate_t ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __mbstate_t > ( ) ) ) . __mbstate8 as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( __mbstate_t ) , "::" , stringify ! ( __mbstate8 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __mbstate_t > ( ) ) ) . _mbstateL as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( __mbstate_t ) , "::" , stringify ! ( _mbstateL ) ) ) ; } impl :: core :: fmt :: Debug for __mbstate_t { fn fmt ( & self , f : & mut :: core :: fmt :: Formatter < '_ > ) -> :: core :: fmt :: Result { write ! ( f , "__mbstate_t {{ union }}" ) } } pub type __darwin_mbstate_t = __mbstate_t ; pub type __darwin_ptrdiff_t = libc :: c_long ; pub type __darwin_size_t = libc :: c_ulong ; pub type __darwin_va_list = __builtin_va_list ; pub type __darwin_wchar_t = libc :: c_int ; pub type __darwin_rune_t = __darwin_wchar_t ; pub type __darwin_wint_t = libc :: c_int ; pub type __darwin_clock_t = libc :: c_ulong ; pub type __darwin_socklen_t = __uint32_t ; pub type __darwin_ssize_t = libc :: c_long ; pub type __darwin_time_t = libc :: c_long ; pub type __darwin_blkcnt_t = __int64_t ; pub type __darwin_blksize_t = __int32_t ; pub type __darwin_dev_t = __int32_t ; pub type __darwin_fsblkcnt_t = libc :: c_uint ; pub type __darwin_fsfilcnt_t = libc :: c_uint ; pub type __darwin_gid_t = __uint32_t ; pub type __darwin_id_t = __uint32_t ; pub type __darwin_ino64_t = __uint64_t ; pub type __darwin_ino_t = __darwin_ino64_t ; pub type __darwin_mach_port_name_t = __darwin_natural_t ; pub type __darwin_mach_port_t = __darwin_mach_port_name_t ; pub type __darwin_mode_t = __uint16_t ; pub type __darwin_off_t = __int64_t ; pub type __darwin_pid_t = __int32_t ; pub type __darwin_sigset_t = __uint32_t ; pub type __darwin_suseconds_t = __int32_t ; pub type __darwin_uid_t = __uint32_t ; pub type __darwin_useconds_t = __uint32_t ; pub type __darwin_uuid_t = [ libc :: c_uchar ; 16usize ] ; pub type __darwin_uuid_string_t = [ libc :: c_char ; 37usize ] ; # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct __darwin_pthread_handler_rec { pub __routine : :: core :: option :: Option < unsafe extern "C" fn ( arg1 : * mut libc :: c_void ) > , pub __arg : * mut libc :: c_void , pub __next : * mut __darwin_pthread_handler_rec , } # [ test ] fn bindgen_test_layout___darwin_pthread_handler_rec ( ) { assert_eq ! ( :: core :: mem :: size_of :: < __darwin_pthread_handler_rec > ( ) , 24usize , concat ! ( "Size of: " , stringify ! ( __darwin_pthread_handler_rec ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < __darwin_pthread_handler_rec > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( __darwin_pthread_handler_rec ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_pthread_handler_rec > ( ) ) ) . __routine as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_pthread_handler_rec ) , "::" , stringify ! ( __routine ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_pthread_handler_rec > ( ) ) ) . __arg as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_pthread_handler_rec ) , "::" , stringify ! ( __arg ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_pthread_handler_rec > ( ) ) ) . __next as * const _ as usize } , 16usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_pthread_handler_rec ) , "::" , stringify ! ( __next ) ) ) ; } # [ repr ( C ) ] # [ derive ( Copy , Clone ) ] pub struct _opaque_pthread_attr_t { pub __sig : libc :: c_long , pub __opaque : [ libc :: c_char ; 56usize ] , } # [ test ] fn bindgen_test_layout__opaque_pthread_attr_t ( ) { assert_eq ! ( :: core :: mem :: size_of :: < _opaque_pthread_attr_t > ( ) , 64usize , concat ! ( "Size of: " , stringify ! ( _opaque_pthread_attr_t ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < _opaque_pthread_attr_t > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( _opaque_pthread_attr_t ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < _opaque_pthread_attr_t > ( ) ) ) . __sig as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( _opaque_pthread_attr_t ) , "::" , stringify ! ( __sig ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < _opaque_pthread_attr_t > ( ) ) ) . __opaque as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( _opaque_pthread_attr_t ) , "::" , stringify ! ( __opaque ) ) ) ; } impl :: core :: fmt :: Debug for _opaque_pthread_attr_t { fn fmt ( & self , f : & mut :: core :: fmt :: Formatter < '_ > ) -> :: core :: fmt :: Result { write ! ( f , "_opaque_pthread_attr_t {{ __sig: {:?}, __opaque: [...] }}" , self . __sig ) } } # [ repr ( C ) ] # [ derive ( Copy , Clone ) ] pub struct _opaque_pthread_cond_t { pub __sig : libc :: c_long , pub __opaque : [ libc :: c_char ; 40usize ] , } # [ test ] fn bindgen_test_layout__opaque_pthread_cond_t ( ) { assert_eq ! ( :: core :: mem :: size_of :: < _opaque_pthread_cond_t > ( ) , 48usize , concat ! ( "Size of: " , stringify ! ( _opaque_pthread_cond_t ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < _opaque_pthread_cond_t > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( _opaque_pthread_cond_t ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < _opaque_pthread_cond_t > ( ) ) ) . __sig as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( _opaque_pthread_cond_t ) , "::" , stringify ! ( __sig ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < _opaque_pthread_cond_t > ( ) ) ) . __opaque as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( _opaque_pthread_cond_t ) , "::" , stringify ! ( __opaque ) ) ) ; } impl :: core :: fmt :: Debug for _opaque_pthread_cond_t { fn fmt ( & self , f : & mut :: core :: fmt :: Formatter < '_ > ) -> :: core :: fmt :: Result { write ! ( f , "_opaque_pthread_cond_t {{ __sig: {:?}, __opaque: [...] }}" , self . __sig ) } } # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct _opaque_pthread_condattr_t { pub __sig : libc :: c_long , pub __opaque : [ libc :: c_char ; 8usize ] , } # [ test ] fn bindgen_test_layout__opaque_pthread_condattr_t ( ) { assert_eq ! ( :: core :: mem :: size_of :: < _opaque_pthread_condattr_t > ( ) , 16usize , concat ! ( "Size of: " , stringify ! ( _opaque_pthread_condattr_t ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < _opaque_pthread_condattr_t > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( _opaque_pthread_condattr_t ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < _opaque_pthread_condattr_t > ( ) ) ) . __sig as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( _opaque_pthread_condattr_t ) , "::" , stringify ! ( __sig ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < _opaque_pthread_condattr_t > ( ) ) ) . __opaque as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( _opaque_pthread_condattr_t ) , "::" , stringify ! ( __opaque ) ) ) ; } # [ repr ( C ) ] # [ derive ( Copy , Clone ) ] pub struct _opaque_pthread_mutex_t { pub __sig : libc :: c_long , pub __opaque : [ libc :: c_char ; 56usize ] , } # [ test ] fn bindgen_test_layout__opaque_pthread_mutex_t ( ) { assert_eq ! ( :: core :: mem :: size_of :: < _opaque_pthread_mutex_t > ( ) , 64usize , concat ! ( "Size of: " , stringify ! ( _opaque_pthread_mutex_t ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < _opaque_pthread_mutex_t > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( _opaque_pthread_mutex_t ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < _opaque_pthread_mutex_t > ( ) ) ) . __sig as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( _opaque_pthread_mutex_t ) , "::" , stringify ! ( __sig ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < _opaque_pthread_mutex_t > ( ) ) ) . __opaque as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( _opaque_pthread_mutex_t ) , "::" , stringify ! ( __opaque ) ) ) ; } impl :: core :: fmt :: Debug for _opaque_pthread_mutex_t { fn fmt ( & self , f : & mut :: core :: fmt :: Formatter < '_ > ) -> :: core :: fmt :: Result { write ! ( f , "_opaque_pthread_mutex_t {{ __sig: {:?}, __opaque: [...] }}" , self . __sig ) } } # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct _opaque_pthread_mutexattr_t { pub __sig : libc :: c_long , pub __opaque : [ libc :: c_char ; 8usize ] , } # [ test ] fn bindgen_test_layout__opaque_pthread_mutexattr_t ( ) { assert_eq ! ( :: core :: mem :: size_of :: < _opaque_pthread_mutexattr_t > ( ) , 16usize , concat ! ( "Size of: " , stringify ! ( _opaque_pthread_mutexattr_t ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < _opaque_pthread_mutexattr_t > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( _opaque_pthread_mutexattr_t ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < _opaque_pthread_mutexattr_t > ( ) ) ) . __sig as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( _opaque_pthread_mutexattr_t ) , "::" , stringify ! ( __sig ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < _opaque_pthread_mutexattr_t > ( ) ) ) . __opaque as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( _opaque_pthread_mutexattr_t ) , "::" , stringify ! ( __opaque ) ) ) ; } # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct _opaque_pthread_once_t { pub __sig : libc :: c_long , pub __opaque : [ libc :: c_char ; 8usize ] , } # [ test ] fn bindgen_test_layout__opaque_pthread_once_t ( ) { assert_eq ! ( :: core :: mem :: size_of :: < _opaque_pthread_once_t > ( ) , 16usize , concat ! ( "Size of: " , stringify ! ( _opaque_pthread_once_t ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < _opaque_pthread_once_t > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( _opaque_pthread_once_t ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < _opaque_pthread_once_t > ( ) ) ) . __sig as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( _opaque_pthread_once_t ) , "::" , stringify ! ( __sig ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < _opaque_pthread_once_t > ( ) ) ) . __opaque as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( _opaque_pthread_once_t ) , "::" , stringify ! ( __opaque ) ) ) ; } # [ repr ( C ) ] # [ derive ( Copy , Clone ) ] pub struct _opaque_pthread_rwlock_t { pub __sig : libc :: c_long , pub __opaque : [ libc :: c_char ; 192usize ] , } # [ test ] fn bindgen_test_layout__opaque_pthread_rwlock_t ( ) { assert_eq ! ( :: core :: mem :: size_of :: < _opaque_pthread_rwlock_t > ( ) , 200usize , concat ! ( "Size of: " , stringify ! ( _opaque_pthread_rwlock_t ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < _opaque_pthread_rwlock_t > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( _opaque_pthread_rwlock_t ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < _opaque_pthread_rwlock_t > ( ) ) ) . __sig as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( _opaque_pthread_rwlock_t ) , "::" , stringify ! ( __sig ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < _opaque_pthread_rwlock_t > ( ) ) ) . __opaque as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( _opaque_pthread_rwlock_t ) , "::" , stringify ! ( __opaque ) ) ) ; } impl :: core :: fmt :: Debug for _opaque_pthread_rwlock_t { fn fmt ( & self , f : & mut :: core :: fmt :: Formatter < '_ > ) -> :: core :: fmt :: Result { write ! ( f , "_opaque_pthread_rwlock_t {{ __sig: {:?}, __opaque: [...] }}" , self . __sig ) } } # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct _opaque_pthread_rwlockattr_t { pub __sig : libc :: c_long , pub __opaque : [ libc :: c_char ; 16usize ] , } # [ test ] fn bindgen_test_layout__opaque_pthread_rwlockattr_t ( ) { assert_eq ! ( :: core :: mem :: size_of :: < _opaque_pthread_rwlockattr_t > ( ) , 24usize , concat ! ( "Size of: " , stringify ! ( _opaque_pthread_rwlockattr_t ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < _opaque_pthread_rwlockattr_t > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( _opaque_pthread_rwlockattr_t ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < _opaque_pthread_rwlockattr_t > ( ) ) ) . __sig as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( _opaque_pthread_rwlockattr_t ) , "::" , stringify ! ( __sig ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < _opaque_pthread_rwlockattr_t > ( ) ) ) . __opaque as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( _opaque_pthread_rwlockattr_t ) , "::" , stringify ! ( __opaque ) ) ) ; } # [ repr ( C ) ] # [ derive ( Copy , Clone ) ] pub struct _opaque_pthread_t { pub __sig : libc :: c_long , pub __cleanup_stack : * mut __darwin_pthread_handler_rec , pub __opaque : [ libc :: c_char ; 8176usize ] , } # [ test ] fn bindgen_test_layout__opaque_pthread_t ( ) { assert_eq ! ( :: core :: mem :: size_of :: < _opaque_pthread_t > ( ) , 8192usize , concat ! ( "Size of: " , stringify ! ( _opaque_pthread_t ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < _opaque_pthread_t > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( _opaque_pthread_t ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < _opaque_pthread_t > ( ) ) ) . __sig as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( _opaque_pthread_t ) , "::" , stringify ! ( __sig ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < _opaque_pthread_t > ( ) ) ) . __cleanup_stack as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( _opaque_pthread_t ) , "::" , stringify ! ( __cleanup_stack ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < _opaque_pthread_t > ( ) ) ) . __opaque as * const _ as usize } , 16usize , concat ! ( "Offset of field: " , stringify ! ( _opaque_pthread_t ) , "::" , stringify ! ( __opaque ) ) ) ; } impl :: core :: fmt :: Debug for _opaque_pthread_t { fn fmt ( & self , f : & mut :: core :: fmt :: Formatter < '_ > ) -> :: core :: fmt :: Result { write ! ( f , "_opaque_pthread_t {{ __sig: {:?}, __cleanup_stack: {:?}, __opaque: [...] }}" , self . __sig , self . __cleanup_stack ) } } pub type __darwin_pthread_attr_t = _opaque_pthread_attr_t ; pub type __darwin_pthread_cond_t = _opaque_pthread_cond_t ; pub type __darwin_pthread_condattr_t = _opaque_pthread_condattr_t ; pub type __darwin_pthread_key_t = libc :: c_ulong ; pub type __darwin_pthread_mutex_t = _opaque_pthread_mutex_t ; pub type __darwin_pthread_mutexattr_t = _opaque_pthread_mutexattr_t ; pub type __darwin_pthread_once_t = _opaque_pthread_once_t ; pub type __darwin_pthread_rwlock_t = _opaque_pthread_rwlock_t ; pub type __darwin_pthread_rwlockattr_t = _opaque_pthread_rwlockattr_t ; pub type __darwin_pthread_t = * mut _opaque_pthread_t ; pub type __darwin_nl_item = libc :: c_int ; pub type __darwin_wctrans_t = libc :: c_int ; pub type __darwin_wctype_t = __uint32_t ; pub type wchar_t = __darwin_wchar_t ; pub type int_least8_t = i8 ; pub type int_least16_t = i16 ; pub type int_least32_t = i32 ; pub type int_least64_t = i64 ; pub type uint_least8_t = u8 ; pub type uint_least16_t = u16 ; pub type uint_least32_t = u32 ; pub type uint_least64_t = u64 ; pub type int_fast8_t = i8 ; pub type int_fast16_t = i16 ; pub type int_fast32_t = i32 ; pub type int_fast64_t = i64 ; pub type uint_fast8_t = u8 ; pub type uint_fast16_t = u16 ; pub type uint_fast32_t = u32 ; pub type uint_fast64_t = u64 ; pub type u_int8_t = libc :: c_uchar ; pub type u_int16_t = libc :: c_ushort ; pub type u_int32_t = libc :: c_uint ; pub type u_int64_t = libc :: c_ulonglong ; pub type register_t = i64 ; pub type user_addr_t = u_int64_t ; pub type user_size_t = u_int64_t ; pub type user_ssize_t = i64 ; pub type user_long_t = i64 ; pub type user_ulong_t = u_int64_t ; pub type user_time_t = i64 ; pub type user_off_t = i64 ; pub type syscall_arg_t = u_int64_t ; pub type intmax_t = libc :: c_long ; pub type uintmax_t = libc :: c_ulong ; extern "C" { pub fn imaxabs ( j : intmax_t ) -> intmax_t ; } # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct imaxdiv_t { pub quot : intmax_t , pub rem : intmax_t , } # [ test ] fn bindgen_test_layout_imaxdiv_t ( ) { assert_eq ! ( :: core :: mem :: size_of :: < imaxdiv_t > ( ) , 16usize , concat ! ( "Size of: " , stringify ! ( imaxdiv_t ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < imaxdiv_t > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( imaxdiv_t ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < imaxdiv_t > ( ) ) ) . quot as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( imaxdiv_t ) , "::" , stringify ! ( quot ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < imaxdiv_t > ( ) ) ) . rem as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( imaxdiv_t ) , "::" , stringify ! ( rem ) ) ) ; } extern "C" { pub fn imaxdiv ( __numer : intmax_t , __denom : intmax_t ) -> imaxdiv_t ; } extern "C" { pub fn strtoimax ( __nptr : * const libc :: c_char , __endptr : * mut * mut libc :: c_char , __base : libc :: c_int ) -> intmax_t ; } extern "C" { pub fn strtoumax ( __nptr : * const libc :: c_char , __endptr : * mut * mut libc :: c_char , __base : libc :: c_int ) -> uintmax_t ; } extern "C" { pub fn wcstoimax ( __nptr : * const wchar_t , __endptr : * mut * mut wchar_t , __base : libc :: c_int ) -> intmax_t ; } extern "C" { pub fn wcstoumax ( __nptr : * const wchar_t , __endptr : * mut * mut wchar_t , __base : libc :: c_int ) -> uintmax_t ; } pub type va_list = __darwin_va_list ; extern "C" { pub fn renameat ( arg1 : libc :: c_int , arg2 : * const libc :: c_char , arg3 : libc :: c_int , arg4 : * const libc :: c_char ) -> libc :: c_int ; } extern "C" { pub fn renamex_np ( arg1 : * const libc :: c_char , arg2 : * const libc :: c_char , arg3 : libc :: c_uint ) -> libc :: c_int ; } extern "C" { pub fn renameatx_np ( arg1 : libc :: c_int , arg2 : * const libc :: c_char , arg3 : libc :: c_int , arg4 : * const libc :: c_char , arg5 : libc :: c_uint ) -> libc :: c_int ; } pub type fpos_t = __darwin_off_t ; # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct __sbuf { pub _base : * mut libc :: c_uchar , pub _size : libc :: c_int , } # [ test ] fn bindgen_test_layout___sbuf ( ) { assert_eq ! ( :: core :: mem :: size_of :: < __sbuf > ( ) , 16usize , concat ! ( "Size of: " , stringify ! ( __sbuf ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < __sbuf > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( __sbuf ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __sbuf > ( ) ) ) . _base as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( __sbuf ) , "::" , stringify ! ( _base ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __sbuf > ( ) ) ) . _size as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( __sbuf ) , "::" , stringify ! ( _size ) ) ) ; } # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct __sFILEX { _unused : [ u8 ; 0 ] , } # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct __sFILE { pub _p : * mut libc :: c_uchar , pub _r : libc :: c_int , pub _w : libc :: c_int , pub _flags : libc :: c_short , pub _file : libc :: c_short , pub _bf : __sbuf , pub _lbfsize : libc :: c_int , pub _cookie : * mut libc :: c_void , pub _close : :: core :: option :: Option < unsafe extern "C" fn ( arg1 : * mut libc :: c_void ) -> libc :: c_int > , pub _read : :: core :: option :: Option < unsafe extern "C" fn ( arg1 : * mut libc :: c_void , arg2 : * mut libc :: c_char , arg3 : libc :: c_int ) -> libc :: c_int > , pub _seek : :: core :: option :: Option < unsafe extern "C" fn ( arg1 : * mut libc :: c_void , arg2 : fpos_t , arg3 : libc :: c_int ) -> fpos_t > , pub _write : :: core :: option :: Option < unsafe extern "C" fn ( arg1 : * mut libc :: c_void , arg2 : * const libc :: c_char , arg3 : libc :: c_int ) -> libc :: c_int > , pub _ub : __sbuf , pub _extra : * mut __sFILEX , pub _ur : libc :: c_int , pub _ubuf : [ libc :: c_uchar ; 3usize ] , pub _nbuf : [ libc :: c_uchar ; 1usize ] , pub _lb : __sbuf , pub _blksize : libc :: c_int , pub _offset : fpos_t , } # [ test ] fn bindgen_test_layout___sFILE ( ) { assert_eq ! ( :: core :: mem :: size_of :: < __sFILE > ( ) , 152usize , concat ! ( "Size of: " , stringify ! ( __sFILE ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < __sFILE > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( __sFILE ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __sFILE > ( ) ) ) . _p as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( __sFILE ) , "::" , stringify ! ( _p ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __sFILE > ( ) ) ) . _r as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( __sFILE ) , "::" , stringify ! ( _r ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __sFILE > ( ) ) ) . _w as * const _ as usize } , 12usize , concat ! ( "Offset of field: " , stringify ! ( __sFILE ) , "::" , stringify ! ( _w ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __sFILE > ( ) ) ) . _flags as * const _ as usize } , 16usize , concat ! ( "Offset of field: " , stringify ! ( __sFILE ) , "::" , stringify ! ( _flags ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __sFILE > ( ) ) ) . _file as * const _ as usize } , 18usize , concat ! ( "Offset of field: " , stringify ! ( __sFILE ) , "::" , stringify ! ( _file ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __sFILE > ( ) ) ) . _bf as * const _ as usize } , 24usize , concat ! ( "Offset of field: " , stringify ! ( __sFILE ) , "::" , stringify ! ( _bf ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __sFILE > ( ) ) ) . _lbfsize as * const _ as usize } , 40usize , concat ! ( "Offset of field: " , stringify ! ( __sFILE ) , "::" , stringify ! ( _lbfsize ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __sFILE > ( ) ) ) . _cookie as * const _ as usize } , 48usize , concat ! ( "Offset of field: " , stringify ! ( __sFILE ) , "::" , stringify ! ( _cookie ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __sFILE > ( ) ) ) . _close as * const _ as usize } , 56usize , concat ! ( "Offset of field: " , stringify ! ( __sFILE ) , "::" , stringify ! ( _close ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __sFILE > ( ) ) ) . _read as * const _ as usize } , 64usize , concat ! ( "Offset of field: " , stringify ! ( __sFILE ) , "::" , stringify ! ( _read ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __sFILE > ( ) ) ) . _seek as * const _ as usize } , 72usize , concat ! ( "Offset of field: " , stringify ! ( __sFILE ) , "::" , stringify ! ( _seek ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __sFILE > ( ) ) ) . _write as * const _ as usize } , 80usize , concat ! ( "Offset of field: " , stringify ! ( __sFILE ) , "::" , stringify ! ( _write ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __sFILE > ( ) ) ) . _ub as * const _ as usize } , 88usize , concat ! ( "Offset of field: " , stringify ! ( __sFILE ) , "::" , stringify ! ( _ub ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __sFILE > ( ) ) ) . _extra as * const _ as usize } , 104usize , concat ! ( "Offset of field: " , stringify ! ( __sFILE ) , "::" , stringify ! ( _extra ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __sFILE > ( ) ) ) . _ur as * const _ as usize } , 112usize , concat ! ( "Offset of field: " , stringify ! ( __sFILE ) , "::" , stringify ! ( _ur ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __sFILE > ( ) ) ) . _ubuf as * const _ as usize } , 116usize , concat ! ( "Offset of field: " , stringify ! ( __sFILE ) , "::" , stringify ! ( _ubuf ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __sFILE > ( ) ) ) . _nbuf as * const _ as usize } , 119usize , concat ! ( "Offset of field: " , stringify ! ( __sFILE ) , "::" , stringify ! ( _nbuf ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __sFILE > ( ) ) ) . _lb as * const _ as usize } , 120usize , concat ! ( "Offset of field: " , stringify ! ( __sFILE ) , "::" , stringify ! ( _lb ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __sFILE > ( ) ) ) . _blksize as * const _ as usize } , 136usize , concat ! ( "Offset of field: " , stringify ! ( __sFILE ) , "::" , stringify ! ( _blksize ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __sFILE > ( ) ) ) . _offset as * const _ as usize } , 144usize , concat ! ( "Offset of field: " , stringify ! ( __sFILE ) , "::" , stringify ! ( _offset ) ) ) ; } pub type FILE = __sFILE ; extern "C" { pub static mut __stdinp : * mut FILE ; } extern "C" { pub static mut __stdoutp : * mut FILE ; } extern "C" { pub static mut __stderrp : * mut FILE ; } extern "C" { pub fn clearerr ( arg1 : * mut FILE ) ; } extern "C" { pub fn fclose ( arg1 : * mut FILE ) -> libc :: c_int ; } extern "C" { pub fn feof ( arg1 : * mut FILE ) -> libc :: c_int ; } extern "C" { pub fn ferror ( arg1 : * mut FILE ) -> libc :: c_int ; } extern "C" { pub fn fflush ( arg1 : * mut FILE ) -> libc :: c_int ; } extern "C" { pub fn fgetc ( arg1 : * mut FILE ) -> libc :: c_int ; } extern "C" { pub fn fgetpos ( arg1 : * mut FILE , arg2 : * mut fpos_t ) -> libc :: c_int ; } extern "C" { pub fn fgets ( arg1 : * mut libc :: c_char , arg2 : libc :: c_int , arg3 : * mut FILE ) -> * mut libc :: c_char ; } extern "C" { pub fn fopen ( __filename : * const libc :: c_char , __mode : * const libc :: c_char ) -> * mut FILE ; } extern "C" { pub fn fprintf ( arg1 : * mut FILE , arg2 : * const libc :: c_char , ... ) -> libc :: c_int ; } extern "C" { pub fn fputc ( arg1 : libc :: c_int , arg2 : * mut FILE ) -> libc :: c_int ; } extern "C" { pub fn fputs ( arg1 : * const libc :: c_char , arg2 : * mut FILE ) -> libc :: c_int ; } extern "C" { pub fn fread ( __ptr : * mut libc :: c_void , __size : libc :: c_ulong , __nitems : libc :: c_ulong , __stream : * mut FILE ) -> libc :: c_ulong ; } extern "C" { pub fn freopen ( arg1 : * const libc :: c_char , arg2 : * const libc :: c_char , arg3 : * mut FILE ) -> * mut FILE ; } extern "C" { pub fn fscanf ( arg1 : * mut FILE , arg2 : * const libc :: c_char , ... ) -> libc :: c_int ; } extern "C" { pub fn fseek ( arg1 : * mut FILE , arg2 : libc :: c_long , arg3 : libc :: c_int ) -> libc :: c_int ; } extern "C" { pub fn fsetpos ( arg1 : * mut FILE , arg2 : * const fpos_t ) -> libc :: c_int ; } extern "C" { pub fn ftell ( arg1 : * mut FILE ) -> libc :: c_long ; } extern "C" { pub fn fwrite ( __ptr : * const libc :: c_void , __size : libc :: c_ulong , __nitems : libc :: c_ulong , __stream : * mut FILE ) -> libc :: c_ulong ; } extern "C" { pub fn getc ( arg1 : * mut FILE ) -> libc :: c_int ; } extern "C" { pub fn getchar ( ) -> libc :: c_int ; } extern "C" { pub fn gets ( arg1 : * mut libc :: c_char ) -> * mut libc :: c_char ; } extern "C" { pub fn perror ( arg1 : * const libc :: c_char ) ; } extern "C" { pub fn printf ( arg1 : * const libc :: c_char , ... ) -> libc :: c_int ; } extern "C" { pub fn putc ( arg1 : libc :: c_int , arg2 : * mut FILE ) -> libc :: c_int ; } extern "C" { pub fn putchar ( arg1 : libc :: c_int ) -> libc :: c_int ; } extern "C" { pub fn puts ( arg1 : * const libc :: c_char ) -> libc :: c_int ; } extern "C" { pub fn remove ( arg1 : * const libc :: c_char ) -> libc :: c_int ; } extern "C" { pub fn rename ( __old : * const libc :: c_char , __new : * const libc :: c_char ) -> libc :: c_int ; } extern "C" { pub fn rewind ( arg1 : * mut FILE ) ; } extern "C" { pub fn scanf ( arg1 : * const libc :: c_char , ... ) -> libc :: c_int ; } extern "C" { pub fn setbuf ( arg1 : * mut FILE , arg2 : * mut libc :: c_char ) ; } extern "C" { pub fn setvbuf ( arg1 : * mut FILE , arg2 : * mut libc :: c_char , arg3 : libc :: c_int , arg4 : usize ) -> libc :: c_int ; } extern "C" { pub fn sprintf ( arg1 : * mut libc :: c_char , arg2 : * const libc :: c_char , ... ) -> libc :: c_int ; } extern "C" { pub fn sscanf ( arg1 : * const libc :: c_char , arg2 : * const libc :: c_char , ... ) -> libc :: c_int ; } extern "C" { pub fn tmpfile ( ) -> * mut FILE ; } extern "C" { pub fn tmpnam ( arg1 : * mut libc :: c_char ) -> * mut libc :: c_char ; } extern "C" { pub fn ungetc ( arg1 : libc :: c_int , arg2 : * mut FILE ) -> libc :: c_int ; } extern "C" { pub fn vfprintf ( arg1 : * mut FILE , arg2 : * const libc :: c_char , arg3 : * mut __va_list_tag ) -> libc :: c_int ; } extern "C" { pub fn vprintf ( arg1 : * const libc :: c_char , arg2 : * mut __va_list_tag ) -> libc :: c_int ; } extern "C" { pub fn vsprintf ( arg1 : * mut libc :: c_char , arg2 : * const libc :: c_char , arg3 : * mut __va_list_tag ) -> libc :: c_int ; } extern "C" { pub fn ctermid ( arg1 : * mut libc :: c_char ) -> * mut libc :: c_char ; } extern "C" { pub fn fdopen ( arg1 : libc :: c_int , arg2 : * const libc :: c_char ) -> * mut FILE ; } extern "C" { pub fn fileno ( arg1 : * mut FILE ) -> libc :: c_int ; } extern "C" { pub fn pclose ( arg1 : * mut FILE ) -> libc :: c_int ; } extern "C" { pub fn popen ( arg1 : * const libc :: c_char , arg2 : * const libc :: c_char ) -> * mut FILE ; } extern "C" { pub fn __srget ( arg1 : * mut FILE ) -> libc :: c_int ; } extern "C" { pub fn __svfscanf ( arg1 : * mut FILE , arg2 : * const libc :: c_char , arg3 : * mut __va_list_tag ) -> libc :: c_int ; } extern "C" { pub fn __swbuf ( arg1 : libc :: c_int , arg2 : * mut FILE ) -> libc :: c_int ; } extern "C" { pub fn flockfile ( arg1 : * mut FILE ) ; } extern "C" { pub fn ftrylockfile ( arg1 : * mut FILE ) -> libc :: c_int ; } extern "C" { pub fn funlockfile ( arg1 : * mut FILE ) ; } extern "C" { pub fn getc_unlocked ( arg1 : * mut FILE ) -> libc :: c_int ; } extern "C" { pub fn getchar_unlocked ( ) -> libc :: c_int ; } extern "C" { pub fn putc_unlocked ( arg1 : libc :: c_int , arg2 : * mut FILE ) -> libc :: c_int ; } extern "C" { pub fn putchar_unlocked ( arg1 : libc :: c_int ) -> libc :: c_int ; } extern "C" { pub fn getw ( arg1 : * mut FILE ) -> libc :: c_int ; } extern "C" { pub fn putw ( arg1 : libc :: c_int , arg2 : * mut FILE ) -> libc :: c_int ; } extern "C" { pub fn tempnam ( __dir : * const libc :: c_char , __prefix : * const libc :: c_char ) -> * mut libc :: c_char ; } pub type off_t = __darwin_off_t ; extern "C" { pub fn fseeko ( __stream : * mut FILE , __offset : off_t , __whence : libc :: c_int ) -> libc :: c_int ; } extern "C" { pub fn ftello ( __stream : * mut FILE ) -> off_t ; } extern "C" { pub fn snprintf ( __str : * mut libc :: c_char , __size : libc :: c_ulong , __format : * const libc :: c_char , ... ) -> libc :: c_int ; } extern "C" { pub fn vfscanf ( __stream : * mut FILE , __format : * const libc :: c_char , arg1 : * mut __va_list_tag ) -> libc :: c_int ; } extern "C" { pub fn vscanf ( __format : * const libc :: c_char , arg1 : * mut __va_list_tag ) -> libc :: c_int ; } extern "C" { pub fn vsnprintf ( __str : * mut libc :: c_char , __size : libc :: c_ulong , __format : * const libc :: c_char , arg1 : * mut __va_list_tag ) -> libc :: c_int ; } extern "C" { pub fn vsscanf ( __str : * const libc :: c_char , __format : * const libc :: c_char , arg1 : * mut __va_list_tag ) -> libc :: c_int ; } extern "C" { pub fn dprintf ( arg1 : libc :: c_int , arg2 : * const libc :: c_char , ... ) -> libc :: c_int ; } extern "C" { pub fn vdprintf ( arg1 : libc :: c_int , arg2 : * const libc :: c_char , arg3 : * mut __va_list_tag ) -> libc :: c_int ; } extern "C" { pub fn getdelim ( __linep : * mut * mut libc :: c_char , __linecapp : * mut usize , __delimiter : libc :: c_int , __stream : * mut FILE ) -> isize ; } extern "C" { pub fn getline ( __linep : * mut * mut libc :: c_char , __linecapp : * mut usize , __stream : * mut FILE ) -> isize ; } extern "C" { pub fn fmemopen ( __buf : * mut libc :: c_void , __size : usize , __mode : * const libc :: c_char ) -> * mut FILE ; } extern "C" { pub fn open_memstream ( __bufp : * mut * mut libc :: c_char , __sizep : * mut usize ) -> * mut FILE ; } extern "C" { pub static sys_nerr : libc :: c_int ; } extern "C" { pub static mut sys_errlist : [ * const libc :: c_char ; 0usize ] ; } extern "C" { pub fn asprintf ( arg1 : * mut * mut libc :: c_char , arg2 : * const libc :: c_char , ... ) -> libc :: c_int ; } extern "C" { pub fn ctermid_r ( arg1 : * mut libc :: c_char ) -> * mut libc :: c_char ; } extern "C" { pub fn fgetln ( arg1 : * mut FILE , arg2 : * mut usize ) -> * mut libc :: c_char ; } extern "C" { pub fn fmtcheck ( arg1 : * const libc :: c_char , arg2 : * const libc :: c_char ) -> * const libc :: c_char ; } extern "C" { pub fn fpurge ( arg1 : * mut FILE ) -> libc :: c_int ; } extern "C" { pub fn setbuffer ( arg1 : * mut FILE , arg2 : * mut libc :: c_char , arg3 : libc :: c_int ) ; } extern "C" { pub fn setlinebuf ( arg1 : * mut FILE ) -> libc :: c_int ; } extern "C" { pub fn vasprintf ( arg1 : * mut * mut libc :: c_char , arg2 : * const libc :: c_char , arg3 : * mut __va_list_tag ) -> libc :: c_int ; } extern "C" { pub fn zopen ( arg1 : * const libc :: c_char , arg2 : * const libc :: c_char , arg3 : libc :: c_int ) -> * mut FILE ; } extern "C" { pub fn funopen ( arg1 : * const libc :: c_void , arg2 : :: core :: option :: Option < unsafe extern "C" fn ( arg1 : * mut libc :: c_void , arg2 : * mut libc :: c_char , arg3 : libc :: c_int ) -> libc :: c_int > , arg3 : :: core :: option :: Option < unsafe extern "C" fn ( arg1 : * mut libc :: c_void , arg2 : * const libc :: c_char , arg3 : libc :: c_int ) -> libc :: c_int > , arg4 : :: core :: option :: Option < unsafe extern "C" fn ( arg1 : * mut libc :: c_void , arg2 : fpos_t , arg3 : libc :: c_int ) -> fpos_t > , arg5 : :: core :: option :: Option < unsafe extern "C" fn ( arg1 : * mut libc :: c_void ) -> libc :: c_int > ) -> * mut FILE ; } extern "C" { pub fn __sprintf_chk ( arg1 : * mut libc :: c_char , arg2 : libc :: c_int , arg3 : usize , arg4 : * const libc :: c_char , ... ) -> libc :: c_int ; } extern "C" { pub fn __snprintf_chk ( arg1 : * mut libc :: c_char , arg2 : usize , arg3 : libc :: c_int , arg4 : usize , arg5 : * const libc :: c_char , ... ) -> libc :: c_int ; } extern "C" { pub fn __vsprintf_chk ( arg1 : * mut libc :: c_char , arg2 : libc :: c_int , arg3 : usize , arg4 : * const libc :: c_char , arg5 : * mut __va_list_tag ) -> libc :: c_int ; } extern "C" { pub fn __vsnprintf_chk ( arg1 : * mut libc :: c_char , arg2 : usize , arg3 : libc :: c_int , arg4 : usize , arg5 : * const libc :: c_char , arg6 : * mut __va_list_tag ) -> libc :: c_int ; } extern "C" { pub fn memchr ( __s : * const libc :: c_void , __c : libc :: c_int , __n : libc :: c_ulong ) -> * mut libc :: c_void ; } extern "C" { pub fn memcmp ( __s1 : * const libc :: c_void , __s2 : * const libc :: c_void , __n : libc :: c_ulong ) -> libc :: c_int ; } extern "C" { pub fn memcpy ( __dst : * mut libc :: c_void , __src : * const libc :: c_void , __n : libc :: c_ulong ) -> * mut libc :: c_void ; } extern "C" { pub fn memmove ( __dst : * mut libc :: c_void , __src : * const libc :: c_void , __len : libc :: c_ulong ) -> * mut libc :: c_void ; } extern "C" { pub fn memset ( __b : * mut libc :: c_void , __c : libc :: c_int , __len : libc :: c_ulong ) -> * mut libc :: c_void ; } extern "C" { pub fn strcat ( __s1 : * mut libc :: c_char , __s2 : * const libc :: c_char ) -> * mut libc :: c_char ; } extern "C" { pub fn strchr ( __s : * const libc :: c_char , __c : libc :: c_int ) -> * mut libc :: c_char ; } extern "C" { pub fn strcmp ( __s1 : * const libc :: c_char , __s2 : * const libc :: c_char ) -> libc :: c_int ; } extern "C" { pub fn strcoll ( __s1 : * const libc :: c_char , __s2 : * const libc :: c_char ) -> libc :: c_int ; } extern "C" { pub fn strcpy ( __dst : * mut libc :: c_char , __src : * const libc :: c_char ) -> * mut libc :: c_char ; } extern "C" { pub fn strcspn ( __s : * const libc :: c_char , __charset : * const libc :: c_char ) -> libc :: c_ulong ; } extern "C" { pub fn strerror ( __errnum : libc :: c_int ) -> * mut libc :: c_char ; } extern "C" { pub fn strlen ( __s : * const libc :: c_char ) -> libc :: c_ulong ; } extern "C" { pub fn strncat ( __s1 : * mut libc :: c_char , __s2 : * const libc :: c_char , __n : libc :: c_ulong ) -> * mut libc :: c_char ; } extern "C" { pub fn strncmp ( __s1 : * const libc :: c_char , __s2 : * const libc :: c_char , __n : libc :: c_ulong ) -> libc :: c_int ; } extern "C" { pub fn strncpy ( __dst : * mut libc :: c_char , __src : * const libc :: c_char , __n : libc :: c_ulong ) -> * mut libc :: c_char ; } extern "C" { pub fn strpbrk ( __s : * const libc :: c_char , __charset : * const libc :: c_char ) -> * mut libc :: c_char ; } extern "C" { pub fn strrchr ( __s : * const libc :: c_char , __c : libc :: c_int ) -> * mut libc :: c_char ; } extern "C" { pub fn strspn ( __s : * const libc :: c_char , __charset : * const libc :: c_char ) -> libc :: c_ulong ; } extern "C" { pub fn strstr ( __big : * const libc :: c_char , __little : * const libc :: c_char ) -> * mut libc :: c_char ; } extern "C" { pub fn strtok ( __str : * mut libc :: c_char , __sep : * const libc :: c_char ) -> * mut libc :: c_char ; } extern "C" { pub fn strxfrm ( __s1 : * mut libc :: c_char , __s2 : * const libc :: c_char , __n : libc :: c_ulong ) -> libc :: c_ulong ; } extern "C" { pub fn strtok_r ( __str : * mut libc :: c_char , __sep : * const libc :: c_char , __lasts : * mut * mut libc :: c_char ) -> * mut libc :: c_char ; } extern "C" { pub fn strerror_r ( __errnum : libc :: c_int , __strerrbuf : * mut libc :: c_char , __buflen : usize ) -> libc :: c_int ; } extern "C" { pub fn strdup ( __s1 : * const libc :: c_char ) -> * mut libc :: c_char ; } extern "C" { pub fn memccpy ( __dst : * mut libc :: c_void , __src : * const libc :: c_void , __c : libc :: c_int , __n : usize ) -> * mut libc :: c_void ; } extern "C" { pub fn stpcpy ( __dst : * mut libc :: c_char , __src : * const libc :: c_char ) -> * mut libc :: c_char ; } extern "C" { pub fn stpncpy ( __dst : * mut libc :: c_char , __src : * const libc :: c_char , __n : libc :: c_ulong ) -> * mut libc :: c_char ; } extern "C" { pub fn strndup ( __s1 : * const libc :: c_char , __n : libc :: c_ulong ) -> * mut libc :: c_char ; } extern "C" { pub fn strnlen ( __s1 : * const libc :: c_char , __n : usize ) -> usize ; } extern "C" { pub fn strsignal ( __sig : libc :: c_int ) -> * mut libc :: c_char ; } pub type rsize_t = __darwin_size_t ; pub type errno_t = libc :: c_int ; extern "C" { pub fn memset_s ( __s : * mut libc :: c_void , __smax : rsize_t , __c : libc :: c_int , __n : rsize_t ) -> errno_t ; } extern "C" { pub fn memmem ( __big : * const libc :: c_void , __big_len : usize , __little : * const libc :: c_void , __little_len : usize ) -> * mut libc :: c_void ; } extern "C" { pub fn memset_pattern4 ( __b : * mut libc :: c_void , __pattern4 : * const libc :: c_void , __len : usize ) ; } extern "C" { pub fn memset_pattern8 ( __b : * mut libc :: c_void , __pattern8 : * const libc :: c_void , __len : usize ) ; } extern "C" { pub fn memset_pattern16 ( __b : * mut libc :: c_void , __pattern16 : * const libc :: c_void , __len : usize ) ; } extern "C" { pub fn strcasestr ( __big : * const libc :: c_char , __little : * const libc :: c_char ) -> * mut libc :: c_char ; } extern "C" { pub fn strnstr ( __big : * const libc :: c_char , __little : * const libc :: c_char , __len : usize ) -> * mut libc :: c_char ; } extern "C" { pub fn strlcat ( __dst : * mut libc :: c_char , __source : * const libc :: c_char , __size : libc :: c_ulong ) -> libc :: c_ulong ; } extern "C" { pub fn strlcpy ( __dst : * mut libc :: c_char , __source : * const libc :: c_char , __size : libc :: c_ulong ) -> libc :: c_ulong ; } extern "C" { pub fn strmode ( __mode : libc :: c_int , __bp : * mut libc :: c_char ) ; } extern "C" { pub fn strsep ( __stringp : * mut * mut libc :: c_char , __delim : * const libc :: c_char ) -> * mut libc :: c_char ; } extern "C" { pub fn swab ( arg1 : * const libc :: c_void , arg2 : * mut libc :: c_void , arg3 : isize ) ; } extern "C" { pub fn timingsafe_bcmp ( __b1 : * const libc :: c_void , __b2 : * const libc :: c_void , __len : usize ) -> libc :: c_int ; } extern "C" { pub fn bcmp ( arg1 : * const libc :: c_void , arg2 : * const libc :: c_void , arg3 : libc :: c_ulong ) -> libc :: c_int ; } extern "C" { pub fn bcopy ( arg1 : * const libc :: c_void , arg2 : * mut libc :: c_void , arg3 : usize ) ; } extern "C" { pub fn bzero ( arg1 : * mut libc :: c_void , arg2 : libc :: c_ulong ) ; } extern "C" { pub fn index ( arg1 : * const libc :: c_char , arg2 : libc :: c_int ) -> * mut libc :: c_char ; } extern "C" { pub fn rindex ( arg1 : * const libc :: c_char , arg2 : libc :: c_int ) -> * mut libc :: c_char ; } extern "C" { pub fn ffs ( arg1 : libc :: c_int ) -> libc :: c_int ; } extern "C" { pub fn strcasecmp ( arg1 : * const libc :: c_char , arg2 : * const libc :: c_char ) -> libc :: c_int ; } extern "C" { pub fn strncasecmp ( arg1 : * const libc :: c_char , arg2 : * const libc :: c_char , arg3 : libc :: c_ulong ) -> libc :: c_int ; } extern "C" { pub fn ffsl ( arg1 : libc :: c_long ) -> libc :: c_int ; } extern "C" { pub fn ffsll ( arg1 : libc :: c_longlong ) -> libc :: c_int ; } extern "C" { pub fn fls ( arg1 : libc :: c_int ) -> libc :: c_int ; } extern "C" { pub fn flsl ( arg1 : libc :: c_long ) -> libc :: c_int ; } extern "C" { pub fn flsll ( arg1 : libc :: c_longlong ) -> libc :: c_int ; } pub type clock_t = __darwin_clock_t ; pub type time_t = __darwin_time_t ; # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct timespec { pub tv_sec : __darwin_time_t , pub tv_nsec : libc :: c_long , } # [ test ] fn bindgen_test_layout_timespec ( ) { assert_eq ! ( :: core :: mem :: size_of :: < timespec > ( ) , 16usize , concat ! ( "Size of: " , stringify ! ( timespec ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < timespec > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( timespec ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < timespec > ( ) ) ) . tv_sec as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( timespec ) , "::" , stringify ! ( tv_sec ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < timespec > ( ) ) ) . tv_nsec as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( timespec ) , "::" , stringify ! ( tv_nsec ) ) ) ; } # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct tm { pub tm_sec : libc :: c_int , pub tm_min : libc :: c_int , pub tm_hour : libc :: c_int , pub tm_mday : libc :: c_int , pub tm_mon : libc :: c_int , pub tm_year : libc :: c_int , pub tm_wday : libc :: c_int , pub tm_yday : libc :: c_int , pub tm_isdst : libc :: c_int , pub tm_gmtoff : libc :: c_long , pub tm_zone : * mut libc :: c_char , } # [ test ] fn bindgen_test_layout_tm ( ) { assert_eq ! ( :: core :: mem :: size_of :: < tm > ( ) , 56usize , concat ! ( "Size of: " , stringify ! ( tm ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < tm > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( tm ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < tm > ( ) ) ) . tm_sec as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( tm ) , "::" , stringify ! ( tm_sec ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < tm > ( ) ) ) . tm_min as * const _ as usize } , 4usize , concat ! ( "Offset of field: " , stringify ! ( tm ) , "::" , stringify ! ( tm_min ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < tm > ( ) ) ) . tm_hour as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( tm ) , "::" , stringify ! ( tm_hour ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < tm > ( ) ) ) . tm_mday as * const _ as usize } , 12usize , concat ! ( "Offset of field: " , stringify ! ( tm ) , "::" , stringify ! ( tm_mday ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < tm > ( ) ) ) . tm_mon as * const _ as usize } , 16usize , concat ! ( "Offset of field: " , stringify ! ( tm ) , "::" , stringify ! ( tm_mon ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < tm > ( ) ) ) . tm_year as * const _ as usize } , 20usize , concat ! ( "Offset of field: " , stringify ! ( tm ) , "::" , stringify ! ( tm_year ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < tm > ( ) ) ) . tm_wday as * const _ as usize } , 24usize , concat ! ( "Offset of field: " , stringify ! ( tm ) , "::" , stringify ! ( tm_wday ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < tm > ( ) ) ) . tm_yday as * const _ as usize } , 28usize , concat ! ( "Offset of field: " , stringify ! ( tm ) , "::" , stringify ! ( tm_yday ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < tm > ( ) ) ) . tm_isdst as * const _ as usize } , 32usize , concat ! ( "Offset of field: " , stringify ! ( tm ) , "::" , stringify ! ( tm_isdst ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < tm > ( ) ) ) . tm_gmtoff as * const _ as usize } , 40usize , concat ! ( "Offset of field: " , stringify ! ( tm ) , "::" , stringify ! ( tm_gmtoff ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < tm > ( ) ) ) . tm_zone as * const _ as usize } , 48usize , concat ! ( "Offset of field: " , stringify ! ( tm ) , "::" , stringify ! ( tm_zone ) ) ) ; } extern "C" { pub static mut tzname : [ * mut libc :: c_char ; 0usize ] ; } extern "C" { pub static mut getdate_err : libc :: c_int ; } extern "C" { pub static mut timezone : libc :: c_long ; } extern "C" { pub static mut daylight : libc :: c_int ; } extern "C" { pub fn asctime ( arg1 : * const tm ) -> * mut libc :: c_char ; } extern "C" { pub fn clock ( ) -> clock_t ; } extern "C" { pub fn ctime ( arg1 : * const time_t ) -> * mut libc :: c_char ; } extern "C" { pub fn difftime ( arg1 : time_t , arg2 : time_t ) -> f64 ; } extern "C" { pub fn getdate ( arg1 : * const libc :: c_char ) -> * mut tm ; } extern "C" { pub fn gmtime ( arg1 : * const time_t ) -> * mut tm ; } extern "C" { pub fn localtime ( arg1 : * const time_t ) -> * mut tm ; } extern "C" { pub fn mktime ( arg1 : * mut tm ) -> time_t ; } extern "C" { pub fn strftime ( arg1 : * mut libc :: c_char , arg2 : usize , arg3 : * const libc :: c_char , arg4 : * const tm ) -> usize ; } extern "C" { pub fn strptime ( arg1 : * const libc :: c_char , arg2 : * const libc :: c_char , arg3 : * mut tm ) -> * mut libc :: c_char ; } extern "C" { pub fn time ( arg1 : * mut time_t ) -> time_t ; } extern "C" { pub fn tzset ( ) ; } extern "C" { pub fn asctime_r ( arg1 : * const tm , arg2 : * mut libc :: c_char ) -> * mut libc :: c_char ; } extern "C" { pub fn ctime_r ( arg1 : * const time_t , arg2 : * mut libc :: c_char ) -> * mut libc :: c_char ; } extern "C" { pub fn gmtime_r ( arg1 : * const time_t , arg2 : * mut tm ) -> * mut tm ; } extern "C" { pub fn localtime_r ( arg1 : * const time_t , arg2 : * mut tm ) -> * mut tm ; } extern "C" { pub fn posix2time ( arg1 : time_t ) -> time_t ; } extern "C" { pub fn tzsetwall ( ) ; } extern "C" { pub fn time2posix ( arg1 : time_t ) -> time_t ; } extern "C" { pub fn timelocal ( arg1 : * mut tm ) -> time_t ; } extern "C" { pub fn timegm ( arg1 : * mut tm ) -> time_t ; } extern "C" { pub fn nanosleep ( __rqtp : * const timespec , __rmtp : * mut timespec ) -> libc :: c_int ; } # [ repr ( u32 ) ] # [ derive ( Debug , Copy , Clone , PartialEq , Eq , Hash ) ] pub enum clockid_t { _CLOCK_REALTIME = 0 , _CLOCK_MONOTONIC = 6 , _CLOCK_MONOTONIC_RAW = 4 , _CLOCK_MONOTONIC_RAW_APPROX = 5 , _CLOCK_UPTIME_RAW = 8 , _CLOCK_UPTIME_RAW_APPROX = 9 , _CLOCK_PROCESS_CPUTIME_ID = 12 , _CLOCK_THREAD_CPUTIME_ID = 16 , } extern "C" { pub fn clock_getres ( __clock_id : clockid_t , __res : * mut timespec ) -> libc :: c_int ; } extern "C" { pub fn clock_gettime ( __clock_id : clockid_t , __tp : * mut timespec ) -> libc :: c_int ; } extern "C" { pub fn clock_gettime_nsec_np ( __clock_id : clockid_t ) -> __uint64_t ; } extern "C" { pub fn clock_settime ( __clock_id : clockid_t , __tp : * const timespec ) -> libc :: c_int ; } extern "C" { pub fn timespec_get ( ts : * mut timespec , base : libc :: c_int ) -> libc :: c_int ; } extern "C" { pub fn alloca ( arg1 : libc :: c_ulong ) -> * mut libc :: c_void ; } extern "C" { pub fn _malloc_ ( size : usize , file : * mut libc :: c_char , func : * const libc :: c_char , line : libc :: c_int ) -> * mut libc :: c_void ; } extern "C" { pub fn _realloc_ ( ptr : * mut libc :: c_void , size : usize , oldsize : usize , file : * mut libc :: c_char , func : * const libc :: c_char , line : libc :: c_int ) -> * mut libc :: c_void ; } extern "C" { pub fn _calloc_ ( n : usize , size : usize , file : * mut libc :: c_char , func : * const libc :: c_char , line : libc :: c_int ) -> * mut libc :: c_void ; } extern "C" { pub fn _free_ ( ptr : * mut libc :: c_void ) ; } # [ repr ( u32 ) ] # [ derive ( Debug , Copy , Clone , PartialEq , Eq , Hash ) ] pub enum idtype_t { P_ALL = 0 , P_PID = 1 , P_PGID = 2 , } pub type pid_t = __darwin_pid_t ; pub type id_t = __darwin_id_t ; pub type sig_atomic_t = libc :: c_int ; # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct __darwin_i386_thread_state { pub __eax : libc :: c_uint , pub __ebx : libc :: c_uint , pub __ecx : libc :: c_uint , pub __edx : libc :: c_uint , pub __edi : libc :: c_uint , pub __esi : libc :: c_uint , pub __ebp : libc :: c_uint , pub __esp : libc :: c_uint , pub __ss : libc :: c_uint , pub __eflags : libc :: c_uint , pub __eip : libc :: c_uint , pub __cs : libc :: c_uint , pub __ds : libc :: c_uint , pub __es : libc :: c_uint , pub __fs : libc :: c_uint , pub __gs : libc :: c_uint , } # [ test ] fn bindgen_test_layout___darwin_i386_thread_state ( ) { assert_eq ! ( :: core :: mem :: size_of :: < __darwin_i386_thread_state > ( ) , 64usize , concat ! ( "Size of: " , stringify ! ( __darwin_i386_thread_state ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < __darwin_i386_thread_state > ( ) , 4usize , concat ! ( "Alignment of " , stringify ! ( __darwin_i386_thread_state ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_thread_state > ( ) ) ) . __eax as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_thread_state ) , "::" , stringify ! ( __eax ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_thread_state > ( ) ) ) . __ebx as * const _ as usize } , 4usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_thread_state ) , "::" , stringify ! ( __ebx ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_thread_state > ( ) ) ) . __ecx as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_thread_state ) , "::" , stringify ! ( __ecx ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_thread_state > ( ) ) ) . __edx as * const _ as usize } , 12usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_thread_state ) , "::" , stringify ! ( __edx ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_thread_state > ( ) ) ) . __edi as * const _ as usize } , 16usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_thread_state ) , "::" , stringify ! ( __edi ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_thread_state > ( ) ) ) . __esi as * const _ as usize } , 20usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_thread_state ) , "::" , stringify ! ( __esi ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_thread_state > ( ) ) ) . __ebp as * const _ as usize } , 24usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_thread_state ) , "::" , stringify ! ( __ebp ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_thread_state > ( ) ) ) . __esp as * const _ as usize } , 28usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_thread_state ) , "::" , stringify ! ( __esp ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_thread_state > ( ) ) ) . __ss as * const _ as usize } , 32usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_thread_state ) , "::" , stringify ! ( __ss ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_thread_state > ( ) ) ) . __eflags as * const _ as usize } , 36usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_thread_state ) , "::" , stringify ! ( __eflags ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_thread_state > ( ) ) ) . __eip as * const _ as usize } , 40usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_thread_state ) , "::" , stringify ! ( __eip ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_thread_state > ( ) ) ) . __cs as * const _ as usize } , 44usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_thread_state ) , "::" , stringify ! ( __cs ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_thread_state > ( ) ) ) . __ds as * const _ as usize } , 48usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_thread_state ) , "::" , stringify ! ( __ds ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_thread_state > ( ) ) ) . __es as * const _ as usize } , 52usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_thread_state ) , "::" , stringify ! ( __es ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_thread_state > ( ) ) ) . __fs as * const _ as usize } , 56usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_thread_state ) , "::" , stringify ! ( __fs ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_thread_state > ( ) ) ) . __gs as * const _ as usize } , 60usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_thread_state ) , "::" , stringify ! ( __gs ) ) ) ; } # [ repr ( C ) ] # [ repr ( align ( 2 ) ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct __darwin_fp_control { pub _bitfield_1 : __BindgenBitfieldUnit < [ u8 ; 2usize ] , u8 > , } # [ test ] fn bindgen_test_layout___darwin_fp_control ( ) { assert_eq ! ( :: core :: mem :: size_of :: < __darwin_fp_control > ( ) , 2usize , concat ! ( "Size of: " , stringify ! ( __darwin_fp_control ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < __darwin_fp_control > ( ) , 2usize , concat ! ( "Alignment of " , stringify ! ( __darwin_fp_control ) ) ) ; } impl __darwin_fp_control { # [ inline ] pub fn __invalid ( & self ) -> libc :: c_ushort { unsafe { :: core :: mem :: transmute ( self . _bitfield_1 . get ( 0usize , 1u8 ) as u16 ) } } # [ inline ] pub fn set___invalid ( & mut self , val : libc :: c_ushort ) { unsafe { let val : u16 = :: core :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 0usize , 1u8 , val as u64 ) } } # [ inline ] pub fn __denorm ( & self ) -> libc :: c_ushort { unsafe { :: core :: mem :: transmute ( self . _bitfield_1 . get ( 1usize , 1u8 ) as u16 ) } } # [ inline ] pub fn set___denorm ( & mut self , val : libc :: c_ushort ) { unsafe { let val : u16 = :: core :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 1usize , 1u8 , val as u64 ) } } # [ inline ] pub fn __zdiv ( & self ) -> libc :: c_ushort { unsafe { :: core :: mem :: transmute ( self . _bitfield_1 . get ( 2usize , 1u8 ) as u16 ) } } # [ inline ] pub fn set___zdiv ( & mut self , val : libc :: c_ushort ) { unsafe { let val : u16 = :: core :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 2usize , 1u8 , val as u64 ) } } # [ inline ] pub fn __ovrfl ( & self ) -> libc :: c_ushort { unsafe { :: core :: mem :: transmute ( self . _bitfield_1 . get ( 3usize , 1u8 ) as u16 ) } } # [ inline ] pub fn set___ovrfl ( & mut self , val : libc :: c_ushort ) { unsafe { let val : u16 = :: core :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 3usize , 1u8 , val as u64 ) } } # [ inline ] pub fn __undfl ( & self ) -> libc :: c_ushort { unsafe { :: core :: mem :: transmute ( self . _bitfield_1 . get ( 4usize , 1u8 ) as u16 ) } } # [ inline ] pub fn set___undfl ( & mut self , val : libc :: c_ushort ) { unsafe { let val : u16 = :: core :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 4usize , 1u8 , val as u64 ) } } # [ inline ] pub fn __precis ( & self ) -> libc :: c_ushort { unsafe { :: core :: mem :: transmute ( self . _bitfield_1 . get ( 5usize , 1u8 ) as u16 ) } } # [ inline ] pub fn set___precis ( & mut self , val : libc :: c_ushort ) { unsafe { let val : u16 = :: core :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 5usize , 1u8 , val as u64 ) } } # [ inline ] pub fn __pc ( & self ) -> libc :: c_ushort { unsafe { :: core :: mem :: transmute ( self . _bitfield_1 . get ( 8usize , 2u8 ) as u16 ) } } # [ inline ] pub fn set___pc ( & mut self , val : libc :: c_ushort ) { unsafe { let val : u16 = :: core :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 8usize , 2u8 , val as u64 ) } } # [ inline ] pub fn __rc ( & self ) -> libc :: c_ushort { unsafe { :: core :: mem :: transmute ( self . _bitfield_1 . get ( 10usize , 2u8 ) as u16 ) } } # [ inline ] pub fn set___rc ( & mut self , val : libc :: c_ushort ) { unsafe { let val : u16 = :: core :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 10usize , 2u8 , val as u64 ) } } # [ inline ] pub fn new_bitfield_1 ( __invalid : libc :: c_ushort , __denorm : libc :: c_ushort , __zdiv : libc :: c_ushort , __ovrfl : libc :: c_ushort , __undfl : libc :: c_ushort , __precis : libc :: c_ushort , __pc : libc :: c_ushort , __rc : libc :: c_ushort ) -> __BindgenBitfieldUnit < [ u8 ; 2usize ] , u8 > { let mut __bindgen_bitfield_unit : __BindgenBitfieldUnit < [ u8 ; 2usize ] , u8 > = Default :: default ( ) ; __bindgen_bitfield_unit . set ( 0usize , 1u8 , { let __invalid : u16 = unsafe { :: core :: mem :: transmute ( __invalid ) } ; __invalid as u64 } ) ; __bindgen_bitfield_unit . set ( 1usize , 1u8 , { let __denorm : u16 = unsafe { :: core :: mem :: transmute ( __denorm ) } ; __denorm as u64 } ) ; __bindgen_bitfield_unit . set ( 2usize , 1u8 , { let __zdiv : u16 = unsafe { :: core :: mem :: transmute ( __zdiv ) } ; __zdiv as u64 } ) ; __bindgen_bitfield_unit . set ( 3usize , 1u8 , { let __ovrfl : u16 = unsafe { :: core :: mem :: transmute ( __ovrfl ) } ; __ovrfl as u64 } ) ; __bindgen_bitfield_unit . set ( 4usize , 1u8 , { let __undfl : u16 = unsafe { :: core :: mem :: transmute ( __undfl ) } ; __undfl as u64 } ) ; __bindgen_bitfield_unit . set ( 5usize , 1u8 , { let __precis : u16 = unsafe { :: core :: mem :: transmute ( __precis ) } ; __precis as u64 } ) ; __bindgen_bitfield_unit . set ( 8usize , 2u8 , { let __pc : u16 = unsafe { :: core :: mem :: transmute ( __pc ) } ; __pc as u64 } ) ; __bindgen_bitfield_unit . set ( 10usize , 2u8 , { let __rc : u16 = unsafe { :: core :: mem :: transmute ( __rc ) } ; __rc as u64 } ) ; __bindgen_bitfield_unit } } pub type __darwin_fp_control_t = __darwin_fp_control ; # [ repr ( C ) ] # [ repr ( align ( 2 ) ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct __darwin_fp_status { pub _bitfield_1 : __BindgenBitfieldUnit < [ u8 ; 2usize ] , u8 > , } # [ test ] fn bindgen_test_layout___darwin_fp_status ( ) { assert_eq ! ( :: core :: mem :: size_of :: < __darwin_fp_status > ( ) , 2usize , concat ! ( "Size of: " , stringify ! ( __darwin_fp_status ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < __darwin_fp_status > ( ) , 2usize , concat ! ( "Alignment of " , stringify ! ( __darwin_fp_status ) ) ) ; } impl __darwin_fp_status { # [ inline ] pub fn __invalid ( & self ) -> libc :: c_ushort { unsafe { :: core :: mem :: transmute ( self . _bitfield_1 . get ( 0usize , 1u8 ) as u16 ) } } # [ inline ] pub fn set___invalid ( & mut self , val : libc :: c_ushort ) { unsafe { let val : u16 = :: core :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 0usize , 1u8 , val as u64 ) } } # [ inline ] pub fn __denorm ( & self ) -> libc :: c_ushort { unsafe { :: core :: mem :: transmute ( self . _bitfield_1 . get ( 1usize , 1u8 ) as u16 ) } } # [ inline ] pub fn set___denorm ( & mut self , val : libc :: c_ushort ) { unsafe { let val : u16 = :: core :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 1usize , 1u8 , val as u64 ) } } # [ inline ] pub fn __zdiv ( & self ) -> libc :: c_ushort { unsafe { :: core :: mem :: transmute ( self . _bitfield_1 . get ( 2usize , 1u8 ) as u16 ) } } # [ inline ] pub fn set___zdiv ( & mut self , val : libc :: c_ushort ) { unsafe { let val : u16 = :: core :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 2usize , 1u8 , val as u64 ) } } # [ inline ] pub fn __ovrfl ( & self ) -> libc :: c_ushort { unsafe { :: core :: mem :: transmute ( self . _bitfield_1 . get ( 3usize , 1u8 ) as u16 ) } } # [ inline ] pub fn set___ovrfl ( & mut self , val : libc :: c_ushort ) { unsafe { let val : u16 = :: core :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 3usize , 1u8 , val as u64 ) } } # [ inline ] pub fn __undfl ( & self ) -> libc :: c_ushort { unsafe { :: core :: mem :: transmute ( self . _bitfield_1 . get ( 4usize , 1u8 ) as u16 ) } } # [ inline ] pub fn set___undfl ( & mut self , val : libc :: c_ushort ) { unsafe { let val : u16 = :: core :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 4usize , 1u8 , val as u64 ) } } # [ inline ] pub fn __precis ( & self ) -> libc :: c_ushort { unsafe { :: core :: mem :: transmute ( self . _bitfield_1 . get ( 5usize , 1u8 ) as u16 ) } } # [ inline ] pub fn set___precis ( & mut self , val : libc :: c_ushort ) { unsafe { let val : u16 = :: core :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 5usize , 1u8 , val as u64 ) } } # [ inline ] pub fn __stkflt ( & self ) -> libc :: c_ushort { unsafe { :: core :: mem :: transmute ( self . _bitfield_1 . get ( 6usize , 1u8 ) as u16 ) } } # [ inline ] pub fn set___stkflt ( & mut self , val : libc :: c_ushort ) { unsafe { let val : u16 = :: core :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 6usize , 1u8 , val as u64 ) } } # [ inline ] pub fn __errsumm ( & self ) -> libc :: c_ushort { unsafe { :: core :: mem :: transmute ( self . _bitfield_1 . get ( 7usize , 1u8 ) as u16 ) } } # [ inline ] pub fn set___errsumm ( & mut self , val : libc :: c_ushort ) { unsafe { let val : u16 = :: core :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 7usize , 1u8 , val as u64 ) } } # [ inline ] pub fn __c0 ( & self ) -> libc :: c_ushort { unsafe { :: core :: mem :: transmute ( self . _bitfield_1 . get ( 8usize , 1u8 ) as u16 ) } } # [ inline ] pub fn set___c0 ( & mut self , val : libc :: c_ushort ) { unsafe { let val : u16 = :: core :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 8usize , 1u8 , val as u64 ) } } # [ inline ] pub fn __c1 ( & self ) -> libc :: c_ushort { unsafe { :: core :: mem :: transmute ( self . _bitfield_1 . get ( 9usize , 1u8 ) as u16 ) } } # [ inline ] pub fn set___c1 ( & mut self , val : libc :: c_ushort ) { unsafe { let val : u16 = :: core :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 9usize , 1u8 , val as u64 ) } } # [ inline ] pub fn __c2 ( & self ) -> libc :: c_ushort { unsafe { :: core :: mem :: transmute ( self . _bitfield_1 . get ( 10usize , 1u8 ) as u16 ) } } # [ inline ] pub fn set___c2 ( & mut self , val : libc :: c_ushort ) { unsafe { let val : u16 = :: core :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 10usize , 1u8 , val as u64 ) } } # [ inline ] pub fn __tos ( & self ) -> libc :: c_ushort { unsafe { :: core :: mem :: transmute ( self . _bitfield_1 . get ( 11usize , 3u8 ) as u16 ) } } # [ inline ] pub fn set___tos ( & mut self , val : libc :: c_ushort ) { unsafe { let val : u16 = :: core :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 11usize , 3u8 , val as u64 ) } } # [ inline ] pub fn __c3 ( & self ) -> libc :: c_ushort { unsafe { :: core :: mem :: transmute ( self . _bitfield_1 . get ( 14usize , 1u8 ) as u16 ) } } # [ inline ] pub fn set___c3 ( & mut self , val : libc :: c_ushort ) { unsafe { let val : u16 = :: core :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 14usize , 1u8 , val as u64 ) } } # [ inline ] pub fn __busy ( & self ) -> libc :: c_ushort { unsafe { :: core :: mem :: transmute ( self . _bitfield_1 . get ( 15usize , 1u8 ) as u16 ) } } # [ inline ] pub fn set___busy ( & mut self , val : libc :: c_ushort ) { unsafe { let val : u16 = :: core :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 15usize , 1u8 , val as u64 ) } } # [ inline ] pub fn new_bitfield_1 ( __invalid : libc :: c_ushort , __denorm : libc :: c_ushort , __zdiv : libc :: c_ushort , __ovrfl : libc :: c_ushort , __undfl : libc :: c_ushort , __precis : libc :: c_ushort , __stkflt : libc :: c_ushort , __errsumm : libc :: c_ushort , __c0 : libc :: c_ushort , __c1 : libc :: c_ushort , __c2 : libc :: c_ushort , __tos : libc :: c_ushort , __c3 : libc :: c_ushort , __busy : libc :: c_ushort ) -> __BindgenBitfieldUnit < [ u8 ; 2usize ] , u8 > { let mut __bindgen_bitfield_unit : __BindgenBitfieldUnit < [ u8 ; 2usize ] , u8 > = Default :: default ( ) ; __bindgen_bitfield_unit . set ( 0usize , 1u8 , { let __invalid : u16 = unsafe { :: core :: mem :: transmute ( __invalid ) } ; __invalid as u64 } ) ; __bindgen_bitfield_unit . set ( 1usize , 1u8 , { let __denorm : u16 = unsafe { :: core :: mem :: transmute ( __denorm ) } ; __denorm as u64 } ) ; __bindgen_bitfield_unit . set ( 2usize , 1u8 , { let __zdiv : u16 = unsafe { :: core :: mem :: transmute ( __zdiv ) } ; __zdiv as u64 } ) ; __bindgen_bitfield_unit . set ( 3usize , 1u8 , { let __ovrfl : u16 = unsafe { :: core :: mem :: transmute ( __ovrfl ) } ; __ovrfl as u64 } ) ; __bindgen_bitfield_unit . set ( 4usize , 1u8 , { let __undfl : u16 = unsafe { :: core :: mem :: transmute ( __undfl ) } ; __undfl as u64 } ) ; __bindgen_bitfield_unit . set ( 5usize , 1u8 , { let __precis : u16 = unsafe { :: core :: mem :: transmute ( __precis ) } ; __precis as u64 } ) ; __bindgen_bitfield_unit . set ( 6usize , 1u8 , { let __stkflt : u16 = unsafe { :: core :: mem :: transmute ( __stkflt ) } ; __stkflt as u64 } ) ; __bindgen_bitfield_unit . set ( 7usize , 1u8 , { let __errsumm : u16 = unsafe { :: core :: mem :: transmute ( __errsumm ) } ; __errsumm as u64 } ) ; __bindgen_bitfield_unit . set ( 8usize , 1u8 , { let __c0 : u16 = unsafe { :: core :: mem :: transmute ( __c0 ) } ; __c0 as u64 } ) ; __bindgen_bitfield_unit . set ( 9usize , 1u8 , { let __c1 : u16 = unsafe { :: core :: mem :: transmute ( __c1 ) } ; __c1 as u64 } ) ; __bindgen_bitfield_unit . set ( 10usize , 1u8 , { let __c2 : u16 = unsafe { :: core :: mem :: transmute ( __c2 ) } ; __c2 as u64 } ) ; __bindgen_bitfield_unit . set ( 11usize , 3u8 , { let __tos : u16 = unsafe { :: core :: mem :: transmute ( __tos ) } ; __tos as u64 } ) ; __bindgen_bitfield_unit . set ( 14usize , 1u8 , { let __c3 : u16 = unsafe { :: core :: mem :: transmute ( __c3 ) } ; __c3 as u64 } ) ; __bindgen_bitfield_unit . set ( 15usize , 1u8 , { let __busy : u16 = unsafe { :: core :: mem :: transmute ( __busy ) } ; __busy as u64 } ) ; __bindgen_bitfield_unit } } pub type __darwin_fp_status_t = __darwin_fp_status ; # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct __darwin_mmst_reg { pub __mmst_reg : [ libc :: c_char ; 10usize ] , pub __mmst_rsrv : [ libc :: c_char ; 6usize ] , } # [ test ] fn bindgen_test_layout___darwin_mmst_reg ( ) { assert_eq ! ( :: core :: mem :: size_of :: < __darwin_mmst_reg > ( ) , 16usize , concat ! ( "Size of: " , stringify ! ( __darwin_mmst_reg ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < __darwin_mmst_reg > ( ) , 1usize , concat ! ( "Alignment of " , stringify ! ( __darwin_mmst_reg ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_mmst_reg > ( ) ) ) . __mmst_reg as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_mmst_reg ) , "::" , stringify ! ( __mmst_reg ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_mmst_reg > ( ) ) ) . __mmst_rsrv as * const _ as usize } , 10usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_mmst_reg ) , "::" , stringify ! ( __mmst_rsrv ) ) ) ; } # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct __darwin_xmm_reg { pub __xmm_reg : [ libc :: c_char ; 16usize ] , } # [ test ] fn bindgen_test_layout___darwin_xmm_reg ( ) { assert_eq ! ( :: core :: mem :: size_of :: < __darwin_xmm_reg > ( ) , 16usize , concat ! ( "Size of: " , stringify ! ( __darwin_xmm_reg ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < __darwin_xmm_reg > ( ) , 1usize , concat ! ( "Alignment of " , stringify ! ( __darwin_xmm_reg ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_xmm_reg > ( ) ) ) . __xmm_reg as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_xmm_reg ) , "::" , stringify ! ( __xmm_reg ) ) ) ; } # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct __darwin_ymm_reg { pub __ymm_reg : [ libc :: c_char ; 32usize ] , } # [ test ] fn bindgen_test_layout___darwin_ymm_reg ( ) { assert_eq ! ( :: core :: mem :: size_of :: < __darwin_ymm_reg > ( ) , 32usize , concat ! ( "Size of: " , stringify ! ( __darwin_ymm_reg ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < __darwin_ymm_reg > ( ) , 1usize , concat ! ( "Alignment of " , stringify ! ( __darwin_ymm_reg ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_ymm_reg > ( ) ) ) . __ymm_reg as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_ymm_reg ) , "::" , stringify ! ( __ymm_reg ) ) ) ; } # [ repr ( C ) ] # [ derive ( Copy , Clone ) ] pub struct __darwin_zmm_reg { pub __zmm_reg : [ libc :: c_char ; 64usize ] , } # [ test ] fn bindgen_test_layout___darwin_zmm_reg ( ) { assert_eq ! ( :: core :: mem :: size_of :: < __darwin_zmm_reg > ( ) , 64usize , concat ! ( "Size of: " , stringify ! ( __darwin_zmm_reg ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < __darwin_zmm_reg > ( ) , 1usize , concat ! ( "Alignment of " , stringify ! ( __darwin_zmm_reg ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_zmm_reg > ( ) ) ) . __zmm_reg as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_zmm_reg ) , "::" , stringify ! ( __zmm_reg ) ) ) ; } impl :: core :: fmt :: Debug for __darwin_zmm_reg { fn fmt ( & self , f : & mut :: core :: fmt :: Formatter < '_ > ) -> :: core :: fmt :: Result { write ! ( f , "__darwin_zmm_reg {{ __zmm_reg: [...] }}" ) } } # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct __darwin_opmask_reg { pub __opmask_reg : [ libc :: c_char ; 8usize ] , } # [ test ] fn bindgen_test_layout___darwin_opmask_reg ( ) { assert_eq ! ( :: core :: mem :: size_of :: < __darwin_opmask_reg > ( ) , 8usize , concat ! ( "Size of: " , stringify ! ( __darwin_opmask_reg ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < __darwin_opmask_reg > ( ) , 1usize , concat ! ( "Alignment of " , stringify ! ( __darwin_opmask_reg ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_opmask_reg > ( ) ) ) . __opmask_reg as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_opmask_reg ) , "::" , stringify ! ( __opmask_reg ) ) ) ; } # [ repr ( C ) ] # [ derive ( Copy , Clone ) ] pub struct __darwin_i386_float_state { pub __fpu_reserved : [ libc :: c_int ; 2usize ] , pub __fpu_fcw : __darwin_fp_control , pub __fpu_fsw : __darwin_fp_status , pub __fpu_ftw : __uint8_t , pub __fpu_rsrv1 : __uint8_t , pub __fpu_fop : __uint16_t , pub __fpu_ip : __uint32_t , pub __fpu_cs : __uint16_t , pub __fpu_rsrv2 : __uint16_t , pub __fpu_dp : __uint32_t , pub __fpu_ds : __uint16_t , pub __fpu_rsrv3 : __uint16_t , pub __fpu_mxcsr : __uint32_t , pub __fpu_mxcsrmask : __uint32_t , pub __fpu_stmm0 : __darwin_mmst_reg , pub __fpu_stmm1 : __darwin_mmst_reg , pub __fpu_stmm2 : __darwin_mmst_reg , pub __fpu_stmm3 : __darwin_mmst_reg , pub __fpu_stmm4 : __darwin_mmst_reg , pub __fpu_stmm5 : __darwin_mmst_reg , pub __fpu_stmm6 : __darwin_mmst_reg , pub __fpu_stmm7 : __darwin_mmst_reg , pub __fpu_xmm0 : __darwin_xmm_reg , pub __fpu_xmm1 : __darwin_xmm_reg , pub __fpu_xmm2 : __darwin_xmm_reg , pub __fpu_xmm3 : __darwin_xmm_reg , pub __fpu_xmm4 : __darwin_xmm_reg , pub __fpu_xmm5 : __darwin_xmm_reg , pub __fpu_xmm6 : __darwin_xmm_reg , pub __fpu_xmm7 : __darwin_xmm_reg , pub __fpu_rsrv4 : [ libc :: c_char ; 224usize ] , pub __fpu_reserved1 : libc :: c_int , } # [ test ] fn bindgen_test_layout___darwin_i386_float_state ( ) { assert_eq ! ( :: core :: mem :: size_of :: < __darwin_i386_float_state > ( ) , 524usize , concat ! ( "Size of: " , stringify ! ( __darwin_i386_float_state ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < __darwin_i386_float_state > ( ) , 4usize , concat ! ( "Alignment of " , stringify ! ( __darwin_i386_float_state ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_float_state > ( ) ) ) . __fpu_reserved as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_float_state ) , "::" , stringify ! ( __fpu_reserved ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_float_state > ( ) ) ) . __fpu_fcw as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_float_state ) , "::" , stringify ! ( __fpu_fcw ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_float_state > ( ) ) ) . __fpu_fsw as * const _ as usize } , 10usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_float_state ) , "::" , stringify ! ( __fpu_fsw ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_float_state > ( ) ) ) . __fpu_ftw as * const _ as usize } , 12usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_float_state ) , "::" , stringify ! ( __fpu_ftw ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_float_state > ( ) ) ) . __fpu_rsrv1 as * const _ as usize } , 13usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_float_state ) , "::" , stringify ! ( __fpu_rsrv1 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_float_state > ( ) ) ) . __fpu_fop as * const _ as usize } , 14usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_float_state ) , "::" , stringify ! ( __fpu_fop ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_float_state > ( ) ) ) . __fpu_ip as * const _ as usize } , 16usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_float_state ) , "::" , stringify ! ( __fpu_ip ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_float_state > ( ) ) ) . __fpu_cs as * const _ as usize } , 20usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_float_state ) , "::" , stringify ! ( __fpu_cs ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_float_state > ( ) ) ) . __fpu_rsrv2 as * const _ as usize } , 22usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_float_state ) , "::" , stringify ! ( __fpu_rsrv2 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_float_state > ( ) ) ) . __fpu_dp as * const _ as usize } , 24usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_float_state ) , "::" , stringify ! ( __fpu_dp ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_float_state > ( ) ) ) . __fpu_ds as * const _ as usize } , 28usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_float_state ) , "::" , stringify ! ( __fpu_ds ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_float_state > ( ) ) ) . __fpu_rsrv3 as * const _ as usize } , 30usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_float_state ) , "::" , stringify ! ( __fpu_rsrv3 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_float_state > ( ) ) ) . __fpu_mxcsr as * const _ as usize } , 32usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_float_state ) , "::" , stringify ! ( __fpu_mxcsr ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_float_state > ( ) ) ) . __fpu_mxcsrmask as * const _ as usize } , 36usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_float_state ) , "::" , stringify ! ( __fpu_mxcsrmask ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_float_state > ( ) ) ) . __fpu_stmm0 as * const _ as usize } , 40usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_float_state ) , "::" , stringify ! ( __fpu_stmm0 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_float_state > ( ) ) ) . __fpu_stmm1 as * const _ as usize } , 56usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_float_state ) , "::" , stringify ! ( __fpu_stmm1 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_float_state > ( ) ) ) . __fpu_stmm2 as * const _ as usize } , 72usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_float_state ) , "::" , stringify ! ( __fpu_stmm2 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_float_state > ( ) ) ) . __fpu_stmm3 as * const _ as usize } , 88usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_float_state ) , "::" , stringify ! ( __fpu_stmm3 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_float_state > ( ) ) ) . __fpu_stmm4 as * const _ as usize } , 104usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_float_state ) , "::" , stringify ! ( __fpu_stmm4 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_float_state > ( ) ) ) . __fpu_stmm5 as * const _ as usize } , 120usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_float_state ) , "::" , stringify ! ( __fpu_stmm5 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_float_state > ( ) ) ) . __fpu_stmm6 as * const _ as usize } , 136usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_float_state ) , "::" , stringify ! ( __fpu_stmm6 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_float_state > ( ) ) ) . __fpu_stmm7 as * const _ as usize } , 152usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_float_state ) , "::" , stringify ! ( __fpu_stmm7 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_float_state > ( ) ) ) . __fpu_xmm0 as * const _ as usize } , 168usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_float_state ) , "::" , stringify ! ( __fpu_xmm0 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_float_state > ( ) ) ) . __fpu_xmm1 as * const _ as usize } , 184usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_float_state ) , "::" , stringify ! ( __fpu_xmm1 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_float_state > ( ) ) ) . __fpu_xmm2 as * const _ as usize } , 200usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_float_state ) , "::" , stringify ! ( __fpu_xmm2 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_float_state > ( ) ) ) . __fpu_xmm3 as * const _ as usize } , 216usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_float_state ) , "::" , stringify ! ( __fpu_xmm3 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_float_state > ( ) ) ) . __fpu_xmm4 as * const _ as usize } , 232usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_float_state ) , "::" , stringify ! ( __fpu_xmm4 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_float_state > ( ) ) ) . __fpu_xmm5 as * const _ as usize } , 248usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_float_state ) , "::" , stringify ! ( __fpu_xmm5 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_float_state > ( ) ) ) . __fpu_xmm6 as * const _ as usize } , 264usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_float_state ) , "::" , stringify ! ( __fpu_xmm6 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_float_state > ( ) ) ) . __fpu_xmm7 as * const _ as usize } , 280usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_float_state ) , "::" , stringify ! ( __fpu_xmm7 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_float_state > ( ) ) ) . __fpu_rsrv4 as * const _ as usize } , 296usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_float_state ) , "::" , stringify ! ( __fpu_rsrv4 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_float_state > ( ) ) ) . __fpu_reserved1 as * const _ as usize } , 520usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_float_state ) , "::" , stringify ! ( __fpu_reserved1 ) ) ) ; } impl :: core :: fmt :: Debug for __darwin_i386_float_state { fn fmt ( & self , f : & mut :: core :: fmt :: Formatter < '_ > ) -> :: core :: fmt :: Result { write ! ( f , "__darwin_i386_float_state {{ __fpu_reserved: {:?}, __fpu_fcw: {:?}, __fpu_fsw: {:?}, __fpu_ftw: {:?}, __fpu_rsrv1: {:?}, __fpu_fop: {:?}, __fpu_ip: {:?}, __fpu_cs: {:?}, __fpu_rsrv2: {:?}, __fpu_dp: {:?}, __fpu_ds: {:?}, __fpu_rsrv3: {:?}, __fpu_mxcsr: {:?}, __fpu_mxcsrmask: {:?}, __fpu_stmm0: {:?}, __fpu_stmm1: {:?}, __fpu_stmm2: {:?}, __fpu_stmm3: {:?}, __fpu_stmm4: {:?}, __fpu_stmm5: {:?}, __fpu_stmm6: {:?}, __fpu_stmm7: {:?}, __fpu_xmm0: {:?}, __fpu_xmm1: {:?}, __fpu_xmm2: {:?}, __fpu_xmm3: {:?}, __fpu_xmm4: {:?}, __fpu_xmm5: {:?}, __fpu_xmm6: {:?}, __fpu_xmm7: {:?}, __fpu_rsrv4: [...], __fpu_reserved1: {:?} }}" , self . __fpu_reserved , self . __fpu_fcw , self . __fpu_fsw , self . __fpu_ftw , self . __fpu_rsrv1 , self . __fpu_fop , self . __fpu_ip , self . __fpu_cs , self . __fpu_rsrv2 , self . __fpu_dp , self . __fpu_ds , self . __fpu_rsrv3 , self . __fpu_mxcsr , self . __fpu_mxcsrmask , self . __fpu_stmm0 , self . __fpu_stmm1 , self . __fpu_stmm2 , self . __fpu_stmm3 , self . __fpu_stmm4 , self . __fpu_stmm5 , self . __fpu_stmm6 , self . __fpu_stmm7 , self . __fpu_xmm0 , self . __fpu_xmm1 , self . __fpu_xmm2 , self . __fpu_xmm3 , self . __fpu_xmm4 , self . __fpu_xmm5 , self . __fpu_xmm6 , self . __fpu_xmm7 , self . __fpu_reserved1 ) } } # [ repr ( C ) ] # [ derive ( Copy , Clone ) ] pub struct __darwin_i386_avx_state { pub __fpu_reserved : [ libc :: c_int ; 2usize ] , pub __fpu_fcw : __darwin_fp_control , pub __fpu_fsw : __darwin_fp_status , pub __fpu_ftw : __uint8_t , pub __fpu_rsrv1 : __uint8_t , pub __fpu_fop : __uint16_t , pub __fpu_ip : __uint32_t , pub __fpu_cs : __uint16_t , pub __fpu_rsrv2 : __uint16_t , pub __fpu_dp : __uint32_t , pub __fpu_ds : __uint16_t , pub __fpu_rsrv3 : __uint16_t , pub __fpu_mxcsr : __uint32_t , pub __fpu_mxcsrmask : __uint32_t , pub __fpu_stmm0 : __darwin_mmst_reg , pub __fpu_stmm1 : __darwin_mmst_reg , pub __fpu_stmm2 : __darwin_mmst_reg , pub __fpu_stmm3 : __darwin_mmst_reg , pub __fpu_stmm4 : __darwin_mmst_reg , pub __fpu_stmm5 : __darwin_mmst_reg , pub __fpu_stmm6 : __darwin_mmst_reg , pub __fpu_stmm7 : __darwin_mmst_reg , pub __fpu_xmm0 : __darwin_xmm_reg , pub __fpu_xmm1 : __darwin_xmm_reg , pub __fpu_xmm2 : __darwin_xmm_reg , pub __fpu_xmm3 : __darwin_xmm_reg , pub __fpu_xmm4 : __darwin_xmm_reg , pub __fpu_xmm5 : __darwin_xmm_reg , pub __fpu_xmm6 : __darwin_xmm_reg , pub __fpu_xmm7 : __darwin_xmm_reg , pub __fpu_rsrv4 : [ libc :: c_char ; 224usize ] , pub __fpu_reserved1 : libc :: c_int , pub __avx_reserved1 : [ libc :: c_char ; 64usize ] , pub __fpu_ymmh0 : __darwin_xmm_reg , pub __fpu_ymmh1 : __darwin_xmm_reg , pub __fpu_ymmh2 : __darwin_xmm_reg , pub __fpu_ymmh3 : __darwin_xmm_reg , pub __fpu_ymmh4 : __darwin_xmm_reg , pub __fpu_ymmh5 : __darwin_xmm_reg , pub __fpu_ymmh6 : __darwin_xmm_reg , pub __fpu_ymmh7 : __darwin_xmm_reg , } # [ test ] fn bindgen_test_layout___darwin_i386_avx_state ( ) { assert_eq ! ( :: core :: mem :: size_of :: < __darwin_i386_avx_state > ( ) , 716usize , concat ! ( "Size of: " , stringify ! ( __darwin_i386_avx_state ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < __darwin_i386_avx_state > ( ) , 4usize , concat ! ( "Alignment of " , stringify ! ( __darwin_i386_avx_state ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx_state > ( ) ) ) . __fpu_reserved as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx_state ) , "::" , stringify ! ( __fpu_reserved ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx_state > ( ) ) ) . __fpu_fcw as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx_state ) , "::" , stringify ! ( __fpu_fcw ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx_state > ( ) ) ) . __fpu_fsw as * const _ as usize } , 10usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx_state ) , "::" , stringify ! ( __fpu_fsw ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx_state > ( ) ) ) . __fpu_ftw as * const _ as usize } , 12usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx_state ) , "::" , stringify ! ( __fpu_ftw ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx_state > ( ) ) ) . __fpu_rsrv1 as * const _ as usize } , 13usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx_state ) , "::" , stringify ! ( __fpu_rsrv1 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx_state > ( ) ) ) . __fpu_fop as * const _ as usize } , 14usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx_state ) , "::" , stringify ! ( __fpu_fop ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx_state > ( ) ) ) . __fpu_ip as * const _ as usize } , 16usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx_state ) , "::" , stringify ! ( __fpu_ip ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx_state > ( ) ) ) . __fpu_cs as * const _ as usize } , 20usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx_state ) , "::" , stringify ! ( __fpu_cs ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx_state > ( ) ) ) . __fpu_rsrv2 as * const _ as usize } , 22usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx_state ) , "::" , stringify ! ( __fpu_rsrv2 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx_state > ( ) ) ) . __fpu_dp as * const _ as usize } , 24usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx_state ) , "::" , stringify ! ( __fpu_dp ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx_state > ( ) ) ) . __fpu_ds as * const _ as usize } , 28usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx_state ) , "::" , stringify ! ( __fpu_ds ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx_state > ( ) ) ) . __fpu_rsrv3 as * const _ as usize } , 30usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx_state ) , "::" , stringify ! ( __fpu_rsrv3 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx_state > ( ) ) ) . __fpu_mxcsr as * const _ as usize } , 32usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx_state ) , "::" , stringify ! ( __fpu_mxcsr ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx_state > ( ) ) ) . __fpu_mxcsrmask as * const _ as usize } , 36usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx_state ) , "::" , stringify ! ( __fpu_mxcsrmask ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx_state > ( ) ) ) . __fpu_stmm0 as * const _ as usize } , 40usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx_state ) , "::" , stringify ! ( __fpu_stmm0 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx_state > ( ) ) ) . __fpu_stmm1 as * const _ as usize } , 56usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx_state ) , "::" , stringify ! ( __fpu_stmm1 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx_state > ( ) ) ) . __fpu_stmm2 as * const _ as usize } , 72usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx_state ) , "::" , stringify ! ( __fpu_stmm2 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx_state > ( ) ) ) . __fpu_stmm3 as * const _ as usize } , 88usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx_state ) , "::" , stringify ! ( __fpu_stmm3 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx_state > ( ) ) ) . __fpu_stmm4 as * const _ as usize } , 104usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx_state ) , "::" , stringify ! ( __fpu_stmm4 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx_state > ( ) ) ) . __fpu_stmm5 as * const _ as usize } , 120usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx_state ) , "::" , stringify ! ( __fpu_stmm5 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx_state > ( ) ) ) . __fpu_stmm6 as * const _ as usize } , 136usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx_state ) , "::" , stringify ! ( __fpu_stmm6 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx_state > ( ) ) ) . __fpu_stmm7 as * const _ as usize } , 152usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx_state ) , "::" , stringify ! ( __fpu_stmm7 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx_state > ( ) ) ) . __fpu_xmm0 as * const _ as usize } , 168usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx_state ) , "::" , stringify ! ( __fpu_xmm0 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx_state > ( ) ) ) . __fpu_xmm1 as * const _ as usize } , 184usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx_state ) , "::" , stringify ! ( __fpu_xmm1 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx_state > ( ) ) ) . __fpu_xmm2 as * const _ as usize } , 200usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx_state ) , "::" , stringify ! ( __fpu_xmm2 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx_state > ( ) ) ) . __fpu_xmm3 as * const _ as usize } , 216usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx_state ) , "::" , stringify ! ( __fpu_xmm3 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx_state > ( ) ) ) . __fpu_xmm4 as * const _ as usize } , 232usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx_state ) , "::" , stringify ! ( __fpu_xmm4 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx_state > ( ) ) ) . __fpu_xmm5 as * const _ as usize } , 248usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx_state ) , "::" , stringify ! ( __fpu_xmm5 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx_state > ( ) ) ) . __fpu_xmm6 as * const _ as usize } , 264usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx_state ) , "::" , stringify ! ( __fpu_xmm6 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx_state > ( ) ) ) . __fpu_xmm7 as * const _ as usize } , 280usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx_state ) , "::" , stringify ! ( __fpu_xmm7 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx_state > ( ) ) ) . __fpu_rsrv4 as * const _ as usize } , 296usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx_state ) , "::" , stringify ! ( __fpu_rsrv4 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx_state > ( ) ) ) . __fpu_reserved1 as * const _ as usize } , 520usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx_state ) , "::" , stringify ! ( __fpu_reserved1 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx_state > ( ) ) ) . __avx_reserved1 as * const _ as usize } , 524usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx_state ) , "::" , stringify ! ( __avx_reserved1 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx_state > ( ) ) ) . __fpu_ymmh0 as * const _ as usize } , 588usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx_state ) , "::" , stringify ! ( __fpu_ymmh0 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx_state > ( ) ) ) . __fpu_ymmh1 as * const _ as usize } , 604usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx_state ) , "::" , stringify ! ( __fpu_ymmh1 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx_state > ( ) ) ) . __fpu_ymmh2 as * const _ as usize } , 620usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx_state ) , "::" , stringify ! ( __fpu_ymmh2 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx_state > ( ) ) ) . __fpu_ymmh3 as * const _ as usize } , 636usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx_state ) , "::" , stringify ! ( __fpu_ymmh3 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx_state > ( ) ) ) . __fpu_ymmh4 as * const _ as usize } , 652usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx_state ) , "::" , stringify ! ( __fpu_ymmh4 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx_state > ( ) ) ) . __fpu_ymmh5 as * const _ as usize } , 668usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx_state ) , "::" , stringify ! ( __fpu_ymmh5 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx_state > ( ) ) ) . __fpu_ymmh6 as * const _ as usize } , 684usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx_state ) , "::" , stringify ! ( __fpu_ymmh6 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx_state > ( ) ) ) . __fpu_ymmh7 as * const _ as usize } , 700usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx_state ) , "::" , stringify ! ( __fpu_ymmh7 ) ) ) ; } impl :: core :: fmt :: Debug for __darwin_i386_avx_state { fn fmt ( & self , f : & mut :: core :: fmt :: Formatter < '_ > ) -> :: core :: fmt :: Result { write ! ( f , "__darwin_i386_avx_state {{ __fpu_reserved: {:?}, __fpu_fcw: {:?}, __fpu_fsw: {:?}, __fpu_ftw: {:?}, __fpu_rsrv1: {:?}, __fpu_fop: {:?}, __fpu_ip: {:?}, __fpu_cs: {:?}, __fpu_rsrv2: {:?}, __fpu_dp: {:?}, __fpu_ds: {:?}, __fpu_rsrv3: {:?}, __fpu_mxcsr: {:?}, __fpu_mxcsrmask: {:?}, __fpu_stmm0: {:?}, __fpu_stmm1: {:?}, __fpu_stmm2: {:?}, __fpu_stmm3: {:?}, __fpu_stmm4: {:?}, __fpu_stmm5: {:?}, __fpu_stmm6: {:?}, __fpu_stmm7: {:?}, __fpu_xmm0: {:?}, __fpu_xmm1: {:?}, __fpu_xmm2: {:?}, __fpu_xmm3: {:?}, __fpu_xmm4: {:?}, __fpu_xmm5: {:?}, __fpu_xmm6: {:?}, __fpu_xmm7: {:?}, __fpu_rsrv4: [...], __fpu_reserved1: {:?}, __avx_reserved1: [...], __fpu_ymmh0: {:?}, __fpu_ymmh1: {:?}, __fpu_ymmh2: {:?}, __fpu_ymmh3: {:?}, __fpu_ymmh4: {:?}, __fpu_ymmh5: {:?}, __fpu_ymmh6: {:?}, __fpu_ymmh7: {:?} }}" , self . __fpu_reserved , self . __fpu_fcw , self . __fpu_fsw , self . __fpu_ftw , self . __fpu_rsrv1 , self . __fpu_fop , self . __fpu_ip , self . __fpu_cs , self . __fpu_rsrv2 , self . __fpu_dp , self . __fpu_ds , self . __fpu_rsrv3 , self . __fpu_mxcsr , self . __fpu_mxcsrmask , self . __fpu_stmm0 , self . __fpu_stmm1 , self . __fpu_stmm2 , self . __fpu_stmm3 , self . __fpu_stmm4 , self . __fpu_stmm5 , self . __fpu_stmm6 , self . __fpu_stmm7 , self . __fpu_xmm0 , self . __fpu_xmm1 , self . __fpu_xmm2 , self . __fpu_xmm3 , self . __fpu_xmm4 , self . __fpu_xmm5 , self . __fpu_xmm6 , self . __fpu_xmm7 , self . __fpu_reserved1 , self . __fpu_ymmh0 , self . __fpu_ymmh1 , self . __fpu_ymmh2 , self . __fpu_ymmh3 , self . __fpu_ymmh4 , self . __fpu_ymmh5 , self . __fpu_ymmh6 , self . __fpu_ymmh7 ) } } # [ repr ( C ) ] # [ derive ( Copy , Clone ) ] pub struct __darwin_i386_avx512_state { pub __fpu_reserved : [ libc :: c_int ; 2usize ] , pub __fpu_fcw : __darwin_fp_control , pub __fpu_fsw : __darwin_fp_status , pub __fpu_ftw : __uint8_t , pub __fpu_rsrv1 : __uint8_t , pub __fpu_fop : __uint16_t , pub __fpu_ip : __uint32_t , pub __fpu_cs : __uint16_t , pub __fpu_rsrv2 : __uint16_t , pub __fpu_dp : __uint32_t , pub __fpu_ds : __uint16_t , pub __fpu_rsrv3 : __uint16_t , pub __fpu_mxcsr : __uint32_t , pub __fpu_mxcsrmask : __uint32_t , pub __fpu_stmm0 : __darwin_mmst_reg , pub __fpu_stmm1 : __darwin_mmst_reg , pub __fpu_stmm2 : __darwin_mmst_reg , pub __fpu_stmm3 : __darwin_mmst_reg , pub __fpu_stmm4 : __darwin_mmst_reg , pub __fpu_stmm5 : __darwin_mmst_reg , pub __fpu_stmm6 : __darwin_mmst_reg , pub __fpu_stmm7 : __darwin_mmst_reg , pub __fpu_xmm0 : __darwin_xmm_reg , pub __fpu_xmm1 : __darwin_xmm_reg , pub __fpu_xmm2 : __darwin_xmm_reg , pub __fpu_xmm3 : __darwin_xmm_reg , pub __fpu_xmm4 : __darwin_xmm_reg , pub __fpu_xmm5 : __darwin_xmm_reg , pub __fpu_xmm6 : __darwin_xmm_reg , pub __fpu_xmm7 : __darwin_xmm_reg , pub __fpu_rsrv4 : [ libc :: c_char ; 224usize ] , pub __fpu_reserved1 : libc :: c_int , pub __avx_reserved1 : [ libc :: c_char ; 64usize ] , pub __fpu_ymmh0 : __darwin_xmm_reg , pub __fpu_ymmh1 : __darwin_xmm_reg , pub __fpu_ymmh2 : __darwin_xmm_reg , pub __fpu_ymmh3 : __darwin_xmm_reg , pub __fpu_ymmh4 : __darwin_xmm_reg , pub __fpu_ymmh5 : __darwin_xmm_reg , pub __fpu_ymmh6 : __darwin_xmm_reg , pub __fpu_ymmh7 : __darwin_xmm_reg , pub __fpu_k0 : __darwin_opmask_reg , pub __fpu_k1 : __darwin_opmask_reg , pub __fpu_k2 : __darwin_opmask_reg , pub __fpu_k3 : __darwin_opmask_reg , pub __fpu_k4 : __darwin_opmask_reg , pub __fpu_k5 : __darwin_opmask_reg , pub __fpu_k6 : __darwin_opmask_reg , pub __fpu_k7 : __darwin_opmask_reg , pub __fpu_zmmh0 : __darwin_ymm_reg , pub __fpu_zmmh1 : __darwin_ymm_reg , pub __fpu_zmmh2 : __darwin_ymm_reg , pub __fpu_zmmh3 : __darwin_ymm_reg , pub __fpu_zmmh4 : __darwin_ymm_reg , pub __fpu_zmmh5 : __darwin_ymm_reg , pub __fpu_zmmh6 : __darwin_ymm_reg , pub __fpu_zmmh7 : __darwin_ymm_reg , } # [ test ] fn bindgen_test_layout___darwin_i386_avx512_state ( ) { assert_eq ! ( :: core :: mem :: size_of :: < __darwin_i386_avx512_state > ( ) , 1036usize , concat ! ( "Size of: " , stringify ! ( __darwin_i386_avx512_state ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < __darwin_i386_avx512_state > ( ) , 4usize , concat ! ( "Alignment of " , stringify ! ( __darwin_i386_avx512_state ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx512_state > ( ) ) ) . __fpu_reserved as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx512_state ) , "::" , stringify ! ( __fpu_reserved ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx512_state > ( ) ) ) . __fpu_fcw as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx512_state ) , "::" , stringify ! ( __fpu_fcw ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx512_state > ( ) ) ) . __fpu_fsw as * const _ as usize } , 10usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx512_state ) , "::" , stringify ! ( __fpu_fsw ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx512_state > ( ) ) ) . __fpu_ftw as * const _ as usize } , 12usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx512_state ) , "::" , stringify ! ( __fpu_ftw ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx512_state > ( ) ) ) . __fpu_rsrv1 as * const _ as usize } , 13usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx512_state ) , "::" , stringify ! ( __fpu_rsrv1 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx512_state > ( ) ) ) . __fpu_fop as * const _ as usize } , 14usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx512_state ) , "::" , stringify ! ( __fpu_fop ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx512_state > ( ) ) ) . __fpu_ip as * const _ as usize } , 16usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx512_state ) , "::" , stringify ! ( __fpu_ip ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx512_state > ( ) ) ) . __fpu_cs as * const _ as usize } , 20usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx512_state ) , "::" , stringify ! ( __fpu_cs ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx512_state > ( ) ) ) . __fpu_rsrv2 as * const _ as usize } , 22usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx512_state ) , "::" , stringify ! ( __fpu_rsrv2 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx512_state > ( ) ) ) . __fpu_dp as * const _ as usize } , 24usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx512_state ) , "::" , stringify ! ( __fpu_dp ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx512_state > ( ) ) ) . __fpu_ds as * const _ as usize } , 28usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx512_state ) , "::" , stringify ! ( __fpu_ds ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx512_state > ( ) ) ) . __fpu_rsrv3 as * const _ as usize } , 30usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx512_state ) , "::" , stringify ! ( __fpu_rsrv3 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx512_state > ( ) ) ) . __fpu_mxcsr as * const _ as usize } , 32usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx512_state ) , "::" , stringify ! ( __fpu_mxcsr ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx512_state > ( ) ) ) . __fpu_mxcsrmask as * const _ as usize } , 36usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx512_state ) , "::" , stringify ! ( __fpu_mxcsrmask ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx512_state > ( ) ) ) . __fpu_stmm0 as * const _ as usize } , 40usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx512_state ) , "::" , stringify ! ( __fpu_stmm0 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx512_state > ( ) ) ) . __fpu_stmm1 as * const _ as usize } , 56usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx512_state ) , "::" , stringify ! ( __fpu_stmm1 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx512_state > ( ) ) ) . __fpu_stmm2 as * const _ as usize } , 72usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx512_state ) , "::" , stringify ! ( __fpu_stmm2 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx512_state > ( ) ) ) . __fpu_stmm3 as * const _ as usize } , 88usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx512_state ) , "::" , stringify ! ( __fpu_stmm3 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx512_state > ( ) ) ) . __fpu_stmm4 as * const _ as usize } , 104usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx512_state ) , "::" , stringify ! ( __fpu_stmm4 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx512_state > ( ) ) ) . __fpu_stmm5 as * const _ as usize } , 120usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx512_state ) , "::" , stringify ! ( __fpu_stmm5 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx512_state > ( ) ) ) . __fpu_stmm6 as * const _ as usize } , 136usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx512_state ) , "::" , stringify ! ( __fpu_stmm6 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx512_state > ( ) ) ) . __fpu_stmm7 as * const _ as usize } , 152usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx512_state ) , "::" , stringify ! ( __fpu_stmm7 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx512_state > ( ) ) ) . __fpu_xmm0 as * const _ as usize } , 168usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx512_state ) , "::" , stringify ! ( __fpu_xmm0 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx512_state > ( ) ) ) . __fpu_xmm1 as * const _ as usize } , 184usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx512_state ) , "::" , stringify ! ( __fpu_xmm1 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx512_state > ( ) ) ) . __fpu_xmm2 as * const _ as usize } , 200usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx512_state ) , "::" , stringify ! ( __fpu_xmm2 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx512_state > ( ) ) ) . __fpu_xmm3 as * const _ as usize } , 216usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx512_state ) , "::" , stringify ! ( __fpu_xmm3 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx512_state > ( ) ) ) . __fpu_xmm4 as * const _ as usize } , 232usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx512_state ) , "::" , stringify ! ( __fpu_xmm4 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx512_state > ( ) ) ) . __fpu_xmm5 as * const _ as usize } , 248usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx512_state ) , "::" , stringify ! ( __fpu_xmm5 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx512_state > ( ) ) ) . __fpu_xmm6 as * const _ as usize } , 264usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx512_state ) , "::" , stringify ! ( __fpu_xmm6 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx512_state > ( ) ) ) . __fpu_xmm7 as * const _ as usize } , 280usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx512_state ) , "::" , stringify ! ( __fpu_xmm7 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx512_state > ( ) ) ) . __fpu_rsrv4 as * const _ as usize } , 296usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx512_state ) , "::" , stringify ! ( __fpu_rsrv4 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx512_state > ( ) ) ) . __fpu_reserved1 as * const _ as usize } , 520usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx512_state ) , "::" , stringify ! ( __fpu_reserved1 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx512_state > ( ) ) ) . __avx_reserved1 as * const _ as usize } , 524usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx512_state ) , "::" , stringify ! ( __avx_reserved1 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx512_state > ( ) ) ) . __fpu_ymmh0 as * const _ as usize } , 588usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx512_state ) , "::" , stringify ! ( __fpu_ymmh0 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx512_state > ( ) ) ) . __fpu_ymmh1 as * const _ as usize } , 604usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx512_state ) , "::" , stringify ! ( __fpu_ymmh1 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx512_state > ( ) ) ) . __fpu_ymmh2 as * const _ as usize } , 620usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx512_state ) , "::" , stringify ! ( __fpu_ymmh2 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx512_state > ( ) ) ) . __fpu_ymmh3 as * const _ as usize } , 636usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx512_state ) , "::" , stringify ! ( __fpu_ymmh3 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx512_state > ( ) ) ) . __fpu_ymmh4 as * const _ as usize } , 652usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx512_state ) , "::" , stringify ! ( __fpu_ymmh4 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx512_state > ( ) ) ) . __fpu_ymmh5 as * const _ as usize } , 668usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx512_state ) , "::" , stringify ! ( __fpu_ymmh5 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx512_state > ( ) ) ) . __fpu_ymmh6 as * const _ as usize } , 684usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx512_state ) , "::" , stringify ! ( __fpu_ymmh6 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx512_state > ( ) ) ) . __fpu_ymmh7 as * const _ as usize } , 700usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx512_state ) , "::" , stringify ! ( __fpu_ymmh7 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx512_state > ( ) ) ) . __fpu_k0 as * const _ as usize } , 716usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx512_state ) , "::" , stringify ! ( __fpu_k0 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx512_state > ( ) ) ) . __fpu_k1 as * const _ as usize } , 724usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx512_state ) , "::" , stringify ! ( __fpu_k1 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx512_state > ( ) ) ) . __fpu_k2 as * const _ as usize } , 732usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx512_state ) , "::" , stringify ! ( __fpu_k2 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx512_state > ( ) ) ) . __fpu_k3 as * const _ as usize } , 740usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx512_state ) , "::" , stringify ! ( __fpu_k3 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx512_state > ( ) ) ) . __fpu_k4 as * const _ as usize } , 748usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx512_state ) , "::" , stringify ! ( __fpu_k4 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx512_state > ( ) ) ) . __fpu_k5 as * const _ as usize } , 756usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx512_state ) , "::" , stringify ! ( __fpu_k5 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx512_state > ( ) ) ) . __fpu_k6 as * const _ as usize } , 764usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx512_state ) , "::" , stringify ! ( __fpu_k6 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx512_state > ( ) ) ) . __fpu_k7 as * const _ as usize } , 772usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx512_state ) , "::" , stringify ! ( __fpu_k7 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx512_state > ( ) ) ) . __fpu_zmmh0 as * const _ as usize } , 780usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx512_state ) , "::" , stringify ! ( __fpu_zmmh0 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx512_state > ( ) ) ) . __fpu_zmmh1 as * const _ as usize } , 812usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx512_state ) , "::" , stringify ! ( __fpu_zmmh1 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx512_state > ( ) ) ) . __fpu_zmmh2 as * const _ as usize } , 844usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx512_state ) , "::" , stringify ! ( __fpu_zmmh2 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx512_state > ( ) ) ) . __fpu_zmmh3 as * const _ as usize } , 876usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx512_state ) , "::" , stringify ! ( __fpu_zmmh3 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx512_state > ( ) ) ) . __fpu_zmmh4 as * const _ as usize } , 908usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx512_state ) , "::" , stringify ! ( __fpu_zmmh4 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx512_state > ( ) ) ) . __fpu_zmmh5 as * const _ as usize } , 940usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx512_state ) , "::" , stringify ! ( __fpu_zmmh5 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx512_state > ( ) ) ) . __fpu_zmmh6 as * const _ as usize } , 972usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx512_state ) , "::" , stringify ! ( __fpu_zmmh6 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_avx512_state > ( ) ) ) . __fpu_zmmh7 as * const _ as usize } , 1004usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_avx512_state ) , "::" , stringify ! ( __fpu_zmmh7 ) ) ) ; } impl :: core :: fmt :: Debug for __darwin_i386_avx512_state { fn fmt ( & self , f : & mut :: core :: fmt :: Formatter < '_ > ) -> :: core :: fmt :: Result { write ! ( f , "__darwin_i386_avx512_state {{ __fpu_reserved: {:?}, __fpu_fcw: {:?}, __fpu_fsw: {:?}, __fpu_ftw: {:?}, __fpu_rsrv1: {:?}, __fpu_fop: {:?}, __fpu_ip: {:?}, __fpu_cs: {:?}, __fpu_rsrv2: {:?}, __fpu_dp: {:?}, __fpu_ds: {:?}, __fpu_rsrv3: {:?}, __fpu_mxcsr: {:?}, __fpu_mxcsrmask: {:?}, __fpu_stmm0: {:?}, __fpu_stmm1: {:?}, __fpu_stmm2: {:?}, __fpu_stmm3: {:?}, __fpu_stmm4: {:?}, __fpu_stmm5: {:?}, __fpu_stmm6: {:?}, __fpu_stmm7: {:?}, __fpu_xmm0: {:?}, __fpu_xmm1: {:?}, __fpu_xmm2: {:?}, __fpu_xmm3: {:?}, __fpu_xmm4: {:?}, __fpu_xmm5: {:?}, __fpu_xmm6: {:?}, __fpu_xmm7: {:?}, __fpu_rsrv4: [...], __fpu_reserved1: {:?}, __avx_reserved1: [...], __fpu_ymmh0: {:?}, __fpu_ymmh1: {:?}, __fpu_ymmh2: {:?}, __fpu_ymmh3: {:?}, __fpu_ymmh4: {:?}, __fpu_ymmh5: {:?}, __fpu_ymmh6: {:?}, __fpu_ymmh7: {:?}, __fpu_k0: {:?}, __fpu_k1: {:?}, __fpu_k2: {:?}, __fpu_k3: {:?}, __fpu_k4: {:?}, __fpu_k5: {:?}, __fpu_k6: {:?}, __fpu_k7: {:?}, __fpu_zmmh0: {:?}, __fpu_zmmh1: {:?}, __fpu_zmmh2: {:?}, __fpu_zmmh3: {:?}, __fpu_zmmh4: {:?}, __fpu_zmmh5: {:?}, __fpu_zmmh6: {:?}, __fpu_zmmh7: {:?} }}" , self . __fpu_reserved , self . __fpu_fcw , self . __fpu_fsw , self . __fpu_ftw , self . __fpu_rsrv1 , self . __fpu_fop , self . __fpu_ip , self . __fpu_cs , self . __fpu_rsrv2 , self . __fpu_dp , self . __fpu_ds , self . __fpu_rsrv3 , self . __fpu_mxcsr , self . __fpu_mxcsrmask , self . __fpu_stmm0 , self . __fpu_stmm1 , self . __fpu_stmm2 , self . __fpu_stmm3 , self . __fpu_stmm4 , self . __fpu_stmm5 , self . __fpu_stmm6 , self . __fpu_stmm7 , self . __fpu_xmm0 , self . __fpu_xmm1 , self . __fpu_xmm2 , self . __fpu_xmm3 , self . __fpu_xmm4 , self . __fpu_xmm5 , self . __fpu_xmm6 , self . __fpu_xmm7 , self . __fpu_reserved1 , self . __fpu_ymmh0 , self . __fpu_ymmh1 , self . __fpu_ymmh2 , self . __fpu_ymmh3 , self . __fpu_ymmh4 , self . __fpu_ymmh5 , self . __fpu_ymmh6 , self . __fpu_ymmh7 , self . __fpu_k0 , self . __fpu_k1 , self . __fpu_k2 , self . __fpu_k3 , self . __fpu_k4 , self . __fpu_k5 , self . __fpu_k6 , self . __fpu_k7 , self . __fpu_zmmh0 , self . __fpu_zmmh1 , self . __fpu_zmmh2 , self . __fpu_zmmh3 , self . __fpu_zmmh4 , self . __fpu_zmmh5 , self . __fpu_zmmh6 , self . __fpu_zmmh7 ) } } # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct __darwin_i386_exception_state { pub __trapno : __uint16_t , pub __cpu : __uint16_t , pub __err : __uint32_t , pub __faultvaddr : __uint32_t , } # [ test ] fn bindgen_test_layout___darwin_i386_exception_state ( ) { assert_eq ! ( :: core :: mem :: size_of :: < __darwin_i386_exception_state > ( ) , 12usize , concat ! ( "Size of: " , stringify ! ( __darwin_i386_exception_state ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < __darwin_i386_exception_state > ( ) , 4usize , concat ! ( "Alignment of " , stringify ! ( __darwin_i386_exception_state ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_exception_state > ( ) ) ) . __trapno as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_exception_state ) , "::" , stringify ! ( __trapno ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_exception_state > ( ) ) ) . __cpu as * const _ as usize } , 2usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_exception_state ) , "::" , stringify ! ( __cpu ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_exception_state > ( ) ) ) . __err as * const _ as usize } , 4usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_exception_state ) , "::" , stringify ! ( __err ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_i386_exception_state > ( ) ) ) . __faultvaddr as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_i386_exception_state ) , "::" , stringify ! ( __faultvaddr ) ) ) ; } # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct __darwin_x86_debug_state32 { pub __dr0 : libc :: c_uint , pub __dr1 : libc :: c_uint , pub __dr2 : libc :: c_uint , pub __dr3 : libc :: c_uint , pub __dr4 : libc :: c_uint , pub __dr5 : libc :: c_uint , pub __dr6 : libc :: c_uint , pub __dr7 : libc :: c_uint , } # [ test ] fn bindgen_test_layout___darwin_x86_debug_state32 ( ) { assert_eq ! ( :: core :: mem :: size_of :: < __darwin_x86_debug_state32 > ( ) , 32usize , concat ! ( "Size of: " , stringify ! ( __darwin_x86_debug_state32 ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < __darwin_x86_debug_state32 > ( ) , 4usize , concat ! ( "Alignment of " , stringify ! ( __darwin_x86_debug_state32 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_debug_state32 > ( ) ) ) . __dr0 as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_debug_state32 ) , "::" , stringify ! ( __dr0 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_debug_state32 > ( ) ) ) . __dr1 as * const _ as usize } , 4usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_debug_state32 ) , "::" , stringify ! ( __dr1 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_debug_state32 > ( ) ) ) . __dr2 as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_debug_state32 ) , "::" , stringify ! ( __dr2 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_debug_state32 > ( ) ) ) . __dr3 as * const _ as usize } , 12usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_debug_state32 ) , "::" , stringify ! ( __dr3 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_debug_state32 > ( ) ) ) . __dr4 as * const _ as usize } , 16usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_debug_state32 ) , "::" , stringify ! ( __dr4 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_debug_state32 > ( ) ) ) . __dr5 as * const _ as usize } , 20usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_debug_state32 ) , "::" , stringify ! ( __dr5 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_debug_state32 > ( ) ) ) . __dr6 as * const _ as usize } , 24usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_debug_state32 ) , "::" , stringify ! ( __dr6 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_debug_state32 > ( ) ) ) . __dr7 as * const _ as usize } , 28usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_debug_state32 ) , "::" , stringify ! ( __dr7 ) ) ) ; } # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct __x86_pagein_state { pub __pagein_error : libc :: c_int , } # [ test ] fn bindgen_test_layout___x86_pagein_state ( ) { assert_eq ! ( :: core :: mem :: size_of :: < __x86_pagein_state > ( ) , 4usize , concat ! ( "Size of: " , stringify ! ( __x86_pagein_state ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < __x86_pagein_state > ( ) , 4usize , concat ! ( "Alignment of " , stringify ! ( __x86_pagein_state ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __x86_pagein_state > ( ) ) ) . __pagein_error as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( __x86_pagein_state ) , "::" , stringify ! ( __pagein_error ) ) ) ; } # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct __darwin_x86_thread_state64 { pub __rax : __uint64_t , pub __rbx : __uint64_t , pub __rcx : __uint64_t , pub __rdx : __uint64_t , pub __rdi : __uint64_t , pub __rsi : __uint64_t , pub __rbp : __uint64_t , pub __rsp : __uint64_t , pub __r8 : __uint64_t , pub __r9 : __uint64_t , pub __r10 : __uint64_t , pub __r11 : __uint64_t , pub __r12 : __uint64_t , pub __r13 : __uint64_t , pub __r14 : __uint64_t , pub __r15 : __uint64_t , pub __rip : __uint64_t , pub __rflags : __uint64_t , pub __cs : __uint64_t , pub __fs : __uint64_t , pub __gs : __uint64_t , } # [ test ] fn bindgen_test_layout___darwin_x86_thread_state64 ( ) { assert_eq ! ( :: core :: mem :: size_of :: < __darwin_x86_thread_state64 > ( ) , 168usize , concat ! ( "Size of: " , stringify ! ( __darwin_x86_thread_state64 ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < __darwin_x86_thread_state64 > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( __darwin_x86_thread_state64 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_thread_state64 > ( ) ) ) . __rax as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_thread_state64 ) , "::" , stringify ! ( __rax ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_thread_state64 > ( ) ) ) . __rbx as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_thread_state64 ) , "::" , stringify ! ( __rbx ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_thread_state64 > ( ) ) ) . __rcx as * const _ as usize } , 16usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_thread_state64 ) , "::" , stringify ! ( __rcx ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_thread_state64 > ( ) ) ) . __rdx as * const _ as usize } , 24usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_thread_state64 ) , "::" , stringify ! ( __rdx ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_thread_state64 > ( ) ) ) . __rdi as * const _ as usize } , 32usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_thread_state64 ) , "::" , stringify ! ( __rdi ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_thread_state64 > ( ) ) ) . __rsi as * const _ as usize } , 40usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_thread_state64 ) , "::" , stringify ! ( __rsi ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_thread_state64 > ( ) ) ) . __rbp as * const _ as usize } , 48usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_thread_state64 ) , "::" , stringify ! ( __rbp ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_thread_state64 > ( ) ) ) . __rsp as * const _ as usize } , 56usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_thread_state64 ) , "::" , stringify ! ( __rsp ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_thread_state64 > ( ) ) ) . __r8 as * const _ as usize } , 64usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_thread_state64 ) , "::" , stringify ! ( __r8 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_thread_state64 > ( ) ) ) . __r9 as * const _ as usize } , 72usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_thread_state64 ) , "::" , stringify ! ( __r9 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_thread_state64 > ( ) ) ) . __r10 as * const _ as usize } , 80usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_thread_state64 ) , "::" , stringify ! ( __r10 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_thread_state64 > ( ) ) ) . __r11 as * const _ as usize } , 88usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_thread_state64 ) , "::" , stringify ! ( __r11 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_thread_state64 > ( ) ) ) . __r12 as * const _ as usize } , 96usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_thread_state64 ) , "::" , stringify ! ( __r12 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_thread_state64 > ( ) ) ) . __r13 as * const _ as usize } , 104usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_thread_state64 ) , "::" , stringify ! ( __r13 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_thread_state64 > ( ) ) ) . __r14 as * const _ as usize } , 112usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_thread_state64 ) , "::" , stringify ! ( __r14 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_thread_state64 > ( ) ) ) . __r15 as * const _ as usize } , 120usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_thread_state64 ) , "::" , stringify ! ( __r15 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_thread_state64 > ( ) ) ) . __rip as * const _ as usize } , 128usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_thread_state64 ) , "::" , stringify ! ( __rip ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_thread_state64 > ( ) ) ) . __rflags as * const _ as usize } , 136usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_thread_state64 ) , "::" , stringify ! ( __rflags ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_thread_state64 > ( ) ) ) . __cs as * const _ as usize } , 144usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_thread_state64 ) , "::" , stringify ! ( __cs ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_thread_state64 > ( ) ) ) . __fs as * const _ as usize } , 152usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_thread_state64 ) , "::" , stringify ! ( __fs ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_thread_state64 > ( ) ) ) . __gs as * const _ as usize } , 160usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_thread_state64 ) , "::" , stringify ! ( __gs ) ) ) ; } # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct __darwin_x86_thread_full_state64 { pub __ss64 : __darwin_x86_thread_state64 , pub __ds : __uint64_t , pub __es : __uint64_t , pub __ss : __uint64_t , pub __gsbase : __uint64_t , } # [ test ] fn bindgen_test_layout___darwin_x86_thread_full_state64 ( ) { assert_eq ! ( :: core :: mem :: size_of :: < __darwin_x86_thread_full_state64 > ( ) , 200usize , concat ! ( "Size of: " , stringify ! ( __darwin_x86_thread_full_state64 ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < __darwin_x86_thread_full_state64 > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( __darwin_x86_thread_full_state64 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_thread_full_state64 > ( ) ) ) . __ss64 as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_thread_full_state64 ) , "::" , stringify ! ( __ss64 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_thread_full_state64 > ( ) ) ) . __ds as * const _ as usize } , 168usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_thread_full_state64 ) , "::" , stringify ! ( __ds ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_thread_full_state64 > ( ) ) ) . __es as * const _ as usize } , 176usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_thread_full_state64 ) , "::" , stringify ! ( __es ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_thread_full_state64 > ( ) ) ) . __ss as * const _ as usize } , 184usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_thread_full_state64 ) , "::" , stringify ! ( __ss ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_thread_full_state64 > ( ) ) ) . __gsbase as * const _ as usize } , 192usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_thread_full_state64 ) , "::" , stringify ! ( __gsbase ) ) ) ; } # [ repr ( C ) ] # [ derive ( Copy , Clone ) ] pub struct __darwin_x86_float_state64 { pub __fpu_reserved : [ libc :: c_int ; 2usize ] , pub __fpu_fcw : __darwin_fp_control , pub __fpu_fsw : __darwin_fp_status , pub __fpu_ftw : __uint8_t , pub __fpu_rsrv1 : __uint8_t , pub __fpu_fop : __uint16_t , pub __fpu_ip : __uint32_t , pub __fpu_cs : __uint16_t , pub __fpu_rsrv2 : __uint16_t , pub __fpu_dp : __uint32_t , pub __fpu_ds : __uint16_t , pub __fpu_rsrv3 : __uint16_t , pub __fpu_mxcsr : __uint32_t , pub __fpu_mxcsrmask : __uint32_t , pub __fpu_stmm0 : __darwin_mmst_reg , pub __fpu_stmm1 : __darwin_mmst_reg , pub __fpu_stmm2 : __darwin_mmst_reg , pub __fpu_stmm3 : __darwin_mmst_reg , pub __fpu_stmm4 : __darwin_mmst_reg , pub __fpu_stmm5 : __darwin_mmst_reg , pub __fpu_stmm6 : __darwin_mmst_reg , pub __fpu_stmm7 : __darwin_mmst_reg , pub __fpu_xmm0 : __darwin_xmm_reg , pub __fpu_xmm1 : __darwin_xmm_reg , pub __fpu_xmm2 : __darwin_xmm_reg , pub __fpu_xmm3 : __darwin_xmm_reg , pub __fpu_xmm4 : __darwin_xmm_reg , pub __fpu_xmm5 : __darwin_xmm_reg , pub __fpu_xmm6 : __darwin_xmm_reg , pub __fpu_xmm7 : __darwin_xmm_reg , pub __fpu_xmm8 : __darwin_xmm_reg , pub __fpu_xmm9 : __darwin_xmm_reg , pub __fpu_xmm10 : __darwin_xmm_reg , pub __fpu_xmm11 : __darwin_xmm_reg , pub __fpu_xmm12 : __darwin_xmm_reg , pub __fpu_xmm13 : __darwin_xmm_reg , pub __fpu_xmm14 : __darwin_xmm_reg , pub __fpu_xmm15 : __darwin_xmm_reg , pub __fpu_rsrv4 : [ libc :: c_char ; 96usize ] , pub __fpu_reserved1 : libc :: c_int , } # [ test ] fn bindgen_test_layout___darwin_x86_float_state64 ( ) { assert_eq ! ( :: core :: mem :: size_of :: < __darwin_x86_float_state64 > ( ) , 524usize , concat ! ( "Size of: " , stringify ! ( __darwin_x86_float_state64 ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < __darwin_x86_float_state64 > ( ) , 4usize , concat ! ( "Alignment of " , stringify ! ( __darwin_x86_float_state64 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_float_state64 > ( ) ) ) . __fpu_reserved as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_float_state64 ) , "::" , stringify ! ( __fpu_reserved ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_float_state64 > ( ) ) ) . __fpu_fcw as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_float_state64 ) , "::" , stringify ! ( __fpu_fcw ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_float_state64 > ( ) ) ) . __fpu_fsw as * const _ as usize } , 10usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_float_state64 ) , "::" , stringify ! ( __fpu_fsw ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_float_state64 > ( ) ) ) . __fpu_ftw as * const _ as usize } , 12usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_float_state64 ) , "::" , stringify ! ( __fpu_ftw ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_float_state64 > ( ) ) ) . __fpu_rsrv1 as * const _ as usize } , 13usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_float_state64 ) , "::" , stringify ! ( __fpu_rsrv1 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_float_state64 > ( ) ) ) . __fpu_fop as * const _ as usize } , 14usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_float_state64 ) , "::" , stringify ! ( __fpu_fop ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_float_state64 > ( ) ) ) . __fpu_ip as * const _ as usize } , 16usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_float_state64 ) , "::" , stringify ! ( __fpu_ip ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_float_state64 > ( ) ) ) . __fpu_cs as * const _ as usize } , 20usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_float_state64 ) , "::" , stringify ! ( __fpu_cs ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_float_state64 > ( ) ) ) . __fpu_rsrv2 as * const _ as usize } , 22usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_float_state64 ) , "::" , stringify ! ( __fpu_rsrv2 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_float_state64 > ( ) ) ) . __fpu_dp as * const _ as usize } , 24usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_float_state64 ) , "::" , stringify ! ( __fpu_dp ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_float_state64 > ( ) ) ) . __fpu_ds as * const _ as usize } , 28usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_float_state64 ) , "::" , stringify ! ( __fpu_ds ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_float_state64 > ( ) ) ) . __fpu_rsrv3 as * const _ as usize } , 30usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_float_state64 ) , "::" , stringify ! ( __fpu_rsrv3 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_float_state64 > ( ) ) ) . __fpu_mxcsr as * const _ as usize } , 32usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_float_state64 ) , "::" , stringify ! ( __fpu_mxcsr ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_float_state64 > ( ) ) ) . __fpu_mxcsrmask as * const _ as usize } , 36usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_float_state64 ) , "::" , stringify ! ( __fpu_mxcsrmask ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_float_state64 > ( ) ) ) . __fpu_stmm0 as * const _ as usize } , 40usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_float_state64 ) , "::" , stringify ! ( __fpu_stmm0 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_float_state64 > ( ) ) ) . __fpu_stmm1 as * const _ as usize } , 56usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_float_state64 ) , "::" , stringify ! ( __fpu_stmm1 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_float_state64 > ( ) ) ) . __fpu_stmm2 as * const _ as usize } , 72usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_float_state64 ) , "::" , stringify ! ( __fpu_stmm2 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_float_state64 > ( ) ) ) . __fpu_stmm3 as * const _ as usize } , 88usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_float_state64 ) , "::" , stringify ! ( __fpu_stmm3 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_float_state64 > ( ) ) ) . __fpu_stmm4 as * const _ as usize } , 104usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_float_state64 ) , "::" , stringify ! ( __fpu_stmm4 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_float_state64 > ( ) ) ) . __fpu_stmm5 as * const _ as usize } , 120usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_float_state64 ) , "::" , stringify ! ( __fpu_stmm5 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_float_state64 > ( ) ) ) . __fpu_stmm6 as * const _ as usize } , 136usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_float_state64 ) , "::" , stringify ! ( __fpu_stmm6 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_float_state64 > ( ) ) ) . __fpu_stmm7 as * const _ as usize } , 152usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_float_state64 ) , "::" , stringify ! ( __fpu_stmm7 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_float_state64 > ( ) ) ) . __fpu_xmm0 as * const _ as usize } , 168usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_float_state64 ) , "::" , stringify ! ( __fpu_xmm0 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_float_state64 > ( ) ) ) . __fpu_xmm1 as * const _ as usize } , 184usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_float_state64 ) , "::" , stringify ! ( __fpu_xmm1 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_float_state64 > ( ) ) ) . __fpu_xmm2 as * const _ as usize } , 200usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_float_state64 ) , "::" , stringify ! ( __fpu_xmm2 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_float_state64 > ( ) ) ) . __fpu_xmm3 as * const _ as usize } , 216usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_float_state64 ) , "::" , stringify ! ( __fpu_xmm3 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_float_state64 > ( ) ) ) . __fpu_xmm4 as * const _ as usize } , 232usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_float_state64 ) , "::" , stringify ! ( __fpu_xmm4 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_float_state64 > ( ) ) ) . __fpu_xmm5 as * const _ as usize } , 248usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_float_state64 ) , "::" , stringify ! ( __fpu_xmm5 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_float_state64 > ( ) ) ) . __fpu_xmm6 as * const _ as usize } , 264usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_float_state64 ) , "::" , stringify ! ( __fpu_xmm6 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_float_state64 > ( ) ) ) . __fpu_xmm7 as * const _ as usize } , 280usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_float_state64 ) , "::" , stringify ! ( __fpu_xmm7 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_float_state64 > ( ) ) ) . __fpu_xmm8 as * const _ as usize } , 296usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_float_state64 ) , "::" , stringify ! ( __fpu_xmm8 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_float_state64 > ( ) ) ) . __fpu_xmm9 as * const _ as usize } , 312usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_float_state64 ) , "::" , stringify ! ( __fpu_xmm9 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_float_state64 > ( ) ) ) . __fpu_xmm10 as * const _ as usize } , 328usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_float_state64 ) , "::" , stringify ! ( __fpu_xmm10 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_float_state64 > ( ) ) ) . __fpu_xmm11 as * const _ as usize } , 344usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_float_state64 ) , "::" , stringify ! ( __fpu_xmm11 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_float_state64 > ( ) ) ) . __fpu_xmm12 as * const _ as usize } , 360usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_float_state64 ) , "::" , stringify ! ( __fpu_xmm12 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_float_state64 > ( ) ) ) . __fpu_xmm13 as * const _ as usize } , 376usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_float_state64 ) , "::" , stringify ! ( __fpu_xmm13 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_float_state64 > ( ) ) ) . __fpu_xmm14 as * const _ as usize } , 392usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_float_state64 ) , "::" , stringify ! ( __fpu_xmm14 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_float_state64 > ( ) ) ) . __fpu_xmm15 as * const _ as usize } , 408usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_float_state64 ) , "::" , stringify ! ( __fpu_xmm15 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_float_state64 > ( ) ) ) . __fpu_rsrv4 as * const _ as usize } , 424usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_float_state64 ) , "::" , stringify ! ( __fpu_rsrv4 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_float_state64 > ( ) ) ) . __fpu_reserved1 as * const _ as usize } , 520usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_float_state64 ) , "::" , stringify ! ( __fpu_reserved1 ) ) ) ; } impl :: core :: fmt :: Debug for __darwin_x86_float_state64 { fn fmt ( & self , f : & mut :: core :: fmt :: Formatter < '_ > ) -> :: core :: fmt :: Result { write ! ( f , "__darwin_x86_float_state64 {{ __fpu_reserved: {:?}, __fpu_fcw: {:?}, __fpu_fsw: {:?}, __fpu_ftw: {:?}, __fpu_rsrv1: {:?}, __fpu_fop: {:?}, __fpu_ip: {:?}, __fpu_cs: {:?}, __fpu_rsrv2: {:?}, __fpu_dp: {:?}, __fpu_ds: {:?}, __fpu_rsrv3: {:?}, __fpu_mxcsr: {:?}, __fpu_mxcsrmask: {:?}, __fpu_stmm0: {:?}, __fpu_stmm1: {:?}, __fpu_stmm2: {:?}, __fpu_stmm3: {:?}, __fpu_stmm4: {:?}, __fpu_stmm5: {:?}, __fpu_stmm6: {:?}, __fpu_stmm7: {:?}, __fpu_xmm0: {:?}, __fpu_xmm1: {:?}, __fpu_xmm2: {:?}, __fpu_xmm3: {:?}, __fpu_xmm4: {:?}, __fpu_xmm5: {:?}, __fpu_xmm6: {:?}, __fpu_xmm7: {:?}, __fpu_xmm8: {:?}, __fpu_xmm9: {:?}, __fpu_xmm10: {:?}, __fpu_xmm11: {:?}, __fpu_xmm12: {:?}, __fpu_xmm13: {:?}, __fpu_xmm14: {:?}, __fpu_xmm15: {:?}, __fpu_rsrv4: [...], __fpu_reserved1: {:?} }}" , self . __fpu_reserved , self . __fpu_fcw , self . __fpu_fsw , self . __fpu_ftw , self . __fpu_rsrv1 , self . __fpu_fop , self . __fpu_ip , self . __fpu_cs , self . __fpu_rsrv2 , self . __fpu_dp , self . __fpu_ds , self . __fpu_rsrv3 , self . __fpu_mxcsr , self . __fpu_mxcsrmask , self . __fpu_stmm0 , self . __fpu_stmm1 , self . __fpu_stmm2 , self . __fpu_stmm3 , self . __fpu_stmm4 , self . __fpu_stmm5 , self . __fpu_stmm6 , self . __fpu_stmm7 , self . __fpu_xmm0 , self . __fpu_xmm1 , self . __fpu_xmm2 , self . __fpu_xmm3 , self . __fpu_xmm4 , self . __fpu_xmm5 , self . __fpu_xmm6 , self . __fpu_xmm7 , self . __fpu_xmm8 , self . __fpu_xmm9 , self . __fpu_xmm10 , self . __fpu_xmm11 , self . __fpu_xmm12 , self . __fpu_xmm13 , self . __fpu_xmm14 , self . __fpu_xmm15 , self . __fpu_reserved1 ) } } # [ repr ( C ) ] # [ derive ( Copy , Clone ) ] pub struct __darwin_x86_avx_state64 { pub __fpu_reserved : [ libc :: c_int ; 2usize ] , pub __fpu_fcw : __darwin_fp_control , pub __fpu_fsw : __darwin_fp_status , pub __fpu_ftw : __uint8_t , pub __fpu_rsrv1 : __uint8_t , pub __fpu_fop : __uint16_t , pub __fpu_ip : __uint32_t , pub __fpu_cs : __uint16_t , pub __fpu_rsrv2 : __uint16_t , pub __fpu_dp : __uint32_t , pub __fpu_ds : __uint16_t , pub __fpu_rsrv3 : __uint16_t , pub __fpu_mxcsr : __uint32_t , pub __fpu_mxcsrmask : __uint32_t , pub __fpu_stmm0 : __darwin_mmst_reg , pub __fpu_stmm1 : __darwin_mmst_reg , pub __fpu_stmm2 : __darwin_mmst_reg , pub __fpu_stmm3 : __darwin_mmst_reg , pub __fpu_stmm4 : __darwin_mmst_reg , pub __fpu_stmm5 : __darwin_mmst_reg , pub __fpu_stmm6 : __darwin_mmst_reg , pub __fpu_stmm7 : __darwin_mmst_reg , pub __fpu_xmm0 : __darwin_xmm_reg , pub __fpu_xmm1 : __darwin_xmm_reg , pub __fpu_xmm2 : __darwin_xmm_reg , pub __fpu_xmm3 : __darwin_xmm_reg , pub __fpu_xmm4 : __darwin_xmm_reg , pub __fpu_xmm5 : __darwin_xmm_reg , pub __fpu_xmm6 : __darwin_xmm_reg , pub __fpu_xmm7 : __darwin_xmm_reg , pub __fpu_xmm8 : __darwin_xmm_reg , pub __fpu_xmm9 : __darwin_xmm_reg , pub __fpu_xmm10 : __darwin_xmm_reg , pub __fpu_xmm11 : __darwin_xmm_reg , pub __fpu_xmm12 : __darwin_xmm_reg , pub __fpu_xmm13 : __darwin_xmm_reg , pub __fpu_xmm14 : __darwin_xmm_reg , pub __fpu_xmm15 : __darwin_xmm_reg , pub __fpu_rsrv4 : [ libc :: c_char ; 96usize ] , pub __fpu_reserved1 : libc :: c_int , pub __avx_reserved1 : [ libc :: c_char ; 64usize ] , pub __fpu_ymmh0 : __darwin_xmm_reg , pub __fpu_ymmh1 : __darwin_xmm_reg , pub __fpu_ymmh2 : __darwin_xmm_reg , pub __fpu_ymmh3 : __darwin_xmm_reg , pub __fpu_ymmh4 : __darwin_xmm_reg , pub __fpu_ymmh5 : __darwin_xmm_reg , pub __fpu_ymmh6 : __darwin_xmm_reg , pub __fpu_ymmh7 : __darwin_xmm_reg , pub __fpu_ymmh8 : __darwin_xmm_reg , pub __fpu_ymmh9 : __darwin_xmm_reg , pub __fpu_ymmh10 : __darwin_xmm_reg , pub __fpu_ymmh11 : __darwin_xmm_reg , pub __fpu_ymmh12 : __darwin_xmm_reg , pub __fpu_ymmh13 : __darwin_xmm_reg , pub __fpu_ymmh14 : __darwin_xmm_reg , pub __fpu_ymmh15 : __darwin_xmm_reg , } # [ test ] fn bindgen_test_layout___darwin_x86_avx_state64 ( ) { assert_eq ! ( :: core :: mem :: size_of :: < __darwin_x86_avx_state64 > ( ) , 844usize , concat ! ( "Size of: " , stringify ! ( __darwin_x86_avx_state64 ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < __darwin_x86_avx_state64 > ( ) , 4usize , concat ! ( "Alignment of " , stringify ! ( __darwin_x86_avx_state64 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx_state64 > ( ) ) ) . __fpu_reserved as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx_state64 ) , "::" , stringify ! ( __fpu_reserved ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx_state64 > ( ) ) ) . __fpu_fcw as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx_state64 ) , "::" , stringify ! ( __fpu_fcw ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx_state64 > ( ) ) ) . __fpu_fsw as * const _ as usize } , 10usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx_state64 ) , "::" , stringify ! ( __fpu_fsw ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx_state64 > ( ) ) ) . __fpu_ftw as * const _ as usize } , 12usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx_state64 ) , "::" , stringify ! ( __fpu_ftw ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx_state64 > ( ) ) ) . __fpu_rsrv1 as * const _ as usize } , 13usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx_state64 ) , "::" , stringify ! ( __fpu_rsrv1 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx_state64 > ( ) ) ) . __fpu_fop as * const _ as usize } , 14usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx_state64 ) , "::" , stringify ! ( __fpu_fop ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx_state64 > ( ) ) ) . __fpu_ip as * const _ as usize } , 16usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx_state64 ) , "::" , stringify ! ( __fpu_ip ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx_state64 > ( ) ) ) . __fpu_cs as * const _ as usize } , 20usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx_state64 ) , "::" , stringify ! ( __fpu_cs ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx_state64 > ( ) ) ) . __fpu_rsrv2 as * const _ as usize } , 22usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx_state64 ) , "::" , stringify ! ( __fpu_rsrv2 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx_state64 > ( ) ) ) . __fpu_dp as * const _ as usize } , 24usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx_state64 ) , "::" , stringify ! ( __fpu_dp ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx_state64 > ( ) ) ) . __fpu_ds as * const _ as usize } , 28usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx_state64 ) , "::" , stringify ! ( __fpu_ds ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx_state64 > ( ) ) ) . __fpu_rsrv3 as * const _ as usize } , 30usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx_state64 ) , "::" , stringify ! ( __fpu_rsrv3 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx_state64 > ( ) ) ) . __fpu_mxcsr as * const _ as usize } , 32usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx_state64 ) , "::" , stringify ! ( __fpu_mxcsr ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx_state64 > ( ) ) ) . __fpu_mxcsrmask as * const _ as usize } , 36usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx_state64 ) , "::" , stringify ! ( __fpu_mxcsrmask ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx_state64 > ( ) ) ) . __fpu_stmm0 as * const _ as usize } , 40usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx_state64 ) , "::" , stringify ! ( __fpu_stmm0 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx_state64 > ( ) ) ) . __fpu_stmm1 as * const _ as usize } , 56usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx_state64 ) , "::" , stringify ! ( __fpu_stmm1 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx_state64 > ( ) ) ) . __fpu_stmm2 as * const _ as usize } , 72usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx_state64 ) , "::" , stringify ! ( __fpu_stmm2 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx_state64 > ( ) ) ) . __fpu_stmm3 as * const _ as usize } , 88usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx_state64 ) , "::" , stringify ! ( __fpu_stmm3 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx_state64 > ( ) ) ) . __fpu_stmm4 as * const _ as usize } , 104usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx_state64 ) , "::" , stringify ! ( __fpu_stmm4 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx_state64 > ( ) ) ) . __fpu_stmm5 as * const _ as usize } , 120usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx_state64 ) , "::" , stringify ! ( __fpu_stmm5 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx_state64 > ( ) ) ) . __fpu_stmm6 as * const _ as usize } , 136usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx_state64 ) , "::" , stringify ! ( __fpu_stmm6 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx_state64 > ( ) ) ) . __fpu_stmm7 as * const _ as usize } , 152usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx_state64 ) , "::" , stringify ! ( __fpu_stmm7 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx_state64 > ( ) ) ) . __fpu_xmm0 as * const _ as usize } , 168usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx_state64 ) , "::" , stringify ! ( __fpu_xmm0 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx_state64 > ( ) ) ) . __fpu_xmm1 as * const _ as usize } , 184usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx_state64 ) , "::" , stringify ! ( __fpu_xmm1 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx_state64 > ( ) ) ) . __fpu_xmm2 as * const _ as usize } , 200usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx_state64 ) , "::" , stringify ! ( __fpu_xmm2 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx_state64 > ( ) ) ) . __fpu_xmm3 as * const _ as usize } , 216usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx_state64 ) , "::" , stringify ! ( __fpu_xmm3 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx_state64 > ( ) ) ) . __fpu_xmm4 as * const _ as usize } , 232usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx_state64 ) , "::" , stringify ! ( __fpu_xmm4 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx_state64 > ( ) ) ) . __fpu_xmm5 as * const _ as usize } , 248usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx_state64 ) , "::" , stringify ! ( __fpu_xmm5 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx_state64 > ( ) ) ) . __fpu_xmm6 as * const _ as usize } , 264usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx_state64 ) , "::" , stringify ! ( __fpu_xmm6 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx_state64 > ( ) ) ) . __fpu_xmm7 as * const _ as usize } , 280usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx_state64 ) , "::" , stringify ! ( __fpu_xmm7 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx_state64 > ( ) ) ) . __fpu_xmm8 as * const _ as usize } , 296usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx_state64 ) , "::" , stringify ! ( __fpu_xmm8 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx_state64 > ( ) ) ) . __fpu_xmm9 as * const _ as usize } , 312usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx_state64 ) , "::" , stringify ! ( __fpu_xmm9 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx_state64 > ( ) ) ) . __fpu_xmm10 as * const _ as usize } , 328usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx_state64 ) , "::" , stringify ! ( __fpu_xmm10 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx_state64 > ( ) ) ) . __fpu_xmm11 as * const _ as usize } , 344usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx_state64 ) , "::" , stringify ! ( __fpu_xmm11 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx_state64 > ( ) ) ) . __fpu_xmm12 as * const _ as usize } , 360usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx_state64 ) , "::" , stringify ! ( __fpu_xmm12 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx_state64 > ( ) ) ) . __fpu_xmm13 as * const _ as usize } , 376usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx_state64 ) , "::" , stringify ! ( __fpu_xmm13 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx_state64 > ( ) ) ) . __fpu_xmm14 as * const _ as usize } , 392usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx_state64 ) , "::" , stringify ! ( __fpu_xmm14 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx_state64 > ( ) ) ) . __fpu_xmm15 as * const _ as usize } , 408usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx_state64 ) , "::" , stringify ! ( __fpu_xmm15 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx_state64 > ( ) ) ) . __fpu_rsrv4 as * const _ as usize } , 424usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx_state64 ) , "::" , stringify ! ( __fpu_rsrv4 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx_state64 > ( ) ) ) . __fpu_reserved1 as * const _ as usize } , 520usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx_state64 ) , "::" , stringify ! ( __fpu_reserved1 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx_state64 > ( ) ) ) . __avx_reserved1 as * const _ as usize } , 524usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx_state64 ) , "::" , stringify ! ( __avx_reserved1 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx_state64 > ( ) ) ) . __fpu_ymmh0 as * const _ as usize } , 588usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx_state64 ) , "::" , stringify ! ( __fpu_ymmh0 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx_state64 > ( ) ) ) . __fpu_ymmh1 as * const _ as usize } , 604usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx_state64 ) , "::" , stringify ! ( __fpu_ymmh1 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx_state64 > ( ) ) ) . __fpu_ymmh2 as * const _ as usize } , 620usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx_state64 ) , "::" , stringify ! ( __fpu_ymmh2 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx_state64 > ( ) ) ) . __fpu_ymmh3 as * const _ as usize } , 636usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx_state64 ) , "::" , stringify ! ( __fpu_ymmh3 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx_state64 > ( ) ) ) . __fpu_ymmh4 as * const _ as usize } , 652usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx_state64 ) , "::" , stringify ! ( __fpu_ymmh4 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx_state64 > ( ) ) ) . __fpu_ymmh5 as * const _ as usize } , 668usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx_state64 ) , "::" , stringify ! ( __fpu_ymmh5 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx_state64 > ( ) ) ) . __fpu_ymmh6 as * const _ as usize } , 684usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx_state64 ) , "::" , stringify ! ( __fpu_ymmh6 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx_state64 > ( ) ) ) . __fpu_ymmh7 as * const _ as usize } , 700usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx_state64 ) , "::" , stringify ! ( __fpu_ymmh7 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx_state64 > ( ) ) ) . __fpu_ymmh8 as * const _ as usize } , 716usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx_state64 ) , "::" , stringify ! ( __fpu_ymmh8 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx_state64 > ( ) ) ) . __fpu_ymmh9 as * const _ as usize } , 732usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx_state64 ) , "::" , stringify ! ( __fpu_ymmh9 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx_state64 > ( ) ) ) . __fpu_ymmh10 as * const _ as usize } , 748usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx_state64 ) , "::" , stringify ! ( __fpu_ymmh10 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx_state64 > ( ) ) ) . __fpu_ymmh11 as * const _ as usize } , 764usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx_state64 ) , "::" , stringify ! ( __fpu_ymmh11 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx_state64 > ( ) ) ) . __fpu_ymmh12 as * const _ as usize } , 780usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx_state64 ) , "::" , stringify ! ( __fpu_ymmh12 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx_state64 > ( ) ) ) . __fpu_ymmh13 as * const _ as usize } , 796usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx_state64 ) , "::" , stringify ! ( __fpu_ymmh13 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx_state64 > ( ) ) ) . __fpu_ymmh14 as * const _ as usize } , 812usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx_state64 ) , "::" , stringify ! ( __fpu_ymmh14 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx_state64 > ( ) ) ) . __fpu_ymmh15 as * const _ as usize } , 828usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx_state64 ) , "::" , stringify ! ( __fpu_ymmh15 ) ) ) ; } impl :: core :: fmt :: Debug for __darwin_x86_avx_state64 { fn fmt ( & self , f : & mut :: core :: fmt :: Formatter < '_ > ) -> :: core :: fmt :: Result { write ! ( f , "__darwin_x86_avx_state64 {{ __fpu_reserved: {:?}, __fpu_fcw: {:?}, __fpu_fsw: {:?}, __fpu_ftw: {:?}, __fpu_rsrv1: {:?}, __fpu_fop: {:?}, __fpu_ip: {:?}, __fpu_cs: {:?}, __fpu_rsrv2: {:?}, __fpu_dp: {:?}, __fpu_ds: {:?}, __fpu_rsrv3: {:?}, __fpu_mxcsr: {:?}, __fpu_mxcsrmask: {:?}, __fpu_stmm0: {:?}, __fpu_stmm1: {:?}, __fpu_stmm2: {:?}, __fpu_stmm3: {:?}, __fpu_stmm4: {:?}, __fpu_stmm5: {:?}, __fpu_stmm6: {:?}, __fpu_stmm7: {:?}, __fpu_xmm0: {:?}, __fpu_xmm1: {:?}, __fpu_xmm2: {:?}, __fpu_xmm3: {:?}, __fpu_xmm4: {:?}, __fpu_xmm5: {:?}, __fpu_xmm6: {:?}, __fpu_xmm7: {:?}, __fpu_xmm8: {:?}, __fpu_xmm9: {:?}, __fpu_xmm10: {:?}, __fpu_xmm11: {:?}, __fpu_xmm12: {:?}, __fpu_xmm13: {:?}, __fpu_xmm14: {:?}, __fpu_xmm15: {:?}, __fpu_rsrv4: [...], __fpu_reserved1: {:?}, __avx_reserved1: [...], __fpu_ymmh0: {:?}, __fpu_ymmh1: {:?}, __fpu_ymmh2: {:?}, __fpu_ymmh3: {:?}, __fpu_ymmh4: {:?}, __fpu_ymmh5: {:?}, __fpu_ymmh6: {:?}, __fpu_ymmh7: {:?}, __fpu_ymmh8: {:?}, __fpu_ymmh9: {:?}, __fpu_ymmh10: {:?}, __fpu_ymmh11: {:?}, __fpu_ymmh12: {:?}, __fpu_ymmh13: {:?}, __fpu_ymmh14: {:?}, __fpu_ymmh15: {:?} }}" , self . __fpu_reserved , self . __fpu_fcw , self . __fpu_fsw , self . __fpu_ftw , self . __fpu_rsrv1 , self . __fpu_fop , self . __fpu_ip , self . __fpu_cs , self . __fpu_rsrv2 , self . __fpu_dp , self . __fpu_ds , self . __fpu_rsrv3 , self . __fpu_mxcsr , self . __fpu_mxcsrmask , self . __fpu_stmm0 , self . __fpu_stmm1 , self . __fpu_stmm2 , self . __fpu_stmm3 , self . __fpu_stmm4 , self . __fpu_stmm5 , self . __fpu_stmm6 , self . __fpu_stmm7 , self . __fpu_xmm0 , self . __fpu_xmm1 , self . __fpu_xmm2 , self . __fpu_xmm3 , self . __fpu_xmm4 , self . __fpu_xmm5 , self . __fpu_xmm6 , self . __fpu_xmm7 , self . __fpu_xmm8 , self . __fpu_xmm9 , self . __fpu_xmm10 , self . __fpu_xmm11 , self . __fpu_xmm12 , self . __fpu_xmm13 , self . __fpu_xmm14 , self . __fpu_xmm15 , self . __fpu_reserved1 , self . __fpu_ymmh0 , self . __fpu_ymmh1 , self . __fpu_ymmh2 , self . __fpu_ymmh3 , self . __fpu_ymmh4 , self . __fpu_ymmh5 , self . __fpu_ymmh6 , self . __fpu_ymmh7 , self . __fpu_ymmh8 , self . __fpu_ymmh9 , self . __fpu_ymmh10 , self . __fpu_ymmh11 , self . __fpu_ymmh12 , self . __fpu_ymmh13 , self . __fpu_ymmh14 , self . __fpu_ymmh15 ) } } # [ repr ( C ) ] # [ derive ( Copy , Clone ) ] pub struct __darwin_x86_avx512_state64 { pub __fpu_reserved : [ libc :: c_int ; 2usize ] , pub __fpu_fcw : __darwin_fp_control , pub __fpu_fsw : __darwin_fp_status , pub __fpu_ftw : __uint8_t , pub __fpu_rsrv1 : __uint8_t , pub __fpu_fop : __uint16_t , pub __fpu_ip : __uint32_t , pub __fpu_cs : __uint16_t , pub __fpu_rsrv2 : __uint16_t , pub __fpu_dp : __uint32_t , pub __fpu_ds : __uint16_t , pub __fpu_rsrv3 : __uint16_t , pub __fpu_mxcsr : __uint32_t , pub __fpu_mxcsrmask : __uint32_t , pub __fpu_stmm0 : __darwin_mmst_reg , pub __fpu_stmm1 : __darwin_mmst_reg , pub __fpu_stmm2 : __darwin_mmst_reg , pub __fpu_stmm3 : __darwin_mmst_reg , pub __fpu_stmm4 : __darwin_mmst_reg , pub __fpu_stmm5 : __darwin_mmst_reg , pub __fpu_stmm6 : __darwin_mmst_reg , pub __fpu_stmm7 : __darwin_mmst_reg , pub __fpu_xmm0 : __darwin_xmm_reg , pub __fpu_xmm1 : __darwin_xmm_reg , pub __fpu_xmm2 : __darwin_xmm_reg , pub __fpu_xmm3 : __darwin_xmm_reg , pub __fpu_xmm4 : __darwin_xmm_reg , pub __fpu_xmm5 : __darwin_xmm_reg , pub __fpu_xmm6 : __darwin_xmm_reg , pub __fpu_xmm7 : __darwin_xmm_reg , pub __fpu_xmm8 : __darwin_xmm_reg , pub __fpu_xmm9 : __darwin_xmm_reg , pub __fpu_xmm10 : __darwin_xmm_reg , pub __fpu_xmm11 : __darwin_xmm_reg , pub __fpu_xmm12 : __darwin_xmm_reg , pub __fpu_xmm13 : __darwin_xmm_reg , pub __fpu_xmm14 : __darwin_xmm_reg , pub __fpu_xmm15 : __darwin_xmm_reg , pub __fpu_rsrv4 : [ libc :: c_char ; 96usize ] , pub __fpu_reserved1 : libc :: c_int , pub __avx_reserved1 : [ libc :: c_char ; 64usize ] , pub __fpu_ymmh0 : __darwin_xmm_reg , pub __fpu_ymmh1 : __darwin_xmm_reg , pub __fpu_ymmh2 : __darwin_xmm_reg , pub __fpu_ymmh3 : __darwin_xmm_reg , pub __fpu_ymmh4 : __darwin_xmm_reg , pub __fpu_ymmh5 : __darwin_xmm_reg , pub __fpu_ymmh6 : __darwin_xmm_reg , pub __fpu_ymmh7 : __darwin_xmm_reg , pub __fpu_ymmh8 : __darwin_xmm_reg , pub __fpu_ymmh9 : __darwin_xmm_reg , pub __fpu_ymmh10 : __darwin_xmm_reg , pub __fpu_ymmh11 : __darwin_xmm_reg , pub __fpu_ymmh12 : __darwin_xmm_reg , pub __fpu_ymmh13 : __darwin_xmm_reg , pub __fpu_ymmh14 : __darwin_xmm_reg , pub __fpu_ymmh15 : __darwin_xmm_reg , pub __fpu_k0 : __darwin_opmask_reg , pub __fpu_k1 : __darwin_opmask_reg , pub __fpu_k2 : __darwin_opmask_reg , pub __fpu_k3 : __darwin_opmask_reg , pub __fpu_k4 : __darwin_opmask_reg , pub __fpu_k5 : __darwin_opmask_reg , pub __fpu_k6 : __darwin_opmask_reg , pub __fpu_k7 : __darwin_opmask_reg , pub __fpu_zmmh0 : __darwin_ymm_reg , pub __fpu_zmmh1 : __darwin_ymm_reg , pub __fpu_zmmh2 : __darwin_ymm_reg , pub __fpu_zmmh3 : __darwin_ymm_reg , pub __fpu_zmmh4 : __darwin_ymm_reg , pub __fpu_zmmh5 : __darwin_ymm_reg , pub __fpu_zmmh6 : __darwin_ymm_reg , pub __fpu_zmmh7 : __darwin_ymm_reg , pub __fpu_zmmh8 : __darwin_ymm_reg , pub __fpu_zmmh9 : __darwin_ymm_reg , pub __fpu_zmmh10 : __darwin_ymm_reg , pub __fpu_zmmh11 : __darwin_ymm_reg , pub __fpu_zmmh12 : __darwin_ymm_reg , pub __fpu_zmmh13 : __darwin_ymm_reg , pub __fpu_zmmh14 : __darwin_ymm_reg , pub __fpu_zmmh15 : __darwin_ymm_reg , pub __fpu_zmm16 : __darwin_zmm_reg , pub __fpu_zmm17 : __darwin_zmm_reg , pub __fpu_zmm18 : __darwin_zmm_reg , pub __fpu_zmm19 : __darwin_zmm_reg , pub __fpu_zmm20 : __darwin_zmm_reg , pub __fpu_zmm21 : __darwin_zmm_reg , pub __fpu_zmm22 : __darwin_zmm_reg , pub __fpu_zmm23 : __darwin_zmm_reg , pub __fpu_zmm24 : __darwin_zmm_reg , pub __fpu_zmm25 : __darwin_zmm_reg , pub __fpu_zmm26 : __darwin_zmm_reg , pub __fpu_zmm27 : __darwin_zmm_reg , pub __fpu_zmm28 : __darwin_zmm_reg , pub __fpu_zmm29 : __darwin_zmm_reg , pub __fpu_zmm30 : __darwin_zmm_reg , pub __fpu_zmm31 : __darwin_zmm_reg , } # [ test ] fn bindgen_test_layout___darwin_x86_avx512_state64 ( ) { assert_eq ! ( :: core :: mem :: size_of :: < __darwin_x86_avx512_state64 > ( ) , 2444usize , concat ! ( "Size of: " , stringify ! ( __darwin_x86_avx512_state64 ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < __darwin_x86_avx512_state64 > ( ) , 4usize , concat ! ( "Alignment of " , stringify ! ( __darwin_x86_avx512_state64 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_reserved as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_reserved ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_fcw as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_fcw ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_fsw as * const _ as usize } , 10usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_fsw ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_ftw as * const _ as usize } , 12usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_ftw ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_rsrv1 as * const _ as usize } , 13usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_rsrv1 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_fop as * const _ as usize } , 14usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_fop ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_ip as * const _ as usize } , 16usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_ip ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_cs as * const _ as usize } , 20usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_cs ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_rsrv2 as * const _ as usize } , 22usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_rsrv2 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_dp as * const _ as usize } , 24usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_dp ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_ds as * const _ as usize } , 28usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_ds ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_rsrv3 as * const _ as usize } , 30usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_rsrv3 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_mxcsr as * const _ as usize } , 32usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_mxcsr ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_mxcsrmask as * const _ as usize } , 36usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_mxcsrmask ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_stmm0 as * const _ as usize } , 40usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_stmm0 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_stmm1 as * const _ as usize } , 56usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_stmm1 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_stmm2 as * const _ as usize } , 72usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_stmm2 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_stmm3 as * const _ as usize } , 88usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_stmm3 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_stmm4 as * const _ as usize } , 104usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_stmm4 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_stmm5 as * const _ as usize } , 120usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_stmm5 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_stmm6 as * const _ as usize } , 136usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_stmm6 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_stmm7 as * const _ as usize } , 152usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_stmm7 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_xmm0 as * const _ as usize } , 168usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_xmm0 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_xmm1 as * const _ as usize } , 184usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_xmm1 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_xmm2 as * const _ as usize } , 200usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_xmm2 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_xmm3 as * const _ as usize } , 216usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_xmm3 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_xmm4 as * const _ as usize } , 232usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_xmm4 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_xmm5 as * const _ as usize } , 248usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_xmm5 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_xmm6 as * const _ as usize } , 264usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_xmm6 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_xmm7 as * const _ as usize } , 280usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_xmm7 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_xmm8 as * const _ as usize } , 296usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_xmm8 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_xmm9 as * const _ as usize } , 312usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_xmm9 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_xmm10 as * const _ as usize } , 328usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_xmm10 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_xmm11 as * const _ as usize } , 344usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_xmm11 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_xmm12 as * const _ as usize } , 360usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_xmm12 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_xmm13 as * const _ as usize } , 376usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_xmm13 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_xmm14 as * const _ as usize } , 392usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_xmm14 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_xmm15 as * const _ as usize } , 408usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_xmm15 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_rsrv4 as * const _ as usize } , 424usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_rsrv4 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_reserved1 as * const _ as usize } , 520usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_reserved1 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __avx_reserved1 as * const _ as usize } , 524usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __avx_reserved1 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_ymmh0 as * const _ as usize } , 588usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_ymmh0 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_ymmh1 as * const _ as usize } , 604usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_ymmh1 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_ymmh2 as * const _ as usize } , 620usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_ymmh2 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_ymmh3 as * const _ as usize } , 636usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_ymmh3 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_ymmh4 as * const _ as usize } , 652usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_ymmh4 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_ymmh5 as * const _ as usize } , 668usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_ymmh5 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_ymmh6 as * const _ as usize } , 684usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_ymmh6 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_ymmh7 as * const _ as usize } , 700usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_ymmh7 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_ymmh8 as * const _ as usize } , 716usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_ymmh8 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_ymmh9 as * const _ as usize } , 732usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_ymmh9 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_ymmh10 as * const _ as usize } , 748usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_ymmh10 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_ymmh11 as * const _ as usize } , 764usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_ymmh11 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_ymmh12 as * const _ as usize } , 780usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_ymmh12 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_ymmh13 as * const _ as usize } , 796usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_ymmh13 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_ymmh14 as * const _ as usize } , 812usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_ymmh14 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_ymmh15 as * const _ as usize } , 828usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_ymmh15 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_k0 as * const _ as usize } , 844usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_k0 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_k1 as * const _ as usize } , 852usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_k1 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_k2 as * const _ as usize } , 860usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_k2 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_k3 as * const _ as usize } , 868usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_k3 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_k4 as * const _ as usize } , 876usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_k4 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_k5 as * const _ as usize } , 884usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_k5 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_k6 as * const _ as usize } , 892usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_k6 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_k7 as * const _ as usize } , 900usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_k7 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_zmmh0 as * const _ as usize } , 908usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_zmmh0 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_zmmh1 as * const _ as usize } , 940usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_zmmh1 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_zmmh2 as * const _ as usize } , 972usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_zmmh2 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_zmmh3 as * const _ as usize } , 1004usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_zmmh3 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_zmmh4 as * const _ as usize } , 1036usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_zmmh4 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_zmmh5 as * const _ as usize } , 1068usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_zmmh5 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_zmmh6 as * const _ as usize } , 1100usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_zmmh6 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_zmmh7 as * const _ as usize } , 1132usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_zmmh7 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_zmmh8 as * const _ as usize } , 1164usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_zmmh8 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_zmmh9 as * const _ as usize } , 1196usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_zmmh9 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_zmmh10 as * const _ as usize } , 1228usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_zmmh10 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_zmmh11 as * const _ as usize } , 1260usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_zmmh11 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_zmmh12 as * const _ as usize } , 1292usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_zmmh12 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_zmmh13 as * const _ as usize } , 1324usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_zmmh13 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_zmmh14 as * const _ as usize } , 1356usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_zmmh14 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_zmmh15 as * const _ as usize } , 1388usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_zmmh15 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_zmm16 as * const _ as usize } , 1420usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_zmm16 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_zmm17 as * const _ as usize } , 1484usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_zmm17 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_zmm18 as * const _ as usize } , 1548usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_zmm18 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_zmm19 as * const _ as usize } , 1612usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_zmm19 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_zmm20 as * const _ as usize } , 1676usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_zmm20 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_zmm21 as * const _ as usize } , 1740usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_zmm21 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_zmm22 as * const _ as usize } , 1804usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_zmm22 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_zmm23 as * const _ as usize } , 1868usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_zmm23 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_zmm24 as * const _ as usize } , 1932usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_zmm24 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_zmm25 as * const _ as usize } , 1996usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_zmm25 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_zmm26 as * const _ as usize } , 2060usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_zmm26 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_zmm27 as * const _ as usize } , 2124usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_zmm27 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_zmm28 as * const _ as usize } , 2188usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_zmm28 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_zmm29 as * const _ as usize } , 2252usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_zmm29 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_zmm30 as * const _ as usize } , 2316usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_zmm30 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_avx512_state64 > ( ) ) ) . __fpu_zmm31 as * const _ as usize } , 2380usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_avx512_state64 ) , "::" , stringify ! ( __fpu_zmm31 ) ) ) ; } impl :: core :: fmt :: Debug for __darwin_x86_avx512_state64 { fn fmt ( & self , f : & mut :: core :: fmt :: Formatter < '_ > ) -> :: core :: fmt :: Result { write ! ( f , "__darwin_x86_avx512_state64 {{ __fpu_reserved: {:?}, __fpu_fcw: {:?}, __fpu_fsw: {:?}, __fpu_ftw: {:?}, __fpu_rsrv1: {:?}, __fpu_fop: {:?}, __fpu_ip: {:?}, __fpu_cs: {:?}, __fpu_rsrv2: {:?}, __fpu_dp: {:?}, __fpu_ds: {:?}, __fpu_rsrv3: {:?}, __fpu_mxcsr: {:?}, __fpu_mxcsrmask: {:?}, __fpu_stmm0: {:?}, __fpu_stmm1: {:?}, __fpu_stmm2: {:?}, __fpu_stmm3: {:?}, __fpu_stmm4: {:?}, __fpu_stmm5: {:?}, __fpu_stmm6: {:?}, __fpu_stmm7: {:?}, __fpu_xmm0: {:?}, __fpu_xmm1: {:?}, __fpu_xmm2: {:?}, __fpu_xmm3: {:?}, __fpu_xmm4: {:?}, __fpu_xmm5: {:?}, __fpu_xmm6: {:?}, __fpu_xmm7: {:?}, __fpu_xmm8: {:?}, __fpu_xmm9: {:?}, __fpu_xmm10: {:?}, __fpu_xmm11: {:?}, __fpu_xmm12: {:?}, __fpu_xmm13: {:?}, __fpu_xmm14: {:?}, __fpu_xmm15: {:?}, __fpu_rsrv4: [...], __fpu_reserved1: {:?}, __avx_reserved1: [...], __fpu_ymmh0: {:?}, __fpu_ymmh1: {:?}, __fpu_ymmh2: {:?}, __fpu_ymmh3: {:?}, __fpu_ymmh4: {:?}, __fpu_ymmh5: {:?}, __fpu_ymmh6: {:?}, __fpu_ymmh7: {:?}, __fpu_ymmh8: {:?}, __fpu_ymmh9: {:?}, __fpu_ymmh10: {:?}, __fpu_ymmh11: {:?}, __fpu_ymmh12: {:?}, __fpu_ymmh13: {:?}, __fpu_ymmh14: {:?}, __fpu_ymmh15: {:?}, __fpu_k0: {:?}, __fpu_k1: {:?}, __fpu_k2: {:?}, __fpu_k3: {:?}, __fpu_k4: {:?}, __fpu_k5: {:?}, __fpu_k6: {:?}, __fpu_k7: {:?}, __fpu_zmmh0: {:?}, __fpu_zmmh1: {:?}, __fpu_zmmh2: {:?}, __fpu_zmmh3: {:?}, __fpu_zmmh4: {:?}, __fpu_zmmh5: {:?}, __fpu_zmmh6: {:?}, __fpu_zmmh7: {:?}, __fpu_zmmh8: {:?}, __fpu_zmmh9: {:?}, __fpu_zmmh10: {:?}, __fpu_zmmh11: {:?}, __fpu_zmmh12: {:?}, __fpu_zmmh13: {:?}, __fpu_zmmh14: {:?}, __fpu_zmmh15: {:?}, __fpu_zmm16: {:?}, __fpu_zmm17: {:?}, __fpu_zmm18: {:?}, __fpu_zmm19: {:?}, __fpu_zmm20: {:?}, __fpu_zmm21: {:?}, __fpu_zmm22: {:?}, __fpu_zmm23: {:?}, __fpu_zmm24: {:?}, __fpu_zmm25: {:?}, __fpu_zmm26: {:?}, __fpu_zmm27: {:?}, __fpu_zmm28: {:?}, __fpu_zmm29: {:?}, __fpu_zmm30: {:?}, __fpu_zmm31: {:?} }}" , self . __fpu_reserved , self . __fpu_fcw , self . __fpu_fsw , self . __fpu_ftw , self . __fpu_rsrv1 , self . __fpu_fop , self . __fpu_ip , self . __fpu_cs , self . __fpu_rsrv2 , self . __fpu_dp , self . __fpu_ds , self . __fpu_rsrv3 , self . __fpu_mxcsr , self . __fpu_mxcsrmask , self . __fpu_stmm0 , self . __fpu_stmm1 , self . __fpu_stmm2 , self . __fpu_stmm3 , self . __fpu_stmm4 , self . __fpu_stmm5 , self . __fpu_stmm6 , self . __fpu_stmm7 , self . __fpu_xmm0 , self . __fpu_xmm1 , self . __fpu_xmm2 , self . __fpu_xmm3 , self . __fpu_xmm4 , self . __fpu_xmm5 , self . __fpu_xmm6 , self . __fpu_xmm7 , self . __fpu_xmm8 , self . __fpu_xmm9 , self . __fpu_xmm10 , self . __fpu_xmm11 , self . __fpu_xmm12 , self . __fpu_xmm13 , self . __fpu_xmm14 , self . __fpu_xmm15 , self . __fpu_reserved1 , self . __fpu_ymmh0 , self . __fpu_ymmh1 , self . __fpu_ymmh2 , self . __fpu_ymmh3 , self . __fpu_ymmh4 , self . __fpu_ymmh5 , self . __fpu_ymmh6 , self . __fpu_ymmh7 , self . __fpu_ymmh8 , self . __fpu_ymmh9 , self . __fpu_ymmh10 , self . __fpu_ymmh11 , self . __fpu_ymmh12 , self . __fpu_ymmh13 , self . __fpu_ymmh14 , self . __fpu_ymmh15 , self . __fpu_k0 , self . __fpu_k1 , self . __fpu_k2 , self . __fpu_k3 , self . __fpu_k4 , self . __fpu_k5 , self . __fpu_k6 , self . __fpu_k7 , self . __fpu_zmmh0 , self . __fpu_zmmh1 , self . __fpu_zmmh2 , self . __fpu_zmmh3 , self . __fpu_zmmh4 , self . __fpu_zmmh5 , self . __fpu_zmmh6 , self . __fpu_zmmh7 , self . __fpu_zmmh8 , self . __fpu_zmmh9 , self . __fpu_zmmh10 , self . __fpu_zmmh11 , self . __fpu_zmmh12 , self . __fpu_zmmh13 , self . __fpu_zmmh14 , self . __fpu_zmmh15 , self . __fpu_zmm16 , self . __fpu_zmm17 , self . __fpu_zmm18 , self . __fpu_zmm19 , self . __fpu_zmm20 , self . __fpu_zmm21 , self . __fpu_zmm22 , self . __fpu_zmm23 , self . __fpu_zmm24 , self . __fpu_zmm25 , self . __fpu_zmm26 , self . __fpu_zmm27 , self . __fpu_zmm28 , self . __fpu_zmm29 , self . __fpu_zmm30 , self . __fpu_zmm31 ) } } # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct __darwin_x86_exception_state64 { pub __trapno : __uint16_t , pub __cpu : __uint16_t , pub __err : __uint32_t , pub __faultvaddr : __uint64_t , } # [ test ] fn bindgen_test_layout___darwin_x86_exception_state64 ( ) { assert_eq ! ( :: core :: mem :: size_of :: < __darwin_x86_exception_state64 > ( ) , 16usize , concat ! ( "Size of: " , stringify ! ( __darwin_x86_exception_state64 ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < __darwin_x86_exception_state64 > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( __darwin_x86_exception_state64 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_exception_state64 > ( ) ) ) . __trapno as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_exception_state64 ) , "::" , stringify ! ( __trapno ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_exception_state64 > ( ) ) ) . __cpu as * const _ as usize } , 2usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_exception_state64 ) , "::" , stringify ! ( __cpu ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_exception_state64 > ( ) ) ) . __err as * const _ as usize } , 4usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_exception_state64 ) , "::" , stringify ! ( __err ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_exception_state64 > ( ) ) ) . __faultvaddr as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_exception_state64 ) , "::" , stringify ! ( __faultvaddr ) ) ) ; } # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct __darwin_x86_debug_state64 { pub __dr0 : __uint64_t , pub __dr1 : __uint64_t , pub __dr2 : __uint64_t , pub __dr3 : __uint64_t , pub __dr4 : __uint64_t , pub __dr5 : __uint64_t , pub __dr6 : __uint64_t , pub __dr7 : __uint64_t , } # [ test ] fn bindgen_test_layout___darwin_x86_debug_state64 ( ) { assert_eq ! ( :: core :: mem :: size_of :: < __darwin_x86_debug_state64 > ( ) , 64usize , concat ! ( "Size of: " , stringify ! ( __darwin_x86_debug_state64 ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < __darwin_x86_debug_state64 > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( __darwin_x86_debug_state64 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_debug_state64 > ( ) ) ) . __dr0 as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_debug_state64 ) , "::" , stringify ! ( __dr0 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_debug_state64 > ( ) ) ) . __dr1 as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_debug_state64 ) , "::" , stringify ! ( __dr1 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_debug_state64 > ( ) ) ) . __dr2 as * const _ as usize } , 16usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_debug_state64 ) , "::" , stringify ! ( __dr2 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_debug_state64 > ( ) ) ) . __dr3 as * const _ as usize } , 24usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_debug_state64 ) , "::" , stringify ! ( __dr3 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_debug_state64 > ( ) ) ) . __dr4 as * const _ as usize } , 32usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_debug_state64 ) , "::" , stringify ! ( __dr4 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_debug_state64 > ( ) ) ) . __dr5 as * const _ as usize } , 40usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_debug_state64 ) , "::" , stringify ! ( __dr5 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_debug_state64 > ( ) ) ) . __dr6 as * const _ as usize } , 48usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_debug_state64 ) , "::" , stringify ! ( __dr6 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_debug_state64 > ( ) ) ) . __dr7 as * const _ as usize } , 56usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_debug_state64 ) , "::" , stringify ! ( __dr7 ) ) ) ; } # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct __darwin_x86_cpmu_state64 { pub __ctrs : [ __uint64_t ; 16usize ] , } # [ test ] fn bindgen_test_layout___darwin_x86_cpmu_state64 ( ) { assert_eq ! ( :: core :: mem :: size_of :: < __darwin_x86_cpmu_state64 > ( ) , 128usize , concat ! ( "Size of: " , stringify ! ( __darwin_x86_cpmu_state64 ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < __darwin_x86_cpmu_state64 > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( __darwin_x86_cpmu_state64 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_x86_cpmu_state64 > ( ) ) ) . __ctrs as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_x86_cpmu_state64 ) , "::" , stringify ! ( __ctrs ) ) ) ; } # [ repr ( C ) ] # [ derive ( Copy , Clone ) ] pub struct __darwin_mcontext32 { pub __es : __darwin_i386_exception_state , pub __ss : __darwin_i386_thread_state , pub __fs : __darwin_i386_float_state , } # [ test ] fn bindgen_test_layout___darwin_mcontext32 ( ) { assert_eq ! ( :: core :: mem :: size_of :: < __darwin_mcontext32 > ( ) , 600usize , concat ! ( "Size of: " , stringify ! ( __darwin_mcontext32 ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < __darwin_mcontext32 > ( ) , 4usize , concat ! ( "Alignment of " , stringify ! ( __darwin_mcontext32 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_mcontext32 > ( ) ) ) . __es as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_mcontext32 ) , "::" , stringify ! ( __es ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_mcontext32 > ( ) ) ) . __ss as * const _ as usize } , 12usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_mcontext32 ) , "::" , stringify ! ( __ss ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_mcontext32 > ( ) ) ) . __fs as * const _ as usize } , 76usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_mcontext32 ) , "::" , stringify ! ( __fs ) ) ) ; } impl :: core :: fmt :: Debug for __darwin_mcontext32 { fn fmt ( & self , f : & mut :: core :: fmt :: Formatter < '_ > ) -> :: core :: fmt :: Result { write ! ( f , "__darwin_mcontext32 {{ __es: {:?}, __ss: {:?}, __fs: {:?} }}" , self . __es , self . __ss , self . __fs ) } } # [ repr ( C ) ] # [ derive ( Copy , Clone ) ] pub struct __darwin_mcontext_avx32 { pub __es : __darwin_i386_exception_state , pub __ss : __darwin_i386_thread_state , pub __fs : __darwin_i386_avx_state , } # [ test ] fn bindgen_test_layout___darwin_mcontext_avx32 ( ) { assert_eq ! ( :: core :: mem :: size_of :: < __darwin_mcontext_avx32 > ( ) , 792usize , concat ! ( "Size of: " , stringify ! ( __darwin_mcontext_avx32 ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < __darwin_mcontext_avx32 > ( ) , 4usize , concat ! ( "Alignment of " , stringify ! ( __darwin_mcontext_avx32 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_mcontext_avx32 > ( ) ) ) . __es as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_mcontext_avx32 ) , "::" , stringify ! ( __es ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_mcontext_avx32 > ( ) ) ) . __ss as * const _ as usize } , 12usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_mcontext_avx32 ) , "::" , stringify ! ( __ss ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_mcontext_avx32 > ( ) ) ) . __fs as * const _ as usize } , 76usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_mcontext_avx32 ) , "::" , stringify ! ( __fs ) ) ) ; } impl :: core :: fmt :: Debug for __darwin_mcontext_avx32 { fn fmt ( & self , f : & mut :: core :: fmt :: Formatter < '_ > ) -> :: core :: fmt :: Result { write ! ( f , "__darwin_mcontext_avx32 {{ __es: {:?}, __ss: {:?}, __fs: {:?} }}" , self . __es , self . __ss , self . __fs ) } } # [ repr ( C ) ] # [ derive ( Copy , Clone ) ] pub struct __darwin_mcontext_avx512_32 { pub __es : __darwin_i386_exception_state , pub __ss : __darwin_i386_thread_state , pub __fs : __darwin_i386_avx512_state , } # [ test ] fn bindgen_test_layout___darwin_mcontext_avx512_32 ( ) { assert_eq ! ( :: core :: mem :: size_of :: < __darwin_mcontext_avx512_32 > ( ) , 1112usize , concat ! ( "Size of: " , stringify ! ( __darwin_mcontext_avx512_32 ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < __darwin_mcontext_avx512_32 > ( ) , 4usize , concat ! ( "Alignment of " , stringify ! ( __darwin_mcontext_avx512_32 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_mcontext_avx512_32 > ( ) ) ) . __es as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_mcontext_avx512_32 ) , "::" , stringify ! ( __es ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_mcontext_avx512_32 > ( ) ) ) . __ss as * const _ as usize } , 12usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_mcontext_avx512_32 ) , "::" , stringify ! ( __ss ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_mcontext_avx512_32 > ( ) ) ) . __fs as * const _ as usize } , 76usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_mcontext_avx512_32 ) , "::" , stringify ! ( __fs ) ) ) ; } impl :: core :: fmt :: Debug for __darwin_mcontext_avx512_32 { fn fmt ( & self , f : & mut :: core :: fmt :: Formatter < '_ > ) -> :: core :: fmt :: Result { write ! ( f , "__darwin_mcontext_avx512_32 {{ __es: {:?}, __ss: {:?}, __fs: {:?} }}" , self . __es , self . __ss , self . __fs ) } } # [ repr ( C ) ] # [ derive ( Copy , Clone ) ] pub struct __darwin_mcontext64 { pub __es : __darwin_x86_exception_state64 , pub __ss : __darwin_x86_thread_state64 , pub __fs : __darwin_x86_float_state64 , } # [ test ] fn bindgen_test_layout___darwin_mcontext64 ( ) { assert_eq ! ( :: core :: mem :: size_of :: < __darwin_mcontext64 > ( ) , 712usize , concat ! ( "Size of: " , stringify ! ( __darwin_mcontext64 ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < __darwin_mcontext64 > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( __darwin_mcontext64 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_mcontext64 > ( ) ) ) . __es as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_mcontext64 ) , "::" , stringify ! ( __es ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_mcontext64 > ( ) ) ) . __ss as * const _ as usize } , 16usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_mcontext64 ) , "::" , stringify ! ( __ss ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_mcontext64 > ( ) ) ) . __fs as * const _ as usize } , 184usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_mcontext64 ) , "::" , stringify ! ( __fs ) ) ) ; } impl :: core :: fmt :: Debug for __darwin_mcontext64 { fn fmt ( & self , f : & mut :: core :: fmt :: Formatter < '_ > ) -> :: core :: fmt :: Result { write ! ( f , "__darwin_mcontext64 {{ __es: {:?}, __ss: {:?}, __fs: {:?} }}" , self . __es , self . __ss , self . __fs ) } } # [ repr ( C ) ] # [ derive ( Copy , Clone ) ] pub struct __darwin_mcontext64_full { pub __es : __darwin_x86_exception_state64 , pub __ss : __darwin_x86_thread_full_state64 , pub __fs : __darwin_x86_float_state64 , } # [ test ] fn bindgen_test_layout___darwin_mcontext64_full ( ) { assert_eq ! ( :: core :: mem :: size_of :: < __darwin_mcontext64_full > ( ) , 744usize , concat ! ( "Size of: " , stringify ! ( __darwin_mcontext64_full ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < __darwin_mcontext64_full > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( __darwin_mcontext64_full ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_mcontext64_full > ( ) ) ) . __es as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_mcontext64_full ) , "::" , stringify ! ( __es ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_mcontext64_full > ( ) ) ) . __ss as * const _ as usize } , 16usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_mcontext64_full ) , "::" , stringify ! ( __ss ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_mcontext64_full > ( ) ) ) . __fs as * const _ as usize } , 216usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_mcontext64_full ) , "::" , stringify ! ( __fs ) ) ) ; } impl :: core :: fmt :: Debug for __darwin_mcontext64_full { fn fmt ( & self , f : & mut :: core :: fmt :: Formatter < '_ > ) -> :: core :: fmt :: Result { write ! ( f , "__darwin_mcontext64_full {{ __es: {:?}, __ss: {:?}, __fs: {:?} }}" , self . __es , self . __ss , self . __fs ) } } # [ repr ( C ) ] # [ derive ( Copy , Clone ) ] pub struct __darwin_mcontext_avx64 { pub __es : __darwin_x86_exception_state64 , pub __ss : __darwin_x86_thread_state64 , pub __fs : __darwin_x86_avx_state64 , } # [ test ] fn bindgen_test_layout___darwin_mcontext_avx64 ( ) { assert_eq ! ( :: core :: mem :: size_of :: < __darwin_mcontext_avx64 > ( ) , 1032usize , concat ! ( "Size of: " , stringify ! ( __darwin_mcontext_avx64 ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < __darwin_mcontext_avx64 > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( __darwin_mcontext_avx64 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_mcontext_avx64 > ( ) ) ) . __es as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_mcontext_avx64 ) , "::" , stringify ! ( __es ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_mcontext_avx64 > ( ) ) ) . __ss as * const _ as usize } , 16usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_mcontext_avx64 ) , "::" , stringify ! ( __ss ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_mcontext_avx64 > ( ) ) ) . __fs as * const _ as usize } , 184usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_mcontext_avx64 ) , "::" , stringify ! ( __fs ) ) ) ; } impl :: core :: fmt :: Debug for __darwin_mcontext_avx64 { fn fmt ( & self , f : & mut :: core :: fmt :: Formatter < '_ > ) -> :: core :: fmt :: Result { write ! ( f , "__darwin_mcontext_avx64 {{ __es: {:?}, __ss: {:?}, __fs: {:?} }}" , self . __es , self . __ss , self . __fs ) } } # [ repr ( C ) ] # [ derive ( Copy , Clone ) ] pub struct __darwin_mcontext_avx64_full { pub __es : __darwin_x86_exception_state64 , pub __ss : __darwin_x86_thread_full_state64 , pub __fs : __darwin_x86_avx_state64 , } # [ test ] fn bindgen_test_layout___darwin_mcontext_avx64_full ( ) { assert_eq ! ( :: core :: mem :: size_of :: < __darwin_mcontext_avx64_full > ( ) , 1064usize , concat ! ( "Size of: " , stringify ! ( __darwin_mcontext_avx64_full ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < __darwin_mcontext_avx64_full > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( __darwin_mcontext_avx64_full ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_mcontext_avx64_full > ( ) ) ) . __es as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_mcontext_avx64_full ) , "::" , stringify ! ( __es ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_mcontext_avx64_full > ( ) ) ) . __ss as * const _ as usize } , 16usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_mcontext_avx64_full ) , "::" , stringify ! ( __ss ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_mcontext_avx64_full > ( ) ) ) . __fs as * const _ as usize } , 216usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_mcontext_avx64_full ) , "::" , stringify ! ( __fs ) ) ) ; } impl :: core :: fmt :: Debug for __darwin_mcontext_avx64_full { fn fmt ( & self , f : & mut :: core :: fmt :: Formatter < '_ > ) -> :: core :: fmt :: Result { write ! ( f , "__darwin_mcontext_avx64_full {{ __es: {:?}, __ss: {:?}, __fs: {:?} }}" , self . __es , self . __ss , self . __fs ) } } # [ repr ( C ) ] # [ derive ( Copy , Clone ) ] pub struct __darwin_mcontext_avx512_64 { pub __es : __darwin_x86_exception_state64 , pub __ss : __darwin_x86_thread_state64 , pub __fs : __darwin_x86_avx512_state64 , } # [ test ] fn bindgen_test_layout___darwin_mcontext_avx512_64 ( ) { assert_eq ! ( :: core :: mem :: size_of :: < __darwin_mcontext_avx512_64 > ( ) , 2632usize , concat ! ( "Size of: " , stringify ! ( __darwin_mcontext_avx512_64 ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < __darwin_mcontext_avx512_64 > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( __darwin_mcontext_avx512_64 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_mcontext_avx512_64 > ( ) ) ) . __es as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_mcontext_avx512_64 ) , "::" , stringify ! ( __es ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_mcontext_avx512_64 > ( ) ) ) . __ss as * const _ as usize } , 16usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_mcontext_avx512_64 ) , "::" , stringify ! ( __ss ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_mcontext_avx512_64 > ( ) ) ) . __fs as * const _ as usize } , 184usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_mcontext_avx512_64 ) , "::" , stringify ! ( __fs ) ) ) ; } impl :: core :: fmt :: Debug for __darwin_mcontext_avx512_64 { fn fmt ( & self , f : & mut :: core :: fmt :: Formatter < '_ > ) -> :: core :: fmt :: Result { write ! ( f , "__darwin_mcontext_avx512_64 {{ __es: {:?}, __ss: {:?}, __fs: {:?} }}" , self . __es , self . __ss , self . __fs ) } } # [ repr ( C ) ] # [ derive ( Copy , Clone ) ] pub struct __darwin_mcontext_avx512_64_full { pub __es : __darwin_x86_exception_state64 , pub __ss : __darwin_x86_thread_full_state64 , pub __fs : __darwin_x86_avx512_state64 , } # [ test ] fn bindgen_test_layout___darwin_mcontext_avx512_64_full ( ) { assert_eq ! ( :: core :: mem :: size_of :: < __darwin_mcontext_avx512_64_full > ( ) , 2664usize , concat ! ( "Size of: " , stringify ! ( __darwin_mcontext_avx512_64_full ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < __darwin_mcontext_avx512_64_full > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( __darwin_mcontext_avx512_64_full ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_mcontext_avx512_64_full > ( ) ) ) . __es as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_mcontext_avx512_64_full ) , "::" , stringify ! ( __es ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_mcontext_avx512_64_full > ( ) ) ) . __ss as * const _ as usize } , 16usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_mcontext_avx512_64_full ) , "::" , stringify ! ( __ss ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_mcontext_avx512_64_full > ( ) ) ) . __fs as * const _ as usize } , 216usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_mcontext_avx512_64_full ) , "::" , stringify ! ( __fs ) ) ) ; } impl :: core :: fmt :: Debug for __darwin_mcontext_avx512_64_full { fn fmt ( & self , f : & mut :: core :: fmt :: Formatter < '_ > ) -> :: core :: fmt :: Result { write ! ( f , "__darwin_mcontext_avx512_64_full {{ __es: {:?}, __ss: {:?}, __fs: {:?} }}" , self . __es , self . __ss , self . __fs ) } } pub type mcontext_t = * mut __darwin_mcontext64 ; pub type pthread_attr_t = __darwin_pthread_attr_t ; # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct __darwin_sigaltstack { pub ss_sp : * mut libc :: c_void , pub ss_size : __darwin_size_t , pub ss_flags : libc :: c_int , } # [ test ] fn bindgen_test_layout___darwin_sigaltstack ( ) { assert_eq ! ( :: core :: mem :: size_of :: < __darwin_sigaltstack > ( ) , 24usize , concat ! ( "Size of: " , stringify ! ( __darwin_sigaltstack ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < __darwin_sigaltstack > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( __darwin_sigaltstack ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_sigaltstack > ( ) ) ) . ss_sp as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_sigaltstack ) , "::" , stringify ! ( ss_sp ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_sigaltstack > ( ) ) ) . ss_size as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_sigaltstack ) , "::" , stringify ! ( ss_size ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_sigaltstack > ( ) ) ) . ss_flags as * const _ as usize } , 16usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_sigaltstack ) , "::" , stringify ! ( ss_flags ) ) ) ; } pub type stack_t = __darwin_sigaltstack ; # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct __darwin_ucontext { pub uc_onstack : libc :: c_int , pub uc_sigmask : __darwin_sigset_t , pub uc_stack : __darwin_sigaltstack , pub uc_link : * mut __darwin_ucontext , pub uc_mcsize : __darwin_size_t , pub uc_mcontext : * mut __darwin_mcontext64 , } # [ test ] fn bindgen_test_layout___darwin_ucontext ( ) { assert_eq ! ( :: core :: mem :: size_of :: < __darwin_ucontext > ( ) , 56usize , concat ! ( "Size of: " , stringify ! ( __darwin_ucontext ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < __darwin_ucontext > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( __darwin_ucontext ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_ucontext > ( ) ) ) . uc_onstack as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_ucontext ) , "::" , stringify ! ( uc_onstack ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_ucontext > ( ) ) ) . uc_sigmask as * const _ as usize } , 4usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_ucontext ) , "::" , stringify ! ( uc_sigmask ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_ucontext > ( ) ) ) . uc_stack as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_ucontext ) , "::" , stringify ! ( uc_stack ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_ucontext > ( ) ) ) . uc_link as * const _ as usize } , 32usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_ucontext ) , "::" , stringify ! ( uc_link ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_ucontext > ( ) ) ) . uc_mcsize as * const _ as usize } , 40usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_ucontext ) , "::" , stringify ! ( uc_mcsize ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __darwin_ucontext > ( ) ) ) . uc_mcontext as * const _ as usize } , 48usize , concat ! ( "Offset of field: " , stringify ! ( __darwin_ucontext ) , "::" , stringify ! ( uc_mcontext ) ) ) ; } pub type ucontext_t = __darwin_ucontext ; pub type sigset_t = __darwin_sigset_t ; pub type uid_t = __darwin_uid_t ; # [ repr ( C ) ] # [ derive ( Copy , Clone ) ] pub union sigval { pub sival_int : libc :: c_int , pub sival_ptr : * mut libc :: c_void , _bindgen_union_align : u64 , } # [ test ] fn bindgen_test_layout_sigval ( ) { assert_eq ! ( :: core :: mem :: size_of :: < sigval > ( ) , 8usize , concat ! ( "Size of: " , stringify ! ( sigval ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < sigval > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( sigval ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < sigval > ( ) ) ) . sival_int as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( sigval ) , "::" , stringify ! ( sival_int ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < sigval > ( ) ) ) . sival_ptr as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( sigval ) , "::" , stringify ! ( sival_ptr ) ) ) ; } impl :: core :: fmt :: Debug for sigval { fn fmt ( & self , f : & mut :: core :: fmt :: Formatter < '_ > ) -> :: core :: fmt :: Result { write ! ( f , "sigval {{ union }}" ) } } # [ repr ( C ) ] # [ derive ( Copy , Clone ) ] pub struct sigevent { pub sigev_notify : libc :: c_int , pub sigev_signo : libc :: c_int , pub sigev_value : sigval , pub sigev_notify_function : :: core :: option :: Option < unsafe extern "C" fn ( arg1 : sigval ) > , pub sigev_notify_attributes : * mut pthread_attr_t , } # [ test ] fn bindgen_test_layout_sigevent ( ) { assert_eq ! ( :: core :: mem :: size_of :: < sigevent > ( ) , 32usize , concat ! ( "Size of: " , stringify ! ( sigevent ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < sigevent > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( sigevent ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < sigevent > ( ) ) ) . sigev_notify as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( sigevent ) , "::" , stringify ! ( sigev_notify ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < sigevent > ( ) ) ) . sigev_signo as * const _ as usize } , 4usize , concat ! ( "Offset of field: " , stringify ! ( sigevent ) , "::" , stringify ! ( sigev_signo ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < sigevent > ( ) ) ) . sigev_value as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( sigevent ) , "::" , stringify ! ( sigev_value ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < sigevent > ( ) ) ) . sigev_notify_function as * const _ as usize } , 16usize , concat ! ( "Offset of field: " , stringify ! ( sigevent ) , "::" , stringify ! ( sigev_notify_function ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < sigevent > ( ) ) ) . sigev_notify_attributes as * const _ as usize } , 24usize , concat ! ( "Offset of field: " , stringify ! ( sigevent ) , "::" , stringify ! ( sigev_notify_attributes ) ) ) ; } impl :: core :: fmt :: Debug for sigevent { fn fmt ( & self , f : & mut :: core :: fmt :: Formatter < '_ > ) -> :: core :: fmt :: Result { write ! ( f , "sigevent {{ sigev_notify: {:?}, sigev_signo: {:?}, sigev_value: {:?}, sigev_notify_function: {:?}, sigev_notify_attributes: {:?} }}" , self . sigev_notify , self . sigev_signo , self . sigev_value , self . sigev_notify_function , self . sigev_notify_attributes ) } } # [ repr ( C ) ] # [ derive ( Copy , Clone ) ] pub struct __siginfo { pub si_signo : libc :: c_int , pub si_errno : libc :: c_int , pub si_code : libc :: c_int , pub si_pid : pid_t , pub si_uid : uid_t , pub si_status : libc :: c_int , pub si_addr : * mut libc :: c_void , pub si_value : sigval , pub si_band : libc :: c_long , pub __pad : [ libc :: c_ulong ; 7usize ] , } # [ test ] fn bindgen_test_layout___siginfo ( ) { assert_eq ! ( :: core :: mem :: size_of :: < __siginfo > ( ) , 104usize , concat ! ( "Size of: " , stringify ! ( __siginfo ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < __siginfo > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( __siginfo ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __siginfo > ( ) ) ) . si_signo as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( __siginfo ) , "::" , stringify ! ( si_signo ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __siginfo > ( ) ) ) . si_errno as * const _ as usize } , 4usize , concat ! ( "Offset of field: " , stringify ! ( __siginfo ) , "::" , stringify ! ( si_errno ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __siginfo > ( ) ) ) . si_code as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( __siginfo ) , "::" , stringify ! ( si_code ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __siginfo > ( ) ) ) . si_pid as * const _ as usize } , 12usize , concat ! ( "Offset of field: " , stringify ! ( __siginfo ) , "::" , stringify ! ( si_pid ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __siginfo > ( ) ) ) . si_uid as * const _ as usize } , 16usize , concat ! ( "Offset of field: " , stringify ! ( __siginfo ) , "::" , stringify ! ( si_uid ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __siginfo > ( ) ) ) . si_status as * const _ as usize } , 20usize , concat ! ( "Offset of field: " , stringify ! ( __siginfo ) , "::" , stringify ! ( si_status ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __siginfo > ( ) ) ) . si_addr as * const _ as usize } , 24usize , concat ! ( "Offset of field: " , stringify ! ( __siginfo ) , "::" , stringify ! ( si_addr ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __siginfo > ( ) ) ) . si_value as * const _ as usize } , 32usize , concat ! ( "Offset of field: " , stringify ! ( __siginfo ) , "::" , stringify ! ( si_value ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __siginfo > ( ) ) ) . si_band as * const _ as usize } , 40usize , concat ! ( "Offset of field: " , stringify ! ( __siginfo ) , "::" , stringify ! ( si_band ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __siginfo > ( ) ) ) . __pad as * const _ as usize } , 48usize , concat ! ( "Offset of field: " , stringify ! ( __siginfo ) , "::" , stringify ! ( __pad ) ) ) ; } impl :: core :: fmt :: Debug for __siginfo { fn fmt ( & self , f : & mut :: core :: fmt :: Formatter < '_ > ) -> :: core :: fmt :: Result { write ! ( f , "__siginfo {{ si_signo: {:?}, si_errno: {:?}, si_code: {:?}, si_pid: {:?}, si_uid: {:?}, si_status: {:?}, si_addr: {:?}, si_value: {:?}, si_band: {:?}, __pad: {:?} }}" , self . si_signo , self . si_errno , self . si_code , self . si_pid , self . si_uid , self . si_status , self . si_addr , self . si_value , self . si_band , self . __pad ) } } pub type siginfo_t = __siginfo ; # [ repr ( C ) ] # [ derive ( Copy , Clone ) ] pub union __sigaction_u { pub __sa_handler : :: core :: option :: Option < unsafe extern "C" fn ( arg1 : libc :: c_int ) > , pub __sa_sigaction : :: core :: option :: Option < unsafe extern "C" fn ( arg1 : libc :: c_int , arg2 : * mut __siginfo , arg3 : * mut libc :: c_void ) > , _bindgen_union_align : u64 , } # [ test ] fn bindgen_test_layout___sigaction_u ( ) { assert_eq ! ( :: core :: mem :: size_of :: < __sigaction_u > ( ) , 8usize , concat ! ( "Size of: " , stringify ! ( __sigaction_u ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < __sigaction_u > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( __sigaction_u ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __sigaction_u > ( ) ) ) . __sa_handler as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( __sigaction_u ) , "::" , stringify ! ( __sa_handler ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __sigaction_u > ( ) ) ) . __sa_sigaction as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( __sigaction_u ) , "::" , stringify ! ( __sa_sigaction ) ) ) ; } impl :: core :: fmt :: Debug for __sigaction_u { fn fmt ( & self , f : & mut :: core :: fmt :: Formatter < '_ > ) -> :: core :: fmt :: Result { write ! ( f , "__sigaction_u {{ union }}" ) } } # [ repr ( C ) ] # [ derive ( Copy , Clone ) ] pub struct __sigaction { pub __sigaction_u : __sigaction_u , pub sa_tramp : :: core :: option :: Option < unsafe extern "C" fn ( arg1 : * mut libc :: c_void , arg2 : libc :: c_int , arg3 : libc :: c_int , arg4 : * mut siginfo_t , arg5 : * mut libc :: c_void ) > , pub sa_mask : sigset_t , pub sa_flags : libc :: c_int , } # [ test ] fn bindgen_test_layout___sigaction ( ) { assert_eq ! ( :: core :: mem :: size_of :: < __sigaction > ( ) , 24usize , concat ! ( "Size of: " , stringify ! ( __sigaction ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < __sigaction > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( __sigaction ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __sigaction > ( ) ) ) . __sigaction_u as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( __sigaction ) , "::" , stringify ! ( __sigaction_u ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __sigaction > ( ) ) ) . sa_tramp as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( __sigaction ) , "::" , stringify ! ( sa_tramp ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __sigaction > ( ) ) ) . sa_mask as * const _ as usize } , 16usize , concat ! ( "Offset of field: " , stringify ! ( __sigaction ) , "::" , stringify ! ( sa_mask ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __sigaction > ( ) ) ) . sa_flags as * const _ as usize } , 20usize , concat ! ( "Offset of field: " , stringify ! ( __sigaction ) , "::" , stringify ! ( sa_flags ) ) ) ; } impl :: core :: fmt :: Debug for __sigaction { fn fmt ( & self , f : & mut :: core :: fmt :: Formatter < '_ > ) -> :: core :: fmt :: Result { write ! ( f , "__sigaction {{ __sigaction_u: {:?}, sa_tramp: {:?}, sa_mask: {:?}, sa_flags: {:?} }}" , self . __sigaction_u , self . sa_tramp , self . sa_mask , self . sa_flags ) } } # [ repr ( C ) ] # [ derive ( Copy , Clone ) ] pub struct sigaction { pub __sigaction_u : __sigaction_u , pub sa_mask : sigset_t , pub sa_flags : libc :: c_int , } # [ test ] fn bindgen_test_layout_sigaction ( ) { assert_eq ! ( :: core :: mem :: size_of :: < sigaction > ( ) , 16usize , concat ! ( "Size of: " , stringify ! ( sigaction ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < sigaction > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( sigaction ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < sigaction > ( ) ) ) . __sigaction_u as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( sigaction ) , "::" , stringify ! ( __sigaction_u ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < sigaction > ( ) ) ) . sa_mask as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( sigaction ) , "::" , stringify ! ( sa_mask ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < sigaction > ( ) ) ) . sa_flags as * const _ as usize } , 12usize , concat ! ( "Offset of field: " , stringify ! ( sigaction ) , "::" , stringify ! ( sa_flags ) ) ) ; } impl :: core :: fmt :: Debug for sigaction { fn fmt ( & self , f : & mut :: core :: fmt :: Formatter < '_ > ) -> :: core :: fmt :: Result { write ! ( f , "sigaction {{ __sigaction_u: {:?}, sa_mask: {:?}, sa_flags: {:?} }}" , self . __sigaction_u , self . sa_mask , self . sa_flags ) } } pub type sig_t = :: core :: option :: Option < unsafe extern "C" fn ( arg1 : libc :: c_int ) > ; # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct sigvec { pub sv_handler : :: core :: option :: Option < unsafe extern "C" fn ( arg1 : libc :: c_int ) > , pub sv_mask : libc :: c_int , pub sv_flags : libc :: c_int , } # [ test ] fn bindgen_test_layout_sigvec ( ) { assert_eq ! ( :: core :: mem :: size_of :: < sigvec > ( ) , 16usize , concat ! ( "Size of: " , stringify ! ( sigvec ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < sigvec > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( sigvec ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < sigvec > ( ) ) ) . sv_handler as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( sigvec ) , "::" , stringify ! ( sv_handler ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < sigvec > ( ) ) ) . sv_mask as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( sigvec ) , "::" , stringify ! ( sv_mask ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < sigvec > ( ) ) ) . sv_flags as * const _ as usize } , 12usize , concat ! ( "Offset of field: " , stringify ! ( sigvec ) , "::" , stringify ! ( sv_flags ) ) ) ; } # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct sigstack { pub ss_sp : * mut libc :: c_char , pub ss_onstack : libc :: c_int , } # [ test ] fn bindgen_test_layout_sigstack ( ) { assert_eq ! ( :: core :: mem :: size_of :: < sigstack > ( ) , 16usize , concat ! ( "Size of: " , stringify ! ( sigstack ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < sigstack > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( sigstack ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < sigstack > ( ) ) ) . ss_sp as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( sigstack ) , "::" , stringify ! ( ss_sp ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < sigstack > ( ) ) ) . ss_onstack as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( sigstack ) , "::" , stringify ! ( ss_onstack ) ) ) ; } extern "C" { pub fn signal ( arg1 : libc :: c_int , arg2 : :: core :: option :: Option < unsafe extern "C" fn ( arg1 : libc :: c_int ) > ) -> :: core :: option :: Option < unsafe extern "C" fn ( arg1 : libc :: c_int , arg2 : :: core :: option :: Option < unsafe extern "C" fn ( arg1 : libc :: c_int ) > ) > ; } # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct timeval { pub tv_sec : __darwin_time_t , pub tv_usec : __darwin_suseconds_t , } # [ test ] fn bindgen_test_layout_timeval ( ) { assert_eq ! ( :: core :: mem :: size_of :: < timeval > ( ) , 16usize , concat ! ( "Size of: " , stringify ! ( timeval ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < timeval > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( timeval ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < timeval > ( ) ) ) . tv_sec as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( timeval ) , "::" , stringify ! ( tv_sec ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < timeval > ( ) ) ) . tv_usec as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( timeval ) , "::" , stringify ! ( tv_usec ) ) ) ; } pub type rlim_t = __uint64_t ; # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct rusage { pub ru_utime : timeval , pub ru_stime : timeval , pub ru_maxrss : libc :: c_long , pub ru_ixrss : libc :: c_long , pub ru_idrss : libc :: c_long , pub ru_isrss : libc :: c_long , pub ru_minflt : libc :: c_long , pub ru_majflt : libc :: c_long , pub ru_nswap : libc :: c_long , pub ru_inblock : libc :: c_long , pub ru_oublock : libc :: c_long , pub ru_msgsnd : libc :: c_long , pub ru_msgrcv : libc :: c_long , pub ru_nsignals : libc :: c_long , pub ru_nvcsw : libc :: c_long , pub ru_nivcsw : libc :: c_long , } # [ test ] fn bindgen_test_layout_rusage ( ) { assert_eq ! ( :: core :: mem :: size_of :: < rusage > ( ) , 144usize , concat ! ( "Size of: " , stringify ! ( rusage ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < rusage > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( rusage ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage > ( ) ) ) . ru_utime as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( rusage ) , "::" , stringify ! ( ru_utime ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage > ( ) ) ) . ru_stime as * const _ as usize } , 16usize , concat ! ( "Offset of field: " , stringify ! ( rusage ) , "::" , stringify ! ( ru_stime ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage > ( ) ) ) . ru_maxrss as * const _ as usize } , 32usize , concat ! ( "Offset of field: " , stringify ! ( rusage ) , "::" , stringify ! ( ru_maxrss ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage > ( ) ) ) . ru_ixrss as * const _ as usize } , 40usize , concat ! ( "Offset of field: " , stringify ! ( rusage ) , "::" , stringify ! ( ru_ixrss ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage > ( ) ) ) . ru_idrss as * const _ as usize } , 48usize , concat ! ( "Offset of field: " , stringify ! ( rusage ) , "::" , stringify ! ( ru_idrss ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage > ( ) ) ) . ru_isrss as * const _ as usize } , 56usize , concat ! ( "Offset of field: " , stringify ! ( rusage ) , "::" , stringify ! ( ru_isrss ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage > ( ) ) ) . ru_minflt as * const _ as usize } , 64usize , concat ! ( "Offset of field: " , stringify ! ( rusage ) , "::" , stringify ! ( ru_minflt ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage > ( ) ) ) . ru_majflt as * const _ as usize } , 72usize , concat ! ( "Offset of field: " , stringify ! ( rusage ) , "::" , stringify ! ( ru_majflt ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage > ( ) ) ) . ru_nswap as * const _ as usize } , 80usize , concat ! ( "Offset of field: " , stringify ! ( rusage ) , "::" , stringify ! ( ru_nswap ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage > ( ) ) ) . ru_inblock as * const _ as usize } , 88usize , concat ! ( "Offset of field: " , stringify ! ( rusage ) , "::" , stringify ! ( ru_inblock ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage > ( ) ) ) . ru_oublock as * const _ as usize } , 96usize , concat ! ( "Offset of field: " , stringify ! ( rusage ) , "::" , stringify ! ( ru_oublock ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage > ( ) ) ) . ru_msgsnd as * const _ as usize } , 104usize , concat ! ( "Offset of field: " , stringify ! ( rusage ) , "::" , stringify ! ( ru_msgsnd ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage > ( ) ) ) . ru_msgrcv as * const _ as usize } , 112usize , concat ! ( "Offset of field: " , stringify ! ( rusage ) , "::" , stringify ! ( ru_msgrcv ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage > ( ) ) ) . ru_nsignals as * const _ as usize } , 120usize , concat ! ( "Offset of field: " , stringify ! ( rusage ) , "::" , stringify ! ( ru_nsignals ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage > ( ) ) ) . ru_nvcsw as * const _ as usize } , 128usize , concat ! ( "Offset of field: " , stringify ! ( rusage ) , "::" , stringify ! ( ru_nvcsw ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage > ( ) ) ) . ru_nivcsw as * const _ as usize } , 136usize , concat ! ( "Offset of field: " , stringify ! ( rusage ) , "::" , stringify ! ( ru_nivcsw ) ) ) ; } pub type rusage_info_t = * mut libc :: c_void ; # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct rusage_info_v0 { pub ri_uuid : [ u8 ; 16usize ] , pub ri_user_time : u64 , pub ri_system_time : u64 , pub ri_pkg_idle_wkups : u64 , pub ri_interrupt_wkups : u64 , pub ri_pageins : u64 , pub ri_wired_size : u64 , pub ri_resident_size : u64 , pub ri_phys_footprint : u64 , pub ri_proc_start_abstime : u64 , pub ri_proc_exit_abstime : u64 , } # [ test ] fn bindgen_test_layout_rusage_info_v0 ( ) { assert_eq ! ( :: core :: mem :: size_of :: < rusage_info_v0 > ( ) , 96usize , concat ! ( "Size of: " , stringify ! ( rusage_info_v0 ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < rusage_info_v0 > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( rusage_info_v0 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v0 > ( ) ) ) . ri_uuid as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v0 ) , "::" , stringify ! ( ri_uuid ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v0 > ( ) ) ) . ri_user_time as * const _ as usize } , 16usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v0 ) , "::" , stringify ! ( ri_user_time ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v0 > ( ) ) ) . ri_system_time as * const _ as usize } , 24usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v0 ) , "::" , stringify ! ( ri_system_time ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v0 > ( ) ) ) . ri_pkg_idle_wkups as * const _ as usize } , 32usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v0 ) , "::" , stringify ! ( ri_pkg_idle_wkups ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v0 > ( ) ) ) . ri_interrupt_wkups as * const _ as usize } , 40usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v0 ) , "::" , stringify ! ( ri_interrupt_wkups ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v0 > ( ) ) ) . ri_pageins as * const _ as usize } , 48usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v0 ) , "::" , stringify ! ( ri_pageins ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v0 > ( ) ) ) . ri_wired_size as * const _ as usize } , 56usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v0 ) , "::" , stringify ! ( ri_wired_size ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v0 > ( ) ) ) . ri_resident_size as * const _ as usize } , 64usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v0 ) , "::" , stringify ! ( ri_resident_size ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v0 > ( ) ) ) . ri_phys_footprint as * const _ as usize } , 72usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v0 ) , "::" , stringify ! ( ri_phys_footprint ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v0 > ( ) ) ) . ri_proc_start_abstime as * const _ as usize } , 80usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v0 ) , "::" , stringify ! ( ri_proc_start_abstime ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v0 > ( ) ) ) . ri_proc_exit_abstime as * const _ as usize } , 88usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v0 ) , "::" , stringify ! ( ri_proc_exit_abstime ) ) ) ; } # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct rusage_info_v1 { pub ri_uuid : [ u8 ; 16usize ] , pub ri_user_time : u64 , pub ri_system_time : u64 , pub ri_pkg_idle_wkups : u64 , pub ri_interrupt_wkups : u64 , pub ri_pageins : u64 , pub ri_wired_size : u64 , pub ri_resident_size : u64 , pub ri_phys_footprint : u64 , pub ri_proc_start_abstime : u64 , pub ri_proc_exit_abstime : u64 , pub ri_child_user_time : u64 , pub ri_child_system_time : u64 , pub ri_child_pkg_idle_wkups : u64 , pub ri_child_interrupt_wkups : u64 , pub ri_child_pageins : u64 , pub ri_child_elapsed_abstime : u64 , } # [ test ] fn bindgen_test_layout_rusage_info_v1 ( ) { assert_eq ! ( :: core :: mem :: size_of :: < rusage_info_v1 > ( ) , 144usize , concat ! ( "Size of: " , stringify ! ( rusage_info_v1 ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < rusage_info_v1 > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( rusage_info_v1 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v1 > ( ) ) ) . ri_uuid as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v1 ) , "::" , stringify ! ( ri_uuid ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v1 > ( ) ) ) . ri_user_time as * const _ as usize } , 16usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v1 ) , "::" , stringify ! ( ri_user_time ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v1 > ( ) ) ) . ri_system_time as * const _ as usize } , 24usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v1 ) , "::" , stringify ! ( ri_system_time ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v1 > ( ) ) ) . ri_pkg_idle_wkups as * const _ as usize } , 32usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v1 ) , "::" , stringify ! ( ri_pkg_idle_wkups ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v1 > ( ) ) ) . ri_interrupt_wkups as * const _ as usize } , 40usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v1 ) , "::" , stringify ! ( ri_interrupt_wkups ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v1 > ( ) ) ) . ri_pageins as * const _ as usize } , 48usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v1 ) , "::" , stringify ! ( ri_pageins ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v1 > ( ) ) ) . ri_wired_size as * const _ as usize } , 56usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v1 ) , "::" , stringify ! ( ri_wired_size ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v1 > ( ) ) ) . ri_resident_size as * const _ as usize } , 64usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v1 ) , "::" , stringify ! ( ri_resident_size ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v1 > ( ) ) ) . ri_phys_footprint as * const _ as usize } , 72usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v1 ) , "::" , stringify ! ( ri_phys_footprint ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v1 > ( ) ) ) . ri_proc_start_abstime as * const _ as usize } , 80usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v1 ) , "::" , stringify ! ( ri_proc_start_abstime ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v1 > ( ) ) ) . ri_proc_exit_abstime as * const _ as usize } , 88usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v1 ) , "::" , stringify ! ( ri_proc_exit_abstime ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v1 > ( ) ) ) . ri_child_user_time as * const _ as usize } , 96usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v1 ) , "::" , stringify ! ( ri_child_user_time ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v1 > ( ) ) ) . ri_child_system_time as * const _ as usize } , 104usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v1 ) , "::" , stringify ! ( ri_child_system_time ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v1 > ( ) ) ) . ri_child_pkg_idle_wkups as * const _ as usize } , 112usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v1 ) , "::" , stringify ! ( ri_child_pkg_idle_wkups ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v1 > ( ) ) ) . ri_child_interrupt_wkups as * const _ as usize } , 120usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v1 ) , "::" , stringify ! ( ri_child_interrupt_wkups ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v1 > ( ) ) ) . ri_child_pageins as * const _ as usize } , 128usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v1 ) , "::" , stringify ! ( ri_child_pageins ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v1 > ( ) ) ) . ri_child_elapsed_abstime as * const _ as usize } , 136usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v1 ) , "::" , stringify ! ( ri_child_elapsed_abstime ) ) ) ; } # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct rusage_info_v2 { pub ri_uuid : [ u8 ; 16usize ] , pub ri_user_time : u64 , pub ri_system_time : u64 , pub ri_pkg_idle_wkups : u64 , pub ri_interrupt_wkups : u64 , pub ri_pageins : u64 , pub ri_wired_size : u64 , pub ri_resident_size : u64 , pub ri_phys_footprint : u64 , pub ri_proc_start_abstime : u64 , pub ri_proc_exit_abstime : u64 , pub ri_child_user_time : u64 , pub ri_child_system_time : u64 , pub ri_child_pkg_idle_wkups : u64 , pub ri_child_interrupt_wkups : u64 , pub ri_child_pageins : u64 , pub ri_child_elapsed_abstime : u64 , pub ri_diskio_bytesread : u64 , pub ri_diskio_byteswritten : u64 , } # [ test ] fn bindgen_test_layout_rusage_info_v2 ( ) { assert_eq ! ( :: core :: mem :: size_of :: < rusage_info_v2 > ( ) , 160usize , concat ! ( "Size of: " , stringify ! ( rusage_info_v2 ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < rusage_info_v2 > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( rusage_info_v2 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v2 > ( ) ) ) . ri_uuid as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v2 ) , "::" , stringify ! ( ri_uuid ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v2 > ( ) ) ) . ri_user_time as * const _ as usize } , 16usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v2 ) , "::" , stringify ! ( ri_user_time ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v2 > ( ) ) ) . ri_system_time as * const _ as usize } , 24usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v2 ) , "::" , stringify ! ( ri_system_time ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v2 > ( ) ) ) . ri_pkg_idle_wkups as * const _ as usize } , 32usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v2 ) , "::" , stringify ! ( ri_pkg_idle_wkups ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v2 > ( ) ) ) . ri_interrupt_wkups as * const _ as usize } , 40usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v2 ) , "::" , stringify ! ( ri_interrupt_wkups ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v2 > ( ) ) ) . ri_pageins as * const _ as usize } , 48usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v2 ) , "::" , stringify ! ( ri_pageins ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v2 > ( ) ) ) . ri_wired_size as * const _ as usize } , 56usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v2 ) , "::" , stringify ! ( ri_wired_size ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v2 > ( ) ) ) . ri_resident_size as * const _ as usize } , 64usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v2 ) , "::" , stringify ! ( ri_resident_size ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v2 > ( ) ) ) . ri_phys_footprint as * const _ as usize } , 72usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v2 ) , "::" , stringify ! ( ri_phys_footprint ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v2 > ( ) ) ) . ri_proc_start_abstime as * const _ as usize } , 80usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v2 ) , "::" , stringify ! ( ri_proc_start_abstime ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v2 > ( ) ) ) . ri_proc_exit_abstime as * const _ as usize } , 88usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v2 ) , "::" , stringify ! ( ri_proc_exit_abstime ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v2 > ( ) ) ) . ri_child_user_time as * const _ as usize } , 96usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v2 ) , "::" , stringify ! ( ri_child_user_time ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v2 > ( ) ) ) . ri_child_system_time as * const _ as usize } , 104usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v2 ) , "::" , stringify ! ( ri_child_system_time ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v2 > ( ) ) ) . ri_child_pkg_idle_wkups as * const _ as usize } , 112usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v2 ) , "::" , stringify ! ( ri_child_pkg_idle_wkups ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v2 > ( ) ) ) . ri_child_interrupt_wkups as * const _ as usize } , 120usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v2 ) , "::" , stringify ! ( ri_child_interrupt_wkups ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v2 > ( ) ) ) . ri_child_pageins as * const _ as usize } , 128usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v2 ) , "::" , stringify ! ( ri_child_pageins ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v2 > ( ) ) ) . ri_child_elapsed_abstime as * const _ as usize } , 136usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v2 ) , "::" , stringify ! ( ri_child_elapsed_abstime ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v2 > ( ) ) ) . ri_diskio_bytesread as * const _ as usize } , 144usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v2 ) , "::" , stringify ! ( ri_diskio_bytesread ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v2 > ( ) ) ) . ri_diskio_byteswritten as * const _ as usize } , 152usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v2 ) , "::" , stringify ! ( ri_diskio_byteswritten ) ) ) ; } # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct rusage_info_v3 { pub ri_uuid : [ u8 ; 16usize ] , pub ri_user_time : u64 , pub ri_system_time : u64 , pub ri_pkg_idle_wkups : u64 , pub ri_interrupt_wkups : u64 , pub ri_pageins : u64 , pub ri_wired_size : u64 , pub ri_resident_size : u64 , pub ri_phys_footprint : u64 , pub ri_proc_start_abstime : u64 , pub ri_proc_exit_abstime : u64 , pub ri_child_user_time : u64 , pub ri_child_system_time : u64 , pub ri_child_pkg_idle_wkups : u64 , pub ri_child_interrupt_wkups : u64 , pub ri_child_pageins : u64 , pub ri_child_elapsed_abstime : u64 , pub ri_diskio_bytesread : u64 , pub ri_diskio_byteswritten : u64 , pub ri_cpu_time_qos_default : u64 , pub ri_cpu_time_qos_maintenance : u64 , pub ri_cpu_time_qos_background : u64 , pub ri_cpu_time_qos_utility : u64 , pub ri_cpu_time_qos_legacy : u64 , pub ri_cpu_time_qos_user_initiated : u64 , pub ri_cpu_time_qos_user_interactive : u64 , pub ri_billed_system_time : u64 , pub ri_serviced_system_time : u64 , } # [ test ] fn bindgen_test_layout_rusage_info_v3 ( ) { assert_eq ! ( :: core :: mem :: size_of :: < rusage_info_v3 > ( ) , 232usize , concat ! ( "Size of: " , stringify ! ( rusage_info_v3 ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < rusage_info_v3 > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( rusage_info_v3 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v3 > ( ) ) ) . ri_uuid as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v3 ) , "::" , stringify ! ( ri_uuid ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v3 > ( ) ) ) . ri_user_time as * const _ as usize } , 16usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v3 ) , "::" , stringify ! ( ri_user_time ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v3 > ( ) ) ) . ri_system_time as * const _ as usize } , 24usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v3 ) , "::" , stringify ! ( ri_system_time ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v3 > ( ) ) ) . ri_pkg_idle_wkups as * const _ as usize } , 32usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v3 ) , "::" , stringify ! ( ri_pkg_idle_wkups ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v3 > ( ) ) ) . ri_interrupt_wkups as * const _ as usize } , 40usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v3 ) , "::" , stringify ! ( ri_interrupt_wkups ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v3 > ( ) ) ) . ri_pageins as * const _ as usize } , 48usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v3 ) , "::" , stringify ! ( ri_pageins ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v3 > ( ) ) ) . ri_wired_size as * const _ as usize } , 56usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v3 ) , "::" , stringify ! ( ri_wired_size ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v3 > ( ) ) ) . ri_resident_size as * const _ as usize } , 64usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v3 ) , "::" , stringify ! ( ri_resident_size ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v3 > ( ) ) ) . ri_phys_footprint as * const _ as usize } , 72usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v3 ) , "::" , stringify ! ( ri_phys_footprint ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v3 > ( ) ) ) . ri_proc_start_abstime as * const _ as usize } , 80usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v3 ) , "::" , stringify ! ( ri_proc_start_abstime ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v3 > ( ) ) ) . ri_proc_exit_abstime as * const _ as usize } , 88usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v3 ) , "::" , stringify ! ( ri_proc_exit_abstime ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v3 > ( ) ) ) . ri_child_user_time as * const _ as usize } , 96usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v3 ) , "::" , stringify ! ( ri_child_user_time ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v3 > ( ) ) ) . ri_child_system_time as * const _ as usize } , 104usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v3 ) , "::" , stringify ! ( ri_child_system_time ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v3 > ( ) ) ) . ri_child_pkg_idle_wkups as * const _ as usize } , 112usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v3 ) , "::" , stringify ! ( ri_child_pkg_idle_wkups ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v3 > ( ) ) ) . ri_child_interrupt_wkups as * const _ as usize } , 120usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v3 ) , "::" , stringify ! ( ri_child_interrupt_wkups ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v3 > ( ) ) ) . ri_child_pageins as * const _ as usize } , 128usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v3 ) , "::" , stringify ! ( ri_child_pageins ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v3 > ( ) ) ) . ri_child_elapsed_abstime as * const _ as usize } , 136usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v3 ) , "::" , stringify ! ( ri_child_elapsed_abstime ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v3 > ( ) ) ) . ri_diskio_bytesread as * const _ as usize } , 144usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v3 ) , "::" , stringify ! ( ri_diskio_bytesread ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v3 > ( ) ) ) . ri_diskio_byteswritten as * const _ as usize } , 152usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v3 ) , "::" , stringify ! ( ri_diskio_byteswritten ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v3 > ( ) ) ) . ri_cpu_time_qos_default as * const _ as usize } , 160usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v3 ) , "::" , stringify ! ( ri_cpu_time_qos_default ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v3 > ( ) ) ) . ri_cpu_time_qos_maintenance as * const _ as usize } , 168usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v3 ) , "::" , stringify ! ( ri_cpu_time_qos_maintenance ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v3 > ( ) ) ) . ri_cpu_time_qos_background as * const _ as usize } , 176usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v3 ) , "::" , stringify ! ( ri_cpu_time_qos_background ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v3 > ( ) ) ) . ri_cpu_time_qos_utility as * const _ as usize } , 184usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v3 ) , "::" , stringify ! ( ri_cpu_time_qos_utility ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v3 > ( ) ) ) . ri_cpu_time_qos_legacy as * const _ as usize } , 192usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v3 ) , "::" , stringify ! ( ri_cpu_time_qos_legacy ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v3 > ( ) ) ) . ri_cpu_time_qos_user_initiated as * const _ as usize } , 200usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v3 ) , "::" , stringify ! ( ri_cpu_time_qos_user_initiated ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v3 > ( ) ) ) . ri_cpu_time_qos_user_interactive as * const _ as usize } , 208usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v3 ) , "::" , stringify ! ( ri_cpu_time_qos_user_interactive ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v3 > ( ) ) ) . ri_billed_system_time as * const _ as usize } , 216usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v3 ) , "::" , stringify ! ( ri_billed_system_time ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v3 > ( ) ) ) . ri_serviced_system_time as * const _ as usize } , 224usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v3 ) , "::" , stringify ! ( ri_serviced_system_time ) ) ) ; } # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct rusage_info_v4 { pub ri_uuid : [ u8 ; 16usize ] , pub ri_user_time : u64 , pub ri_system_time : u64 , pub ri_pkg_idle_wkups : u64 , pub ri_interrupt_wkups : u64 , pub ri_pageins : u64 , pub ri_wired_size : u64 , pub ri_resident_size : u64 , pub ri_phys_footprint : u64 , pub ri_proc_start_abstime : u64 , pub ri_proc_exit_abstime : u64 , pub ri_child_user_time : u64 , pub ri_child_system_time : u64 , pub ri_child_pkg_idle_wkups : u64 , pub ri_child_interrupt_wkups : u64 , pub ri_child_pageins : u64 , pub ri_child_elapsed_abstime : u64 , pub ri_diskio_bytesread : u64 , pub ri_diskio_byteswritten : u64 , pub ri_cpu_time_qos_default : u64 , pub ri_cpu_time_qos_maintenance : u64 , pub ri_cpu_time_qos_background : u64 , pub ri_cpu_time_qos_utility : u64 , pub ri_cpu_time_qos_legacy : u64 , pub ri_cpu_time_qos_user_initiated : u64 , pub ri_cpu_time_qos_user_interactive : u64 , pub ri_billed_system_time : u64 , pub ri_serviced_system_time : u64 , pub ri_logical_writes : u64 , pub ri_lifetime_max_phys_footprint : u64 , pub ri_instructions : u64 , pub ri_cycles : u64 , pub ri_billed_energy : u64 , pub ri_serviced_energy : u64 , pub ri_interval_max_phys_footprint : u64 , pub ri_runnable_time : u64 , } # [ test ] fn bindgen_test_layout_rusage_info_v4 ( ) { assert_eq ! ( :: core :: mem :: size_of :: < rusage_info_v4 > ( ) , 296usize , concat ! ( "Size of: " , stringify ! ( rusage_info_v4 ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < rusage_info_v4 > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( rusage_info_v4 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v4 > ( ) ) ) . ri_uuid as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v4 ) , "::" , stringify ! ( ri_uuid ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v4 > ( ) ) ) . ri_user_time as * const _ as usize } , 16usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v4 ) , "::" , stringify ! ( ri_user_time ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v4 > ( ) ) ) . ri_system_time as * const _ as usize } , 24usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v4 ) , "::" , stringify ! ( ri_system_time ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v4 > ( ) ) ) . ri_pkg_idle_wkups as * const _ as usize } , 32usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v4 ) , "::" , stringify ! ( ri_pkg_idle_wkups ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v4 > ( ) ) ) . ri_interrupt_wkups as * const _ as usize } , 40usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v4 ) , "::" , stringify ! ( ri_interrupt_wkups ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v4 > ( ) ) ) . ri_pageins as * const _ as usize } , 48usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v4 ) , "::" , stringify ! ( ri_pageins ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v4 > ( ) ) ) . ri_wired_size as * const _ as usize } , 56usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v4 ) , "::" , stringify ! ( ri_wired_size ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v4 > ( ) ) ) . ri_resident_size as * const _ as usize } , 64usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v4 ) , "::" , stringify ! ( ri_resident_size ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v4 > ( ) ) ) . ri_phys_footprint as * const _ as usize } , 72usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v4 ) , "::" , stringify ! ( ri_phys_footprint ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v4 > ( ) ) ) . ri_proc_start_abstime as * const _ as usize } , 80usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v4 ) , "::" , stringify ! ( ri_proc_start_abstime ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v4 > ( ) ) ) . ri_proc_exit_abstime as * const _ as usize } , 88usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v4 ) , "::" , stringify ! ( ri_proc_exit_abstime ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v4 > ( ) ) ) . ri_child_user_time as * const _ as usize } , 96usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v4 ) , "::" , stringify ! ( ri_child_user_time ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v4 > ( ) ) ) . ri_child_system_time as * const _ as usize } , 104usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v4 ) , "::" , stringify ! ( ri_child_system_time ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v4 > ( ) ) ) . ri_child_pkg_idle_wkups as * const _ as usize } , 112usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v4 ) , "::" , stringify ! ( ri_child_pkg_idle_wkups ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v4 > ( ) ) ) . ri_child_interrupt_wkups as * const _ as usize } , 120usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v4 ) , "::" , stringify ! ( ri_child_interrupt_wkups ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v4 > ( ) ) ) . ri_child_pageins as * const _ as usize } , 128usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v4 ) , "::" , stringify ! ( ri_child_pageins ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v4 > ( ) ) ) . ri_child_elapsed_abstime as * const _ as usize } , 136usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v4 ) , "::" , stringify ! ( ri_child_elapsed_abstime ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v4 > ( ) ) ) . ri_diskio_bytesread as * const _ as usize } , 144usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v4 ) , "::" , stringify ! ( ri_diskio_bytesread ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v4 > ( ) ) ) . ri_diskio_byteswritten as * const _ as usize } , 152usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v4 ) , "::" , stringify ! ( ri_diskio_byteswritten ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v4 > ( ) ) ) . ri_cpu_time_qos_default as * const _ as usize } , 160usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v4 ) , "::" , stringify ! ( ri_cpu_time_qos_default ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v4 > ( ) ) ) . ri_cpu_time_qos_maintenance as * const _ as usize } , 168usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v4 ) , "::" , stringify ! ( ri_cpu_time_qos_maintenance ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v4 > ( ) ) ) . ri_cpu_time_qos_background as * const _ as usize } , 176usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v4 ) , "::" , stringify ! ( ri_cpu_time_qos_background ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v4 > ( ) ) ) . ri_cpu_time_qos_utility as * const _ as usize } , 184usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v4 ) , "::" , stringify ! ( ri_cpu_time_qos_utility ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v4 > ( ) ) ) . ri_cpu_time_qos_legacy as * const _ as usize } , 192usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v4 ) , "::" , stringify ! ( ri_cpu_time_qos_legacy ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v4 > ( ) ) ) . ri_cpu_time_qos_user_initiated as * const _ as usize } , 200usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v4 ) , "::" , stringify ! ( ri_cpu_time_qos_user_initiated ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v4 > ( ) ) ) . ri_cpu_time_qos_user_interactive as * const _ as usize } , 208usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v4 ) , "::" , stringify ! ( ri_cpu_time_qos_user_interactive ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v4 > ( ) ) ) . ri_billed_system_time as * const _ as usize } , 216usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v4 ) , "::" , stringify ! ( ri_billed_system_time ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v4 > ( ) ) ) . ri_serviced_system_time as * const _ as usize } , 224usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v4 ) , "::" , stringify ! ( ri_serviced_system_time ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v4 > ( ) ) ) . ri_logical_writes as * const _ as usize } , 232usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v4 ) , "::" , stringify ! ( ri_logical_writes ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v4 > ( ) ) ) . ri_lifetime_max_phys_footprint as * const _ as usize } , 240usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v4 ) , "::" , stringify ! ( ri_lifetime_max_phys_footprint ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v4 > ( ) ) ) . ri_instructions as * const _ as usize } , 248usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v4 ) , "::" , stringify ! ( ri_instructions ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v4 > ( ) ) ) . ri_cycles as * const _ as usize } , 256usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v4 ) , "::" , stringify ! ( ri_cycles ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v4 > ( ) ) ) . ri_billed_energy as * const _ as usize } , 264usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v4 ) , "::" , stringify ! ( ri_billed_energy ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v4 > ( ) ) ) . ri_serviced_energy as * const _ as usize } , 272usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v4 ) , "::" , stringify ! ( ri_serviced_energy ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v4 > ( ) ) ) . ri_interval_max_phys_footprint as * const _ as usize } , 280usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v4 ) , "::" , stringify ! ( ri_interval_max_phys_footprint ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rusage_info_v4 > ( ) ) ) . ri_runnable_time as * const _ as usize } , 288usize , concat ! ( "Offset of field: " , stringify ! ( rusage_info_v4 ) , "::" , stringify ! ( ri_runnable_time ) ) ) ; } pub type rusage_info_current = rusage_info_v4 ; # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct rlimit { pub rlim_cur : rlim_t , pub rlim_max : rlim_t , } # [ test ] fn bindgen_test_layout_rlimit ( ) { assert_eq ! ( :: core :: mem :: size_of :: < rlimit > ( ) , 16usize , concat ! ( "Size of: " , stringify ! ( rlimit ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < rlimit > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( rlimit ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rlimit > ( ) ) ) . rlim_cur as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( rlimit ) , "::" , stringify ! ( rlim_cur ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < rlimit > ( ) ) ) . rlim_max as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( rlimit ) , "::" , stringify ! ( rlim_max ) ) ) ; } # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct proc_rlimit_control_wakeupmon { pub wm_flags : u32 , pub wm_rate : i32 , } # [ test ] fn bindgen_test_layout_proc_rlimit_control_wakeupmon ( ) { assert_eq ! ( :: core :: mem :: size_of :: < proc_rlimit_control_wakeupmon > ( ) , 8usize , concat ! ( "Size of: " , stringify ! ( proc_rlimit_control_wakeupmon ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < proc_rlimit_control_wakeupmon > ( ) , 4usize , concat ! ( "Alignment of " , stringify ! ( proc_rlimit_control_wakeupmon ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < proc_rlimit_control_wakeupmon > ( ) ) ) . wm_flags as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( proc_rlimit_control_wakeupmon ) , "::" , stringify ! ( wm_flags ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < proc_rlimit_control_wakeupmon > ( ) ) ) . wm_rate as * const _ as usize } , 4usize , concat ! ( "Offset of field: " , stringify ! ( proc_rlimit_control_wakeupmon ) , "::" , stringify ! ( wm_rate ) ) ) ; } extern "C" { pub fn getpriority ( arg1 : libc :: c_int , arg2 : id_t ) -> libc :: c_int ; } extern "C" { pub fn getiopolicy_np ( arg1 : libc :: c_int , arg2 : libc :: c_int ) -> libc :: c_int ; } extern "C" { pub fn getrlimit ( arg1 : libc :: c_int , arg2 : * mut rlimit ) -> libc :: c_int ; } extern "C" { pub fn getrusage ( arg1 : libc :: c_int , arg2 : * mut rusage ) -> libc :: c_int ; } extern "C" { pub fn setpriority ( arg1 : libc :: c_int , arg2 : id_t , arg3 : libc :: c_int ) -> libc :: c_int ; } extern "C" { pub fn setiopolicy_np ( arg1 : libc :: c_int , arg2 : libc :: c_int , arg3 : libc :: c_int ) -> libc :: c_int ; } extern "C" { pub fn setrlimit ( arg1 : libc :: c_int , arg2 : * const rlimit ) -> libc :: c_int ; } # [ repr ( C ) ] # [ derive ( Copy , Clone ) ] pub union wait { pub w_status : libc :: c_int , pub w_T : wait__bindgen_ty_1 , pub w_S : wait__bindgen_ty_2 , _bindgen_union_align : u32 , } # [ repr ( C ) ] # [ repr ( align ( 4 ) ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct wait__bindgen_ty_1 { pub _bitfield_1 : __BindgenBitfieldUnit < [ u8 ; 4usize ] , u16 > , } # [ test ] fn bindgen_test_layout_wait__bindgen_ty_1 ( ) { assert_eq ! ( :: core :: mem :: size_of :: < wait__bindgen_ty_1 > ( ) , 4usize , concat ! ( "Size of: " , stringify ! ( wait__bindgen_ty_1 ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < wait__bindgen_ty_1 > ( ) , 4usize , concat ! ( "Alignment of " , stringify ! ( wait__bindgen_ty_1 ) ) ) ; } impl wait__bindgen_ty_1 { # [ inline ] pub fn w_Termsig ( & self ) -> libc :: c_uint { unsafe { :: core :: mem :: transmute ( self . _bitfield_1 . get ( 0usize , 7u8 ) as u32 ) } } # [ inline ] pub fn set_w_Termsig ( & mut self , val : libc :: c_uint ) { unsafe { let val : u32 = :: core :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 0usize , 7u8 , val as u64 ) } } # [ inline ] pub fn w_Coredump ( & self ) -> libc :: c_uint { unsafe { :: core :: mem :: transmute ( self . _bitfield_1 . get ( 7usize , 1u8 ) as u32 ) } } # [ inline ] pub fn set_w_Coredump ( & mut self , val : libc :: c_uint ) { unsafe { let val : u32 = :: core :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 7usize , 1u8 , val as u64 ) } } # [ inline ] pub fn w_Retcode ( & self ) -> libc :: c_uint { unsafe { :: core :: mem :: transmute ( self . _bitfield_1 . get ( 8usize , 8u8 ) as u32 ) } } # [ inline ] pub fn set_w_Retcode ( & mut self , val : libc :: c_uint ) { unsafe { let val : u32 = :: core :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 8usize , 8u8 , val as u64 ) } } # [ inline ] pub fn w_Filler ( & self ) -> libc :: c_uint { unsafe { :: core :: mem :: transmute ( self . _bitfield_1 . get ( 16usize , 16u8 ) as u32 ) } } # [ inline ] pub fn set_w_Filler ( & mut self , val : libc :: c_uint ) { unsafe { let val : u32 = :: core :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 16usize , 16u8 , val as u64 ) } } # [ inline ] pub fn new_bitfield_1 ( w_Termsig : libc :: c_uint , w_Coredump : libc :: c_uint , w_Retcode : libc :: c_uint , w_Filler : libc :: c_uint ) -> __BindgenBitfieldUnit < [ u8 ; 4usize ] , u16 > { let mut __bindgen_bitfield_unit : __BindgenBitfieldUnit < [ u8 ; 4usize ] , u16 > = Default :: default ( ) ; __bindgen_bitfield_unit . set ( 0usize , 7u8 , { let w_Termsig : u32 = unsafe { :: core :: mem :: transmute ( w_Termsig ) } ; w_Termsig as u64 } ) ; __bindgen_bitfield_unit . set ( 7usize , 1u8 , { let w_Coredump : u32 = unsafe { :: core :: mem :: transmute ( w_Coredump ) } ; w_Coredump as u64 } ) ; __bindgen_bitfield_unit . set ( 8usize , 8u8 , { let w_Retcode : u32 = unsafe { :: core :: mem :: transmute ( w_Retcode ) } ; w_Retcode as u64 } ) ; __bindgen_bitfield_unit . set ( 16usize , 16u8 , { let w_Filler : u32 = unsafe { :: core :: mem :: transmute ( w_Filler ) } ; w_Filler as u64 } ) ; __bindgen_bitfield_unit } } # [ repr ( C ) ] # [ repr ( align ( 4 ) ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct wait__bindgen_ty_2 { pub _bitfield_1 : __BindgenBitfieldUnit < [ u8 ; 4usize ] , u16 > , } # [ test ] fn bindgen_test_layout_wait__bindgen_ty_2 ( ) { assert_eq ! ( :: core :: mem :: size_of :: < wait__bindgen_ty_2 > ( ) , 4usize , concat ! ( "Size of: " , stringify ! ( wait__bindgen_ty_2 ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < wait__bindgen_ty_2 > ( ) , 4usize , concat ! ( "Alignment of " , stringify ! ( wait__bindgen_ty_2 ) ) ) ; } impl wait__bindgen_ty_2 { # [ inline ] pub fn w_Stopval ( & self ) -> libc :: c_uint { unsafe { :: core :: mem :: transmute ( self . _bitfield_1 . get ( 0usize , 8u8 ) as u32 ) } } # [ inline ] pub fn set_w_Stopval ( & mut self , val : libc :: c_uint ) { unsafe { let val : u32 = :: core :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 0usize , 8u8 , val as u64 ) } } # [ inline ] pub fn w_Stopsig ( & self ) -> libc :: c_uint { unsafe { :: core :: mem :: transmute ( self . _bitfield_1 . get ( 8usize , 8u8 ) as u32 ) } } # [ inline ] pub fn set_w_Stopsig ( & mut self , val : libc :: c_uint ) { unsafe { let val : u32 = :: core :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 8usize , 8u8 , val as u64 ) } } # [ inline ] pub fn w_Filler ( & self ) -> libc :: c_uint { unsafe { :: core :: mem :: transmute ( self . _bitfield_1 . get ( 16usize , 16u8 ) as u32 ) } } # [ inline ] pub fn set_w_Filler ( & mut self , val : libc :: c_uint ) { unsafe { let val : u32 = :: core :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 16usize , 16u8 , val as u64 ) } } # [ inline ] pub fn new_bitfield_1 ( w_Stopval : libc :: c_uint , w_Stopsig : libc :: c_uint , w_Filler : libc :: c_uint ) -> __BindgenBitfieldUnit < [ u8 ; 4usize ] , u16 > { let mut __bindgen_bitfield_unit : __BindgenBitfieldUnit < [ u8 ; 4usize ] , u16 > = Default :: default ( ) ; __bindgen_bitfield_unit . set ( 0usize , 8u8 , { let w_Stopval : u32 = unsafe { :: core :: mem :: transmute ( w_Stopval ) } ; w_Stopval as u64 } ) ; __bindgen_bitfield_unit . set ( 8usize , 8u8 , { let w_Stopsig : u32 = unsafe { :: core :: mem :: transmute ( w_Stopsig ) } ; w_Stopsig as u64 } ) ; __bindgen_bitfield_unit . set ( 16usize , 16u8 , { let w_Filler : u32 = unsafe { :: core :: mem :: transmute ( w_Filler ) } ; w_Filler as u64 } ) ; __bindgen_bitfield_unit } } # [ test ] fn bindgen_test_layout_wait ( ) { assert_eq ! ( :: core :: mem :: size_of :: < wait > ( ) , 4usize , concat ! ( "Size of: " , stringify ! ( wait ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < wait > ( ) , 4usize , concat ! ( "Alignment of " , stringify ! ( wait ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < wait > ( ) ) ) . w_status as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( wait ) , "::" , stringify ! ( w_status ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < wait > ( ) ) ) . w_T as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( wait ) , "::" , stringify ! ( w_T ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < wait > ( ) ) ) . w_S as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( wait ) , "::" , stringify ! ( w_S ) ) ) ; } impl :: core :: fmt :: Debug for wait { fn fmt ( & self , f : & mut :: core :: fmt :: Formatter < '_ > ) -> :: core :: fmt :: Result { write ! ( f , "wait {{ union }}" ) } } extern "C" { pub fn wait ( arg1 : * mut libc :: c_int ) -> pid_t ; } extern "C" { pub fn waitpid ( arg1 : pid_t , arg2 : * mut libc :: c_int , arg3 : libc :: c_int ) -> pid_t ; } extern "C" { pub fn waitid ( arg1 : idtype_t , arg2 : id_t , arg3 : * mut siginfo_t , arg4 : libc :: c_int ) -> libc :: c_int ; } extern "C" { pub fn wait3 ( arg1 : * mut libc :: c_int , arg2 : libc :: c_int , arg3 : * mut rusage ) -> pid_t ; } extern "C" { pub fn wait4 ( arg1 : pid_t , arg2 : * mut libc :: c_int , arg3 : libc :: c_int , arg4 : * mut rusage ) -> pid_t ; } pub type ct_rune_t = __darwin_ct_rune_t ; pub type rune_t = __darwin_rune_t ; # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct div_t { pub quot : libc :: c_int , pub rem : libc :: c_int , } # [ test ] fn bindgen_test_layout_div_t ( ) { assert_eq ! ( :: core :: mem :: size_of :: < div_t > ( ) , 8usize , concat ! ( "Size of: " , stringify ! ( div_t ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < div_t > ( ) , 4usize , concat ! ( "Alignment of " , stringify ! ( div_t ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < div_t > ( ) ) ) . quot as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( div_t ) , "::" , stringify ! ( quot ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < div_t > ( ) ) ) . rem as * const _ as usize } , 4usize , concat ! ( "Offset of field: " , stringify ! ( div_t ) , "::" , stringify ! ( rem ) ) ) ; } # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct ldiv_t { pub quot : libc :: c_long , pub rem : libc :: c_long , } # [ test ] fn bindgen_test_layout_ldiv_t ( ) { assert_eq ! ( :: core :: mem :: size_of :: < ldiv_t > ( ) , 16usize , concat ! ( "Size of: " , stringify ! ( ldiv_t ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < ldiv_t > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( ldiv_t ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < ldiv_t > ( ) ) ) . quot as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( ldiv_t ) , "::" , stringify ! ( quot ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < ldiv_t > ( ) ) ) . rem as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( ldiv_t ) , "::" , stringify ! ( rem ) ) ) ; } # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct lldiv_t { pub quot : libc :: c_longlong , pub rem : libc :: c_longlong , } # [ test ] fn bindgen_test_layout_lldiv_t ( ) { assert_eq ! ( :: core :: mem :: size_of :: < lldiv_t > ( ) , 16usize , concat ! ( "Size of: " , stringify ! ( lldiv_t ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < lldiv_t > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( lldiv_t ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < lldiv_t > ( ) ) ) . quot as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( lldiv_t ) , "::" , stringify ! ( quot ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < lldiv_t > ( ) ) ) . rem as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( lldiv_t ) , "::" , stringify ! ( rem ) ) ) ; } extern "C" { pub static mut __mb_cur_max : libc :: c_int ; } extern "C" { pub fn malloc ( __size : libc :: c_ulong ) -> * mut libc :: c_void ; } extern "C" { pub fn calloc ( __count : libc :: c_ulong , __size : libc :: c_ulong ) -> * mut libc :: c_void ; } extern "C" { pub fn free ( arg1 : * mut libc :: c_void ) ; } extern "C" { pub fn realloc ( __ptr : * mut libc :: c_void , __size : libc :: c_ulong ) -> * mut libc :: c_void ; } extern "C" { pub fn valloc ( arg1 : usize ) -> * mut libc :: c_void ; } extern "C" { pub fn aligned_alloc ( __alignment : usize , __size : usize ) -> * mut libc :: c_void ; } extern "C" { pub fn posix_memalign ( __memptr : * mut * mut libc :: c_void , __alignment : usize , __size : usize ) -> libc :: c_int ; } extern "C" { pub fn abort ( ) ; } extern "C" { pub fn abs ( arg1 : libc :: c_int ) -> libc :: c_int ; } extern "C" { pub fn atexit ( arg1 : :: core :: option :: Option < unsafe extern "C" fn ( ) > ) -> libc :: c_int ; } extern "C" { pub fn atof ( arg1 : * const libc :: c_char ) -> f64 ; } extern "C" { pub fn atoi ( arg1 : * const libc :: c_char ) -> libc :: c_int ; } extern "C" { pub fn atol ( arg1 : * const libc :: c_char ) -> libc :: c_long ; } extern "C" { pub fn atoll ( arg1 : * const libc :: c_char ) -> libc :: c_longlong ; } extern "C" { pub fn bsearch ( __key : * const libc :: c_void , __base : * const libc :: c_void , __nel : usize , __width : usize , __compar : :: core :: option :: Option < unsafe extern "C" fn ( arg1 : * const libc :: c_void , arg2 : * const libc :: c_void ) -> libc :: c_int > ) -> * mut libc :: c_void ; } extern "C" { pub fn div ( arg1 : libc :: c_int , arg2 : libc :: c_int ) -> div_t ; } extern "C" { pub fn exit ( arg1 : libc :: c_int ) ; } extern "C" { pub fn getenv ( arg1 : * const libc :: c_char ) -> * mut libc :: c_char ; } extern "C" { pub fn labs ( arg1 : libc :: c_long ) -> libc :: c_long ; } extern "C" { pub fn ldiv ( arg1 : libc :: c_long , arg2 : libc :: c_long ) -> ldiv_t ; } extern "C" { pub fn llabs ( arg1 : libc :: c_longlong ) -> libc :: c_longlong ; } extern "C" { pub fn lldiv ( arg1 : libc :: c_longlong , arg2 : libc :: c_longlong ) -> lldiv_t ; } extern "C" { pub fn mblen ( __s : * const libc :: c_char , __n : usize ) -> libc :: c_int ; } extern "C" { pub fn mbstowcs ( arg1 : * mut wchar_t , arg2 : * const libc :: c_char , arg3 : usize ) -> usize ; } extern "C" { pub fn mbtowc ( arg1 : * mut wchar_t , arg2 : * const libc :: c_char , arg3 : usize ) -> libc :: c_int ; } extern "C" { pub fn qsort ( __base : * mut libc :: c_void , __nel : usize , __width : usize , __compar : :: core :: option :: Option < unsafe extern "C" fn ( arg1 : * const libc :: c_void , arg2 : * const libc :: c_void ) -> libc :: c_int > ) ; } extern "C" { pub fn rand ( ) -> libc :: c_int ; } extern "C" { pub fn srand ( arg1 : libc :: c_uint ) ; } extern "C" { pub fn strtod ( arg1 : * const libc :: c_char , arg2 : * mut * mut libc :: c_char ) -> f64 ; } extern "C" { pub fn strtof ( arg1 : * const libc :: c_char , arg2 : * mut * mut libc :: c_char ) -> f32 ; } extern "C" { pub fn strtol ( __str : * const libc :: c_char , __endptr : * mut * mut libc :: c_char , __base : libc :: c_int ) -> libc :: c_long ; } extern "C" { pub fn strtold ( arg1 : * const libc :: c_char , arg2 : * mut * mut libc :: c_char ) -> u128 ; } extern "C" { pub fn strtoll ( __str : * const libc :: c_char , __endptr : * mut * mut libc :: c_char , __base : libc :: c_int ) -> libc :: c_longlong ; } extern "C" { pub fn strtoul ( __str : * const libc :: c_char , __endptr : * mut * mut libc :: c_char , __base : libc :: c_int ) -> libc :: c_ulong ; } extern "C" { pub fn strtoull ( __str : * const libc :: c_char , __endptr : * mut * mut libc :: c_char , __base : libc :: c_int ) -> libc :: c_ulonglong ; } extern "C" { pub fn system ( arg1 : * const libc :: c_char ) -> libc :: c_int ; } extern "C" { pub fn wcstombs ( arg1 : * mut libc :: c_char , arg2 : * const wchar_t , arg3 : usize ) -> usize ; } extern "C" { pub fn wctomb ( arg1 : * mut libc :: c_char , arg2 : wchar_t ) -> libc :: c_int ; } extern "C" { pub fn _Exit ( arg1 : libc :: c_int ) ; } extern "C" { pub fn a64l ( arg1 : * const libc :: c_char ) -> libc :: c_long ; } extern "C" { pub fn drand48 ( ) -> f64 ; } extern "C" { pub fn ecvt ( arg1 : f64 , arg2 : libc :: c_int , arg3 : * mut libc :: c_int , arg4 : * mut libc :: c_int ) -> * mut libc :: c_char ; } extern "C" { pub fn erand48 ( arg1 : * mut libc :: c_ushort ) -> f64 ; } extern "C" { pub fn fcvt ( arg1 : f64 , arg2 : libc :: c_int , arg3 : * mut libc :: c_int , arg4 : * mut libc :: c_int ) -> * mut libc :: c_char ; } extern "C" { pub fn gcvt ( arg1 : f64 , arg2 : libc :: c_int , arg3 : * mut libc :: c_char ) -> * mut libc :: c_char ; } extern "C" { pub fn getsubopt ( arg1 : * mut * mut libc :: c_char , arg2 : * const * mut libc :: c_char , arg3 : * mut * mut libc :: c_char ) -> libc :: c_int ; } extern "C" { pub fn grantpt ( arg1 : libc :: c_int ) -> libc :: c_int ; } extern "C" { pub fn initstate ( arg1 : libc :: c_uint , arg2 : * mut libc :: c_char , arg3 : usize ) -> * mut libc :: c_char ; } extern "C" { pub fn jrand48 ( arg1 : * mut libc :: c_ushort ) -> libc :: c_long ; } extern "C" { pub fn l64a ( arg1 : libc :: c_long ) -> * mut libc :: c_char ; } extern "C" { pub fn lcong48 ( arg1 : * mut libc :: c_ushort ) ; } extern "C" { pub fn lrand48 ( ) -> libc :: c_long ; } extern "C" { pub fn mktemp ( arg1 : * mut libc :: c_char ) -> * mut libc :: c_char ; } extern "C" { pub fn mkstemp ( arg1 : * mut libc :: c_char ) -> libc :: c_int ; } extern "C" { pub fn mrand48 ( ) -> libc :: c_long ; } extern "C" { pub fn nrand48 ( arg1 : * mut libc :: c_ushort ) -> libc :: c_long ; } extern "C" { pub fn posix_openpt ( arg1 : libc :: c_int ) -> libc :: c_int ; } extern "C" { pub fn ptsname ( arg1 : libc :: c_int ) -> * mut libc :: c_char ; } extern "C" { pub fn ptsname_r ( fildes : libc :: c_int , buffer : * mut libc :: c_char , buflen : usize ) -> libc :: c_int ; } extern "C" { pub fn putenv ( arg1 : * mut libc :: c_char ) -> libc :: c_int ; } extern "C" { pub fn random ( ) -> libc :: c_long ; } extern "C" { pub fn rand_r ( arg1 : * mut libc :: c_uint ) -> libc :: c_int ; } extern "C" { # [ link_name = "\u{1}_realpath$DARWIN_EXTSN" ] pub fn realpath ( arg1 : * const libc :: c_char , arg2 : * mut libc :: c_char ) -> * mut libc :: c_char ; } extern "C" { pub fn seed48 ( arg1 : * mut libc :: c_ushort ) -> * mut libc :: c_ushort ; } extern "C" { pub fn setenv ( __name : * const libc :: c_char , __value : * const libc :: c_char , __overwrite : libc :: c_int ) -> libc :: c_int ; } extern "C" { pub fn setkey ( arg1 : * const libc :: c_char ) ; } extern "C" { pub fn setstate ( arg1 : * const libc :: c_char ) -> * mut libc :: c_char ; } extern "C" { pub fn srand48 ( arg1 : libc :: c_long ) ; } extern "C" { pub fn srandom ( arg1 : libc :: c_uint ) ; } extern "C" { pub fn unlockpt ( arg1 : libc :: c_int ) -> libc :: c_int ; } extern "C" { pub fn unsetenv ( arg1 : * const libc :: c_char ) -> libc :: c_int ; } pub type dev_t = __darwin_dev_t ; pub type mode_t = __darwin_mode_t ; extern "C" { pub fn arc4random ( ) -> u32 ; } extern "C" { pub fn arc4random_addrandom ( arg1 : * mut libc :: c_uchar , arg2 : libc :: c_int ) ; } extern "C" { pub fn arc4random_buf ( __buf : * mut libc :: c_void , __nbytes : usize ) ; } extern "C" { pub fn arc4random_stir ( ) ; } extern "C" { pub fn arc4random_uniform ( __upper_bound : u32 ) -> u32 ; } extern "C" { pub fn atexit_b ( arg1 : * mut libc :: c_void ) -> libc :: c_int ; } extern "C" { pub fn bsearch_b ( __key : * const libc :: c_void , __base : * const libc :: c_void , __nel : usize , __width : usize , __compar : * mut libc :: c_void ) -> * mut libc :: c_void ; } extern "C" { pub fn cgetcap ( arg1 : * mut libc :: c_char , arg2 : * const libc :: c_char , arg3 : libc :: c_int ) -> * mut libc :: c_char ; } extern "C" { pub fn cgetclose ( ) -> libc :: c_int ; } extern "C" { pub fn cgetent ( arg1 : * mut * mut libc :: c_char , arg2 : * mut * mut libc :: c_char , arg3 : * const libc :: c_char ) -> libc :: c_int ; } extern "C" { pub fn cgetfirst ( arg1 : * mut * mut libc :: c_char , arg2 : * mut * mut libc :: c_char ) -> libc :: c_int ; } extern "C" { pub fn cgetmatch ( arg1 : * const libc :: c_char , arg2 : * const libc :: c_char ) -> libc :: c_int ; } extern "C" { pub fn cgetnext ( arg1 : * mut * mut libc :: c_char , arg2 : * mut * mut libc :: c_char ) -> libc :: c_int ; } extern "C" { pub fn cgetnum ( arg1 : * mut libc :: c_char , arg2 : * const libc :: c_char , arg3 : * mut libc :: c_long ) -> libc :: c_int ; } extern "C" { pub fn cgetset ( arg1 : * const libc :: c_char ) -> libc :: c_int ; } extern "C" { pub fn cgetstr ( arg1 : * mut libc :: c_char , arg2 : * const libc :: c_char , arg3 : * mut * mut libc :: c_char ) -> libc :: c_int ; } extern "C" { pub fn cgetustr ( arg1 : * mut libc :: c_char , arg2 : * const libc :: c_char , arg3 : * mut * mut libc :: c_char ) -> libc :: c_int ; } extern "C" { # [ link_name = "\u{1}_daemon$1050" ] pub fn daemon ( arg1 : libc :: c_int , arg2 : libc :: c_int ) -> libc :: c_int ; } extern "C" { pub fn devname ( arg1 : dev_t , arg2 : mode_t ) -> * mut libc :: c_char ; } extern "C" { pub fn devname_r ( arg1 : dev_t , arg2 : mode_t , buf : * mut libc :: c_char , len : libc :: c_int ) -> * mut libc :: c_char ; } extern "C" { pub fn getbsize ( arg1 : * mut libc :: c_int , arg2 : * mut libc :: c_long ) -> * mut libc :: c_char ; } extern "C" { pub fn getloadavg ( arg1 : * mut f64 , arg2 : libc :: c_int ) -> libc :: c_int ; } extern "C" { pub fn getprogname ( ) -> * const libc :: c_char ; } extern "C" { pub fn setprogname ( arg1 : * const libc :: c_char ) ; } extern "C" { pub fn heapsort ( __base : * mut libc :: c_void , __nel : usize , __width : usize , __compar : :: core :: option :: Option < unsafe extern "C" fn ( arg1 : * const libc :: c_void , arg2 : * const libc :: c_void ) -> libc :: c_int > ) -> libc :: c_int ; } extern "C" { pub fn heapsort_b ( __base : * mut libc :: c_void , __nel : usize , __width : usize , __compar : * mut libc :: c_void ) -> libc :: c_int ; } extern "C" { pub fn mergesort ( __base : * mut libc :: c_void , __nel : usize , __width : usize , __compar : :: core :: option :: Option < unsafe extern "C" fn ( arg1 : * const libc :: c_void , arg2 : * const libc :: c_void ) -> libc :: c_int > ) -> libc :: c_int ; } extern "C" { pub fn mergesort_b ( __base : * mut libc :: c_void , __nel : usize , __width : usize , __compar : * mut libc :: c_void ) -> libc :: c_int ; } extern "C" { pub fn psort ( __base : * mut libc :: c_void , __nel : usize , __width : usize , __compar : :: core :: option :: Option < unsafe extern "C" fn ( arg1 : * const libc :: c_void , arg2 : * const libc :: c_void ) -> libc :: c_int > ) ; } extern "C" { pub fn psort_b ( __base : * mut libc :: c_void , __nel : usize , __width : usize , __compar : * mut libc :: c_void ) ; } extern "C" { pub fn psort_r ( __base : * mut libc :: c_void , __nel : usize , __width : usize , arg1 : * mut libc :: c_void , __compar : :: core :: option :: Option < unsafe extern "C" fn ( arg1 : * mut libc :: c_void , arg2 : * const libc :: c_void , arg3 : * const libc :: c_void ) -> libc :: c_int > ) ; } extern "C" { pub fn qsort_b ( __base : * mut libc :: c_void , __nel : usize , __width : usize , __compar : * mut libc :: c_void ) ; } extern "C" { pub fn qsort_r ( __base : * mut libc :: c_void , __nel : usize , __width : usize , arg1 : * mut libc :: c_void , __compar : :: core :: option :: Option < unsafe extern "C" fn ( arg1 : * mut libc :: c_void , arg2 : * const libc :: c_void , arg3 : * const libc :: c_void ) -> libc :: c_int > ) ; } extern "C" { pub fn radixsort ( __base : * mut * const libc :: c_uchar , __nel : libc :: c_int , __table : * const libc :: c_uchar , __endbyte : libc :: c_uint ) -> libc :: c_int ; } extern "C" { pub fn rpmatch ( arg1 : * const libc :: c_char ) -> libc :: c_int ; } extern "C" { pub fn sradixsort ( __base : * mut * const libc :: c_uchar , __nel : libc :: c_int , __table : * const libc :: c_uchar , __endbyte : libc :: c_uint ) -> libc :: c_int ; } extern "C" { pub fn sranddev ( ) ; } extern "C" { pub fn srandomdev ( ) ; } extern "C" { pub fn reallocf ( __ptr : * mut libc :: c_void , __size : usize ) -> * mut libc :: c_void ; } extern "C" { pub fn strtoq ( __str : * const libc :: c_char , __endptr : * mut * mut libc :: c_char , __base : libc :: c_int ) -> libc :: c_longlong ; } extern "C" { pub fn strtouq ( __str : * const libc :: c_char , __endptr : * mut * mut libc :: c_char , __base : libc :: c_int ) -> libc :: c_ulonglong ; } extern "C" { pub static mut suboptarg : * mut libc :: c_char ; } pub type address_t = [ u8 ; 20usize ] ; pub type bytes32_t = [ u8 ; 32usize ] ; pub type wlen_t = uint_fast8_t ; # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct bytes { pub data : * mut u8 , pub len : u32 , } # [ test ] fn bindgen_test_layout_bytes ( ) { assert_eq ! ( :: core :: mem :: size_of :: < bytes > ( ) , 16usize , concat ! ( "Size of: " , stringify ! ( bytes ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < bytes > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( bytes ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < bytes > ( ) ) ) . data as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( bytes ) , "::" , stringify ! ( data ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < bytes > ( ) ) ) . len as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( bytes ) , "::" , stringify ! ( len ) ) ) ; } pub type bytes_t = bytes ; # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct bytes_builder_t { pub bsize : usize , pub b : bytes_t , } # [ test ] fn bindgen_test_layout_bytes_builder_t ( ) { assert_eq ! ( :: core :: mem :: size_of :: < bytes_builder_t > ( ) , 24usize , concat ! ( "Size of: " , stringify ! ( bytes_builder_t ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < bytes_builder_t > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( bytes_builder_t ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < bytes_builder_t > ( ) ) ) . bsize as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( bytes_builder_t ) , "::" , stringify ! ( bsize ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < bytes_builder_t > ( ) ) ) . b as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( bytes_builder_t ) , "::" , stringify ! ( b ) ) ) ; } extern "C" { pub fn b_new ( data : * const u8 , len : u32 ) -> * mut bytes_t ; } extern "C" { pub fn b_print ( a : * const bytes_t ) ; } extern "C" { pub fn ba_print ( a : * const u8 , l : usize ) ; } extern "C" { pub fn b_cmp ( a : * const bytes_t , b : * const bytes_t ) -> libc :: c_int ; } extern "C" { pub fn bytes_cmp ( a : bytes_t , b : bytes_t ) -> libc :: c_int ; } extern "C" { pub fn b_free ( a : * mut bytes_t ) ; } extern "C" { pub fn b_dup ( a : * const bytes_t ) -> * mut bytes_t ; } extern "C" { pub fn b_read_byte ( b : * mut bytes_t , pos : * mut usize ) -> u8 ; } extern "C" { pub fn b_read_int ( b : * mut bytes_t , pos : * mut usize ) -> u32 ; } extern "C" { pub fn b_read_long ( b : * mut bytes_t , pos : * mut usize ) -> u64 ; } extern "C" { pub fn b_new_chars ( b : * mut bytes_t , pos : * mut usize ) -> * mut libc :: c_char ; } extern "C" { pub fn b_new_fixed_bytes ( b : * mut bytes_t , pos : * mut usize , len : libc :: c_int ) -> * mut bytes_t ; } extern "C" { pub fn bb_newl ( l : usize ) -> * mut bytes_builder_t ; } extern "C" { pub fn bb_free ( bb : * mut bytes_builder_t ) ; } extern "C" { pub fn bb_check_size ( bb : * mut bytes_builder_t , len : usize ) -> libc :: c_int ; } extern "C" { pub fn bb_write_chars ( bb : * mut bytes_builder_t , c : * mut libc :: c_char , len : libc :: c_int ) ; } extern "C" { pub fn bb_write_dyn_bytes ( bb : * mut bytes_builder_t , src : * const bytes_t ) ; } extern "C" { pub fn bb_write_fixed_bytes ( bb : * mut bytes_builder_t , src : * const bytes_t ) ; } extern "C" { pub fn bb_write_int ( bb : * mut bytes_builder_t , val : u32 ) ; } extern "C" { pub fn bb_write_long ( bb : * mut bytes_builder_t , val : u64 ) ; } extern "C" { pub fn bb_write_long_be ( bb : * mut bytes_builder_t , val : u64 , len : libc :: c_int ) ; } extern "C" { pub fn bb_write_byte ( bb : * mut bytes_builder_t , val : u8 ) ; } extern "C" { pub fn bb_write_raw_bytes ( bb : * mut bytes_builder_t , ptr : * mut libc :: c_void , len : usize ) ; } extern "C" { pub fn bb_clear ( bb : * mut bytes_builder_t ) ; } extern "C" { pub fn bb_replace ( bb : * mut bytes_builder_t , offset : libc :: c_int , delete_len : libc :: c_int , data : * mut u8 , data_len : libc :: c_int ) ; } extern "C" { pub fn bb_move_to_bytes ( bb : * mut bytes_builder_t ) -> * mut bytes_t ; } extern "C" { pub fn bb_read_long ( bb : * mut bytes_builder_t , i : * mut usize ) -> u64 ; } extern "C" { pub fn bb_read_int ( bb : * mut bytes_builder_t , i : * mut usize ) -> u32 ; } extern "C" { pub fn cloned_bytes ( data : bytes_t ) -> bytes_t ; } pub type max_align_t = u128 ; # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct sb { pub data : * mut libc :: c_char , pub allocted : usize , pub len : usize , } # [ test ] fn bindgen_test_layout_sb ( ) { assert_eq ! ( :: core :: mem :: size_of :: < sb > ( ) , 24usize , concat ! ( "Size of: " , stringify ! ( sb ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < sb > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( sb ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < sb > ( ) ) ) . data as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( sb ) , "::" , stringify ! ( data ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < sb > ( ) ) ) . allocted as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( sb ) , "::" , stringify ! ( allocted ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < sb > ( ) ) ) . len as * const _ as usize } , 16usize , concat ! ( "Offset of field: " , stringify ! ( sb ) , "::" , stringify ! ( len ) ) ) ; } pub type sb_t = sb ; extern "C" { pub fn sb_new ( chars : * const libc :: c_char ) -> * mut sb_t ; } extern "C" { pub fn sb_init ( sb : * mut sb_t ) -> * mut sb_t ; } extern "C" { pub fn sb_free ( sb : * mut sb_t ) ; } extern "C" { pub fn sb_add_char ( sb : * mut sb_t , c : libc :: c_char ) -> * mut sb_t ; } extern "C" { pub fn sb_add_chars ( sb : * mut sb_t , chars : * const libc :: c_char ) -> * mut sb_t ; } extern "C" { pub fn sb_add_range ( sb : * mut sb_t , chars : * const libc :: c_char , start : libc :: c_int , len : libc :: c_int ) -> * mut sb_t ; } extern "C" { pub fn sb_add_key_value ( sb : * mut sb_t , key : * const libc :: c_char , value : * const libc :: c_char , value_len : libc :: c_int , as_string : bool ) -> * mut sb_t ; } extern "C" { pub fn sb_add_bytes ( sb : * mut sb_t , prefix : * const libc :: c_char , bytes : * const bytes_t , len : libc :: c_int , as_array : bool ) -> * mut sb_t ; } extern "C" { pub fn sb_add_hexuint_l ( sb : * mut sb_t , uint : uintmax_t , l : usize ) -> * mut sb_t ; } extern "C" { pub fn sb_add_escaped_chars ( sb : * mut sb_t , chars : * const libc :: c_char ) -> * mut sb_t ; } extern "C" { pub fn sb_add_int ( sb : * mut sb_t , val : u64 ) -> * mut sb_t ; } pub type d_key_t = u16 ; # [ repr ( u32 ) ] # [ derive ( Debug , Copy , Clone , PartialEq , Eq , Hash ) ] pub enum d_type_t { T_BYTES = 0 , T_STRING = 1 , T_ARRAY = 2 , T_OBJECT = 3 , T_BOOLEAN = 4 , T_INTEGER = 5 , T_NULL = 6 , } # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct item { pub data : * mut u8 , pub len : u32 , pub key : d_key_t , } # [ test ] fn bindgen_test_layout_item ( ) { assert_eq ! ( :: core :: mem :: size_of :: < item > ( ) , 16usize , concat ! ( "Size of: " , stringify ! ( item ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < item > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( item ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < item > ( ) ) ) . data as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( item ) , "::" , stringify ! ( data ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < item > ( ) ) ) . len as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( item ) , "::" , stringify ! ( len ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < item > ( ) ) ) . key as * const _ as usize } , 12usize , concat ! ( "Offset of field: " , stringify ! ( item ) , "::" , stringify ! ( key ) ) ) ; } pub type d_token_t = item ; # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct str_range { pub data : * mut libc :: c_char , pub len : usize , } # [ test ] fn bindgen_test_layout_str_range ( ) { assert_eq ! ( :: core :: mem :: size_of :: < str_range > ( ) , 16usize , concat ! ( "Size of: " , stringify ! ( str_range ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < str_range > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( str_range ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < str_range > ( ) ) ) . data as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( str_range ) , "::" , stringify ! ( data ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < str_range > ( ) ) ) . len as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( str_range ) , "::" , stringify ! ( len ) ) ) ; } pub type str_range_t = str_range ; # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct json_parser { pub result : * mut d_token_t , pub c : * mut libc :: c_char , pub allocated : usize , pub len : usize , pub depth : usize , } # [ test ] fn bindgen_test_layout_json_parser ( ) { assert_eq ! ( :: core :: mem :: size_of :: < json_parser > ( ) , 40usize , concat ! ( "Size of: " , stringify ! ( json_parser ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < json_parser > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( json_parser ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < json_parser > ( ) ) ) . result as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( json_parser ) , "::" , stringify ! ( result ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < json_parser > ( ) ) ) . c as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( json_parser ) , "::" , stringify ! ( c ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < json_parser > ( ) ) ) . allocated as * const _ as usize } , 16usize , concat ! ( "Offset of field: " , stringify ! ( json_parser ) , "::" , stringify ! ( allocated ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < json_parser > ( ) ) ) . len as * const _ as usize } , 24usize , concat ! ( "Offset of field: " , stringify ! ( json_parser ) , "::" , stringify ! ( len ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < json_parser > ( ) ) ) . depth as * const _ as usize } , 32usize , concat ! ( "Offset of field: " , stringify ! ( json_parser ) , "::" , stringify ! ( depth ) ) ) ; } pub type json_ctx_t = json_parser ; extern "C" { pub fn d_to_bytes ( item : * mut d_token_t ) -> bytes_t ; } extern "C" { pub fn d_bytes_to ( item : * mut d_token_t , dst : * mut u8 , max : libc :: c_int ) -> libc :: c_int ; } extern "C" { pub fn d_bytes ( item : * const d_token_t ) -> * mut bytes_t ; } extern "C" { pub fn d_bytesl ( item : * mut d_token_t , l : usize ) -> * mut bytes_t ; } extern "C" { pub fn d_string ( item : * const d_token_t ) -> * mut libc :: c_char ; } extern "C" { pub fn d_int ( item : * const d_token_t ) -> i32 ; } extern "C" { pub fn d_intd ( item : * const d_token_t , def_val : u32 ) -> i32 ; } extern "C" { pub fn d_long ( item : * const d_token_t ) -> u64 ; } extern "C" { pub fn d_longd ( item : * const d_token_t , def_val : u64 ) -> u64 ; } extern "C" { pub fn d_create_bytes_vec ( arr : * const d_token_t ) -> * mut * mut bytes_t ; } extern "C" { pub fn d_eq ( a : * const d_token_t , b : * const d_token_t ) -> bool ; } extern "C" { pub fn keyn ( c : * const libc :: c_char , len : usize ) -> d_key_t ; } extern "C" { pub fn d_get ( item : * mut d_token_t , key : u16 ) -> * mut d_token_t ; } extern "C" { pub fn d_get_or ( item : * mut d_token_t , key1 : u16 , key2 : u16 ) -> * mut d_token_t ; } extern "C" { pub fn d_get_at ( item : * mut d_token_t , index : u32 ) -> * mut d_token_t ; } extern "C" { pub fn d_next ( item : * mut d_token_t ) -> * mut d_token_t ; } extern "C" { pub fn d_serialize_binary ( bb : * mut bytes_builder_t , t : * mut d_token_t ) ; } extern "C" { pub fn parse_binary ( data : * const bytes_t ) -> * mut json_ctx_t ; } extern "C" { pub fn parse_binary_str ( data : * const libc :: c_char , len : libc :: c_int ) -> * mut json_ctx_t ; } extern "C" { pub fn parse_json ( js : * const libc :: c_char ) -> * mut json_ctx_t ; } extern "C" { pub fn json_free ( parser_ctx : * mut json_ctx_t ) ; } extern "C" { pub fn d_to_json ( item : * const d_token_t ) -> str_range_t ; } extern "C" { pub fn d_create_json ( item : * mut d_token_t ) -> * mut libc :: c_char ; } extern "C" { pub fn json_create ( ) -> * mut json_ctx_t ; } extern "C" { pub fn json_create_null ( jp : * mut json_ctx_t ) -> * mut d_token_t ; } extern "C" { pub fn json_create_bool ( jp : * mut json_ctx_t , value : bool ) -> * mut d_token_t ; } extern "C" { pub fn json_create_int ( jp : * mut json_ctx_t , value : u64 ) -> * mut d_token_t ; } extern "C" { pub fn json_create_string ( jp : * mut json_ctx_t , value : * mut libc :: c_char ) -> * mut d_token_t ; } extern "C" { pub fn json_create_bytes ( jp : * mut json_ctx_t , value : bytes_t ) -> * mut d_token_t ; } extern "C" { pub fn json_create_object ( jp : * mut json_ctx_t ) -> * mut d_token_t ; } extern "C" { pub fn json_create_array ( jp : * mut json_ctx_t ) -> * mut d_token_t ; } extern "C" { pub fn json_object_add_prop ( object : * mut d_token_t , key : d_key_t , value : * mut d_token_t ) -> * mut d_token_t ; } extern "C" { pub fn json_array_add_value ( object : * mut d_token_t , value : * mut d_token_t ) -> * mut d_token_t ; } extern "C" { pub fn d_get_keystr ( k : d_key_t ) -> * mut libc :: c_char ; } extern "C" { pub fn d_track_keynames ( v : u8 ) ; } extern "C" { pub fn d_clear_keynames ( ) ; } extern "C" { pub fn d_get_byteskl ( r : * mut d_token_t , k : d_key_t , minl : u32 ) -> * mut bytes_t ; } extern "C" { pub fn d_getl ( item : * mut d_token_t , k : u16 , minl : u32 ) -> * mut d_token_t ; } # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct d_iterator { pub token : * mut d_token_t , pub left : libc :: c_int , } # [ test ] fn bindgen_test_layout_d_iterator ( ) { assert_eq ! ( :: core :: mem :: size_of :: < d_iterator > ( ) , 16usize , concat ! ( "Size of: " , stringify ! ( d_iterator ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < d_iterator > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( d_iterator ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < d_iterator > ( ) ) ) . token as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( d_iterator ) , "::" , stringify ! ( token ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < d_iterator > ( ) ) ) . left as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( d_iterator ) , "::" , stringify ! ( left ) ) ) ; } pub type d_iterator_t = d_iterator ; extern "C" { pub fn d_iter ( parent : * mut d_token_t ) -> d_iterator_t ; } # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct cache_entry { pub key : bytes_t , pub value : bytes_t , pub buffer : [ u8 ; 4usize ] , pub must_free : bool , pub next : * mut cache_entry , } # [ test ] fn bindgen_test_layout_cache_entry ( ) { assert_eq ! ( :: core :: mem :: size_of :: < cache_entry > ( ) , 48usize , concat ! ( "Size of: " , stringify ! ( cache_entry ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < cache_entry > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( cache_entry ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < cache_entry > ( ) ) ) . key as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( cache_entry ) , "::" , stringify ! ( key ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < cache_entry > ( ) ) ) . value as * const _ as usize } , 16usize , concat ! ( "Offset of field: " , stringify ! ( cache_entry ) , "::" , stringify ! ( value ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < cache_entry > ( ) ) ) . buffer as * const _ as usize } , 32usize , concat ! ( "Offset of field: " , stringify ! ( cache_entry ) , "::" , stringify ! ( buffer ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < cache_entry > ( ) ) ) . must_free as * const _ as usize } , 36usize , concat ! ( "Offset of field: " , stringify ! ( cache_entry ) , "::" , stringify ! ( must_free ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < cache_entry > ( ) ) ) . next as * const _ as usize } , 40usize , concat ! ( "Offset of field: " , stringify ! ( cache_entry ) , "::" , stringify ! ( next ) ) ) ; } pub type cache_entry_t = cache_entry ; extern "C" { pub fn in3_cache_get_entry ( cache : * mut cache_entry_t , key : * mut bytes_t ) -> * mut bytes_t ; } extern "C" { pub fn in3_cache_add_entry ( cache : * mut * mut cache_entry_t , key : bytes_t , value : bytes_t ) -> * mut cache_entry_t ; } extern "C" { pub fn in3_cache_free ( cache : * mut cache_entry_t ) ; } extern "C" { pub fn bytes_to_long ( data : * const u8 , len : libc :: c_int ) -> u64 ; } extern "C" { pub fn char_to_long ( a : * const libc :: c_char , l : libc :: c_int ) -> u64 ; } extern "C" { pub fn hexchar_to_int ( c : libc :: c_char ) -> u8 ; } extern "C" { pub fn u64_to_str ( value : u64 , pBuf : * mut libc :: c_char , szBuf : libc :: c_int ) -> * const libc :: c_char ; } extern "C" { pub fn hex_to_bytes ( hexdata : * const libc :: c_char , hexlen : libc :: c_int , out : * mut u8 , outlen : libc :: c_int ) -> libc :: c_int ; } extern "C" { pub fn hex_to_new_bytes ( buf : * const libc :: c_char , len : libc :: c_int ) -> * mut bytes_t ; } extern "C" { pub fn bytes_to_hex ( buffer : * const u8 , len : libc :: c_int , out : * mut libc :: c_char ) -> libc :: c_int ; } extern "C" { pub fn sha3 ( data : * const bytes_t ) -> * mut bytes_t ; } extern "C" { pub fn sha3_to ( data : * mut bytes_t , dst : * mut libc :: c_void ) -> libc :: c_int ; } extern "C" { pub fn long_to_bytes ( val : u64 , dst : * mut u8 ) ; } extern "C" { pub fn int_to_bytes ( val : u32 , dst : * mut u8 ) ; } extern "C" { pub fn _strdupn ( src : * const libc :: c_char , len : libc :: c_int ) -> * mut libc :: c_char ; } extern "C" { pub fn min_bytes_len ( val : u64 ) -> libc :: c_int ; } extern "C" { pub fn uint256_set ( src : * const u8 , src_len : wlen_t , dst : * mut u8 ) ; } extern "C" { pub fn str_replace ( orig : * mut libc :: c_char , rep : * const libc :: c_char , with : * const libc :: c_char ) -> * mut libc :: c_char ; } extern "C" { pub fn str_replace_pos ( orig : * mut libc :: c_char , pos : usize , len : usize , rep : * const libc :: c_char ) -> * mut libc :: c_char ; } extern "C" { pub fn str_find ( haystack : * mut libc :: c_char , needle : * const libc :: c_char ) -> * mut libc :: c_char ; } extern "C" { pub fn str_remove_html ( data : * mut libc :: c_char ) -> * mut libc :: c_char ; } extern "C" { pub fn current_ms ( ) -> u64 ; } pub type time_func = :: core :: option :: Option < unsafe extern "C" fn ( t : * mut libc :: c_void ) -> u64 > ; extern "C" { pub fn in3_set_func_time ( fn_ : time_func ) ; } extern "C" { pub fn in3_time ( t : * mut libc :: c_void ) -> u64 ; } pub type rand_func = :: core :: option :: Option < unsafe extern "C" fn ( s : * mut libc :: c_void ) -> libc :: c_int > ; extern "C" { pub fn in3_set_func_rand ( fn_ : rand_func ) ; } extern "C" { pub fn in3_rand ( s : * mut libc :: c_void ) -> libc :: c_int ; } pub type srand_func = :: core :: option :: Option < unsafe extern "C" fn ( s : libc :: c_uint ) > ; extern "C" { pub fn in3_set_func_srand ( fn_ : srand_func ) ; } extern "C" { pub fn in3_srand ( s : libc :: c_uint ) ; } extern "C" { pub fn parse_float_val ( data : * const libc :: c_char , expo : i32 ) -> i64 ; } pub mod in3_ret_t { pub type Type = i32 ; pub const IN3_OK : Type = 0 ; pub const IN3_EUNKNOWN : Type = - 1 ; pub const IN3_ENOMEM : Type = - 2 ; pub const IN3_ENOTSUP : Type = - 3 ; pub const IN3_EINVAL : Type = - 4 ; pub const IN3_EFIND : Type = - 5 ; pub const IN3_ECONFIG : Type = - 6 ; pub const IN3_ELIMIT : Type = - 7 ; pub const IN3_EVERS : Type = - 8 ; pub const IN3_EINVALDT : Type = - 9 ; pub const IN3_EPASS : Type = - 10 ; pub const IN3_ERPC : Type = - 11 ; pub const IN3_ERPCNRES : Type = - 12 ; pub const IN3_EUSNURL : Type = - 13 ; pub const IN3_ETRANS : Type = - 14 ; pub const IN3_ERANGE : Type = - 15 ; pub const IN3_WAITING : Type = - 16 ; pub const IN3_EIGNORE : Type = - 17 ; pub const IN3_EPAYMENT_REQUIRED : Type = - 18 ; pub const IN3_ENODEVICE : Type = - 19 ; pub const IN3_EAPDU : Type = - 20 ; } extern "C" { pub fn in3_errmsg ( err : in3_ret_t :: Type ) -> * mut libc :: c_char ; } pub type chain_id_t = u32 ; # [ repr ( u32 ) ] # [ derive ( Debug , Copy , Clone , PartialEq , Eq , Hash ) ] pub enum in3_chain_type_t { CHAIN_ETH = 0 , CHAIN_SUBSTRATE = 1 , CHAIN_IPFS = 2 , CHAIN_BTC = 3 , CHAIN_EOS = 4 , CHAIN_IOTA = 5 , CHAIN_GENERIC = 6 , } # [ repr ( u32 ) ] # [ derive ( Debug , Copy , Clone , PartialEq , Eq , Hash ) ] pub enum in3_proof_t { PROOF_NONE = 0 , PROOF_STANDARD = 1 , PROOF_FULL = 2 , } pub type in3_node_props_t = u64 ; # [ repr ( u32 ) ] # [ derive ( Debug , Copy , Clone , PartialEq , Eq , Hash ) ] pub enum in3_node_props_type_t { NODE_PROP_PROOF = 1 , NODE_PROP_MULTICHAIN = 2 , NODE_PROP_ARCHIVE = 4 , NODE_PROP_HTTP = 8 , NODE_PROP_BINARY = 16 , NODE_PROP_ONION = 32 , NODE_PROP_SIGNER = 64 , NODE_PROP_DATA = 128 , NODE_PROP_STATS = 256 , NODE_PROP_MIN_BLOCK_HEIGHT = 1024 , } # [ repr ( u32 ) ] # [ derive ( Debug , Copy , Clone , PartialEq , Eq , Hash ) ] pub enum in3_flags_type_t { FLAGS_KEEP_IN3 = 1 , FLAGS_AUTO_UPDATE_LIST = 2 , FLAGS_INCLUDE_CODE = 4 , FLAGS_BINARY = 8 , FLAGS_HTTP = 16 , FLAGS_STATS = 32 , FLAGS_NODE_LIST_NO_SIG = 64 , FLAGS_BOOT_WEIGHTS = 128 , } # [ repr ( u32 ) ] # [ derive ( Debug , Copy , Clone , PartialEq , Eq , Hash ) ] pub enum in3_node_attr_type_t { ATTR_WHITELISTED = 1 , ATTR_BOOT_NODE = 2 , } pub type in3_node_attr_t = u8 ; # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct in3_node { pub address : * mut bytes_t , pub deposit : u64 , pub index : u32 , pub capacity : u32 , pub props : in3_node_props_t , pub url : * mut libc :: c_char , pub attrs : u8 , } # [ test ] fn bindgen_test_layout_in3_node ( ) { assert_eq ! ( :: core :: mem :: size_of :: < in3_node > ( ) , 48usize , concat ! ( "Size of: " , stringify ! ( in3_node ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < in3_node > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( in3_node ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_node > ( ) ) ) . address as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( in3_node ) , "::" , stringify ! ( address ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_node > ( ) ) ) . deposit as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( in3_node ) , "::" , stringify ! ( deposit ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_node > ( ) ) ) . index as * const _ as usize } , 16usize , concat ! ( "Offset of field: " , stringify ! ( in3_node ) , "::" , stringify ! ( index ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_node > ( ) ) ) . capacity as * const _ as usize } , 20usize , concat ! ( "Offset of field: " , stringify ! ( in3_node ) , "::" , stringify ! ( capacity ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_node > ( ) ) ) . props as * const _ as usize } , 24usize , concat ! ( "Offset of field: " , stringify ! ( in3_node ) , "::" , stringify ! ( props ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_node > ( ) ) ) . url as * const _ as usize } , 32usize , concat ! ( "Offset of field: " , stringify ! ( in3_node ) , "::" , stringify ! ( url ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_node > ( ) ) ) . attrs as * const _ as usize } , 40usize , concat ! ( "Offset of field: " , stringify ! ( in3_node ) , "::" , stringify ! ( attrs ) ) ) ; } pub type in3_node_t = in3_node ; # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct in3_node_weight { pub response_count : u32 , pub total_response_time : u32 , pub blacklisted_until : u64 , } # [ test ] fn bindgen_test_layout_in3_node_weight ( ) { assert_eq ! ( :: core :: mem :: size_of :: < in3_node_weight > ( ) , 16usize , concat ! ( "Size of: " , stringify ! ( in3_node_weight ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < in3_node_weight > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( in3_node_weight ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_node_weight > ( ) ) ) . response_count as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( in3_node_weight ) , "::" , stringify ! ( response_count ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_node_weight > ( ) ) ) . total_response_time as * const _ as usize } , 4usize , concat ! ( "Offset of field: " , stringify ! ( in3_node_weight ) , "::" , stringify ! ( total_response_time ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_node_weight > ( ) ) ) . blacklisted_until as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( in3_node_weight ) , "::" , stringify ! ( blacklisted_until ) ) ) ; } pub type in3_node_weight_t = in3_node_weight ; extern "C" { pub fn in3_node_props_set ( node_props : * mut in3_node_props_t , type_ : in3_node_props_type_t , value : u8 ) ; } # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct in3_whitelist { pub contract : address_t , pub addresses : bytes_t , pub last_block : u64 , pub needs_update : bool , } # [ test ] fn bindgen_test_layout_in3_whitelist ( ) { assert_eq ! ( :: core :: mem :: size_of :: < in3_whitelist > ( ) , 56usize , concat ! ( "Size of: " , stringify ! ( in3_whitelist ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < in3_whitelist > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( in3_whitelist ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_whitelist > ( ) ) ) . contract as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( in3_whitelist ) , "::" , stringify ! ( contract ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_whitelist > ( ) ) ) . addresses as * const _ as usize } , 24usize , concat ! ( "Offset of field: " , stringify ! ( in3_whitelist ) , "::" , stringify ! ( addresses ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_whitelist > ( ) ) ) . last_block as * const _ as usize } , 40usize , concat ! ( "Offset of field: " , stringify ! ( in3_whitelist ) , "::" , stringify ! ( last_block ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_whitelist > ( ) ) ) . needs_update as * const _ as usize } , 48usize , concat ! ( "Offset of field: " , stringify ! ( in3_whitelist ) , "::" , stringify ! ( needs_update ) ) ) ; } pub type in3_whitelist_t = in3_whitelist ; # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct in3_verified_hash { pub block_number : u64 , pub hash : bytes32_t , } # [ test ] fn bindgen_test_layout_in3_verified_hash ( ) { assert_eq ! ( :: core :: mem :: size_of :: < in3_verified_hash > ( ) , 40usize , concat ! ( "Size of: " , stringify ! ( in3_verified_hash ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < in3_verified_hash > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( in3_verified_hash ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_verified_hash > ( ) ) ) . block_number as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( in3_verified_hash ) , "::" , stringify ! ( block_number ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_verified_hash > ( ) ) ) . hash as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( in3_verified_hash ) , "::" , stringify ! ( hash ) ) ) ; } pub type in3_verified_hash_t = in3_verified_hash ; # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct in3_chain { pub chain_id : chain_id_t , pub type_ : in3_chain_type_t , pub last_block : u64 , pub nodelist_length : libc :: c_int , pub nodelist : * mut in3_node_t , pub weights : * mut in3_node_weight_t , pub init_addresses : * mut * mut bytes_t , pub contract : * mut bytes_t , pub registry_id : bytes32_t , pub version : u8 , pub verified_hashes : * mut in3_verified_hash_t , pub whitelist : * mut in3_whitelist_t , pub avg_block_time : u16 , pub conf : * mut libc :: c_void , pub nodelist_upd8_params : * mut in3_chain__bindgen_ty_1 , } # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct in3_chain__bindgen_ty_1 { pub node : address_t , pub exp_last_block : u64 , pub timestamp : u64 , } # [ test ] fn bindgen_test_layout_in3_chain__bindgen_ty_1 ( ) { assert_eq ! ( :: core :: mem :: size_of :: < in3_chain__bindgen_ty_1 > ( ) , 40usize , concat ! ( "Size of: " , stringify ! ( in3_chain__bindgen_ty_1 ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < in3_chain__bindgen_ty_1 > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( in3_chain__bindgen_ty_1 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_chain__bindgen_ty_1 > ( ) ) ) . node as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( in3_chain__bindgen_ty_1 ) , "::" , stringify ! ( node ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_chain__bindgen_ty_1 > ( ) ) ) . exp_last_block as * const _ as usize } , 24usize , concat ! ( "Offset of field: " , stringify ! ( in3_chain__bindgen_ty_1 ) , "::" , stringify ! ( exp_last_block ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_chain__bindgen_ty_1 > ( ) ) ) . timestamp as * const _ as usize } , 32usize , concat ! ( "Offset of field: " , stringify ! ( in3_chain__bindgen_ty_1 ) , "::" , stringify ! ( timestamp ) ) ) ; } # [ test ] fn bindgen_test_layout_in3_chain ( ) { assert_eq ! ( :: core :: mem :: size_of :: < in3_chain > ( ) , 136usize , concat ! ( "Size of: " , stringify ! ( in3_chain ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < in3_chain > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( in3_chain ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_chain > ( ) ) ) . chain_id as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( in3_chain ) , "::" , stringify ! ( chain_id ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_chain > ( ) ) ) . type_ as * const _ as usize } , 4usize , concat ! ( "Offset of field: " , stringify ! ( in3_chain ) , "::" , stringify ! ( type_ ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_chain > ( ) ) ) . last_block as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( in3_chain ) , "::" , stringify ! ( last_block ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_chain > ( ) ) ) . nodelist_length as * const _ as usize } , 16usize , concat ! ( "Offset of field: " , stringify ! ( in3_chain ) , "::" , stringify ! ( nodelist_length ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_chain > ( ) ) ) . nodelist as * const _ as usize } , 24usize , concat ! ( "Offset of field: " , stringify ! ( in3_chain ) , "::" , stringify ! ( nodelist ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_chain > ( ) ) ) . weights as * const _ as usize } , 32usize , concat ! ( "Offset of field: " , stringify ! ( in3_chain ) , "::" , stringify ! ( weights ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_chain > ( ) ) ) . init_addresses as * const _ as usize } , 40usize , concat ! ( "Offset of field: " , stringify ! ( in3_chain ) , "::" , stringify ! ( init_addresses ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_chain > ( ) ) ) . contract as * const _ as usize } , 48usize , concat ! ( "Offset of field: " , stringify ! ( in3_chain ) , "::" , stringify ! ( contract ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_chain > ( ) ) ) . registry_id as * const _ as usize } , 56usize , concat ! ( "Offset of field: " , stringify ! ( in3_chain ) , "::" , stringify ! ( registry_id ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_chain > ( ) ) ) . version as * const _ as usize } , 88usize , concat ! ( "Offset of field: " , stringify ! ( in3_chain ) , "::" , stringify ! ( version ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_chain > ( ) ) ) . verified_hashes as * const _ as usize } , 96usize , concat ! ( "Offset of field: " , stringify ! ( in3_chain ) , "::" , stringify ! ( verified_hashes ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_chain > ( ) ) ) . whitelist as * const _ as usize } , 104usize , concat ! ( "Offset of field: " , stringify ! ( in3_chain ) , "::" , stringify ! ( whitelist ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_chain > ( ) ) ) . avg_block_time as * const _ as usize } , 112usize , concat ! ( "Offset of field: " , stringify ! ( in3_chain ) , "::" , stringify ! ( avg_block_time ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_chain > ( ) ) ) . conf as * const _ as usize } , 120usize , concat ! ( "Offset of field: " , stringify ! ( in3_chain ) , "::" , stringify ! ( conf ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_chain > ( ) ) ) . nodelist_upd8_params as * const _ as usize } , 128usize , concat ! ( "Offset of field: " , stringify ! ( in3_chain ) , "::" , stringify ! ( nodelist_upd8_params ) ) ) ; } pub type in3_chain_t = in3_chain ; pub type in3_storage_get_item = :: core :: option :: Option < unsafe extern "C" fn ( cptr : * mut libc :: c_void , key : * const libc :: c_char ) -> * mut bytes_t > ; pub type in3_storage_set_item = :: core :: option :: Option < unsafe extern "C" fn ( cptr : * mut libc :: c_void , key : * const libc :: c_char , value : * mut bytes_t ) > ; pub type in3_storage_clear = :: core :: option :: Option < unsafe extern "C" fn ( cptr : * mut libc :: c_void ) > ; # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct in3_storage_handler { pub get_item : in3_storage_get_item , pub set_item : in3_storage_set_item , pub clear : in3_storage_clear , pub cptr : * mut libc :: c_void , } # [ test ] fn bindgen_test_layout_in3_storage_handler ( ) { assert_eq ! ( :: core :: mem :: size_of :: < in3_storage_handler > ( ) , 32usize , concat ! ( "Size of: " , stringify ! ( in3_storage_handler ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < in3_storage_handler > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( in3_storage_handler ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_storage_handler > ( ) ) ) . get_item as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( in3_storage_handler ) , "::" , stringify ! ( get_item ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_storage_handler > ( ) ) ) . set_item as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( in3_storage_handler ) , "::" , stringify ! ( set_item ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_storage_handler > ( ) ) ) . clear as * const _ as usize } , 16usize , concat ! ( "Offset of field: " , stringify ! ( in3_storage_handler ) , "::" , stringify ! ( clear ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_storage_handler > ( ) ) ) . cptr as * const _ as usize } , 24usize , concat ! ( "Offset of field: " , stringify ! ( in3_storage_handler ) , "::" , stringify ! ( cptr ) ) ) ; } pub type in3_storage_handler_t = in3_storage_handler ; # [ repr ( u32 ) ] # [ derive ( Debug , Copy , Clone , PartialEq , Eq , Hash ) ] pub enum d_signature_type_t { SIGN_EC_RAW = 0 , SIGN_EC_HASH = 1 , } # [ repr ( C ) ] # [ derive ( Copy , Clone ) ] pub struct sign_ctx { pub type_ : d_signature_type_t , pub message : bytes_t , pub account : bytes_t , pub signature : [ u8 ; 65usize ] , pub wallet : * mut libc :: c_void , pub ctx : * mut libc :: c_void , } # [ test ] fn bindgen_test_layout_sign_ctx ( ) { assert_eq ! ( :: core :: mem :: size_of :: < sign_ctx > ( ) , 128usize , concat ! ( "Size of: " , stringify ! ( sign_ctx ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < sign_ctx > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( sign_ctx ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < sign_ctx > ( ) ) ) . type_ as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( sign_ctx ) , "::" , stringify ! ( type_ ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < sign_ctx > ( ) ) ) . message as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( sign_ctx ) , "::" , stringify ! ( message ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < sign_ctx > ( ) ) ) . account as * const _ as usize } , 24usize , concat ! ( "Offset of field: " , stringify ! ( sign_ctx ) , "::" , stringify ! ( account ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < sign_ctx > ( ) ) ) . signature as * const _ as usize } , 40usize , concat ! ( "Offset of field: " , stringify ! ( sign_ctx ) , "::" , stringify ! ( signature ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < sign_ctx > ( ) ) ) . wallet as * const _ as usize } , 112usize , concat ! ( "Offset of field: " , stringify ! ( sign_ctx ) , "::" , stringify ! ( wallet ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < sign_ctx > ( ) ) ) . ctx as * const _ as usize } , 120usize , concat ! ( "Offset of field: " , stringify ! ( sign_ctx ) , "::" , stringify ! ( ctx ) ) ) ; } impl :: core :: fmt :: Debug for sign_ctx { fn fmt ( & self , f : & mut :: core :: fmt :: Formatter < '_ > ) -> :: core :: fmt :: Result { write ! ( f , "sign_ctx {{ type: {:?}, message: {:?}, account: {:?}, signature: [...], wallet: {:?}, ctx: {:?} }}" , self . type_ , self . message , self . account , self . wallet , self . ctx ) } } pub type in3_sign_ctx_t = sign_ctx ; pub type in3_sign = :: core :: option :: Option < unsafe extern "C" fn ( ctx : * mut in3_sign_ctx_t ) -> in3_ret_t :: Type > ; pub type in3_prepare_tx = :: core :: option :: Option < unsafe extern "C" fn ( ctx : * mut libc :: c_void , raw_tx : bytes_t , new_raw_tx : * mut bytes_t ) -> in3_ret_t :: Type > ; # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct in3_signer { pub sign : in3_sign , pub prepare_tx : in3_prepare_tx , pub wallet : * mut libc :: c_void , pub default_address : address_t , } # [ test ] fn bindgen_test_layout_in3_signer ( ) { assert_eq ! ( :: core :: mem :: size_of :: < in3_signer > ( ) , 48usize , concat ! ( "Size of: " , stringify ! ( in3_signer ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < in3_signer > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( in3_signer ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_signer > ( ) ) ) . sign as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( in3_signer ) , "::" , stringify ! ( sign ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_signer > ( ) ) ) . prepare_tx as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( in3_signer ) , "::" , stringify ! ( prepare_tx ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_signer > ( ) ) ) . wallet as * const _ as usize } , 16usize , concat ! ( "Offset of field: " , stringify ! ( in3_signer ) , "::" , stringify ! ( wallet ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_signer > ( ) ) ) . default_address as * const _ as usize } , 24usize , concat ! ( "Offset of field: " , stringify ! ( in3_signer ) , "::" , stringify ! ( default_address ) ) ) ; } pub type in3_signer_t = in3_signer ; pub type in3_pay_prepare = :: core :: option :: Option < unsafe extern "C" fn ( ctx : * mut libc :: c_void , cptr : * mut libc :: c_void ) -> in3_ret_t :: Type > ; pub type in3_pay_follow_up = :: core :: option :: Option < unsafe extern "C" fn ( ctx : * mut libc :: c_void , node : * mut libc :: c_void , in3 : * mut d_token_t , error : * mut d_token_t , cptr : * mut libc :: c_void ) -> in3_ret_t :: Type > ; pub type in3_pay_free = :: core :: option :: Option < unsafe extern "C" fn ( cptr : * mut libc :: c_void ) > ; pub type in3_pay_handle_request = :: core :: option :: Option < unsafe extern "C" fn ( ctx : * mut libc :: c_void , sb : * mut sb_t , cptr : * mut libc :: c_void ) -> in3_ret_t :: Type > ; # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct in3_pay { pub prepare : in3_pay_prepare , pub follow_up : in3_pay_follow_up , pub handle_request : in3_pay_handle_request , pub free : in3_pay_free , pub cptr : * mut libc :: c_void , } # [ test ] fn bindgen_test_layout_in3_pay ( ) { assert_eq ! ( :: core :: mem :: size_of :: < in3_pay > ( ) , 40usize , concat ! ( "Size of: " , stringify ! ( in3_pay ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < in3_pay > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( in3_pay ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_pay > ( ) ) ) . prepare as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( in3_pay ) , "::" , stringify ! ( prepare ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_pay > ( ) ) ) . follow_up as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( in3_pay ) , "::" , stringify ! ( follow_up ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_pay > ( ) ) ) . handle_request as * const _ as usize } , 16usize , concat ! ( "Offset of field: " , stringify ! ( in3_pay ) , "::" , stringify ! ( handle_request ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_pay > ( ) ) ) . free as * const _ as usize } , 24usize , concat ! ( "Offset of field: " , stringify ! ( in3_pay ) , "::" , stringify ! ( free ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_pay > ( ) ) ) . cptr as * const _ as usize } , 32usize , concat ! ( "Offset of field: " , stringify ! ( in3_pay ) , "::" , stringify ! ( cptr ) ) ) ; } pub type in3_pay_t = in3_pay ; # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct in3_response { pub state : in3_ret_t :: Type , pub data : sb_t , } # [ test ] fn bindgen_test_layout_in3_response ( ) { assert_eq ! ( :: core :: mem :: size_of :: < in3_response > ( ) , 32usize , concat ! ( "Size of: " , stringify ! ( in3_response ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < in3_response > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( in3_response ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_response > ( ) ) ) . state as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( in3_response ) , "::" , stringify ! ( state ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_response > ( ) ) ) . data as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( in3_response ) , "::" , stringify ! ( data ) ) ) ; } pub type in3_response_t = in3_response ; pub type in3_t = in3_t_ ; # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct in3_request { pub payload : * mut libc :: c_char , pub urls : * mut * mut libc :: c_char , pub urls_len : libc :: c_int , pub results : * mut in3_response_t , pub timeout : u32 , pub times : * mut u32 , pub in3 : * mut in3_t , } # [ test ] fn bindgen_test_layout_in3_request ( ) { assert_eq ! ( :: core :: mem :: size_of :: < in3_request > ( ) , 56usize , concat ! ( "Size of: " , stringify ! ( in3_request ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < in3_request > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( in3_request ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_request > ( ) ) ) . payload as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( in3_request ) , "::" , stringify ! ( payload ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_request > ( ) ) ) . urls as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( in3_request ) , "::" , stringify ! ( urls ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_request > ( ) ) ) . urls_len as * const _ as usize } , 16usize , concat ! ( "Offset of field: " , stringify ! ( in3_request ) , "::" , stringify ! ( urls_len ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_request > ( ) ) ) . results as * const _ as usize } , 24usize , concat ! ( "Offset of field: " , stringify ! ( in3_request ) , "::" , stringify ! ( results ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_request > ( ) ) ) . timeout as * const _ as usize } , 32usize , concat ! ( "Offset of field: " , stringify ! ( in3_request ) , "::" , stringify ! ( timeout ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_request > ( ) ) ) . times as * const _ as usize } , 40usize , concat ! ( "Offset of field: " , stringify ! ( in3_request ) , "::" , stringify ! ( times ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_request > ( ) ) ) . in3 as * const _ as usize } , 48usize , concat ! ( "Offset of field: " , stringify ! ( in3_request ) , "::" , stringify ! ( in3 ) ) ) ; } pub type in3_request_t = in3_request ; pub type in3_transport_send = :: core :: option :: Option < unsafe extern "C" fn ( request : * mut in3_request_t ) -> in3_ret_t :: Type > ; # [ repr ( u32 ) ] # [ derive ( Debug , Copy , Clone , PartialEq , Eq , Hash ) ] pub enum in3_filter_type_t { FILTER_EVENT = 0 , FILTER_BLOCK = 1 , FILTER_PENDING = 2 , } # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct in3_filter_t_ { pub type_ : in3_filter_type_t , pub options : * mut libc :: c_char , pub last_block : u64 , pub is_first_usage : bool , pub release : :: core :: option :: Option < unsafe extern "C" fn ( f : * mut in3_filter_t_ ) > , } # [ test ] fn bindgen_test_layout_in3_filter_t_ ( ) { assert_eq ! ( :: core :: mem :: size_of :: < in3_filter_t_ > ( ) , 40usize , concat ! ( "Size of: " , stringify ! ( in3_filter_t_ ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < in3_filter_t_ > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( in3_filter_t_ ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_filter_t_ > ( ) ) ) . type_ as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( in3_filter_t_ ) , "::" , stringify ! ( type_ ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_filter_t_ > ( ) ) ) . options as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( in3_filter_t_ ) , "::" , stringify ! ( options ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_filter_t_ > ( ) ) ) . last_block as * const _ as usize } , 16usize , concat ! ( "Offset of field: " , stringify ! ( in3_filter_t_ ) , "::" , stringify ! ( last_block ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_filter_t_ > ( ) ) ) . is_first_usage as * const _ as usize } , 24usize , concat ! ( "Offset of field: " , stringify ! ( in3_filter_t_ ) , "::" , stringify ! ( is_first_usage ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_filter_t_ > ( ) ) ) . release as * const _ as usize } , 32usize , concat ! ( "Offset of field: " , stringify ! ( in3_filter_t_ ) , "::" , stringify ! ( release ) ) ) ; } pub type in3_filter_t = in3_filter_t_ ; # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct in3_filter_handler_t_ { pub array : * mut * mut in3_filter_t , pub count : usize , } # [ test ] fn bindgen_test_layout_in3_filter_handler_t_ ( ) { assert_eq ! ( :: core :: mem :: size_of :: < in3_filter_handler_t_ > ( ) , 16usize , concat ! ( "Size of: " , stringify ! ( in3_filter_handler_t_ ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < in3_filter_handler_t_ > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( in3_filter_handler_t_ ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_filter_handler_t_ > ( ) ) ) . array as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( in3_filter_handler_t_ ) , "::" , stringify ! ( array ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_filter_handler_t_ > ( ) ) ) . count as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( in3_filter_handler_t_ ) , "::" , stringify ! ( count ) ) ) ; } pub type in3_filter_handler_t = in3_filter_handler_t_ ; # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct in3_t_ { pub cache_timeout : u32 , pub node_limit : u16 , pub key : * mut libc :: c_void , pub max_code_cache : u32 , pub max_block_cache : u32 , pub proof : in3_proof_t , pub request_count : u8 , pub signature_count : u8 , pub min_deposit : u64 , pub replace_latest_block : u8 , pub finality : u16 , pub max_attempts : uint_fast16_t , pub max_verified_hashes : uint_fast16_t , pub timeout : u32 , pub chain_id : chain_id_t , pub cache : * mut in3_storage_handler_t , pub signer : * mut in3_signer_t , pub transport : in3_transport_send , pub flags : uint_fast8_t , pub chains : * mut in3_chain_t , pub chains_length : u16 , pub filters : * mut in3_filter_handler_t , pub node_props : in3_node_props_t , pub pending : uint_fast16_t , pub internal : * mut libc :: c_void , } # [ test ] fn bindgen_test_layout_in3_t_ ( ) { assert_eq ! ( :: core :: mem :: size_of :: < in3_t_ > ( ) , 136usize , concat ! ( "Size of: " , stringify ! ( in3_t_ ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < in3_t_ > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( in3_t_ ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_t_ > ( ) ) ) . cache_timeout as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( in3_t_ ) , "::" , stringify ! ( cache_timeout ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_t_ > ( ) ) ) . node_limit as * const _ as usize } , 4usize , concat ! ( "Offset of field: " , stringify ! ( in3_t_ ) , "::" , stringify ! ( node_limit ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_t_ > ( ) ) ) . key as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( in3_t_ ) , "::" , stringify ! ( key ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_t_ > ( ) ) ) . max_code_cache as * const _ as usize } , 16usize , concat ! ( "Offset of field: " , stringify ! ( in3_t_ ) , "::" , stringify ! ( max_code_cache ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_t_ > ( ) ) ) . max_block_cache as * const _ as usize } , 20usize , concat ! ( "Offset of field: " , stringify ! ( in3_t_ ) , "::" , stringify ! ( max_block_cache ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_t_ > ( ) ) ) . proof as * const _ as usize } , 24usize , concat ! ( "Offset of field: " , stringify ! ( in3_t_ ) , "::" , stringify ! ( proof ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_t_ > ( ) ) ) . request_count as * const _ as usize } , 28usize , concat ! ( "Offset of field: " , stringify ! ( in3_t_ ) , "::" , stringify ! ( request_count ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_t_ > ( ) ) ) . signature_count as * const _ as usize } , 29usize , concat ! ( "Offset of field: " , stringify ! ( in3_t_ ) , "::" , stringify ! ( signature_count ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_t_ > ( ) ) ) . min_deposit as * const _ as usize } , 32usize , concat ! ( "Offset of field: " , stringify ! ( in3_t_ ) , "::" , stringify ! ( min_deposit ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_t_ > ( ) ) ) . replace_latest_block as * const _ as usize } , 40usize , concat ! ( "Offset of field: " , stringify ! ( in3_t_ ) , "::" , stringify ! ( replace_latest_block ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_t_ > ( ) ) ) . finality as * const _ as usize } , 42usize , concat ! ( "Offset of field: " , stringify ! ( in3_t_ ) , "::" , stringify ! ( finality ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_t_ > ( ) ) ) . max_attempts as * const _ as usize } , 44usize , concat ! ( "Offset of field: " , stringify ! ( in3_t_ ) , "::" , stringify ! ( max_attempts ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_t_ > ( ) ) ) . max_verified_hashes as * const _ as usize } , 46usize , concat ! ( "Offset of field: " , stringify ! ( in3_t_ ) , "::" , stringify ! ( max_verified_hashes ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_t_ > ( ) ) ) . timeout as * const _ as usize } , 48usize , concat ! ( "Offset of field: " , stringify ! ( in3_t_ ) , "::" , stringify ! ( timeout ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_t_ > ( ) ) ) . chain_id as * const _ as usize } , 52usize , concat ! ( "Offset of field: " , stringify ! ( in3_t_ ) , "::" , stringify ! ( chain_id ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_t_ > ( ) ) ) . cache as * const _ as usize } , 56usize , concat ! ( "Offset of field: " , stringify ! ( in3_t_ ) , "::" , stringify ! ( cache ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_t_ > ( ) ) ) . signer as * const _ as usize } , 64usize , concat ! ( "Offset of field: " , stringify ! ( in3_t_ ) , "::" , stringify ! ( signer ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_t_ > ( ) ) ) . transport as * const _ as usize } , 72usize , concat ! ( "Offset of field: " , stringify ! ( in3_t_ ) , "::" , stringify ! ( transport ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_t_ > ( ) ) ) . flags as * const _ as usize } , 80usize , concat ! ( "Offset of field: " , stringify ! ( in3_t_ ) , "::" , stringify ! ( flags ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_t_ > ( ) ) ) . chains as * const _ as usize } , 88usize , concat ! ( "Offset of field: " , stringify ! ( in3_t_ ) , "::" , stringify ! ( chains ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_t_ > ( ) ) ) . chains_length as * const _ as usize } , 96usize , concat ! ( "Offset of field: " , stringify ! ( in3_t_ ) , "::" , stringify ! ( chains_length ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_t_ > ( ) ) ) . filters as * const _ as usize } , 104usize , concat ! ( "Offset of field: " , stringify ! ( in3_t_ ) , "::" , stringify ! ( filters ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_t_ > ( ) ) ) . node_props as * const _ as usize } , 112usize , concat ! ( "Offset of field: " , stringify ! ( in3_t_ ) , "::" , stringify ! ( node_props ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_t_ > ( ) ) ) . pending as * const _ as usize } , 120usize , concat ! ( "Offset of field: " , stringify ! ( in3_t_ ) , "::" , stringify ! ( pending ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_t_ > ( ) ) ) . internal as * const _ as usize } , 128usize , concat ! ( "Offset of field: " , stringify ! ( in3_t_ ) , "::" , stringify ! ( internal ) ) ) ; } extern "C" { pub fn in3_new ( ) -> * mut in3_t ; } extern "C" { pub fn in3_for_chain_default ( chain_id : chain_id_t ) -> * mut in3_t ; } extern "C" { pub fn in3_client_rpc ( c : * mut in3_t , method : * const libc :: c_char , params : * const libc :: c_char , result : * mut * mut libc :: c_char , error : * mut * mut libc :: c_char ) -> in3_ret_t :: Type ; } extern "C" { pub fn in3_client_rpc_raw ( c : * mut in3_t , request : * const libc :: c_char , result : * mut * mut libc :: c_char , error : * mut * mut libc :: c_char ) -> in3_ret_t :: Type ; } extern "C" { pub fn in3_client_exec_req ( c : * mut in3_t , req : * mut libc :: c_char ) -> * mut libc :: c_char ; } extern "C" { pub fn in3_req_add_response ( req : * mut in3_request_t , index : libc :: c_int , is_error : bool , data : * const libc :: c_char , data_len : libc :: c_int ) ; } extern "C" { pub fn in3_client_register_chain ( client : * mut in3_t , chain_id : chain_id_t , type_ : in3_chain_type_t , contract : * mut u8 , registry_id : * mut u8 , version : u8 , wl_contract : * mut u8 ) -> in3_ret_t :: Type ; } extern "C" { pub fn in3_client_add_node ( client : * mut in3_t , chain_id : chain_id_t , url : * mut libc :: c_char , props : in3_node_props_t , address : * mut u8 ) -> in3_ret_t :: Type ; } extern "C" { pub fn in3_client_remove_node ( client : * mut in3_t , chain_id : chain_id_t , address : * mut u8 ) -> in3_ret_t :: Type ; } extern "C" { pub fn in3_client_clear_nodes ( client : * mut in3_t , chain_id : chain_id_t ) -> in3_ret_t :: Type ; } extern "C" { pub fn in3_free ( a : * mut in3_t ) ; } extern "C" { pub fn in3_cache_init ( c : * mut in3_t ) -> in3_ret_t :: Type ; } extern "C" { pub fn in3_find_chain ( c : * mut in3_t , chain_id : chain_id_t ) -> * mut in3_chain_t ; } extern "C" { pub fn in3_configure ( c : * mut in3_t , config : * const libc :: c_char ) -> * mut libc :: c_char ; } extern "C" { pub fn in3_get_config ( c : * mut in3_t ) -> * mut libc :: c_char ; } extern "C" { pub fn in3_set_default_transport ( transport : in3_transport_send ) ; } extern "C" { pub fn in3_set_default_storage ( cacheStorage : * mut in3_storage_handler_t ) ; } extern "C" { pub fn in3_set_default_signer ( signer : * mut in3_signer_t ) ; } extern "C" { pub fn in3_create_signer ( sign : in3_sign , prepare_tx : in3_prepare_tx , wallet : * mut libc :: c_void ) -> * mut in3_signer_t ; } extern "C" { pub fn in3_sign_ctx_get_message ( ctx : * mut in3_sign_ctx_t ) -> bytes_t ; } extern "C" { pub fn in3_sign_ctx_get_account ( ctx : * mut in3_sign_ctx_t ) -> bytes_t ; } extern "C" { pub fn in3_sign_ctx_get_signature ( ctx : * mut in3_sign_ctx_t ) -> * mut u8 ; } extern "C" { pub fn in3_set_transport ( c : * mut in3_t , cptr : in3_transport_send ) ; } extern "C" { pub fn in3_get_request_payload ( request : * mut in3_request_t ) -> * mut libc :: c_char ; } extern "C" { pub fn in3_get_request_urls ( request : * mut in3_request_t ) -> * mut * mut libc :: c_char ; } extern "C" { pub fn in3_get_request_urls_len ( request : * mut in3_request_t ) -> libc :: c_int ; } extern "C" { pub fn in3_get_request_timeout ( request : * mut in3_request_t ) -> u32 ; } extern "C" { pub fn in3_set_storage_handler ( c : * mut in3_t , get_item : in3_storage_get_item , set_item : in3_storage_set_item , clear : in3_storage_clear , cptr : * mut libc :: c_void ) -> * mut in3_storage_handler_t ; } # [ repr ( u32 ) ] # [ derive ( Debug , Copy , Clone , PartialEq , Eq , Hash ) ] pub enum ctx_type { CT_RPC = 0 , CT_SIGN = 1 , } pub use self :: ctx_type as ctx_type_t ; # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct weight { pub node : * mut in3_node_t , pub weight : * mut in3_node_weight_t , pub s : f32 , pub w : f32 , pub next : * mut weight , } # [ test ] fn bindgen_test_layout_weight ( ) { assert_eq ! ( :: core :: mem :: size_of :: < weight > ( ) , 32usize , concat ! ( "Size of: " , stringify ! ( weight ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < weight > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( weight ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < weight > ( ) ) ) . node as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( weight ) , "::" , stringify ! ( node ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < weight > ( ) ) ) . weight as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( weight ) , "::" , stringify ! ( weight ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < weight > ( ) ) ) . s as * const _ as usize } , 16usize , concat ! ( "Offset of field: " , stringify ! ( weight ) , "::" , stringify ! ( s ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < weight > ( ) ) ) . w as * const _ as usize } , 20usize , concat ! ( "Offset of field: " , stringify ! ( weight ) , "::" , stringify ! ( w ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < weight > ( ) ) ) . next as * const _ as usize } , 24usize , concat ! ( "Offset of field: " , stringify ! ( weight ) , "::" , stringify ! ( next ) ) ) ; } pub type node_match_t = weight ; # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct in3_ctx { pub type_ : ctx_type_t , pub verification_state : in3_ret_t :: Type , pub error : * mut libc :: c_char , pub len : uint_fast16_t , pub attempt : uint_fast16_t , pub request_context : * mut json_ctx_t , pub response_context : * mut json_ctx_t , pub requests : * mut * mut d_token_t , pub responses : * mut * mut d_token_t , pub raw_response : * mut in3_response_t , pub signers : * mut bytes_t , pub signers_length : uint_fast8_t , pub times : * mut u32 , pub nodes : * mut node_match_t , pub cache : * mut cache_entry_t , pub required : * mut in3_ctx , pub client : * mut in3_t , } # [ test ] fn bindgen_test_layout_in3_ctx ( ) { assert_eq ! ( :: core :: mem :: size_of :: < in3_ctx > ( ) , 120usize , concat ! ( "Size of: " , stringify ! ( in3_ctx ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < in3_ctx > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( in3_ctx ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_ctx > ( ) ) ) . type_ as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( in3_ctx ) , "::" , stringify ! ( type_ ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_ctx > ( ) ) ) . verification_state as * const _ as usize } , 4usize , concat ! ( "Offset of field: " , stringify ! ( in3_ctx ) , "::" , stringify ! ( verification_state ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_ctx > ( ) ) ) . error as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( in3_ctx ) , "::" , stringify ! ( error ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_ctx > ( ) ) ) . len as * const _ as usize } , 16usize , concat ! ( "Offset of field: " , stringify ! ( in3_ctx ) , "::" , stringify ! ( len ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_ctx > ( ) ) ) . attempt as * const _ as usize } , 18usize , concat ! ( "Offset of field: " , stringify ! ( in3_ctx ) , "::" , stringify ! ( attempt ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_ctx > ( ) ) ) . request_context as * const _ as usize } , 24usize , concat ! ( "Offset of field: " , stringify ! ( in3_ctx ) , "::" , stringify ! ( request_context ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_ctx > ( ) ) ) . response_context as * const _ as usize } , 32usize , concat ! ( "Offset of field: " , stringify ! ( in3_ctx ) , "::" , stringify ! ( response_context ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_ctx > ( ) ) ) . requests as * const _ as usize } , 40usize , concat ! ( "Offset of field: " , stringify ! ( in3_ctx ) , "::" , stringify ! ( requests ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_ctx > ( ) ) ) . responses as * const _ as usize } , 48usize , concat ! ( "Offset of field: " , stringify ! ( in3_ctx ) , "::" , stringify ! ( responses ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_ctx > ( ) ) ) . raw_response as * const _ as usize } , 56usize , concat ! ( "Offset of field: " , stringify ! ( in3_ctx ) , "::" , stringify ! ( raw_response ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_ctx > ( ) ) ) . signers as * const _ as usize } , 64usize , concat ! ( "Offset of field: " , stringify ! ( in3_ctx ) , "::" , stringify ! ( signers ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_ctx > ( ) ) ) . signers_length as * const _ as usize } , 72usize , concat ! ( "Offset of field: " , stringify ! ( in3_ctx ) , "::" , stringify ! ( signers_length ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_ctx > ( ) ) ) . times as * const _ as usize } , 80usize , concat ! ( "Offset of field: " , stringify ! ( in3_ctx ) , "::" , stringify ! ( times ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_ctx > ( ) ) ) . nodes as * const _ as usize } , 88usize , concat ! ( "Offset of field: " , stringify ! ( in3_ctx ) , "::" , stringify ! ( nodes ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_ctx > ( ) ) ) . cache as * const _ as usize } , 96usize , concat ! ( "Offset of field: " , stringify ! ( in3_ctx ) , "::" , stringify ! ( cache ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_ctx > ( ) ) ) . required as * const _ as usize } , 104usize , concat ! ( "Offset of field: " , stringify ! ( in3_ctx ) , "::" , stringify ! ( required ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < in3_ctx > ( ) ) ) . client as * const _ as usize } , 112usize , concat ! ( "Offset of field: " , stringify ! ( in3_ctx ) , "::" , stringify ! ( client ) ) ) ; } pub type in3_ctx_t = in3_ctx ; # [ repr ( i32 ) ] # [ derive ( Debug , Copy , Clone , PartialEq , Eq , Hash ) ] pub enum state { CTX_SUCCESS = 0 , CTX_WAITING_FOR_REQUIRED_CTX = 1 , CTX_WAITING_FOR_RESPONSE = 2 , CTX_ERROR = - 1 , } pub use self :: state as in3_ctx_state_t ; extern "C" { pub fn ctx_new ( client : * mut in3_t , req_data : * const libc :: c_char ) -> * mut in3_ctx_t ; } extern "C" { pub fn in3_send_ctx ( ctx : * mut in3_ctx_t ) -> in3_ret_t :: Type ; } extern "C" { pub fn in3_ctx_execute ( ctx : * mut in3_ctx_t ) -> in3_ret_t :: Type ; } extern "C" { pub fn in3_ctx_state ( ctx : * mut in3_ctx_t ) -> in3_ctx_state_t ; } extern "C" { pub fn ctx_free ( ctx : * mut in3_ctx_t ) ; } extern "C" { pub fn ctx_add_required ( parent : * mut in3_ctx_t , ctx : * mut in3_ctx_t ) -> in3_ret_t :: Type ; } extern "C" { pub fn ctx_find_required ( parent : * const in3_ctx_t , method : * const libc :: c_char ) -> * mut in3_ctx_t ; } extern "C" { pub fn ctx_remove_required ( parent : * mut in3_ctx_t , ctx : * mut in3_ctx_t ) -> in3_ret_t :: Type ; } extern "C" { pub fn ctx_check_response_error ( c : * mut in3_ctx_t , i : libc :: c_int ) -> in3_ret_t :: Type ; } extern "C" { pub fn ctx_get_error ( ctx : * mut in3_ctx_t , id : libc :: c_int ) -> in3_ret_t :: Type ; } extern "C" { pub fn in3_client_rpc_ctx_raw ( c : * mut in3_t , request : * const libc :: c_char ) -> * mut in3_ctx_t ; } extern "C" { pub fn in3_client_rpc_ctx ( c : * mut in3_t , method : * const libc :: c_char , params : * const libc :: c_char ) -> * mut in3_ctx_t ; } extern "C" { pub fn in3_ctx_get_proof ( ctx : * mut in3_ctx_t ) -> in3_proof_t ; } extern "C" { pub fn in3_create_request ( ctx : * mut in3_ctx_t ) -> * mut in3_request_t ; } extern "C" { pub fn request_free ( req : * mut in3_request_t , c : * const in3_t , response_free : bool ) ; } extern "C" { pub fn ctx_set_error_intern ( c : * mut in3_ctx_t , msg : * mut libc :: c_char , errnumber : in3_ret_t :: Type ) -> in3_ret_t :: Type ; } extern "C" { pub fn ctx_handle_failable ( ctx : * mut in3_ctx_t ) -> in3_ret_t :: Type ; } # [ repr ( u32 ) ] # [ derive ( Debug , Copy , Clone , PartialEq , Eq , Hash ) ] pub enum hasher_t { hasher_sha2 = 0 , hasher_sha2d = 1 , hasher_sha2_ripemd = 2 , hasher_sha3 = 3 , hasher_sha3k = 4 , hasher_blake = 5 , hasher_blaked = 6 , hasher_blake_ripemd = 7 , hasher_groestld_trunc = 8 , hasher_overwinter_prevouts = 9 , hasher_overwinter_sequence = 10 , hasher_overwinter_outputs = 11 , hasher_overwinter_preimage = 12 , hasher_sapling_preimage = 13 , } extern "C" { pub fn eth_set_pk_signer ( in3 : * mut in3_t , pk : * mut u8 ) -> in3_ret_t :: Type ; } extern "C" { pub fn eth_set_pk_signer_hex ( in3 : * mut in3_t , key : * mut libc :: c_char ) -> * mut u8 ; } extern "C" { pub fn ec_sign_pk_hash ( message : * mut u8 , len : usize , pk : * mut u8 , hasher : hasher_t , dst : * mut u8 ) -> in3_ret_t :: Type ; } extern "C" { pub fn ec_sign_pk_raw ( message : * mut u8 , pk : * mut u8 , dst : * mut u8 ) -> in3_ret_t :: Type ; } extern "C" { pub fn ec_sign_pk ( type_ : d_signature_type_t , message : bytes_t , pk : * mut u8 , dst : * mut u8 ) -> in3_ret_t :: Type ; } extern "C" { pub fn eth_sign_pk_ctx ( ctx : * mut in3_sign_ctx_t ) -> in3_ret_t :: Type ; } # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct uint256_t { pub data : [ u8 ; 32usize ] , } # [ test ] fn bindgen_test_layout_uint256_t ( ) { assert_eq ! ( :: core :: mem :: size_of :: < uint256_t > ( ) , 32usize , concat ! ( "Size of: " , stringify ! ( uint256_t ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < uint256_t > ( ) , 1usize , concat ! ( "Alignment of " , stringify ! ( uint256_t ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < uint256_t > ( ) ) ) . data as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( uint256_t ) , "::" , stringify ! ( data ) ) ) ; } extern "C" { pub fn as_double ( d : uint256_t ) -> u128 ; } extern "C" { pub fn as_long ( d : uint256_t ) -> u64 ; } extern "C" { pub fn to_uint256 ( value : u64 ) -> uint256_t ; } extern "C" { pub fn decrypt_key ( key_data : * mut d_token_t , password : * mut libc :: c_char , dst : * mut u8 ) -> in3_ret_t :: Type ; } extern "C" { pub fn to_checksum ( adr : * mut u8 , chain_id : chain_id_t , out : * mut libc :: c_char ) -> in3_ret_t :: Type ; } pub type set_error_fn = :: core :: option :: Option < unsafe extern "C" fn ( err : libc :: c_int , msg : * const libc :: c_char ) > ; extern "C" { pub fn api_set_error_fn ( fn_ : set_error_fn ) ; } pub type get_error_fn = :: core :: option :: Option < unsafe extern "C" fn ( ) -> * mut libc :: c_char > ; extern "C" { pub fn api_get_error_fn ( fn_ : get_error_fn ) ; } extern "C" { pub fn api_last_error ( ) -> * mut libc :: c_char ; } # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct btc_transaction_in { pub vout : u32 , pub txid : bytes32_t , pub sequence : u32 , pub script : bytes_t , pub txinwitness : bytes_t , } # [ test ] fn bindgen_test_layout_btc_transaction_in ( ) { assert_eq ! ( :: core :: mem :: size_of :: < btc_transaction_in > ( ) , 72usize , concat ! ( "Size of: " , stringify ! ( btc_transaction_in ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < btc_transaction_in > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( btc_transaction_in ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < btc_transaction_in > ( ) ) ) . vout as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( btc_transaction_in ) , "::" , stringify ! ( vout ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < btc_transaction_in > ( ) ) ) . txid as * const _ as usize } , 4usize , concat ! ( "Offset of field: " , stringify ! ( btc_transaction_in ) , "::" , stringify ! ( txid ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < btc_transaction_in > ( ) ) ) . sequence as * const _ as usize } , 36usize , concat ! ( "Offset of field: " , stringify ! ( btc_transaction_in ) , "::" , stringify ! ( sequence ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < btc_transaction_in > ( ) ) ) . script as * const _ as usize } , 40usize , concat ! ( "Offset of field: " , stringify ! ( btc_transaction_in ) , "::" , stringify ! ( script ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < btc_transaction_in > ( ) ) ) . txinwitness as * const _ as usize } , 56usize , concat ! ( "Offset of field: " , stringify ! ( btc_transaction_in ) , "::" , stringify ! ( txinwitness ) ) ) ; } pub type btc_transaction_in_t = btc_transaction_in ; # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct btc_transaction_out { pub value : u64 , pub n : u32 , pub script_pubkey : bytes_t , } # [ test ] fn bindgen_test_layout_btc_transaction_out ( ) { assert_eq ! ( :: core :: mem :: size_of :: < btc_transaction_out > ( ) , 32usize , concat ! ( "Size of: " , stringify ! ( btc_transaction_out ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < btc_transaction_out > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( btc_transaction_out ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < btc_transaction_out > ( ) ) ) . value as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( btc_transaction_out ) , "::" , stringify ! ( value ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < btc_transaction_out > ( ) ) ) . n as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( btc_transaction_out ) , "::" , stringify ! ( n ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < btc_transaction_out > ( ) ) ) . script_pubkey as * const _ as usize } , 16usize , concat ! ( "Offset of field: " , stringify ! ( btc_transaction_out ) , "::" , stringify ! ( script_pubkey ) ) ) ; } pub type btc_transaction_out_t = btc_transaction_out ; # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct btc_transaction { pub in_active_chain : bool , pub data : bytes_t , pub txid : bytes32_t , pub hash : bytes32_t , pub size : u32 , pub vsize : u32 , pub weight : u32 , pub version : u32 , pub locktime : u32 , pub vin : * mut btc_transaction_in_t , pub vout : * mut btc_transaction_out_t , pub vin_len : u32 , pub vout_len : u32 , pub blockhash : bytes32_t , pub confirmations : u32 , pub time : u32 , pub blocktime : u32 , } # [ test ] fn bindgen_test_layout_btc_transaction ( ) { assert_eq ! ( :: core :: mem :: size_of :: < btc_transaction > ( ) , 184usize , concat ! ( "Size of: " , stringify ! ( btc_transaction ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < btc_transaction > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( btc_transaction ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < btc_transaction > ( ) ) ) . in_active_chain as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( btc_transaction ) , "::" , stringify ! ( in_active_chain ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < btc_transaction > ( ) ) ) . data as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( btc_transaction ) , "::" , stringify ! ( data ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < btc_transaction > ( ) ) ) . txid as * const _ as usize } , 24usize , concat ! ( "Offset of field: " , stringify ! ( btc_transaction ) , "::" , stringify ! ( txid ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < btc_transaction > ( ) ) ) . hash as * const _ as usize } , 56usize , concat ! ( "Offset of field: " , stringify ! ( btc_transaction ) , "::" , stringify ! ( hash ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < btc_transaction > ( ) ) ) . size as * const _ as usize } , 88usize , concat ! ( "Offset of field: " , stringify ! ( btc_transaction ) , "::" , stringify ! ( size ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < btc_transaction > ( ) ) ) . vsize as * const _ as usize } , 92usize , concat ! ( "Offset of field: " , stringify ! ( btc_transaction ) , "::" , stringify ! ( vsize ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < btc_transaction > ( ) ) ) . weight as * const _ as usize } , 96usize , concat ! ( "Offset of field: " , stringify ! ( btc_transaction ) , "::" , stringify ! ( weight ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < btc_transaction > ( ) ) ) . version as * const _ as usize } , 100usize , concat ! ( "Offset of field: " , stringify ! ( btc_transaction ) , "::" , stringify ! ( version ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < btc_transaction > ( ) ) ) . locktime as * const _ as usize } , 104usize , concat ! ( "Offset of field: " , stringify ! ( btc_transaction ) , "::" , stringify ! ( locktime ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < btc_transaction > ( ) ) ) . vin as * const _ as usize } , 112usize , concat ! ( "Offset of field: " , stringify ! ( btc_transaction ) , "::" , stringify ! ( vin ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < btc_transaction > ( ) ) ) . vout as * const _ as usize } , 120usize , concat ! ( "Offset of field: " , stringify ! ( btc_transaction ) , "::" , stringify ! ( vout ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < btc_transaction > ( ) ) ) . vin_len as * const _ as usize } , 128usize , concat ! ( "Offset of field: " , stringify ! ( btc_transaction ) , "::" , stringify ! ( vin_len ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < btc_transaction > ( ) ) ) . vout_len as * const _ as usize } , 132usize , concat ! ( "Offset of field: " , stringify ! ( btc_transaction ) , "::" , stringify ! ( vout_len ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < btc_transaction > ( ) ) ) . blockhash as * const _ as usize } , 136usize , concat ! ( "Offset of field: " , stringify ! ( btc_transaction ) , "::" , stringify ! ( blockhash ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < btc_transaction > ( ) ) ) . confirmations as * const _ as usize } , 168usize , concat ! ( "Offset of field: " , stringify ! ( btc_transaction ) , "::" , stringify ! ( confirmations ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < btc_transaction > ( ) ) ) . time as * const _ as usize } , 172usize , concat ! ( "Offset of field: " , stringify ! ( btc_transaction ) , "::" , stringify ! ( time ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < btc_transaction > ( ) ) ) . blocktime as * const _ as usize } , 176usize , concat ! ( "Offset of field: " , stringify ! ( btc_transaction ) , "::" , stringify ! ( blocktime ) ) ) ; } pub type btc_transaction_t = btc_transaction ; # [ repr ( C ) ] # [ derive ( Copy , Clone ) ] pub struct btc_blockheader { pub hash : bytes32_t , pub confirmations : u32 , pub height : u32 , pub version : u32 , pub merkleroot : bytes32_t , pub time : u32 , pub nonce : u32 , pub bits : [ u8 ; 4usize ] , pub chainwork : bytes32_t , pub n_tx : u32 , pub previous_hash : bytes32_t , pub next_hash : bytes32_t , pub data : [ u8 ; 80usize ] , } # [ test ] fn bindgen_test_layout_btc_blockheader ( ) { assert_eq ! ( :: core :: mem :: size_of :: < btc_blockheader > ( ) , 268usize , concat ! ( "Size of: " , stringify ! ( btc_blockheader ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < btc_blockheader > ( ) , 4usize , concat ! ( "Alignment of " , stringify ! ( btc_blockheader ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < btc_blockheader > ( ) ) ) . hash as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( btc_blockheader ) , "::" , stringify ! ( hash ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < btc_blockheader > ( ) ) ) . confirmations as * const _ as usize } , 32usize , concat ! ( "Offset of field: " , stringify ! ( btc_blockheader ) , "::" , stringify ! ( confirmations ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < btc_blockheader > ( ) ) ) . height as * const _ as usize } , 36usize , concat ! ( "Offset of field: " , stringify ! ( btc_blockheader ) , "::" , stringify ! ( height ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < btc_blockheader > ( ) ) ) . version as * const _ as usize } , 40usize , concat ! ( "Offset of field: " , stringify ! ( btc_blockheader ) , "::" , stringify ! ( version ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < btc_blockheader > ( ) ) ) . merkleroot as * const _ as usize } , 44usize , concat ! ( "Offset of field: " , stringify ! ( btc_blockheader ) , "::" , stringify ! ( merkleroot ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < btc_blockheader > ( ) ) ) . time as * const _ as usize } , 76usize , concat ! ( "Offset of field: " , stringify ! ( btc_blockheader ) , "::" , stringify ! ( time ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < btc_blockheader > ( ) ) ) . nonce as * const _ as usize } , 80usize , concat ! ( "Offset of field: " , stringify ! ( btc_blockheader ) , "::" , stringify ! ( nonce ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < btc_blockheader > ( ) ) ) . bits as * const _ as usize } , 84usize , concat ! ( "Offset of field: " , stringify ! ( btc_blockheader ) , "::" , stringify ! ( bits ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < btc_blockheader > ( ) ) ) . chainwork as * const _ as usize } , 88usize , concat ! ( "Offset of field: " , stringify ! ( btc_blockheader ) , "::" , stringify ! ( chainwork ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < btc_blockheader > ( ) ) ) . n_tx as * const _ as usize } , 120usize , concat ! ( "Offset of field: " , stringify ! ( btc_blockheader ) , "::" , stringify ! ( n_tx ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < btc_blockheader > ( ) ) ) . previous_hash as * const _ as usize } , 124usize , concat ! ( "Offset of field: " , stringify ! ( btc_blockheader ) , "::" , stringify ! ( previous_hash ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < btc_blockheader > ( ) ) ) . next_hash as * const _ as usize } , 156usize , concat ! ( "Offset of field: " , stringify ! ( btc_blockheader ) , "::" , stringify ! ( next_hash ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < btc_blockheader > ( ) ) ) . data as * const _ as usize } , 188usize , concat ! ( "Offset of field: " , stringify ! ( btc_blockheader ) , "::" , stringify ! ( data ) ) ) ; } impl :: core :: fmt :: Debug for btc_blockheader { fn fmt ( & self , f : & mut :: core :: fmt :: Formatter < '_ > ) -> :: core :: fmt :: Result { write ! ( f , "btc_blockheader {{ hash: [...], confirmations: {:?}, height: {:?}, version: {:?}, merkleroot: [...], time: {:?}, nonce: {:?}, bits: {:?}, chainwork: [...], n_tx: {:?}, previous_hash: [...], next_hash: [...], data: [...] }}" , self . confirmations , self . height , self . version , self . time , self . nonce , self . bits , self . n_tx ) } } pub type btc_blockheader_t = btc_blockheader ; # [ repr ( C ) ] # [ derive ( Copy , Clone ) ] pub struct btc_block_txdata { pub header : btc_blockheader_t , pub tx_len : u32 , pub tx : * mut btc_transaction_t , } # [ test ] fn bindgen_test_layout_btc_block_txdata ( ) { assert_eq ! ( :: core :: mem :: size_of :: < btc_block_txdata > ( ) , 280usize , concat ! ( "Size of: " , stringify ! ( btc_block_txdata ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < btc_block_txdata > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( btc_block_txdata ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < btc_block_txdata > ( ) ) ) . header as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( btc_block_txdata ) , "::" , stringify ! ( header ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < btc_block_txdata > ( ) ) ) . tx_len as * const _ as usize } , 268usize , concat ! ( "Offset of field: " , stringify ! ( btc_block_txdata ) , "::" , stringify ! ( tx_len ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < btc_block_txdata > ( ) ) ) . tx as * const _ as usize } , 272usize , concat ! ( "Offset of field: " , stringify ! ( btc_block_txdata ) , "::" , stringify ! ( tx ) ) ) ; } impl :: core :: fmt :: Debug for btc_block_txdata { fn fmt ( & self , f : & mut :: core :: fmt :: Formatter < '_ > ) -> :: core :: fmt :: Result { write ! ( f , "btc_block_txdata {{ header: {:?}, tx_len: {:?}, tx: {:?} }}" , self . header , self . tx_len , self . tx ) } } pub type btc_block_txdata_t = btc_block_txdata ; # [ repr ( C ) ] # [ derive ( Copy , Clone ) ] pub struct btc_block_txids { pub header : btc_blockheader_t , pub tx_len : u32 , pub tx : * mut bytes32_t , } # [ test ] fn bindgen_test_layout_btc_block_txids ( ) { assert_eq ! ( :: core :: mem :: size_of :: < btc_block_txids > ( ) , 280usize , concat ! ( "Size of: " , stringify ! ( btc_block_txids ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < btc_block_txids > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( btc_block_txids ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < btc_block_txids > ( ) ) ) . header as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( btc_block_txids ) , "::" , stringify ! ( header ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < btc_block_txids > ( ) ) ) . tx_len as * const _ as usize } , 268usize , concat ! ( "Offset of field: " , stringify ! ( btc_block_txids ) , "::" , stringify ! ( tx_len ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < btc_block_txids > ( ) ) ) . tx as * const _ as usize } , 272usize , concat ! ( "Offset of field: " , stringify ! ( btc_block_txids ) , "::" , stringify ! ( tx ) ) ) ; } impl :: core :: fmt :: Debug for btc_block_txids { fn fmt ( & self , f : & mut :: core :: fmt :: Formatter < '_ > ) -> :: core :: fmt :: Result { write ! ( f , "btc_block_txids {{ header: {:?}, tx_len: {:?}, tx: {:?} }}" , self . header , self . tx_len , self . tx ) } } pub type btc_block_txids_t = btc_block_txids ; extern "C" { pub fn btc_get_transaction_bytes ( in3 : * mut in3_t , txid : * mut u8 ) -> * mut bytes_t ; } extern "C" { pub fn btc_get_transaction ( in3 : * mut in3_t , txid : * mut u8 ) -> * mut btc_transaction_t ; } extern "C" { pub fn btc_get_blockheader ( in3 : * mut in3_t , blockhash : * mut u8 ) -> * mut btc_blockheader_t ; } extern "C" { pub fn btc_get_blockheader_bytes ( in3 : * mut in3_t , blockhash : * mut u8 ) -> * mut bytes_t ; } extern "C" { pub fn btc_get_block_txdata ( in3 : * mut in3_t , blockhash : * mut u8 ) -> * mut btc_block_txdata_t ; } extern "C" { pub fn btc_get_block_txids ( in3 : * mut in3_t , blockhash : * mut u8 ) -> * mut btc_block_txids_t ; } extern "C" { pub fn btc_get_block_bytes ( in3 : * mut in3_t , blockhash : * mut u8 ) -> * mut bytes_t ; } extern "C" { pub fn btc_d_to_tx ( t : * mut d_token_t ) -> * mut btc_transaction_t ; } extern "C" { pub fn btc_d_to_blockheader ( t : * mut d_token_t ) -> * mut btc_blockheader_t ; } extern "C" { pub fn btc_d_to_block_txids ( t : * mut d_token_t ) -> * mut btc_block_txids_t ; } extern "C" { pub fn btc_d_to_block_txdata ( t : * mut d_token_t ) -> * mut btc_block_txdata_t ; } pub type __gnuc_va_list = __builtin_va_list ; # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct opt_uint64_t { pub value : u64 , pub defined : bool , } # [ test ] fn bindgen_test_layout_opt_uint64_t ( ) { assert_eq ! ( :: core :: mem :: size_of :: < opt_uint64_t > ( ) , 16usize , concat ! ( "Size of: " , stringify ! ( opt_uint64_t ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < opt_uint64_t > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( opt_uint64_t ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < opt_uint64_t > ( ) ) ) . value as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( opt_uint64_t ) , "::" , stringify ! ( value ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < opt_uint64_t > ( ) ) ) . defined as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( opt_uint64_t ) , "::" , stringify ! ( defined ) ) ) ; } # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct opt_bytes_t { pub value : bytes_t , pub defined : bool , } # [ test ] fn bindgen_test_layout_opt_bytes_t ( ) { assert_eq ! ( :: core :: mem :: size_of :: < opt_bytes_t > ( ) , 24usize , concat ! ( "Size of: " , stringify ! ( opt_bytes_t ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < opt_bytes_t > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( opt_bytes_t ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < opt_bytes_t > ( ) ) ) . value as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( opt_bytes_t ) , "::" , stringify ! ( value ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < opt_bytes_t > ( ) ) ) . defined as * const _ as usize } , 16usize , concat ! ( "Offset of field: " , stringify ! ( opt_bytes_t ) , "::" , stringify ! ( defined ) ) ) ; } # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct opt_address_t { pub value : address_t , pub defined : bool , } # [ test ] fn bindgen_test_layout_opt_address_t ( ) { assert_eq ! ( :: core :: mem :: size_of :: < opt_address_t > ( ) , 21usize , concat ! ( "Size of: " , stringify ! ( opt_address_t ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < opt_address_t > ( ) , 1usize , concat ! ( "Alignment of " , stringify ! ( opt_address_t ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < opt_address_t > ( ) ) ) . value as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( opt_address_t ) , "::" , stringify ! ( value ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < opt_address_t > ( ) ) ) . defined as * const _ as usize } , 20usize , concat ! ( "Offset of field: " , stringify ! ( opt_address_t ) , "::" , stringify ! ( defined ) ) ) ; } # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct opt_uint256_t { pub value : uint256_t , pub defined : bool , } # [ test ] fn bindgen_test_layout_opt_uint256_t ( ) { assert_eq ! ( :: core :: mem :: size_of :: < opt_uint256_t > ( ) , 33usize , concat ! ( "Size of: " , stringify ! ( opt_uint256_t ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < opt_uint256_t > ( ) , 1usize , concat ! ( "Alignment of " , stringify ! ( opt_uint256_t ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < opt_uint256_t > ( ) ) ) . value as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( opt_uint256_t ) , "::" , stringify ! ( value ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < opt_uint256_t > ( ) ) ) . defined as * const _ as usize } , 32usize , concat ! ( "Offset of field: " , stringify ! ( opt_uint256_t ) , "::" , stringify ! ( defined ) ) ) ; } # [ repr ( C ) ] # [ derive ( Copy , Clone ) ] pub struct eth_tx { pub hash : bytes32_t , pub block_hash : bytes32_t , pub block_number : u64 , pub from : address_t , pub gas : u64 , pub gas_price : u64 , pub data : bytes_t , pub nonce : u64 , pub to : address_t , pub value : uint256_t , pub transaction_index : libc :: c_int , pub signature : [ u8 ; 65usize ] , } # [ test ] fn bindgen_test_layout_eth_tx ( ) { assert_eq ! ( :: core :: mem :: size_of :: < eth_tx > ( ) , 264usize , concat ! ( "Size of: " , stringify ! ( eth_tx ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < eth_tx > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( eth_tx ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < eth_tx > ( ) ) ) . hash as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( eth_tx ) , "::" , stringify ! ( hash ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < eth_tx > ( ) ) ) . block_hash as * const _ as usize } , 32usize , concat ! ( "Offset of field: " , stringify ! ( eth_tx ) , "::" , stringify ! ( block_hash ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < eth_tx > ( ) ) ) . block_number as * const _ as usize } , 64usize , concat ! ( "Offset of field: " , stringify ! ( eth_tx ) , "::" , stringify ! ( block_number ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < eth_tx > ( ) ) ) . from as * const _ as usize } , 72usize , concat ! ( "Offset of field: " , stringify ! ( eth_tx ) , "::" , stringify ! ( from ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < eth_tx > ( ) ) ) . gas as * const _ as usize } , 96usize , concat ! ( "Offset of field: " , stringify ! ( eth_tx ) , "::" , stringify ! ( gas ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < eth_tx > ( ) ) ) . gas_price as * const _ as usize } , 104usize , concat ! ( "Offset of field: " , stringify ! ( eth_tx ) , "::" , stringify ! ( gas_price ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < eth_tx > ( ) ) ) . data as * const _ as usize } , 112usize , concat ! ( "Offset of field: " , stringify ! ( eth_tx ) , "::" , stringify ! ( data ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < eth_tx > ( ) ) ) . nonce as * const _ as usize } , 128usize , concat ! ( "Offset of field: " , stringify ! ( eth_tx ) , "::" , stringify ! ( nonce ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < eth_tx > ( ) ) ) . to as * const _ as usize } , 136usize , concat ! ( "Offset of field: " , stringify ! ( eth_tx ) , "::" , stringify ! ( to ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < eth_tx > ( ) ) ) . value as * const _ as usize } , 156usize , concat ! ( "Offset of field: " , stringify ! ( eth_tx ) , "::" , stringify ! ( value ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < eth_tx > ( ) ) ) . transaction_index as * const _ as usize } , 188usize , concat ! ( "Offset of field: " , stringify ! ( eth_tx ) , "::" , stringify ! ( transaction_index ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < eth_tx > ( ) ) ) . signature as * const _ as usize } , 192usize , concat ! ( "Offset of field: " , stringify ! ( eth_tx ) , "::" , stringify ! ( signature ) ) ) ; } impl :: core :: fmt :: Debug for eth_tx { fn fmt ( & self , f : & mut :: core :: fmt :: Formatter < '_ > ) -> :: core :: fmt :: Result { write ! ( f , "eth_tx {{ hash: [...], block_hash: [...], block_number: {:?}, from: {:?}, gas: {:?}, gas_price: {:?}, data: {:?}, nonce: {:?}, to: {:?}, value: {:?}, transaction_index: {:?}, signature: [...] }}" , self . block_number , self . from , self . gas , self . gas_price , self . data , self . nonce , self . to , self . value , self . transaction_index ) } } pub type eth_tx_t = eth_tx ; # [ repr ( C ) ] # [ derive ( Copy , Clone ) ] pub struct eth_block { pub number : u64 , pub hash : bytes32_t , pub gasUsed : u64 , pub gasLimit : u64 , pub author : address_t , pub difficulty : uint256_t , pub extra_data : bytes_t , pub logsBloom : [ u8 ; 256usize ] , pub parent_hash : bytes32_t , pub sha3_uncles : bytes32_t , pub state_root : bytes32_t , pub receipts_root : bytes32_t , pub transaction_root : bytes32_t , pub tx_count : libc :: c_int , pub tx_data : * mut eth_tx_t , pub tx_hashes : * mut bytes32_t , pub timestamp : u64 , pub seal_fields : * mut bytes_t , pub seal_fields_count : libc :: c_int , } # [ test ] fn bindgen_test_layout_eth_block ( ) { assert_eq ! ( :: core :: mem :: size_of :: < eth_block > ( ) , 592usize , concat ! ( "Size of: " , stringify ! ( eth_block ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < eth_block > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( eth_block ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < eth_block > ( ) ) ) . number as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( eth_block ) , "::" , stringify ! ( number ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < eth_block > ( ) ) ) . hash as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( eth_block ) , "::" , stringify ! ( hash ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < eth_block > ( ) ) ) . gasUsed as * const _ as usize } , 40usize , concat ! ( "Offset of field: " , stringify ! ( eth_block ) , "::" , stringify ! ( gasUsed ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < eth_block > ( ) ) ) . gasLimit as * const _ as usize } , 48usize , concat ! ( "Offset of field: " , stringify ! ( eth_block ) , "::" , stringify ! ( gasLimit ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < eth_block > ( ) ) ) . author as * const _ as usize } , 56usize , concat ! ( "Offset of field: " , stringify ! ( eth_block ) , "::" , stringify ! ( author ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < eth_block > ( ) ) ) . difficulty as * const _ as usize } , 76usize , concat ! ( "Offset of field: " , stringify ! ( eth_block ) , "::" , stringify ! ( difficulty ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < eth_block > ( ) ) ) . extra_data as * const _ as usize } , 112usize , concat ! ( "Offset of field: " , stringify ! ( eth_block ) , "::" , stringify ! ( extra_data ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < eth_block > ( ) ) ) . logsBloom as * const _ as usize } , 128usize , concat ! ( "Offset of field: " , stringify ! ( eth_block ) , "::" , stringify ! ( logsBloom ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < eth_block > ( ) ) ) . parent_hash as * const _ as usize } , 384usize , concat ! ( "Offset of field: " , stringify ! ( eth_block ) , "::" , stringify ! ( parent_hash ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < eth_block > ( ) ) ) . sha3_uncles as * const _ as usize } , 416usize , concat ! ( "Offset of field: " , stringify ! ( eth_block ) , "::" , stringify ! ( sha3_uncles ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < eth_block > ( ) ) ) . state_root as * const _ as usize } , 448usize , concat ! ( "Offset of field: " , stringify ! ( eth_block ) , "::" , stringify ! ( state_root ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < eth_block > ( ) ) ) . receipts_root as * const _ as usize } , 480usize , concat ! ( "Offset of field: " , stringify ! ( eth_block ) , "::" , stringify ! ( receipts_root ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < eth_block > ( ) ) ) . transaction_root as * const _ as usize } , 512usize , concat ! ( "Offset of field: " , stringify ! ( eth_block ) , "::" , stringify ! ( transaction_root ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < eth_block > ( ) ) ) . tx_count as * const _ as usize } , 544usize , concat ! ( "Offset of field: " , stringify ! ( eth_block ) , "::" , stringify ! ( tx_count ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < eth_block > ( ) ) ) . tx_data as * const _ as usize } , 552usize , concat ! ( "Offset of field: " , stringify ! ( eth_block ) , "::" , stringify ! ( tx_data ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < eth_block > ( ) ) ) . tx_hashes as * const _ as usize } , 560usize , concat ! ( "Offset of field: " , stringify ! ( eth_block ) , "::" , stringify ! ( tx_hashes ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < eth_block > ( ) ) ) . timestamp as * const _ as usize } , 568usize , concat ! ( "Offset of field: " , stringify ! ( eth_block ) , "::" , stringify ! ( timestamp ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < eth_block > ( ) ) ) . seal_fields as * const _ as usize } , 576usize , concat ! ( "Offset of field: " , stringify ! ( eth_block ) , "::" , stringify ! ( seal_fields ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < eth_block > ( ) ) ) . seal_fields_count as * const _ as usize } , 584usize , concat ! ( "Offset of field: " , stringify ! ( eth_block ) , "::" , stringify ! ( seal_fields_count ) ) ) ; } impl :: core :: fmt :: Debug for eth_block { fn fmt ( & self , f : & mut :: core :: fmt :: Formatter < '_ > ) -> :: core :: fmt :: Result { write ! ( f , "eth_block {{ number: {:?}, hash: [...], gasUsed: {:?}, gasLimit: {:?}, author: {:?}, difficulty: {:?}, extra_data: {:?}, logsBloom: [...], parent_hash: [...], sha3_uncles: [...], state_root: [...], receipts_root: [...], transaction_root: [...], tx_count: {:?}, tx_data: {:?}, tx_hashes: {:?}, timestamp: {:?}, seal_fields: {:?}, seal_fields_count: {:?} }}" , self . number , self . gasUsed , self . gasLimit , self . author , self . difficulty , self . extra_data , self . tx_count , self . tx_data , self . tx_hashes , self . timestamp , self . seal_fields , self . seal_fields_count ) } } pub type eth_block_t = eth_block ; # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct eth_log { pub removed : bool , pub log_index : usize , pub transaction_index : usize , pub transaction_hash : bytes32_t , pub block_hash : bytes32_t , pub block_number : u64 , pub address : address_t , pub data : bytes_t , pub topics : * mut bytes32_t , pub topic_count : usize , pub next : * mut eth_log , } # [ test ] fn bindgen_test_layout_eth_log ( ) { assert_eq ! ( :: core :: mem :: size_of :: < eth_log > ( ) , 160usize , concat ! ( "Size of: " , stringify ! ( eth_log ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < eth_log > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( eth_log ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < eth_log > ( ) ) ) . removed as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( eth_log ) , "::" , stringify ! ( removed ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < eth_log > ( ) ) ) . log_index as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( eth_log ) , "::" , stringify ! ( log_index ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < eth_log > ( ) ) ) . transaction_index as * const _ as usize } , 16usize , concat ! ( "Offset of field: " , stringify ! ( eth_log ) , "::" , stringify ! ( transaction_index ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < eth_log > ( ) ) ) . transaction_hash as * const _ as usize } , 24usize , concat ! ( "Offset of field: " , stringify ! ( eth_log ) , "::" , stringify ! ( transaction_hash ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < eth_log > ( ) ) ) . block_hash as * const _ as usize } , 56usize , concat ! ( "Offset of field: " , stringify ! ( eth_log ) , "::" , stringify ! ( block_hash ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < eth_log > ( ) ) ) . block_number as * const _ as usize } , 88usize , concat ! ( "Offset of field: " , stringify ! ( eth_log ) , "::" , stringify ! ( block_number ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < eth_log > ( ) ) ) . address as * const _ as usize } , 96usize , concat ! ( "Offset of field: " , stringify ! ( eth_log ) , "::" , stringify ! ( address ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < eth_log > ( ) ) ) . data as * const _ as usize } , 120usize , concat ! ( "Offset of field: " , stringify ! ( eth_log ) , "::" , stringify ! ( data ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < eth_log > ( ) ) ) . topics as * const _ as usize } , 136usize , concat ! ( "Offset of field: " , stringify ! ( eth_log ) , "::" , stringify ! ( topics ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < eth_log > ( ) ) ) . topic_count as * const _ as usize } , 144usize , concat ! ( "Offset of field: " , stringify ! ( eth_log ) , "::" , stringify ! ( topic_count ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < eth_log > ( ) ) ) . next as * const _ as usize } , 152usize , concat ! ( "Offset of field: " , stringify ! ( eth_log ) , "::" , stringify ! ( next ) ) ) ; } pub type eth_log_t = eth_log ; # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct eth_tx_receipt { pub transaction_hash : bytes32_t , pub transaction_index : libc :: c_int , pub block_hash : bytes32_t , pub block_number : u64 , pub cumulative_gas_used : u64 , pub gas_used : u64 , pub contract_address : * mut bytes_t , pub status : bool , pub logs : * mut eth_log_t , } # [ test ] fn bindgen_test_layout_eth_tx_receipt ( ) { assert_eq ! ( :: core :: mem :: size_of :: < eth_tx_receipt > ( ) , 120usize , concat ! ( "Size of: " , stringify ! ( eth_tx_receipt ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < eth_tx_receipt > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( eth_tx_receipt ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < eth_tx_receipt > ( ) ) ) . transaction_hash as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( eth_tx_receipt ) , "::" , stringify ! ( transaction_hash ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < eth_tx_receipt > ( ) ) ) . transaction_index as * const _ as usize } , 32usize , concat ! ( "Offset of field: " , stringify ! ( eth_tx_receipt ) , "::" , stringify ! ( transaction_index ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < eth_tx_receipt > ( ) ) ) . block_hash as * const _ as usize } , 36usize , concat ! ( "Offset of field: " , stringify ! ( eth_tx_receipt ) , "::" , stringify ! ( block_hash ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < eth_tx_receipt > ( ) ) ) . block_number as * const _ as usize } , 72usize , concat ! ( "Offset of field: " , stringify ! ( eth_tx_receipt ) , "::" , stringify ! ( block_number ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < eth_tx_receipt > ( ) ) ) . cumulative_gas_used as * const _ as usize } , 80usize , concat ! ( "Offset of field: " , stringify ! ( eth_tx_receipt ) , "::" , stringify ! ( cumulative_gas_used ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < eth_tx_receipt > ( ) ) ) . gas_used as * const _ as usize } , 88usize , concat ! ( "Offset of field: " , stringify ! ( eth_tx_receipt ) , "::" , stringify ! ( gas_used ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < eth_tx_receipt > ( ) ) ) . contract_address as * const _ as usize } , 96usize , concat ! ( "Offset of field: " , stringify ! ( eth_tx_receipt ) , "::" , stringify ! ( contract_address ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < eth_tx_receipt > ( ) ) ) . status as * const _ as usize } , 104usize , concat ! ( "Offset of field: " , stringify ! ( eth_tx_receipt ) , "::" , stringify ! ( status ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < eth_tx_receipt > ( ) ) ) . logs as * const _ as usize } , 112usize , concat ! ( "Offset of field: " , stringify ! ( eth_tx_receipt ) , "::" , stringify ! ( logs ) ) ) ; } pub type eth_tx_receipt_t = eth_tx_receipt ; # [ repr ( u32 ) ] # [ derive ( Debug , Copy , Clone , PartialEq , Eq , Hash ) ] pub enum eth_blknum_def_t { BLK_LATEST = 0 , BLK_EARLIEST = 1 , BLK_PENDING = 2 , } # [ repr ( C ) ] # [ derive ( Copy , Clone ) ] pub struct eth_blknum_t { pub __bindgen_anon_1 : eth_blknum_t__bindgen_ty_1 , pub is_u64 : bool , } # [ repr ( C ) ] # [ derive ( Copy , Clone ) ] pub union eth_blknum_t__bindgen_ty_1 { pub u64 : u64 , pub def : eth_blknum_def_t , _bindgen_union_align : u64 , } # [ test ] fn bindgen_test_layout_eth_blknum_t__bindgen_ty_1 ( ) { assert_eq ! ( :: core :: mem :: size_of :: < eth_blknum_t__bindgen_ty_1 > ( ) , 8usize , concat ! ( "Size of: " , stringify ! ( eth_blknum_t__bindgen_ty_1 ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < eth_blknum_t__bindgen_ty_1 > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( eth_blknum_t__bindgen_ty_1 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < eth_blknum_t__bindgen_ty_1 > ( ) ) ) . u64 as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( eth_blknum_t__bindgen_ty_1 ) , "::" , stringify ! ( u64 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < eth_blknum_t__bindgen_ty_1 > ( ) ) ) . def as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( eth_blknum_t__bindgen_ty_1 ) , "::" , stringify ! ( def ) ) ) ; } impl :: core :: fmt :: Debug for eth_blknum_t__bindgen_ty_1 { fn fmt ( & self , f : & mut :: core :: fmt :: Formatter < '_ > ) -> :: core :: fmt :: Result { write ! ( f , "eth_blknum_t__bindgen_ty_1 {{ union }}" ) } } # [ test ] fn bindgen_test_layout_eth_blknum_t ( ) { assert_eq ! ( :: core :: mem :: size_of :: < eth_blknum_t > ( ) , 16usize , concat ! ( "Size of: " , stringify ! ( eth_blknum_t ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < eth_blknum_t > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( eth_blknum_t ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < eth_blknum_t > ( ) ) ) . is_u64 as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( eth_blknum_t ) , "::" , stringify ! ( is_u64 ) ) ) ; } impl :: core :: fmt :: Debug for eth_blknum_t { fn fmt ( & self , f : & mut :: core :: fmt :: Formatter < '_ > ) -> :: core :: fmt :: Result { write ! ( f , "eth_blknum_t {{ __bindgen_anon_1: {:?}, is_u64: {:?} }}" , self . __bindgen_anon_1 , self . is_u64 ) } } extern "C" { pub fn eth_getStorageAt ( in3 : * mut in3_t , account : * mut u8 , key : * mut u8 , block : eth_blknum_t ) -> uint256_t ; } extern "C" { pub fn eth_getCode ( in3 : * mut in3_t , account : * mut u8 , block : eth_blknum_t ) -> bytes_t ; } extern "C" { pub fn eth_getBalance ( in3 : * mut in3_t , account : * mut u8 , block : eth_blknum_t ) -> uint256_t ; } extern "C" { pub fn eth_blockNumber ( in3 : * mut in3_t ) -> u64 ; } extern "C" { pub fn eth_gasPrice ( in3 : * mut in3_t ) -> u64 ; } extern "C" { pub fn eth_getBlockByNumber ( in3 : * mut in3_t , number : eth_blknum_t , include_tx : bool ) -> * mut eth_block_t ; } extern "C" { pub fn eth_getBlockByHash ( in3 : * mut in3_t , hash : * mut u8 , include_tx : bool ) -> * mut eth_block_t ; } extern "C" { pub fn eth_getLogs ( in3 : * mut in3_t , fopt : * mut libc :: c_char ) -> * mut eth_log_t ; } extern "C" { pub fn eth_newFilter ( in3 : * mut in3_t , options : * mut json_ctx_t ) -> in3_ret_t :: Type ; } extern "C" { pub fn eth_newBlockFilter ( in3 : * mut in3_t ) -> in3_ret_t :: Type ; } extern "C" { pub fn eth_newPendingTransactionFilter ( in3 : * mut in3_t ) -> in3_ret_t :: Type ; } extern "C" { pub fn eth_uninstallFilter ( in3 : * mut in3_t , id : usize ) -> bool ; } extern "C" { pub fn eth_getFilterChanges ( in3 : * mut in3_t , id : usize , block_hashes : * mut * mut bytes32_t , logs : * mut * mut eth_log_t ) -> in3_ret_t :: Type ; } extern "C" { pub fn eth_getFilterLogs ( in3 : * mut in3_t , id : usize , logs : * mut * mut eth_log_t ) -> in3_ret_t :: Type ; } extern "C" { pub fn eth_chainId ( in3 : * mut in3_t ) -> u64 ; } extern "C" { pub fn eth_getBlockTransactionCountByHash ( in3 : * mut in3_t , hash : * mut u8 ) -> u64 ; } extern "C" { pub fn eth_getBlockTransactionCountByNumber ( in3 : * mut in3_t , block : eth_blknum_t ) -> u64 ; } extern "C" { pub fn eth_call_fn ( in3 : * mut in3_t , contract : * mut u8 , block : eth_blknum_t , fn_sig : * mut libc :: c_char , ... ) -> * mut json_ctx_t ; } extern "C" { pub fn eth_estimate_fn ( in3 : * mut in3_t , contract : * mut u8 , block : eth_blknum_t , fn_sig : * mut libc :: c_char , ... ) -> u64 ; } extern "C" { pub fn eth_getTransactionByHash ( in3 : * mut in3_t , tx_hash : * mut u8 ) -> * mut eth_tx_t ; } extern "C" { pub fn eth_getTransactionByBlockHashAndIndex ( in3 : * mut in3_t , block_hash : * mut u8 , index : usize ) -> * mut eth_tx_t ; } extern "C" { pub fn eth_getTransactionByBlockNumberAndIndex ( in3 : * mut in3_t , block : eth_blknum_t , index : usize ) -> * mut eth_tx_t ; } extern "C" { pub fn eth_getTransactionCount ( in3 : * mut in3_t , address : * mut u8 , block : eth_blknum_t ) -> u64 ; } extern "C" { pub fn eth_getUncleByBlockNumberAndIndex ( in3 : * mut in3_t , block : eth_blknum_t , index : usize ) -> * mut eth_block_t ; } extern "C" { pub fn eth_getUncleCountByBlockHash ( in3 : * mut in3_t , hash : * mut u8 ) -> u64 ; } extern "C" { pub fn eth_getUncleCountByBlockNumber ( in3 : * mut in3_t , block : eth_blknum_t ) -> u64 ; } extern "C" { pub fn eth_sendTransaction ( in3 : * mut in3_t , from : * mut u8 , to : * mut u8 , gas : opt_uint64_t , gas_price : opt_uint64_t , value : opt_uint256_t , data : opt_bytes_t , nonce : opt_uint64_t ) -> * mut bytes_t ; } extern "C" { pub fn eth_sendRawTransaction ( in3 : * mut in3_t , data : bytes_t ) -> * mut bytes_t ; } extern "C" { pub fn eth_getTransactionReceipt ( in3 : * mut in3_t , tx_hash : * mut u8 ) -> * mut eth_tx_receipt_t ; } extern "C" { pub fn eth_wait_for_receipt ( in3 : * mut in3_t , tx_hash : * mut u8 ) -> * mut libc :: c_char ; } extern "C" { pub fn eth_log_free ( log : * mut eth_log_t ) ; } extern "C" { pub fn eth_tx_receipt_free ( txr : * mut eth_tx_receipt_t ) ; } extern "C" { pub fn in3_register_eth_api ( ) ; } extern "C" { pub fn send_curl ( req : * mut in3_request_t ) -> in3_ret_t :: Type ; } extern "C" { pub fn in3_register_curl ( ) ; } extern "C" { pub fn in3_for_chain_auto_init ( chain_id : chain_id_t ) -> * mut in3_t ; } pub type __builtin_va_list = [ __va_list_tag ; 1usize ] ; # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct __va_list_tag { pub gp_offset : libc :: c_uint , pub fp_offset : libc :: c_uint , pub overflow_arg_area : * mut libc :: c_void , pub reg_save_area : * mut libc :: c_void , } # [ test ] fn bindgen_test_layout___va_list_tag ( ) { assert_eq ! ( :: core :: mem :: size_of :: < __va_list_tag > ( ) , 24usize , concat ! ( "Size of: " , stringify ! ( __va_list_tag ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < __va_list_tag > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( __va_list_tag ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __va_list_tag > ( ) ) ) . gp_offset as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( __va_list_tag ) , "::" , stringify ! ( gp_offset ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __va_list_tag > ( ) ) ) . fp_offset as * const _ as usize } , 4usize , concat ! ( "Offset of field: " , stringify ! ( __va_list_tag ) , "::" , stringify ! ( fp_offset ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __va_list_tag > ( ) ) ) . overflow_arg_area as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( __va_list_tag ) , "::" , stringify ! ( overflow_arg_area ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: core :: ptr :: null :: < __va_list_tag > ( ) ) ) . reg_save_area as * const _ as usize } , 16usize , concat ! ( "Offset of field: " , stringify ! ( __va_list_tag ) , "::" , stringify ! ( reg_save_area ) ) ) ; } \ No newline at end of file From fdd6e4ceb7baa136ed266b39824dde2e1343372b Mon Sep 17 00:00:00 2001 From: Shoaib Ahmed Date: Sat, 4 Jul 2020 23:36:15 +0200 Subject: [PATCH 05/37] Fix example sign.rs --- rust/in3-rs/examples/sign.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rust/in3-rs/examples/sign.rs b/rust/in3-rs/examples/sign.rs index e29da33c3..1c7d3856a 100644 --- a/rust/in3-rs/examples/sign.rs +++ b/rust/in3-rs/examples/sign.rs @@ -33,7 +33,7 @@ fn sign_tx_api() { r#"{"proof":"none", "autoUpdateList":false,"nodes":{"0x1":{"needsUpdate":false}}}}"#, ); eth_api.client().set_signer(Box::new(In3Signer::new( - "0x889dbed9450f7a4b68e0732ccb7cd016dab158e6946d16158f2736fda1143ca6" + "889dbed9450f7a4b68e0732ccb7cd016dab158e6946d16158f2736fda1143ca6" .try_into() .unwrap(), ))); @@ -86,7 +86,7 @@ fn sign_tx_rpc() { ]; c.set_transport(Box::new(MockTransport { responses })); c.set_signer(Box::new(In3Signer::new( - "0x8da4ef21b864d2cc526dbdb2a120bd2874c36c9d0a1fb7f8c63d7f7a8b41de8f" + "8da4ef21b864d2cc526dbdb2a120bd2874c36c9d0a1fb7f8c63d7f7a8b41de8f" .try_into() .unwrap(), ))); From 0749ad46ff6626b14c22103a40d9a436089c65ce Mon Sep 17 00:00:00 2001 From: Camilo Soto Valenzuela Date: Sun, 5 Jul 2020 13:02:19 +0200 Subject: [PATCH 06/37] Test tool for xml output cargo --- rust/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rust/ci.yml b/rust/ci.yml index 7c8705fba..a5e380aab 100644 --- a/rust/ci.yml +++ b/rust/ci.yml @@ -108,8 +108,9 @@ rust: - cd rust/ - export UPDATE_IN3_BINDINGS=1 - export IN3_MODE="RELEASE" + - cargo install cargo2junit - cargo run --example custom_transport --release - - RUST_TEST_THREADS=1 cargo test + - RUST_TEST_THREADS=1 cargo test -- -Z unstable-options --format json | cargo2junit > results.xml needs: [] tags: - mac-mini-runner From 86751aa515259734f02613d8a4f318e754fe8a6e Mon Sep 17 00:00:00 2001 From: Camilo Soto Valenzuela Date: Mon, 6 Jul 2020 09:46:18 +0200 Subject: [PATCH 07/37] Add artifact --- rust/ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rust/ci.yml b/rust/ci.yml index a5e380aab..83e9e05a5 100644 --- a/rust/ci.yml +++ b/rust/ci.yml @@ -110,8 +110,11 @@ rust: - export IN3_MODE="RELEASE" - cargo install cargo2junit - cargo run --example custom_transport --release - - RUST_TEST_THREADS=1 cargo test -- -Z unstable-options --format json | cargo2junit > results.xml + - RUST_TEST_THREADS=1 cargo test -- -Z unstable-options --format json | cargo2junit > ../rust_test.xml needs: [] + artifacts: + reports: + junit: rust_test.xml tags: - mac-mini-runner From 849782747906474acf39e711454eca5daa296709 Mon Sep 17 00:00:00 2001 From: Shoaib Ahmed Date: Mon, 6 Jul 2020 23:44:58 +0200 Subject: [PATCH 08/37] Reexport types from ethereum_types crate publicly --- rust/in3-rs/examples/eth_api.rs | 3 --- rust/in3-rs/examples/sign.rs | 1 - rust/in3-rs/src/btc/api.rs | 1 - rust/in3-rs/src/btc/types.rs | 4 +--- rust/in3-rs/src/eth1/abi.rs | 2 +- rust/in3-rs/src/eth1/api.rs | 4 +--- rust/in3-rs/src/eth1/types.rs | 3 +-- rust/in3-rs/src/lib.rs | 4 +--- rust/in3-rs/src/transport.rs | 2 -- rust/in3-rs/src/types.rs | 1 + 10 files changed, 6 insertions(+), 19 deletions(-) diff --git a/rust/in3-rs/examples/eth_api.rs b/rust/in3-rs/examples/eth_api.rs index 98a7b498e..ed85e0413 100644 --- a/rust/in3-rs/examples/eth_api.rs +++ b/rust/in3-rs/examples/eth_api.rs @@ -1,12 +1,9 @@ use std::convert::TryInto; use async_std::task; -use ethereum_types::{Address, U256}; - use in3::eth1::*; use in3::logging; use in3::prelude::*; -use in3::types::Bytes; fn main() -> In3Result<()> { // enable logging diff --git a/rust/in3-rs/examples/sign.rs b/rust/in3-rs/examples/sign.rs index 1c7d3856a..8be1507a0 100644 --- a/rust/in3-rs/examples/sign.rs +++ b/rust/in3-rs/examples/sign.rs @@ -1,7 +1,6 @@ use std::convert::TryInto; use async_std::task; -use ethereum_types::Address; use serde_json::json; use in3::eth1::*; diff --git a/rust/in3-rs/src/btc/api.rs b/rust/in3-rs/src/btc/api.rs index b3c274e1f..5601dd41f 100644 --- a/rust/in3-rs/src/btc/api.rs +++ b/rust/in3-rs/src/btc/api.rs @@ -216,7 +216,6 @@ impl Api { #[cfg(test)] mod tests { use async_std::task; - use ethereum_types::U256; use rustc_hex::FromHex; use crate::prelude::*; diff --git a/rust/in3-rs/src/btc/types.rs b/rust/in3-rs/src/btc/types.rs index 32f3cd860..5a1ea7de1 100644 --- a/rust/in3-rs/src/btc/types.rs +++ b/rust/in3-rs/src/btc/types.rs @@ -1,8 +1,6 @@ //! Bitcoin types' definitions. -use ethereum_types::U256; - use crate::eth1::Hash; -use crate::types::Bytes; +use crate::types::*; /// The transaction in type. #[derive(Debug)] diff --git a/rust/in3-rs/src/eth1/abi.rs b/rust/in3-rs/src/eth1/abi.rs index be55df45c..00918a412 100644 --- a/rust/in3-rs/src/eth1/abi.rs +++ b/rust/in3-rs/src/eth1/abi.rs @@ -76,9 +76,9 @@ impl Decode for In3EthAbi { #[cfg(test)] mod tests { use async_std::task; - use ethereum_types::Address; use super::*; + use crate::types::Address; #[test] fn test_abi_encode() { diff --git a/rust/in3-rs/src/eth1/api.rs b/rust/in3-rs/src/eth1/api.rs index 7a13110f7..c16505aa4 100644 --- a/rust/in3-rs/src/eth1/api.rs +++ b/rust/in3-rs/src/eth1/api.rs @@ -5,7 +5,7 @@ use crate::eth1::*; use crate::in3::chain::{BTC, IPFS}; use crate::json_rpc::{rpc, Request}; use crate::traits::{Api as ApiTrait, Client as ClientTrait}; -use crate::types::Bytes; +use crate::types::*; use serde_json::json; /// Primary interface for the Ethereum JSON RPC API. @@ -547,12 +547,10 @@ mod tests { use std::convert::TryInto; use async_std::task; - use ethereum_types::{Address, U256}; use rustc_hex::FromHex; use crate::eth1::*; use crate::prelude::*; - use crate::types::Bytes; use super::*; diff --git a/rust/in3-rs/src/eth1/types.rs b/rust/in3-rs/src/eth1/types.rs index 028c42a8e..9b22bc2d3 100644 --- a/rust/in3-rs/src/eth1/types.rs +++ b/rust/in3-rs/src/eth1/types.rs @@ -1,8 +1,7 @@ //! Ethereum types' definitions. -pub use ethereum_types::{Address, Bloom, H256, U256, U64}; use serde::{Deserialize, Serialize, Serializer}; -use crate::types::Bytes; +use crate::types::*; /// Hash types representing 32-bytes hashes. pub type Hash = H256; diff --git a/rust/in3-rs/src/lib.rs b/rust/in3-rs/src/lib.rs index 2e36e099c..eb4756f70 100644 --- a/rust/in3-rs/src/lib.rs +++ b/rust/in3-rs/src/lib.rs @@ -36,9 +36,7 @@ pub mod prelude { pub use crate::error::*; pub use crate::in3::*; pub use crate::signer::*; - pub use crate::traits::Api as ApiTrait; - pub use crate::traits::Client as ClientTrait; - pub use crate::traits::{Signer, Storage, Transport}; + pub use crate::traits::{Api as ApiTrait, Client as ClientTrait, Signer, Storage, Transport}; pub use crate::transport::{HttpTransport, MockJsonTransport, MockTransport}; pub use crate::types::*; } diff --git a/rust/in3-rs/src/transport.rs b/rust/in3-rs/src/transport.rs index 7cd8ed278..7b4edcc60 100644 --- a/rust/in3-rs/src/transport.rs +++ b/rust/in3-rs/src/transport.rs @@ -206,8 +206,6 @@ impl Transport for HttpTransport { #[cfg(test)] mod tests { - use ethereum_types::U256; - use crate::json_rpc::Response; use crate::prelude::*; diff --git a/rust/in3-rs/src/types.rs b/rust/in3-rs/src/types.rs index 7e706d69d..7a455fc8b 100644 --- a/rust/in3-rs/src/types.rs +++ b/rust/in3-rs/src/types.rs @@ -3,6 +3,7 @@ use std::convert::TryFrom; use std::fmt; use std::fmt::Formatter; +pub use ethereum_types::{Address, Bloom, H256, U256, U64}; use rustc_hex::{FromHex, FromHexError, ToHex}; use serde::de::{Error, Visitor}; use serde::{Deserialize, Deserializer, Serialize, Serializer}; From eed129f6c4afa4de68e5038a21f73381802f070c Mon Sep 17 00:00:00 2001 From: Shoaib Ahmed Date: Tue, 7 Jul 2020 00:10:42 +0200 Subject: [PATCH 09/37] Reexport serde_json elements publicly as json_rpc::json --- rust/in3-rs/examples/btc_get_tx.rs | 8 +-- rust/in3-rs/examples/custom_signer.rs | 5 +- rust/in3-rs/examples/eth_api.rs | 21 ++++---- rust/in3-rs/examples/sign.rs | 18 +++---- rust/in3-rs/src/btc/api.rs | 20 ++++--- rust/in3-rs/src/error.rs | 12 ++--- rust/in3-rs/src/eth1/abi.rs | 25 ++++----- rust/in3-rs/src/eth1/api.rs | 76 +++++++++++---------------- rust/in3-rs/src/in3.rs | 4 +- rust/in3-rs/src/ipfs.rs | 2 +- rust/in3-rs/src/json_rpc.rs | 30 +++++------ rust/in3-rs/src/signer.rs | 9 ++-- rust/in3-rs/src/transport.rs | 18 +++---- 13 files changed, 109 insertions(+), 139 deletions(-) diff --git a/rust/in3-rs/examples/btc_get_tx.rs b/rust/in3-rs/examples/btc_get_tx.rs index 78b11d474..a477109e1 100644 --- a/rust/in3-rs/examples/btc_get_tx.rs +++ b/rust/in3-rs/examples/btc_get_tx.rs @@ -4,6 +4,7 @@ use async_std::task; use in3::btc::*; use in3::eth1::Hash; +use in3::json_rpc::json::from_str; use in3::prelude::*; fn main() { @@ -11,10 +12,9 @@ fn main() { // `get_transaction_bytes` is an asynchronous request (due to the internal C library). // Therefore to block execution we use async_std's block_on function - let txid: Hash = serde_json::from_str::( - r#""0x83ce5041679c75721ec7135e0ebeeae52636cfcb4844dbdccf86644df88da8c1""#, - ) - .unwrap(); + let txid: Hash = + from_str::(r#""0x83ce5041679c75721ec7135e0ebeeae52636cfcb4844dbdccf86644df88da8c1""#) + .unwrap(); let tx_data = task::block_on(btc_api.get_transaction_bytes(txid)).unwrap(); println!("{:?}", tx_data) diff --git a/rust/in3-rs/examples/custom_signer.rs b/rust/in3-rs/examples/custom_signer.rs index 36eabd0aa..a3569544f 100644 --- a/rust/in3-rs/examples/custom_signer.rs +++ b/rust/in3-rs/examples/custom_signer.rs @@ -1,9 +1,8 @@ use std::convert::TryInto; use async_std::task; -use serde_json::json; -use in3::json_rpc::Request; +use in3::json_rpc::{json::*, Request}; use in3::prelude::*; fn main() { @@ -51,7 +50,7 @@ fn main() { method: "eth_sendTransaction", params: tx, }; - let req_str = serde_json::to_string(&rpc_req).unwrap(); // Serialize `Request` impl cannot fail + let req_str = to_string(&rpc_req).unwrap(); // Serialize `Request` impl cannot fail match task::block_on(c.rpc(&req_str)) { Ok(res) => println!("RESPONSE > {:?}, {:?}", req_str, res), Err(err) => println!("Failed with error: {:?}", err), diff --git a/rust/in3-rs/examples/eth_api.rs b/rust/in3-rs/examples/eth_api.rs index ed85e0413..7c3b78a54 100644 --- a/rust/in3-rs/examples/eth_api.rs +++ b/rust/in3-rs/examples/eth_api.rs @@ -2,6 +2,7 @@ use std::convert::TryInto; use async_std::task; use in3::eth1::*; +use in3::json_rpc::json::{from_str, from_value, json}; use in3::logging; use in3::prelude::*; @@ -17,7 +18,7 @@ fn main() -> In3Result<()> { .configure(r#"{"autoUpdateList":false,"nodes":{"0x1":{"needsUpdate":false}}}}"#)?; // eth_getStorageAt - let address: Address = serde_json::from_str(r#""0x0123456789012345678901234567890123456789""#)?; + let address: Address = from_str(r#""0x0123456789012345678901234567890123456789""#)?; let key: U256 = 0u64.into(); let storage: u64 = task::block_on(eth_api.get_storage_at(address, key, BlockNumber::Latest))? .try_into() @@ -25,7 +26,7 @@ fn main() -> In3Result<()> { println!("Storage value => {:?}", storage); // eth_getCode - let address: Address = serde_json::from_str(r#""0xac1b824795e1eb1f6e609fe0da9b9af8beaab60f""#)?; + let address: Address = from_str(r#""0xac1b824795e1eb1f6e609fe0da9b9af8beaab60f""#)?; let code: Bytes = task::block_on(eth_api.get_code(address, BlockNumber::Latest))? .try_into() .expect("cannot convert to Bytes"); @@ -44,7 +45,7 @@ fn main() -> In3Result<()> { println!("Gas price => {:?}", gas_price); // eth_getBalance - let address: Address = serde_json::from_str(r#""0x0123456789012345678901234567890123456789""#)?; + let address: Address = from_str(r#""0x0123456789012345678901234567890123456789""#)?; let balance: u64 = task::block_on( eth_api.get_balance(address, BlockNumber::Number((latest_blk_num - 10).into())), )? @@ -57,24 +58,22 @@ fn main() -> In3Result<()> { println!("Block => {:?}", block); // eth_getBlockByHash - let hash: Hash = serde_json::from_str( - r#""0xa2ad3d67e3a09d016ab72e40fc1e47d6662f9156f16ce1cce62d5805a62ffd02""#, - )?; + let hash: Hash = + from_str(r#""0xa2ad3d67e3a09d016ab72e40fc1e47d6662f9156f16ce1cce62d5805a62ffd02""#)?; let block: Block = task::block_on(eth_api.get_block_by_hash(hash, false))?; println!("Block => {:?}", block); // eth_getLogs - let logs: Vec = task::block_on(eth_api.get_logs(serde_json::json!({ + let logs: Vec = task::block_on(eth_api.get_logs(json!({ "blockHash": "0x468f88ed8b40d940528552f093a11e4eb05991c787608139c931b0e9782ec5af", "topics": ["0xa61b5dec2abee862ab0841952bfbc161b99ad8c14738afa8ed8d5c522cd03946"] })))?; println!("Logs => {:?}", logs); // eth_call - let contract: Address = - serde_json::from_str(r#""0x2736D225f85740f42D17987100dc8d58e9e16252""#).unwrap(); // cannot fail + let contract: Address = from_str(r#""0x2736D225f85740f42D17987100dc8d58e9e16252""#).unwrap(); // cannot fail let mut abi = abi::In3EthAbi::new(); - let params = task::block_on(abi.encode("totalServers():uint256", serde_json::json!([]))) + let params = task::block_on(abi.encode("totalServers():uint256", json!([]))) .expect("failed to ABI encode params"); let txn = CallTransaction { @@ -86,7 +85,7 @@ fn main() -> In3Result<()> { task::block_on(eth_api.call(txn, BlockNumber::Latest)).expect("ETH call failed"); let output = task::block_on(abi.decode("uint256", output)).expect("failed to ABI decode output"); - let total_servers: U256 = serde_json::from_value(output).unwrap(); // cannot fail if ABI decode succeeds + let total_servers: U256 = from_value(output).unwrap(); // cannot fail if ABI decode succeeds println!("Total servers => {:?}", total_servers); Ok(()) diff --git a/rust/in3-rs/examples/sign.rs b/rust/in3-rs/examples/sign.rs index 8be1507a0..7105ac376 100644 --- a/rust/in3-rs/examples/sign.rs +++ b/rust/in3-rs/examples/sign.rs @@ -1,10 +1,9 @@ use std::convert::TryInto; use async_std::task; -use serde_json::json; use in3::eth1::*; -use in3::json_rpc::Request; +use in3::json_rpc::{json::*, Request}; use in3::prelude::*; fn sign_tx_api() { @@ -40,17 +39,12 @@ fn sign_tx_api() { .client() .set_transport(Box::new(MockTransport { responses })); let mut abi = abi::In3EthAbi::new(); - let params = task::block_on(abi.encode( - "setData(uint256,string)", - serde_json::json!([123, "testdata"]), - )) - .expect("failed to ABI encode params"); + let params = task::block_on(abi.encode("setData(uint256,string)", json!([123, "testdata"]))) + .expect("failed to ABI encode params"); println!("{:?}", params); - let to: Address = - serde_json::from_str(r#""0x1234567890123456789012345678901234567890""#).unwrap(); // cannot fail - let from: Address = - serde_json::from_str(r#""0x3fEfF9E04aCD51062467C494b057923F771C9423""#).unwrap(); // cannot fail + let to: Address = from_str(r#""0x1234567890123456789012345678901234567890""#).unwrap(); // cannot fail + let from: Address = from_str(r#""0x3fEfF9E04aCD51062467C494b057923F771C9423""#).unwrap(); // cannot fail let txn = OutgoingTransaction { to, from, @@ -102,7 +96,7 @@ fn sign_tx_rpc() { method: "eth_sendTransaction", params: tx, }; - let req_str = serde_json::to_string(&rpc_req).unwrap(); // Serialize `Request` impl cannot fail + let req_str = to_string(&rpc_req).unwrap(); // Serialize `Request` impl cannot fail match task::block_on(c.rpc(&req_str)) { Ok(res) => println!("RESPONSE > {:?}, {:?}\n\n", req_str, res), Err(err) => println!("Failed with error: {:?}\n\n", err), diff --git a/rust/in3-rs/src/btc/api.rs b/rust/in3-rs/src/btc/api.rs index 5601dd41f..5284632a5 100644 --- a/rust/in3-rs/src/btc/api.rs +++ b/rust/in3-rs/src/btc/api.rs @@ -1,13 +1,11 @@ //! Bitcoin JSON RPC client API. use std::ffi::CString; -use serde_json::{json, Value}; - use crate::btc::{BlockHeader, BlockTransactionData, BlockTransactionIds, Transaction}; use crate::error::In3Result; use crate::eth1::Hash; use crate::in3::chain::{BTC, MULTICHAIN}; -use crate::json_rpc::{rpc, Request}; +use crate::json_rpc::{json::*, rpc, Request}; use crate::traits::{Api as ApiTrait, Client as ClientTrait}; use crate::types::Bytes; @@ -251,7 +249,7 @@ mod tests { ]"#, )], })); - let header = task::block_on(api.get_blockheader_bytes(serde_json::from_str::( + let header = task::block_on(api.get_blockheader_bytes(from_str::( r#""0x00000000000000000007171457f3352e101d92bca75f055c330fe33e84bb183b""#, )?))?; assert_eq!(header.0, FromHex::from_hex("00000020802cb8f913050c95fdeaffdf45605a17d09ba2d6121e06000000000000000000b66e299fce5925442281461266a189bd786db1013093cebaa84ab1666c75f5184959c55ef6971217a26a25ae").unwrap()); @@ -301,7 +299,7 @@ mod tests { }]"#, )], })); - let header = task::block_on(api.get_blockheader(serde_json::from_str::( + let header = task::block_on(api.get_blockheader(from_str::( r#""0x00000000000000000007171457f3352e101d92bca75f055c330fe33e84bb183b""#, )?))?; assert_eq!(header.confirmations, 1979); @@ -309,14 +307,14 @@ mod tests { assert_eq!(header.version, 536870912); assert_eq!( header.chainwork, - serde_json::from_str::( + from_str::( r#""0x00000000000000000000000000000000000000000f9f574f8d39680a92ad1bdc""# )? ); assert_eq!(header.n_tx, 2339); assert_eq!( header.next_hash, - serde_json::from_str::( + from_str::( r#""0x00000000000000000000eac6e799c468b3a140d9e1400c31f7603fdb20e1198d""# )? ); @@ -355,7 +353,7 @@ mod tests { }]"#, )], })); - let tx = task::block_on(api.get_transaction_bytes(serde_json::from_str::( + let tx = task::block_on(api.get_transaction_bytes(from_str::( r#""0x83ce5041679c75721ec7135e0ebeeae52636cfcb4844dbdccf86644df88da8c1""#, )?))?; assert_eq!(tx.0, FromHex::from_hex("01000000000101dccee3ce73ba66bc2d2602d647e1238a76d795cfb120f520ba64b0f085e2f694010000001716001430d71be06aa53fd845913f8613ed518d742d082affffffff02c0d8a7000000000017a914d129842dbe1ee73e69d14d54a8a62784877fb83e87108428030000000017a914e483fe5491d8ef5acf043fac5eb1af0f049a80318702473044022035c13c5fdf5f5d07c2101176db8a9c727cec9c31c612b15ae0a4cbdeb25b4dc2022046849e039477aa67fb60e24635668ae1de0bddb9ade3eac2d5ca350898d43c2b01210344715d54ec59240a4ae9f5d8e469f3933a7b03d5c09e15ac3ff53239ea1041b800000000").unwrap()); @@ -436,7 +434,7 @@ mod tests { }]"#, )], })); - let tx = task::block_on(api.get_transaction(serde_json::from_str::( + let tx = task::block_on(api.get_transaction(from_str::( r#""0x83ce5041679c75721ec7135e0ebeeae52636cfcb4844dbdccf86644df88da8c1""#, )?)) .expect("invalid tx"); @@ -450,13 +448,13 @@ mod tests { assert_eq!(tx.blocktime, 1589863750); assert_eq!( tx.txid, - serde_json::from_str::( + from_str::( r#""0x83ce5041679c75721ec7135e0ebeeae52636cfcb4844dbdccf86644df88da8c1""# )? ); assert_eq!( tx.hash, - serde_json::from_str::( + from_str::( r#""0x4041e8162e2c1a9711b15fd2a2b0c7aae59fbc06a95667682f1271fab0393f69""# )? ); diff --git a/rust/in3-rs/src/error.rs b/rust/in3-rs/src/error.rs index ae72cc72d..4f219c84d 100644 --- a/rust/in3-rs/src/error.rs +++ b/rust/in3-rs/src/error.rs @@ -1,8 +1,8 @@ //! Errors used throughout the library. +use crate::json_rpc::{json, Error as JsonRpcError}; use core::result; -use std::convert; - use in3_sys::in3_ret_t::*; +use std::convert; macro_rules! in3_error_def { ( $( $( #[$attr:meta] )* => $rust_variant:ident = $cs_variant:ident; )* ) => { @@ -83,11 +83,11 @@ pub enum Error { /// Errors originating in the C code InternalError(SysError), /// JSON parser errors - JsonError(serde_json::error::Error), + JsonError(json::error::Error), /// Base64 decoding errors Base64Error(base64::DecodeError), /// JSON RPC errors - JsonRpcError(crate::json_rpc::Error), + JsonRpcError(JsonRpcError), /// Custom error type for ease of use CustomError(String), } @@ -98,8 +98,8 @@ impl convert::From for Error { } } -impl convert::From for Error { - fn from(err: serde_json::error::Error) -> Self { +impl convert::From for Error { + fn from(err: json::error::Error) -> Self { Self::JsonError(err) } } diff --git a/rust/in3-rs/src/eth1/abi.rs b/rust/in3-rs/src/eth1/abi.rs index 00918a412..85c29d210 100644 --- a/rust/in3-rs/src/eth1/abi.rs +++ b/rust/in3-rs/src/eth1/abi.rs @@ -1,10 +1,8 @@ //! ABI encoder/decoder. -use serde_json::{json, Value}; - use async_trait::async_trait; +use crate::json_rpc::json::*; use crate::prelude::*; -use crate::types::Bytes; /// Trait definition for ABI encode. #[async_trait(? Send)] @@ -40,7 +38,7 @@ impl Encode for In3EthAbi { let resp_str = self .in3 .rpc( - serde_json::to_string(&json!({ + to_string(&json!({ "method": "in3_abiEncode", "params": [fn_sig, params] })) @@ -48,8 +46,8 @@ impl Encode for In3EthAbi { .as_str(), ) .await?; - let resp: Value = serde_json::from_str(resp_str.as_str())?; - let res: Bytes = serde_json::from_str(resp["result"].to_string().as_str())?; + let resp: Value = from_str(resp_str.as_str())?; + let res: Bytes = from_str(resp["result"].to_string().as_str())?; Ok(res) } } @@ -61,14 +59,12 @@ impl Decode for In3EthAbi { let resp_str = self .in3 .rpc( - serde_json::to_string( - &json!({"method": "in3_abiDecode", "params": [fn_sig, data]}), - ) - .unwrap() - .as_str(), + to_string(&json!({"method": "in3_abiDecode", "params": [fn_sig, data]})) + .unwrap() + .as_str(), ) .await?; - let resp: Value = serde_json::from_str(resp_str.as_str())?; + let resp: Value = from_str(resp_str.as_str())?; Ok(resp["result"].clone()) } } @@ -83,11 +79,10 @@ mod tests { #[test] fn test_abi_encode() { let mut encoder = In3EthAbi::new(); - let address: Address = - serde_json::from_str(r#""0x1234567890123456789012345678901234567890""#).unwrap(); + let address: Address = from_str(r#""0x1234567890123456789012345678901234567890""#).unwrap(); let params = task::block_on(encoder.encode("getBalance(address)", json!([address]))).unwrap(); - let expected: Bytes = serde_json::from_str( + let expected: Bytes = from_str( r#""0xf8b2cb4f0000000000000000000000001234567890123456789012345678901234567890""#, ) .unwrap(); diff --git a/rust/in3-rs/src/eth1/api.rs b/rust/in3-rs/src/eth1/api.rs index c16505aa4..6e8911614 100644 --- a/rust/in3-rs/src/eth1/api.rs +++ b/rust/in3-rs/src/eth1/api.rs @@ -3,10 +3,10 @@ use crate::error::*; use crate::eth1::*; use crate::in3::chain::{BTC, IPFS}; +use crate::json_rpc::json::*; use crate::json_rpc::{rpc, Request}; use crate::traits::{Api as ApiTrait, Client as ClientTrait}; use crate::types::*; -use serde_json::json; /// Primary interface for the Ethereum JSON RPC API. pub struct Api { @@ -157,7 +157,7 @@ impl Api { /// originate. /// * topics: (optional) Array of 32 Bytes DATA topics. Each topic can also be an array of /// DATA with "or" options. - pub async fn get_logs(&mut self, filter_options: serde_json::Value) -> In3Result> { + pub async fn get_logs(&mut self, filter_options: Value) -> In3Result> { rpc( self.client(), Request { @@ -180,7 +180,7 @@ impl Api { /// originate. /// * topics: (optional) Array of 32 Bytes DATA topics. Each topic can also be an array of /// DATA with "or" options. - pub async fn new_filter(&mut self, filter_options: serde_json::Value) -> In3Result { + pub async fn new_filter(&mut self, filter_options: Value) -> In3Result { rpc( self.client(), Request { @@ -585,8 +585,7 @@ mod tests { let transport: Box = Box::new(MockJsonTransport {}); let config = r#"{"autoUpdateList":false,"requestCount":1,"maxAttempts":1,"nodes":{"0x1":{"needsUpdate":false}}}}"#; let mut eth_api = init_api(transport, chain::MAINNET, config); - let address: Address = - serde_json::from_str(r#""0x36643F8D17FE745a69A2Fd22188921Fade60a98B""#).unwrap(); // cannot fail + let address: Address = from_str(r#""0x36643F8D17FE745a69A2Fd22188921Fade60a98B""#).unwrap(); // cannot fail let key: U256 = 0u64.into(); let storage: u64 = task::block_on(eth_api.get_storage_at(address, key, BlockNumber::Earliest))? @@ -602,8 +601,7 @@ mod tests { let transport: Box = Box::new(MockJsonTransport {}); let config = r#"{"autoUpdateList":false,"requestCount":1,"maxAttempts":1,"nodes":{"0x1":{"needsUpdate":false}}}}"#; let mut eth_api = init_api(transport, chain::MAINNET, config); - let address: Address = - serde_json::from_str(r#""0x36643F8D17FE745a69A2Fd22188921Fade60a98B""#)?; + let address: Address = from_str(r#""0x36643F8D17FE745a69A2Fd22188921Fade60a98B""#)?; let code: Bytes = task::block_on(eth_api.get_code(address, BlockNumber::Latest))? .try_into() .expect("cannot convert to bytes"); @@ -617,8 +615,7 @@ mod tests { let transport: Box = Box::new(MockJsonTransport {}); let config = r#"{"autoUpdateList":false,"requestCount":1,"maxAttempts":1,"nodes":{"0x1":{"needsUpdate":false}}}}"#; let mut eth_api = init_api(transport, chain::MAINNET, config); - let address: Address = - serde_json::from_str(r#""0xF99dbd3CFc292b11F74DeEa9fa730825Ee0b56f2""#)?; + let address: Address = from_str(r#""0xF99dbd3CFc292b11F74DeEa9fa730825Ee0b56f2""#)?; let balance: u64 = task::block_on(eth_api.get_balance(address, BlockNumber::Number((1555415).into())))? .try_into() @@ -661,9 +658,8 @@ mod tests { let config = r#"{"autoUpdateList":false,"requestCount":1,"maxAttempts":1,"nodes":{"0x1":{"needsUpdate":false}}}}"#; let mut eth_api = init_api(transport, chain::MAINNET, config); // eth_getBlockByHash - let hash: Hash = serde_json::from_str( - r#""0x1c9d592c4ad3fba02f7aa063e8048b3ff12551fd377e78061ab6ad146cc8df4d""#, - )?; + let hash: Hash = + from_str(r#""0x1c9d592c4ad3fba02f7aa063e8048b3ff12551fd377e78061ab6ad146cc8df4d""#)?; let block: Block = task::block_on(eth_api.get_block_by_hash(hash, false))?; println!("Block => {:?}", block); let expected: U256 = (1550244).into(); @@ -681,7 +677,7 @@ mod tests { let _ = client.configure(config); client.set_transport(transport); let mut eth_api = Api::new(client); - let logs: Vec = task::block_on(eth_api.get_logs(serde_json::json!({ + let logs: Vec = task::block_on(eth_api.get_logs(json!({ "fromBlock":"0x1ca181", })))?; assert!(logs.len() > 0); @@ -694,10 +690,10 @@ mod tests { let config = r#"{"autoUpdateList":false,"requestCount":1,"maxAttempts":1,"nodes":{"0x1":{"needsUpdate":false}}},"verification":"none"}"#; let mut eth_api = init_api(transport, chain::MAINNET, config); let contract: Address = - serde_json::from_str(r#""0x36643F8D17FE745a69A2Fd22188921Fade60a98B""#).unwrap(); // cannot fail + from_str(r#""0x36643F8D17FE745a69A2Fd22188921Fade60a98B""#).unwrap(); // cannot fail let mut abi = abi::In3EthAbi::new(); - let params = task::block_on(abi.encode("hasAccess():bool", serde_json::json!([]))) - .expect("ABI encode failed"); + let params = + task::block_on(abi.encode("hasAccess():bool", json!([]))).expect("ABI encode failed"); let txn = CallTransaction { to: Some(contract), data: Some(params), @@ -707,7 +703,7 @@ mod tests { .try_into() .expect("cannot convert to bytes"); let output = task::block_on(abi.decode("uint256", output)).expect("ABI decode failed"); - let access: U256 = serde_json::from_value(output).unwrap(); // cannot fail if decode succeeded + let access: U256 = from_value(output).unwrap(); // cannot fail if decode succeeded println!("{:?}", access); let expected: U256 = (1).into(); assert_eq!(access, expected); @@ -731,9 +727,8 @@ mod tests { let transport: Box = Box::new(MockJsonTransport {}); let config = r#"{"autoUpdateList":false,"requestCount":1,"maxAttempts":1,"nodes":{"0x1":{"needsUpdate":false}}}}"#; let mut eth_api = init_api(transport, chain::MAINNET, config); - let hash: Hash = serde_json::from_str( - r#""0x1c9d592c4ad3fba02f7aa063e8048b3ff12551fd377e78061ab6ad146cc8df4d""#, - )?; + let hash: Hash = + from_str(r#""0x1c9d592c4ad3fba02f7aa063e8048b3ff12551fd377e78061ab6ad146cc8df4d""#)?; let ret: u64 = task::block_on(eth_api.get_block_transaction_count_by_hash(hash))? .try_into() .expect("cannot convert to u64"); @@ -760,10 +755,10 @@ mod tests { let config = r#"{"autoUpdateList":false,"requestCount":1,"maxAttempts":1,"nodes":{"0x1":{"needsUpdate":false}}}}"#; let mut eth_api = init_api(transport, chain::MAINNET, config); let contract: Address = - serde_json::from_str(r#""0x36643F8D17FE745a69A2Fd22188921Fade60a98B""#).unwrap(); // cannot fail + from_str(r#""0x36643F8D17FE745a69A2Fd22188921Fade60a98B""#).unwrap(); // cannot fail let mut abi = abi::In3EthAbi::new(); - let params = task::block_on(abi.encode("hasAccess():bool", serde_json::json!([]))) - .expect("ABI encode failed"); + let params = + task::block_on(abi.encode("hasAccess():bool", json!([]))).expect("ABI encode failed"); let txn = CallTransaction { to: Some(contract), data: Some(params), @@ -781,9 +776,8 @@ mod tests { let transport: Box = Box::new(MockJsonTransport {}); let config = r#"{"autoUpdateList":false,"requestCount":1,"maxAttempts":1,"nodes":{"0x1":{"needsUpdate":false}}}}"#; let mut eth_api = init_api(transport, chain::MAINNET, config); - let hash: Hash = serde_json::from_str( - r#""0x9241334b0b568ef6cd44d80e37a0ce14de05557a3cfa98b5fd1d006204caf164""#, - )?; + let hash: Hash = + from_str(r#""0x9241334b0b568ef6cd44d80e37a0ce14de05557a3cfa98b5fd1d006204caf164""#)?; let tx: Transaction = task::block_on(eth_api.get_transaction_by_hash(hash))?; let nonce = tx.nonce; let blk_number = tx @@ -801,9 +795,8 @@ mod tests { let transport: Box = Box::new(MockJsonTransport {}); let config = r#"{"autoUpdateList":false,"requestCount":1,"maxAttempts":1,"nodes":{"0x1":{"needsUpdate":false}}}}"#; let mut eth_api = init_api(transport, chain::MAINNET, config); - let hash: Hash = serde_json::from_str( - r#""0xbaf52e8d5e9c7ece67b1c3a0788379a4f486d8ec50bbf531b3a6720ca03fe1c4""#, - )?; + let hash: Hash = + from_str(r#""0xbaf52e8d5e9c7ece67b1c3a0788379a4f486d8ec50bbf531b3a6720ca03fe1c4""#)?; let tx: Transaction = task::block_on(eth_api.get_transaction_by_block_hash_and_index(hash, (0).into()))?; let nonce = tx.nonce; @@ -843,8 +836,7 @@ mod tests { let transport: Box = Box::new(MockJsonTransport {}); let config = r#"{"autoUpdateList":false,"requestCount":1,"maxAttempts":1,"nodes":{"0x1":{"needsUpdate":false}}}}"#; let mut eth_api = init_api(transport, chain::MAINNET, config); - let address: Address = - serde_json::from_str(r#""0x0de496ae79194d5f5b18eb66987b504a0feb32f2""#)?; + let address: Address = from_str(r#""0x0de496ae79194d5f5b18eb66987b504a0feb32f2""#)?; let tx_count: u64 = task::block_on(eth_api.get_transaction_count(address, BlockNumber::Latest))? .try_into() @@ -889,10 +881,8 @@ mod tests { ))); client.set_transport(transport); let mut eth_api = Api::new(client); - let to: Address = - serde_json::from_str(r#""0x930e62afa9ceb9889c2177c858dc28810cedbf5d""#).unwrap(); // cannot fail - let from: Address = - serde_json::from_str(r#""0x25e10479a1AD17B895C45364a7D971e815F8867D""#).unwrap(); // cannot fail + let to: Address = from_str(r#""0x930e62afa9ceb9889c2177c858dc28810cedbf5d""#).unwrap(); // cannot fail + let from: Address = from_str(r#""0x25e10479a1AD17B895C45364a7D971e815F8867D""#).unwrap(); // cannot fail let data = "00"; let rawbytes: Bytes = FromHex::from_hex(&data).unwrap().into(); // cannot fail @@ -908,10 +898,9 @@ mod tests { let hash: Hash = task::block_on(eth_api.send_transaction(txn)).expect("ETH send transaction failed"); - let expected_hash: Hash = serde_json::from_str( - r#""0xee051f86d1a55c58d8e828ac9e1fb60ecd7cd78de0e5e8b4061d5a4d6d51ae2a""#, - ) - .unwrap(); // cannot fail + let expected_hash: Hash = + from_str(r#""0xee051f86d1a55c58d8e828ac9e1fb60ecd7cd78de0e5e8b4061d5a4d6d51ae2a""#) + .unwrap(); // cannot fail println!("Hash => {:?}", hash); assert_eq!(hash.to_string(), expected_hash.to_string()); Ok(()) @@ -925,7 +914,7 @@ mod tests { let _ = client.configure(config); client.set_transport(transport); let mut eth_api = Api::new(client); - let jopts = serde_json::json!({ + let jopts = json!({ "fromBlock":"0x1ca181" }); let fid = task::block_on(eth_api.new_filter(jopts))?; @@ -942,7 +931,7 @@ mod tests { let _ = client.configure(config); client.set_transport(transport); let mut eth_api = Api::new(client); - let jopts = serde_json::json!({ + let jopts = json!({ "fromBlock":"0x1ca181" }); let fid = task::block_on(eth_api.new_filter(jopts))?; @@ -978,9 +967,8 @@ mod tests { let config = r#"{"autoUpdateList":false,"requestCount":1,"maxAttempts":1,"nodes":{"0x1":{"needsUpdate":false}}}}"#; let mut eth_api = init_api(transport, chain::MAINNET, config); - let hash: Hash = serde_json::from_str( - r#""0x685b2226cbf6e1f890211010aa192bf16f0a0cba9534264a033b023d7367b845""#, - )?; + let hash: Hash = + from_str(r#""0x685b2226cbf6e1f890211010aa192bf16f0a0cba9534264a033b023d7367b845""#)?; let count: u64 = task::block_on(eth_api.get_uncle_count_by_block_hash(hash))? .try_into() .expect("cannot convert to u64"); diff --git a/rust/in3-rs/src/in3.rs b/rust/in3-rs/src/in3.rs index 35b184d1d..02364712a 100644 --- a/rust/in3-rs/src/in3.rs +++ b/rust/in3-rs/src/in3.rs @@ -10,6 +10,7 @@ use rustc_hex::FromHex; use async_trait::async_trait; use crate::error::{Error, In3Result, SysError}; +use crate::json_rpc::json::*; use crate::traits::{Client as ClientTrait, Signer, Storage, Transport}; use crate::transport::HttpTransport; use crate::types::Bytes; @@ -119,8 +120,7 @@ impl Ctx { let slice = CStr::from_ptr(item_) .to_str() .expect("result is not valid UTF-8"); - let request: serde_json::Value = - serde_json::from_str(slice).expect("result not valid JSON"); + let request: Value = from_str(slice).expect("result not valid JSON"); let data_str = &request["params"][0].as_str().expect("params[0] not string"); let data_hex = data_str[2..] .from_hex() diff --git a/rust/in3-rs/src/ipfs.rs b/rust/in3-rs/src/ipfs.rs index 324a82c34..1731e0430 100644 --- a/rust/in3-rs/src/ipfs.rs +++ b/rust/in3-rs/src/ipfs.rs @@ -1,6 +1,6 @@ //! IPFS JSON RPC client API. +use crate::json_rpc::json::*; use base64::{decode, encode, DecodeError}; -use serde_json::json; use crate::error::{Error, In3Result}; use crate::in3::chain::{IPFS, MULTICHAIN}; diff --git a/rust/in3-rs/src/json_rpc.rs b/rust/in3-rs/src/json_rpc.rs index e3062b275..fc9951ceb 100644 --- a/rust/in3-rs/src/json_rpc.rs +++ b/rust/in3-rs/src/json_rpc.rs @@ -2,10 +2,14 @@ use std::convert; use serde::{Deserialize, Serialize}; -use serde_json::Value; use crate::error; use crate::traits::Client; +use json::*; + +pub mod json { + pub use serde_json::{error, from_reader, from_str, from_value, json, to_string, Value}; +} /// JSON RPC request. #[derive(Serialize)] @@ -46,9 +50,9 @@ impl Response { if let Some(ref res) = self.result { Ok(res) } else if let Some(ref err) = self.error { - Err(Error::ErrorResponse(serde_json::to_string(err).unwrap()).into()) + Err(Error::ErrorResponse(to_string(err).unwrap()).into()) } else { - Err(Error::InvalidResponse(serde_json::to_string(self).unwrap()).into()) + Err(Error::InvalidResponse(to_string(self).unwrap()).into()) } } } @@ -63,32 +67,28 @@ pub async fn rpc(client: &mut Box, request: Request<'_>) -> error where T: serde::de::DeserializeOwned, { - let req_str = serde_json::to_string(&request)?; + let req_str = to_string(&request)?; let resp_str = client.rpc(req_str.as_str()).await?; //Check for array in or object in the response. - let resp_: Vec = match serde_json::from_str(resp_str.as_str()) { + let resp_: Vec = match from_str(resp_str.as_str()) { Result::Ok(val) => val, Result::Err(_) => { let response = Response { - result: Some(serde_json::Value::Null), - error: Some(serde_json::Value::Null), + result: Some(Value::Null), + error: Some(Value::Null), }; vec![response] } }; //Check array is valid and try once again - if resp_[0].result == Some(serde_json::Value::Null) { + if resp_[0].result == Some(Value::Null) { let resp_single: Response = - serde_json::from_str(resp_str.as_str()).expect("response is not valid JSON-RPC result"); - return Ok(serde_json::from_str( - resp_single.to_result()?.to_string().as_str(), - )?); + from_str(resp_str.as_str()).expect("response is not valid JSON-RPC result"); + return Ok(from_str(resp_single.to_result()?.to_string().as_str())?); } else { let resp = resp_.first().expect("empty response"); - return Ok(serde_json::from_str( - resp.to_result()?.to_string().as_str(), - )?); + return Ok(from_str(resp.to_result()?.to_string().as_str())?); } } diff --git a/rust/in3-rs/src/signer.rs b/rust/in3-rs/src/signer.rs index 70ecbb505..a76e16934 100644 --- a/rust/in3-rs/src/signer.rs +++ b/rust/in3-rs/src/signer.rs @@ -1,10 +1,9 @@ //! Signer trait implementations. -use serde_json::{json, Value}; - use async_trait::async_trait; use crate::error::{In3Result, SysError}; use crate::in3::{chain, Client}; +use crate::json_rpc::json::*; use crate::traits::{Client as ClientTrait, Signer}; use crate::types::Bytes; @@ -47,7 +46,7 @@ impl Signer for In3Signer { let resp_str = self .in3 .rpc( - serde_json::to_string(&json!({ + to_string(&json!({ "method": "in3_prepareTx", "params": [msg] })) @@ -55,8 +54,8 @@ impl Signer for In3Signer { .as_str(), ) .await?; - let resp: Value = serde_json::from_str(resp_str.as_str())?; - let res: Bytes = serde_json::from_str(resp["result"].to_string().as_str())?; + let resp: Value = from_str(resp_str.as_str())?; + let res: Bytes = from_str(resp["result"].to_string().as_str())?; Ok(res) } } diff --git a/rust/in3-rs/src/transport.rs b/rust/in3-rs/src/transport.rs index 7b4edcc60..89d2c5499 100644 --- a/rust/in3-rs/src/transport.rs +++ b/rust/in3-rs/src/transport.rs @@ -8,6 +8,7 @@ use std::path::{Path, PathBuf}; use async_trait::async_trait; +use crate::json_rpc::json::*; use crate::logging::LOGGER; use crate::traits::Transport; @@ -37,13 +38,10 @@ impl MockJsonTransport { /// Read file from path /// /// Return serde:json Value or Error if file not found - pub fn read_file>( - &mut self, - path: P, - ) -> Result> { + pub fn read_file>(&mut self, path: P) -> Result> { let file = File::open(path)?; let reader = BufReader::new(file); - let u = serde_json::from_reader(reader)?; + let u = from_reader(reader)?; Ok(u) } @@ -105,7 +103,7 @@ impl Transport for MockJsonTransport { /// /// Read responses from json async fn fetch(&mut self, request_: &str, _uris: &[&str]) -> Vec> { - let request: serde_json::Value = serde_json::from_str(request_).unwrap(); + let request: Value = from_str(request_).unwrap(); let method_ = request[0]["method"].as_str(); let response = self.read_json(String::from(method_.unwrap())); vec![Ok(response.to_string())] @@ -139,7 +137,7 @@ impl Transport for MockTransport<'_> { /// Otherwise, returns an error string. async fn fetch(&mut self, request: &str, _uris: &[&str]) -> Vec> { let response = self.responses.pop(); - let request: serde_json::Value = serde_json::from_str(request).unwrap(); + let request: Value = from_str(request).unwrap(); unsafe { LOGGER.trace(&format!("{:?} ->\n {:?}\n", request, response)); } @@ -217,9 +215,9 @@ mod tests { //Make use of static string literals conversion for mock transport. let method = String::from("eth_getTransactionCount"); let response = transport.read_json(method).to_string(); - let resp: Vec = serde_json::from_str(&response)?; + let resp: Vec = from_str(&response)?; let result = resp.first().unwrap(); - let json_str = serde_json::from_str::(result.to_result()?.to_string().as_str())?; + let json_str = from_str::(result.to_result()?.to_string().as_str())?; println!("{:?}", json_str); Ok(()) } @@ -230,7 +228,7 @@ mod tests { //Make use of static string literals conversion for mock transport. let method = String::from("eth_getBlockByHash"); let response = transport.read_json(method).to_string(); - let resp: Vec = serde_json::from_str(&response)?; + let resp: Vec = from_str(&response)?; let result = resp.first().unwrap(); let parsed = result.to_result()?; println!("{:?}", parsed["number"]); From 820f2a81a177e63b9698ddf3112597fe173bc7e5 Mon Sep 17 00:00:00 2001 From: leonardocardoso Date: Tue, 7 Jul 2020 09:35:20 +0200 Subject: [PATCH 10/37] Freed pointer on cache --- dotnet/In3/Context/Context.cs | 4 ++++ dotnet/In3/Native/AsyncRequestHandler.cs | 1 + dotnet/In3/Native/RegistrableStorageHandler.cs | 5 +++-- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/dotnet/In3/Context/Context.cs b/dotnet/In3/Context/Context.cs index fb9a03533..796c9f3c1 100644 --- a/dotnet/In3/Context/Context.cs +++ b/dotnet/In3/Context/Context.cs @@ -94,6 +94,7 @@ public string GetResponse() { IntPtr rspPtr = ctx_get_response_data(_nativeCtx); string msg = Marshal.PtrToStringUTF8(rspPtr); + // This needs to be freed since it is a copy of the response context. Native.Utils._free_(rspPtr); return msg; } @@ -140,6 +141,8 @@ public void ReportError(string errorMessage) { IntPtr rpcPtr = Marshal.StringToHGlobalAnsi(errorMessage); ctx_set_error_intern(_nativeCtx, rpcPtr, (int)In3Code.IN3_ERPC); + // This needs to be freed since our pointer is copied into the context by the function and needs to be freed this way else it will lead to Heap Corruption and its platform independent. + Marshal.FreeHGlobal(rpcPtr); } /// @@ -150,6 +153,7 @@ public string GetErrorMessage() { IntPtr msgPtr = ctx_get_error_rpc(_nativeCtx, 0); string msg = Marshal.PtrToStringUTF8(msgPtr); + // This needs to be freed since it is a copy of the error context. Native.Utils._free_(msgPtr); return msg; } diff --git a/dotnet/In3/Native/AsyncRequestHandler.cs b/dotnet/In3/Native/AsyncRequestHandler.cs index 236e0927e..22d342b62 100644 --- a/dotnet/In3/Native/AsyncRequestHandler.cs +++ b/dotnet/In3/Native/AsyncRequestHandler.cs @@ -29,6 +29,7 @@ public async Task Handle(IntPtr ctx) try { string result = await NativeClient.Client.Transport.Handle(urls[i], payload); + // This is freed here (by the declartive marshall) and it works because internally this is an sb_add which copies the string (same with error). in3_req_add_response(reqPtr, i, false, result, result.Length); } catch (Exception ex) diff --git a/dotnet/In3/Native/RegistrableStorageHandler.cs b/dotnet/In3/Native/RegistrableStorageHandler.cs index b9833921e..53811cf8d 100644 --- a/dotnet/In3/Native/RegistrableStorageHandler.cs +++ b/dotnet/In3/Native/RegistrableStorageHandler.cs @@ -45,8 +45,8 @@ private IntPtr GetItem(IntPtr ignored, string key) { byte[] result = Wrapper.Client.Storage.GetItem(key); if (result == null) return IntPtr.Zero; - IntPtr unmanagedPointer = Marshal.AllocHGlobal(result.Length); - Marshal.Copy(result, 0, unmanagedPointer, result.Length); + // This needs to be release on c-side so its needs to be created there as well to prevent heap corruption. + IntPtr unmanagedPointer = b_new(result, (uint) result.Length); return unmanagedPointer; } @@ -60,6 +60,7 @@ private bool Clear(IntPtr ignored) return Wrapper.Client.Storage.Clear(); } + [DllImport("libin3", CharSet = CharSet.Ansi)] private static extern IntPtr b_new([MarshalAs(UnmanagedType.LPArray)] byte[] content, uint len); [DllImport("libin3", CharSet = CharSet.Ansi)] private static extern IntPtr in3_set_storage_handler(IntPtr c, in3_storage_get_item get_item, in3_storage_set_item set_item, in3_storage_clear clear, IntPtr cptr); } } \ No newline at end of file From 97955e99886d55eee89ede928e53be7aa48922df Mon Sep 17 00:00:00 2001 From: Simon Jentzsch Date: Tue, 7 Jul 2020 18:41:38 +0200 Subject: [PATCH 11/37] fix python-deploy --- c/ci-deploy.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/c/ci-deploy.yml b/c/ci-deploy.yml index ffc13cfb1..474c27ce3 100644 --- a/c/ci-deploy.yml +++ b/c/ci-deploy.yml @@ -97,7 +97,7 @@ release_mac_and_wasm: - cp -r ../wasm_build/module wasm/release-wasm - cp -r ../asmjs_build/module wasm/release-asmjs - cp ../java_build/lib/in3.jar lib/in3.jar - - cp ../python_multilib/in3/libin3/shared/* python/in3/libin3/shared/ + - cp -r ../python_multilib/in3/libin3/shared python/in3/libin3/ - cd .. - tar -zcv --exclude=*cmake* -f in3_${CI_COMMIT_TAG}_mac.tar.gz in3-mac-wasm/ - IPFS_RESPONSE=$(curl -X POST https://api.pinata.cloud/pinning/pinFileToIPFS -H 'Content-Type:multipart/form-data' -H 'pinata_api_key:'"$PINATA_API_KEY" -H 'pinata_secret_api_key:'"$PINATA_SECRET_API_KEY" -F file=@in3_${CI_COMMIT_TAG}_mac.tar.gz -F 'pinataMetadata={"name":"in3_'${CI_COMMIT_TAG}'_mac.tar.gz","keyValues":{"version":"${CI_COMMIT_TAG}"}}' -F 'pinataOptions={"cidVersion":0}') @@ -137,7 +137,7 @@ release_x64: - cp -r ../wasm_build/module wasm/release-wasm - cp -r ../asmjs_build/module wasm/release-asmjs - cp ../java_build/lib/in3.jar lib/in3.jar - - cp ../python_multilib/in3/libin3/shared/* python/in3/libin3/shared/ + - cp -r ../python_multilib/in3/libin3/shared python/in3/libin3/ - cd .. - tar -zcv --exclude=*cmake* -f in3_${CI_COMMIT_TAG}_x64.tar.gz in3-x64/ - IPFS_RESPONSE=$(curl -X POST https://api.pinata.cloud/pinning/pinFileToIPFS -H 'Content-Type:multipart/form-data' -H 'pinata_api_key:'"$PINATA_API_KEY" -H 'pinata_secret_api_key:'"$PINATA_SECRET_API_KEY" -F file=@in3_${CI_COMMIT_TAG}_x64.tar.gz -F 'pinataMetadata={"name":"in3_'${CI_COMMIT_TAG}'_mac.tar.gz","keyValues":{"version":"${CI_COMMIT_TAG}"}}' -F 'pinataOptions={"cidVersion":0}') @@ -174,7 +174,7 @@ release_x86: - cp -r ../wasm_build/module wasm/release-wasm - cp -r ../asmjs_build/module wasm/release-asmjs - cp ../java_build/lib/in3.jar lib/in3.jar - - cp ../python_multilib/in3/libin3/shared/* python/in3/libin3/shared/ + - cp -r ../python_multilib/in3/libin3/shared python/in3/libin3/ - cd .. - tar -zcv --exclude=*cmake* -f in3_${CI_COMMIT_TAG}_x86.tar.gz in3-x86/ - IPFS_RESPONSE=$(curl -X POST https://api.pinata.cloud/pinning/pinFileToIPFS -H 'Content-Type:multipart/form-data' -H 'pinata_api_key:'"$PINATA_API_KEY" -H 'pinata_secret_api_key:'"$PINATA_SECRET_API_KEY" -F file=@in3_${CI_COMMIT_TAG}_x86.tar.gz -F 'pinataMetadata={"name":"in3_'${CI_COMMIT_TAG}'_x86.tar.gz","keyValues":{"version":"${CI_COMMIT_TAG}"}}' -F 'pinataOptions={"cidVersion":0}') @@ -211,7 +211,7 @@ release_arm7: - cp -r ../wasm_build/module wasm/release-wasm - cp -r ../asmjs_build/module wasm/release-asmjs - cp ../java_build/lib/in3.jar lib/in3.jar - - cp ../python_multilib/in3/libin3/shared/* python/in3/libin3/shared/ + - cp -r ../python_multilib/in3/libin3/shared python/in3/libin3/ - cd .. - tar -zcv --exclude=*cmake* -f in3_${CI_COMMIT_TAG}_arm7.tar.gz in3-arm7/ - IPFS_RESPONSE=$(curl -X POST https://api.pinata.cloud/pinning/pinFileToIPFS -H 'Content-Type:multipart/form-data' -H 'pinata_api_key:'"$PINATA_API_KEY" -H 'pinata_secret_api_key:'"$PINATA_SECRET_API_KEY" -F file=@in3_${CI_COMMIT_TAG}_arm7.tar.gz -F 'pinataMetadata={"name":"in3_'${CI_COMMIT_TAG}'_arm7.tar.gz","keyValues":{"version":"${CI_COMMIT_TAG}"}}' -F 'pinataOptions={"cidVersion":0}') @@ -252,7 +252,7 @@ release_win: - cp -r ../wasm_build/module wasm/release-wasm - cp -r ../asmjs_build/module wasm/release-asmjs - cp ../java_build/lib/in3.jar lib/in3.jar - - cp ../python_multilib/in3/libin3/shared/* python/in3/libin3/shared/ + - cp -r ../python_multilib/in3/libin3/shared python/in3/libin3/ - cd .. - tar -zcv --exclude=*cmake* -f in3_${CI_COMMIT_TAG}_windows.tar.gz in3-win/ - IPFS_RESPONSE=$(curl -X POST https://api.pinata.cloud/pinning/pinFileToIPFS -H 'Content-Type:multipart/form-data' -H 'pinata_api_key:'"$PINATA_API_KEY" -H 'pinata_secret_api_key:'"$PINATA_SECRET_API_KEY" -F file=@in3_${CI_COMMIT_TAG}_windows.tar.gz -F 'pinataMetadata={"name":"in3_'${CI_COMMIT_TAG}'_windows.tar.gz","keyValues":{"version":"${CI_COMMIT_TAG}"}}' -F 'pinataOptions={"cidVersion":0}') From 0b3628e81f290069ce0f097042315e5dc2c9f275 Mon Sep 17 00:00:00 2001 From: Simon Jentzsch Date: Wed, 8 Jul 2020 00:38:36 +0200 Subject: [PATCH 12/37] clean up --- c/src/core/client/execute.c | 269 ++++++++++++++++------------ c/src/verifier/eth1/evm/code.c | 3 + c/src/verifier/eth1/full/eth_full.c | 6 + wasm/src/in3.js | 26 +-- 4 files changed, 181 insertions(+), 123 deletions(-) diff --git a/c/src/core/client/execute.c b/c/src/core/client/execute.c index 34f0ec2c9..43049f458 100644 --- a/c/src/core/client/execute.c +++ b/c/src/core/client/execute.c @@ -344,143 +344,189 @@ static void check_autoupdate(const in3_ctx_t* ctx, in3_chain_t* chain, d_token_t static inline bool is_blacklisted(const node_match_t* node_weight) { return node_weight && node_weight->weight == NULL; } -static bool is_user_error(d_token_t* error) { - char* err_msg = d_type(error) == T_STRING ? d_string(error) : d_get_stringk(error, K_MESSAGE); +static bool is_user_error(d_token_t* error, char** err_msg) { + *err_msg = d_type(error) == T_STRING ? d_string(error) : d_get_stringk(error, K_MESSAGE); // here we need to find a better way to detect user errors // currently we assume a error-message starting with 'Error:' is a server error and not a user error. - return err_msg && strncmp(err_msg, "Error:", 6) != 0; + return *err_msg && strncmp(*err_msg, "Error:", 6) && strncmp(*err_msg, "TypeError:", 10); +} + +static in3_ret_t handle_error_response(in3_ctx_t* ctx, node_match_t* node, in3_response_t* response) { + if (is_blacklisted(node)) return IN3_ERPC; // already handled + if (node) blacklist_node(node); // we block this node + ctx_set_error(ctx, response->data.len ? response->data.data : "no response from node", IN3_ERPC); // and copy the error to the ctx + if (response->data.data) { // free up memory + // clean up invalid data + _free(response->data.data); + response->data.data = NULL; + response->data.allocted = 0; + response->data.len = 0; + } + return IN3_ERPC; } -static in3_ret_t find_valid_result(in3_ctx_t* ctx, int nodes_count, in3_response_t* response, in3_chain_t* chain, in3_verifier_t* verifier) { - node_match_t* node = ctx->nodes; +static void clean_up_ctx(in3_ctx_t* ctx, node_match_t* node) { + if (ctx->verification_state != IN3_OK && ctx->verification_state != IN3_WAITING) ctx->verification_state = IN3_WAITING; + if (ctx->error) _free(ctx->error); + if (ctx->responses) _free(ctx->responses); + if (ctx->response_context) json_free(ctx->response_context); + ctx->error = NULL; + if (node && node->weight) node->weight->blacklisted_until = 0; // we reset the blacklisted, because if the response was correct, no need to blacklist, otherwise we will set the blacklisted_until anyway +} - // find the verifier - in3_vctx_t vc; - vc.ctx = ctx; - vc.chain = chain; - bool still_pending = false; +static in3_ret_t handle_payment(in3_ctx_t* ctx, node_match_t* node, int index) { +#ifdef PAY + // we update the payment info from the in3-section + if (ctx->client->pay && ctx->client->pay->follow_up) { + in3_ret_t res = ctx->client->pay->follow_up(ctx, node, vc.proof, d_get(ctx->responses[index], K_ERROR), ctx->client->pay->cptr); + if (res == IN3_WAITING && ctx->attempt < ctx->client->max_attempts - 1) { + int nodes_count = ctx_nodes_len(ctx->node); + // this means we need to retry with the same node + ctx->attempt++; + for (int i = 0; i < nodes_count; i++) { + if (ctx->raw_response[i].data.data) + _free(ctx->raw_response[i].data.data); + } + _free(ctx->raw_response); + _free(ctx->responses); + json_free(ctx->response_context); - // blacklist nodes for missing response - for (int n = 0; n < nodes_count; n++, node = node ? node->next : NULL) { + ctx->raw_response = NULL; + ctx->response_context = NULL; + ctx->responses = NULL; + return res; - // if the response is still pending, we skip... - if (response[n].state == IN3_WAITING) { - still_pending = true; - continue; - } + } else if (res) + return ctx_set_error(ctx, "Error following up the payment data", res); + } +#else + UNUSED_VAR(ctx); + UNUSED_VAR(node); + UNUSED_VAR(index); +#endif + return IN3_OK; +} + +static in3_ret_t verify_response(in3_ctx_t* ctx, in3_chain_t* chain, in3_verifier_t* verifier, node_match_t* node, in3_response_t* response) { + in3_ret_t res = IN3_OK; - // handle times - if (node && node->weight && ctx->raw_response && ctx->raw_response[n].time) { - node->weight->response_count++; - node->weight->total_response_time += ctx->raw_response[n].time; - ctx->raw_response[n].time = 0; // make sure we count the time only once + if (response->state || !response->data.len) // reponse has an error + return handle_error_response(ctx, node, response); + + // we need to clean up the previos responses if set + clean_up_ctx(ctx, node); + + // parse + if (ctx_parse_response(ctx, response->data.data, response->data.len)) { // in case of an error we get a error-code and error is set in the ctx? + if (node) blacklist_node(node); // so we need to block the node. + return ctx->verification_state; + } + + // check each request + for (uint_fast16_t i = 0; i < ctx->len; i++) { + + // find the verifier + in3_vctx_t vc; + vc.ctx = ctx; + vc.chain = chain; + vc.request = ctx->requests[i]; + vc.result = d_get(ctx->responses[i], K_RESULT); + vc.client = ctx->client; + + if ((vc.proof = d_get(ctx->responses[i], K_IN3))) { // vc.proof is temporary set to the in3-section. It will be updated to real proof in the next lines. + if ((res = handle_payment(ctx, node, i))) return res; + vc.last_validator_change = d_get_longk(vc.proof, K_LAST_VALIDATOR_CHANGE); + vc.currentBlock = d_get_longk(vc.proof, K_CURRENT_BLOCK); + vc.proof = d_get(vc.proof, K_PROOF); } - // since nodes_count was detected before, this should not happen! - if (response[n].state) { - if (is_blacklisted(node)) + // no result? + if (!vc.result && ctx->attempt < ctx->client->max_attempts - 1) { + char* err_msg; + // if we don't have a result, the node reported an error + if (is_user_error(d_get(ctx->responses[i], K_ERROR), &err_msg)) { + node->weight = NULL; // we mark it as blacklisted, but not blacklist it in the nodelist, since it was not the nodes fault. + in3_log_debug("we have a user-error from %s, so we reject the response, but don't blacklist ..\n", node ? node->node->url : "intern"); continue; - else if (node) + } else { + in3_log_debug("we have a system-error from %s, so we block it ..\n", node ? node->node->url : "intern"); blacklist_node(node); - ctx_set_error(ctx, response[n].data.len ? response[n].data.data : "no response from node", IN3_ERPC); - if (response[n].data.data) { - // clean up invalid data - _free(response[n].data.data); - response[n].data.data = NULL; - response[n].data.allocted = 0; - response[n].data.len = 0; + return ctx_set_error(ctx, err_msg ? err_msg : "Invalid response", IN3_EINVAL); } - } else { - // we need to clean up the previos responses if set - if (ctx->error) _free(ctx->error); - if (ctx->responses) _free(ctx->responses); - if (ctx->response_context) json_free(ctx->response_context); - ctx->error = NULL; - - if (node && node->weight) node->weight->blacklisted_until = 0; // we reset the blacklisted, because if the response was correct, no need to blacklist, otherwise we will set the blacklisted_until anyway - in3_ret_t res = ctx_parse_response(ctx, response[n].data.data, response[n].data.len); // parse the result - if (res < 0) { - if (node) blacklist_node(node); - } else { - // check each request - for (uint_fast16_t i = 0; i < ctx->len; i++) { - vc.request = ctx->requests[i]; - vc.result = d_get(ctx->responses[i], K_RESULT); - vc.client = ctx->client; - - if ((vc.proof = d_get(ctx->responses[i], K_IN3))) { - // vc.proof is temporary set to the in3-section. It will be updated to real proof in the next lines. -#ifdef PAY - // we update the payment info from the in3-section - if (ctx->client->pay && ctx->client->pay->follow_up) { - res = ctx->client->pay->follow_up(ctx, node, vc.proof, d_get(ctx->responses[i], K_ERROR), ctx->client->pay->cptr); - if (res == IN3_WAITING && ctx->attempt < ctx->client->max_attempts - 1) { - // this means we need to retry with the same node - ctx->attempt++; - for (int i = 0; i < nodes_count; i++) { - _free(ctx->raw_response[i].error.data); - _free(ctx->raw_response[i].result.data); - } - _free(ctx->raw_response); - _free(ctx->responses); - json_free(ctx->response_context); - - ctx->raw_response = NULL; - ctx->response_context = NULL; - ctx->responses = NULL; - return res; - - } else if (res) - return ctx_set_error(ctx, "Error following up the payment data", (ctx->verification_state = res)); - } -#endif - vc.last_validator_change = d_get_longk(vc.proof, K_LAST_VALIDATOR_CHANGE); - vc.currentBlock = d_get_longk(vc.proof, K_CURRENT_BLOCK); - vc.proof = d_get(vc.proof, K_PROOF); - } + } - if (!vc.result && ctx->attempt < ctx->client->max_attempts - 1) { - // if we don't have a result, the node reported an error - // since we don't know if this error is our fault or the server fault,we don't blacklist the node, but retry - ctx->verification_state = IN3_ERPC; - if (is_user_error(d_get(ctx->responses[i], K_ERROR))) - node->weight = NULL; // we mark it as blacklisted, but not blacklist it in the nodelist, since it was not the nodes fault. - else - blacklist_node(node); - break; - } else if (verifier) { - res = ctx->verification_state = verifier->verify(&vc); - if (res == IN3_WAITING) - return res; - else if (res < 0) { - blacklist_node(node); - break; - } - } else - // no verifier - nothing to verify - ctx->verification_state = IN3_OK; - } + // we have a verifier? + if (verifier) { + res = ctx->verification_state = verifier->verify(&vc); + if (res == IN3_WAITING) + return res; + if (res) { + blacklist_node(node); + return res; } } + } - // check auto update opts only if this node wasn't blacklisted (due to wrong result/proof) - if (!is_blacklisted(node) && ctx->responses && d_get(ctx->responses[0], K_IN3) && !d_get(ctx->responses[0], K_ERROR)) - check_autoupdate(ctx, chain, d_get(ctx->responses[0], K_IN3), node); + // all is ok + return (ctx->verification_state = IN3_OK); +} - // !node_weight is valid, because it means this is a internaly handled response - if (!node || !is_blacklisted(node)) - return IN3_OK; // this reponse was successfully verified, so let us keep it. +static void handle_times(node_match_t* node, in3_response_t* response) { + if (node && node->weight && response && response->time) { + node->weight->response_count++; + node->weight->total_response_time += response->time; + response->time = 0; // make sure we count the time only once } +} + +static in3_ret_t find_valid_result(in3_ctx_t* ctx, int nodes_count, in3_response_t* response, in3_chain_t* chain, in3_verifier_t* verifier) { + node_match_t* node = ctx->nodes; + bool still_pending = false; + in3_ret_t state = IN3_ERPC; + + // blacklist nodes for missing response + for (int n = 0; n < nodes_count; n++, node = node ? node->next : NULL) { + + // if the response is still pending, we skip... + if (response[n].state == IN3_WAITING) { + still_pending = true; + in3_log_debug("request from node %s is still pending ..\n", node ? node->node->url : "intern"); + continue; + } + + handle_times(node, response + n); + + state = verify_response(ctx, chain, verifier, node, response + n); + if (state == IN3_OK) { + in3_log_debug("accepted response from %s\n", node ? node->node->url : "intern"); + break; + } else if (state == IN3_WAITING) + return state; + // in case of an error, we keep on trying.... + } + // no valid response found, // if pending, we remove the error and wait - if (still_pending) { + if (state && still_pending) { + in3_log_debug("failed to verify, but waiting for pending\n"); if (ctx->error) _free(ctx->error); + if (ctx->responses) _free(ctx->responses); + if (ctx->response_context) json_free(ctx->response_context); ctx->error = NULL; ctx->verification_state = IN3_WAITING; + ctx->response_context = NULL; + ctx->responses = NULL; return IN3_WAITING; } - return IN3_EINVAL; + // if the last state is an error we report this as failed + if (state) return state; + + // check auto update opts only if this node wasn't blacklisted (due to wrong result/proof) + if (!is_blacklisted(node) && ctx->responses && d_get(ctx->responses[0], K_IN3) && !d_get(ctx->responses[0], K_ERROR)) + check_autoupdate(ctx, chain, d_get(ctx->responses[0], K_IN3), node); + + return IN3_OK; } NONULL static char* convert_to_http_url(char* src_url) { @@ -835,6 +881,7 @@ in3_ctx_state_t in3_ctx_exec_state(in3_ctx_t* ctx) { in3_ret_t in3_ctx_execute(in3_ctx_t* ctx) { in3_ret_t ret; + // if there is an error it does not make sense to execute. if (ctx->error) return (ctx->verification_state && ctx->verification_state != IN3_WAITING) ? ctx->verification_state : IN3_EUNKNOWN; @@ -852,6 +899,8 @@ in3_ret_t in3_ctx_execute(in3_ctx_t* ctx) { return ctx_set_error(ctx, ctx->required->error ? ctx->required->error : "error handling subrequest", ret); } + in3_log_debug("ctx_execute %s ... attempt = %i\n", d_get_stringk(ctx->requests[0], K_METHOD), ctx->error, ctx->attempt); + switch (ctx->type) { case CT_RPC: { diff --git a/c/src/verifier/eth1/evm/code.c b/c/src/verifier/eth1/evm/code.c index 7718a98ed..4c0180fe4 100644 --- a/c/src/verifier/eth1/evm/code.c +++ b/c/src/verifier/eth1/evm/code.c @@ -34,6 +34,7 @@ #include "../../../core/client/keys.h" #include "../../../core/client/verifier.h" +#include "../../../core/util/log.h" #include "../../../core/util/mem.h" #include #include @@ -152,6 +153,8 @@ in3_ret_t in3_get_code(in3_vctx_t* vc, address_t address, cache_entry_t** target if (vc->ctx->client->cache) code = vc->ctx->client->cache->get_item(vc->ctx->client->cache->cptr, key_str); + in3_log_debug("try to get the code for %s from cache: %p\n", key_str, code); + if (code) must_free = 1; else { diff --git a/c/src/verifier/eth1/full/eth_full.c b/c/src/verifier/eth1/full/eth_full.c index ff77fbd9c..19dfe8d63 100644 --- a/c/src/verifier/eth1/full/eth_full.c +++ b/c/src/verifier/eth1/full/eth_full.c @@ -105,7 +105,13 @@ int in3_verify_eth_full(in3_vctx_t* vc) { case 0: if (!result) return vc_err(vc, "no result"); res = b_cmp(d_bytes(vc->result), result); + b_free(result); + if (!res) { + in3_log_debug("mismatching result\n"); + b_print(result); + b_print(d_bytes(vc->result)); + } return res ? 0 : vc_err(vc, "The result does not match the proven result"); case IN3_WAITING: return IN3_WAITING; diff --git a/wasm/src/in3.js b/wasm/src/in3.js index 0529114a2..69a4eebf0 100644 --- a/wasm/src/in3.js +++ b/wasm/src/in3.js @@ -309,25 +309,25 @@ function url_queue(req) { const promises = [], responses = [] if (req.in3.config.debug) console.log("send req (" + req.ctx + ") to " + req.urls.join() + ' : ', JSON.stringify(req.payload, null, 2)) req.urls.forEach((url, i) => in3w.transport(url, JSON.stringify(req.payload), req.timeout || 30000).then( - response => { - if (req.in3.config.debug) console.log("res (" + req.ctx + "," + url + ") : " + JSON.stringify(JSON.parse(response), null, 2)) - responses.push({ i, url, response }); - trigger() - }, - error => { - if (req.in3.config.debug) console.error("res err (" + req.ctx + "," + url + ") : " + error) - responses.push({ i, url, error }); - trigger() - } + response => { responses.push({ i, url, response }); trigger() }, + error => { responses.push({ i, url, error }); trigger() } )) function trigger() { while (promises.length && responses.length) { const p = promises.shift(), r = responses.shift() if (!req.cleanUp) { - if (r.error) + if (r.error) { + if (req.in3.config.debug) console.error("res err (" + req.ctx + "," + r.url + ") : " + r.error) setResponse(req.ctx, r.error.message || r.error, r.i, true) - else - setResponse(req.ctx, r.response, r.i, false) + } + else { + try { + if (req.in3.config.debug) console.log("res (" + req.ctx + "," + r.url + ") : " + JSON.stringify(JSON.parse(r.response), null, 2)) + setResponse(req.ctx, r.response, r.i, false) + } catch (x) { + setResponse(req.ctx, r.error.message || r.error, r.i, true) + } + } } p.resolve(r) } From d534e47bd5b3bf64b604e3f373beaf134478adc2 Mon Sep 17 00:00:00 2001 From: Simon Jentzsch Date: Wed, 8 Jul 2020 05:58:52 +0200 Subject: [PATCH 13/37] fixed test --- c/test/unit_tests/test_request.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/c/test/unit_tests/test_request.c b/c/test/unit_tests/test_request.c index 637eba486..15e9a1be7 100644 --- a/c/test/unit_tests/test_request.c +++ b/c/test/unit_tests/test_request.c @@ -191,7 +191,7 @@ static void test_retry_response() { TEST_ASSERT_NOT_NULL(ctx->nodes->next->weight); // second node is not blacklisted TEST_ASSERT_NOT_NULL(ctx->raw_response); // we still keep the raw response - in3_ctx_add_response(req->ctx, 1, false, "{\"error\":\"no internet\"}", -1); + in3_ctx_add_response(req->ctx, 1, false, "{\"error\":\"Error:no internet\"}", -1); TEST_ASSERT_EQUAL(IN3_WAITING, in3_ctx_execute(ctx)); TEST_ASSERT_NULL(ctx->raw_response); From 5c95babb2f4606d46227f1b6abd4dc94652733b0 Mon Sep 17 00:00:00 2001 From: Simon Jentzsch Date: Wed, 8 Jul 2020 07:43:23 +0200 Subject: [PATCH 14/37] only get storage from the same address --- c/src/verifier/eth1/evm/accounts.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/c/src/verifier/eth1/evm/accounts.c b/c/src/verifier/eth1/evm/accounts.c index f1c00535a..f3a21200a 100644 --- a/c/src/verifier/eth1/evm/accounts.c +++ b/c/src/verifier/eth1/evm/accounts.c @@ -147,7 +147,8 @@ storage_t* evm_get_storage(evm_t* evm, address_t adr, uint8_t* s_key, wlen_t s_k } } - // get storage value from env + // get storage value only if this is the same account + if (memcmp(evm->address, adr, 20)) return NULL; int l = evm->env(evm, EVM_ENV_STORAGE, s_key, s_key_len, &data, 0, 0); // if it does not exist and we have a value, we set it From 53d7e2900128b4d384b6f17956ff07554bab0606 Mon Sep 17 00:00:00 2001 From: Simon Jentzsch Date: Wed, 8 Jul 2020 08:00:58 +0200 Subject: [PATCH 15/37] report errors for missing valiues --- c/src/verifier/eth1/evm/env.c | 27 ++++++++++++++++++++------- c/src/verifier/eth1/full/eth_full.c | 1 + c/test/runner.c | 5 +++-- 3 files changed, 24 insertions(+), 9 deletions(-) diff --git a/c/src/verifier/eth1/evm/env.c b/c/src/verifier/eth1/evm/env.c index 28ee63efe..61d66c856 100644 --- a/c/src/verifier/eth1/evm/env.c +++ b/c/src/verifier/eth1/evm/env.c @@ -53,6 +53,19 @@ static d_token_t* get_account(in3_vctx_t* vc, d_token_t* accounts, uint8_t* addr vc_err(vc, "The account could not be found!"); return NULL; } +#ifdef LOGGING +#define INVALID(msg) \ + { \ + vc_err(vc, msg); \ + return EVM_ERROR_INVALID_ENV; \ + } +#else +#define INVALID(msg) \ + { \ + vc_err(vc, "E"); \ + return EVM_ERROR_INVALID_ENV; \ + } +#endif int in3_get_env(void* evm_ptr, uint16_t evm_key, uint8_t* in_data, int in_len, uint8_t** out_data, int offset, int len) { bytes_t* res = NULL; @@ -69,40 +82,40 @@ int in3_get_env(void* evm_ptr, uint16_t evm_key, uint8_t* in_data, int in_len, u switch (evm_key) { case EVM_ENV_BLOCKHEADER: if (!(res = d_get_bytesk(vc->proof, K_BLOCK))) - return EVM_ERROR_INVALID_ENV; + INVALID("no blockheader found") *out_data = res->data; return res->len; case EVM_ENV_BALANCE: if (!(t = get_account(vc, d_get(vc->proof, K_ACCOUNTS), in_data)) || !(t = d_get(t, K_BALANCE))) - return EVM_ERROR_INVALID_ENV; + INVALID("account not found in proof") bytes_t b1 = d_to_bytes(t); *out_data = b1.data; return b1.len; case EVM_ENV_NONCE: if (!(t = get_account(vc, d_get(vc->proof, K_ACCOUNTS), in_data)) || !(t = d_get(t, K_NONCE))) - return EVM_ERROR_INVALID_ENV; + INVALID("account not found in proof") bytes_t b2 = d_to_bytes(t); *out_data = b2.data; return b2.len; case EVM_ENV_STORAGE: if (!(t = get_account(vc, d_get(vc->proof, K_ACCOUNTS), evm->address)) || !(t = d_get(t, K_STORAGE_PROOF))) - return EVM_ERROR_INVALID_ENV; + INVALID("account not found in proof") for (i = 0, t2 = t + 1; i < d_len(t); i++, t2 = d_next(t2)) { bytes_t k = d_to_bytes(d_get(t2, K_KEY)); - if (!k.data) return EVM_ERROR_INVALID_ENV; + if (!k.data) INVALID("no data on storage") if (big_cmp(in_data, in_len, k.data, k.len) == 0) { k = d_to_bytes(d_get(t2, K_VALUE)); - if (!k.data) return EVM_ERROR_INVALID_ENV; + if (!k.data) INVALID("no data on storage") *out_data = k.data; return k.len; } } - return EVM_ERROR_INVALID_ENV; + INVALID("storage not found in proof"); case EVM_ENV_BLOCKHASH: return EVM_ERROR_UNSUPPORTED_CALL_OPCODE; diff --git a/c/src/verifier/eth1/full/eth_full.c b/c/src/verifier/eth1/full/eth_full.c index 19dfe8d63..4a8fe9056 100644 --- a/c/src/verifier/eth1/full/eth_full.c +++ b/c/src/verifier/eth1/full/eth_full.c @@ -112,6 +112,7 @@ int in3_verify_eth_full(in3_vctx_t* vc) { b_print(result); b_print(d_bytes(vc->result)); } + if (vc->ctx->error) return IN3_EINVAL; return res ? 0 : vc_err(vc, "The result does not match the proven result"); case IN3_WAITING: return IN3_WAITING; diff --git a/c/test/runner.c b/c/test/runner.c index 437ec6945..2370dfbb6 100644 --- a/c/test/runner.c +++ b/c/test/runner.c @@ -466,9 +466,10 @@ int main(int argc, char* argv[]) { for (i = 1; i < argc; i++) { if (strcmp(argv[i], "-t") == 0) testIndex = atoi(argv[++i]); - else if (strcmp(argv[i], "-d") == 0) + else if (strcmp(argv[i], "-d") == 0) { in3_log_set_level(LOG_TRACE); - else if (strcmp(argv[i], "-m") == 0) + in3_log_set_quiet(false); + } else if (strcmp(argv[i], "-m") == 0) membrk = atoi(argv[++i]); else { char** t = malloc((size + 1) * sizeof(char*)); From 4ded1cac3d38139504f3c7a024bbdcd731f93ddf Mon Sep 17 00:00:00 2001 From: Simon Jentzsch Date: Wed, 8 Jul 2020 09:58:04 +0200 Subject: [PATCH 16/37] fix tests --- c/src/verifier/eth1/full/eth_full.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/c/src/verifier/eth1/full/eth_full.c b/c/src/verifier/eth1/full/eth_full.c index 4a8fe9056..b81973feb 100644 --- a/c/src/verifier/eth1/full/eth_full.c +++ b/c/src/verifier/eth1/full/eth_full.c @@ -109,8 +109,8 @@ int in3_verify_eth_full(in3_vctx_t* vc) { b_free(result); if (!res) { in3_log_debug("mismatching result\n"); - b_print(result); - b_print(d_bytes(vc->result)); + // b_print(result); + // b_print(d_bytes(vc->result)); } if (vc->ctx->error) return IN3_EINVAL; return res ? 0 : vc_err(vc, "The result does not match the proven result"); From b68b2f7e083176b4a8059d4fbaa09b202a9aab4e Mon Sep 17 00:00:00 2001 From: leonardocardoso Date: Tue, 7 Jul 2020 15:28:31 +0200 Subject: [PATCH 17/37] Reestructure dotnet examples --- .../CallSmartContractFunction.sln | 34 +++++++++ .../CallSmartContractFunction.csproj | 2 +- .../Program.cs | 0 .../ConnectToEthereum/ConnectToEthereum.sln | 34 +++++++++ .../ConnectToEthereum.csproj | 2 +- .../{ => ConnectToEthereum}/Program.cs | 0 dotnet/Examples/EnsResolver/EnsResolver.sln | 34 +++++++++ .../{ => EnsResolver}/EnsResolver.csproj | 2 +- .../EnsResolver/{ => EnsResolver}/Program.cs | 0 dotnet/Examples/Example.sln | 76 ------------------- dotnet/Examples/Ipfs/Ipfs.sln | 34 +++++++++ dotnet/Examples/Ipfs/Ipfs/Ipfs.csproj | 12 +++ dotnet/Examples/Ipfs/Ipfs/Program.cs | 27 +++++++ dotnet/Examples/Logs/Logs.sln | 34 +++++++++ dotnet/Examples/Logs/Logs/Logs.csproj | 12 +++ dotnet/Examples/Logs/Logs/Program.cs | 42 ++++++++++ .../SendTransaction/SendTransaction.sln | 34 +++++++++ .../{ => SendTransaction}/Program.cs | 0 .../SendTransaction.csproj | 2 +- 19 files changed, 301 insertions(+), 80 deletions(-) create mode 100644 dotnet/Examples/CallSmartContractFunction/CallSmartContractFunction.sln rename dotnet/Examples/CallSmartContractFunction/{ => CallSmartContractFunction}/CallSmartContractFunction.csproj (77%) rename dotnet/Examples/CallSmartContractFunction/{ => CallSmartContractFunction}/Program.cs (100%) create mode 100644 dotnet/Examples/ConnectToEthereum/ConnectToEthereum.sln rename dotnet/Examples/ConnectToEthereum/{ => ConnectToEthereum}/ConnectToEthereum.csproj (73%) rename dotnet/Examples/ConnectToEthereum/{ => ConnectToEthereum}/Program.cs (100%) create mode 100644 dotnet/Examples/EnsResolver/EnsResolver.sln rename dotnet/Examples/EnsResolver/{ => EnsResolver}/EnsResolver.csproj (77%) rename dotnet/Examples/EnsResolver/{ => EnsResolver}/Program.cs (100%) delete mode 100644 dotnet/Examples/Example.sln create mode 100644 dotnet/Examples/Ipfs/Ipfs.sln create mode 100644 dotnet/Examples/Ipfs/Ipfs/Ipfs.csproj create mode 100644 dotnet/Examples/Ipfs/Ipfs/Program.cs create mode 100644 dotnet/Examples/Logs/Logs.sln create mode 100644 dotnet/Examples/Logs/Logs/Logs.csproj create mode 100644 dotnet/Examples/Logs/Logs/Program.cs create mode 100644 dotnet/Examples/SendTransaction/SendTransaction.sln rename dotnet/Examples/SendTransaction/{ => SendTransaction}/Program.cs (100%) rename dotnet/Examples/SendTransaction/{ => SendTransaction}/SendTransaction.csproj (77%) diff --git a/dotnet/Examples/CallSmartContractFunction/CallSmartContractFunction.sln b/dotnet/Examples/CallSmartContractFunction/CallSmartContractFunction.sln new file mode 100644 index 000000000..708fbb03a --- /dev/null +++ b/dotnet/Examples/CallSmartContractFunction/CallSmartContractFunction.sln @@ -0,0 +1,34 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.26124.0 +MinimumVisualStudioVersion = 15.0.26124.0 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CallSmartContractFunction", "CallSmartContractFunction\CallSmartContractFunction.csproj", "{D7FB636D-CE77-48F3-82A3-65116987E90C}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {D7FB636D-CE77-48F3-82A3-65116987E90C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D7FB636D-CE77-48F3-82A3-65116987E90C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D7FB636D-CE77-48F3-82A3-65116987E90C}.Debug|x64.ActiveCfg = Debug|Any CPU + {D7FB636D-CE77-48F3-82A3-65116987E90C}.Debug|x64.Build.0 = Debug|Any CPU + {D7FB636D-CE77-48F3-82A3-65116987E90C}.Debug|x86.ActiveCfg = Debug|Any CPU + {D7FB636D-CE77-48F3-82A3-65116987E90C}.Debug|x86.Build.0 = Debug|Any CPU + {D7FB636D-CE77-48F3-82A3-65116987E90C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D7FB636D-CE77-48F3-82A3-65116987E90C}.Release|Any CPU.Build.0 = Release|Any CPU + {D7FB636D-CE77-48F3-82A3-65116987E90C}.Release|x64.ActiveCfg = Release|Any CPU + {D7FB636D-CE77-48F3-82A3-65116987E90C}.Release|x64.Build.0 = Release|Any CPU + {D7FB636D-CE77-48F3-82A3-65116987E90C}.Release|x86.ActiveCfg = Release|Any CPU + {D7FB636D-CE77-48F3-82A3-65116987E90C}.Release|x86.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal diff --git a/dotnet/Examples/CallSmartContractFunction/CallSmartContractFunction.csproj b/dotnet/Examples/CallSmartContractFunction/CallSmartContractFunction/CallSmartContractFunction.csproj similarity index 77% rename from dotnet/Examples/CallSmartContractFunction/CallSmartContractFunction.csproj rename to dotnet/Examples/CallSmartContractFunction/CallSmartContractFunction/CallSmartContractFunction.csproj index 48fe68da7..90671bd72 100644 --- a/dotnet/Examples/CallSmartContractFunction/CallSmartContractFunction.csproj +++ b/dotnet/Examples/CallSmartContractFunction/CallSmartContractFunction/CallSmartContractFunction.csproj @@ -6,7 +6,7 @@ - + diff --git a/dotnet/Examples/CallSmartContractFunction/Program.cs b/dotnet/Examples/CallSmartContractFunction/CallSmartContractFunction/Program.cs similarity index 100% rename from dotnet/Examples/CallSmartContractFunction/Program.cs rename to dotnet/Examples/CallSmartContractFunction/CallSmartContractFunction/Program.cs diff --git a/dotnet/Examples/ConnectToEthereum/ConnectToEthereum.sln b/dotnet/Examples/ConnectToEthereum/ConnectToEthereum.sln new file mode 100644 index 000000000..e466f405c --- /dev/null +++ b/dotnet/Examples/ConnectToEthereum/ConnectToEthereum.sln @@ -0,0 +1,34 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.26124.0 +MinimumVisualStudioVersion = 15.0.26124.0 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConnectToEthereum", "ConnectToEthereum\ConnectToEthereum.csproj", "{86243A65-ADD2-486D-AF6D-8E3204BAFD08}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {86243A65-ADD2-486D-AF6D-8E3204BAFD08}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {86243A65-ADD2-486D-AF6D-8E3204BAFD08}.Debug|Any CPU.Build.0 = Debug|Any CPU + {86243A65-ADD2-486D-AF6D-8E3204BAFD08}.Debug|x64.ActiveCfg = Debug|Any CPU + {86243A65-ADD2-486D-AF6D-8E3204BAFD08}.Debug|x64.Build.0 = Debug|Any CPU + {86243A65-ADD2-486D-AF6D-8E3204BAFD08}.Debug|x86.ActiveCfg = Debug|Any CPU + {86243A65-ADD2-486D-AF6D-8E3204BAFD08}.Debug|x86.Build.0 = Debug|Any CPU + {86243A65-ADD2-486D-AF6D-8E3204BAFD08}.Release|Any CPU.ActiveCfg = Release|Any CPU + {86243A65-ADD2-486D-AF6D-8E3204BAFD08}.Release|Any CPU.Build.0 = Release|Any CPU + {86243A65-ADD2-486D-AF6D-8E3204BAFD08}.Release|x64.ActiveCfg = Release|Any CPU + {86243A65-ADD2-486D-AF6D-8E3204BAFD08}.Release|x64.Build.0 = Release|Any CPU + {86243A65-ADD2-486D-AF6D-8E3204BAFD08}.Release|x86.ActiveCfg = Release|Any CPU + {86243A65-ADD2-486D-AF6D-8E3204BAFD08}.Release|x86.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal diff --git a/dotnet/Examples/ConnectToEthereum/ConnectToEthereum.csproj b/dotnet/Examples/ConnectToEthereum/ConnectToEthereum/ConnectToEthereum.csproj similarity index 73% rename from dotnet/Examples/ConnectToEthereum/ConnectToEthereum.csproj rename to dotnet/Examples/ConnectToEthereum/ConnectToEthereum/ConnectToEthereum.csproj index 93fe13955..4e5def3e7 100644 --- a/dotnet/Examples/ConnectToEthereum/ConnectToEthereum.csproj +++ b/dotnet/Examples/ConnectToEthereum/ConnectToEthereum/ConnectToEthereum.csproj @@ -6,7 +6,7 @@ - + diff --git a/dotnet/Examples/ConnectToEthereum/Program.cs b/dotnet/Examples/ConnectToEthereum/ConnectToEthereum/Program.cs similarity index 100% rename from dotnet/Examples/ConnectToEthereum/Program.cs rename to dotnet/Examples/ConnectToEthereum/ConnectToEthereum/Program.cs diff --git a/dotnet/Examples/EnsResolver/EnsResolver.sln b/dotnet/Examples/EnsResolver/EnsResolver.sln new file mode 100644 index 000000000..866b9cd38 --- /dev/null +++ b/dotnet/Examples/EnsResolver/EnsResolver.sln @@ -0,0 +1,34 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.26124.0 +MinimumVisualStudioVersion = 15.0.26124.0 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EnsResolver", "EnsResolver\EnsResolver.csproj", "{CE33DA49-8F77-4E0F-BF05-D584BBD878F4}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {CE33DA49-8F77-4E0F-BF05-D584BBD878F4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CE33DA49-8F77-4E0F-BF05-D584BBD878F4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CE33DA49-8F77-4E0F-BF05-D584BBD878F4}.Debug|x64.ActiveCfg = Debug|Any CPU + {CE33DA49-8F77-4E0F-BF05-D584BBD878F4}.Debug|x64.Build.0 = Debug|Any CPU + {CE33DA49-8F77-4E0F-BF05-D584BBD878F4}.Debug|x86.ActiveCfg = Debug|Any CPU + {CE33DA49-8F77-4E0F-BF05-D584BBD878F4}.Debug|x86.Build.0 = Debug|Any CPU + {CE33DA49-8F77-4E0F-BF05-D584BBD878F4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CE33DA49-8F77-4E0F-BF05-D584BBD878F4}.Release|Any CPU.Build.0 = Release|Any CPU + {CE33DA49-8F77-4E0F-BF05-D584BBD878F4}.Release|x64.ActiveCfg = Release|Any CPU + {CE33DA49-8F77-4E0F-BF05-D584BBD878F4}.Release|x64.Build.0 = Release|Any CPU + {CE33DA49-8F77-4E0F-BF05-D584BBD878F4}.Release|x86.ActiveCfg = Release|Any CPU + {CE33DA49-8F77-4E0F-BF05-D584BBD878F4}.Release|x86.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal diff --git a/dotnet/Examples/EnsResolver/EnsResolver.csproj b/dotnet/Examples/EnsResolver/EnsResolver/EnsResolver.csproj similarity index 77% rename from dotnet/Examples/EnsResolver/EnsResolver.csproj rename to dotnet/Examples/EnsResolver/EnsResolver/EnsResolver.csproj index 02dee2b61..3171b2a8b 100644 --- a/dotnet/Examples/EnsResolver/EnsResolver.csproj +++ b/dotnet/Examples/EnsResolver/EnsResolver/EnsResolver.csproj @@ -6,7 +6,7 @@ - + diff --git a/dotnet/Examples/EnsResolver/Program.cs b/dotnet/Examples/EnsResolver/EnsResolver/Program.cs similarity index 100% rename from dotnet/Examples/EnsResolver/Program.cs rename to dotnet/Examples/EnsResolver/EnsResolver/Program.cs diff --git a/dotnet/Examples/Example.sln b/dotnet/Examples/Example.sln deleted file mode 100644 index 1aa234eaf..000000000 --- a/dotnet/Examples/Example.sln +++ /dev/null @@ -1,76 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26124.0 -MinimumVisualStudioVersion = 15.0.26124.0 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConnectToEthereum", "ConnectToEthereum\ConnectToEthereum.csproj", "{882DFE29-3AA0-4A5F-A0FF-5D8F25069DF3}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CallSmartContractFunction", "CallSmartContractFunction\CallSmartContractFunction.csproj", "{3C3B30AA-711C-4B2B-9FE6-A1D4EB5DF602}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SendTransaction", "SendTransaction\SendTransaction.csproj", "{0B2C774B-4E9E-42B6-8959-F9A7857EB81E}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EnsResolver", "EnsResolver\EnsResolver.csproj", "{53190342-94F8-4082-BC48-B42449501A96}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {882DFE29-3AA0-4A5F-A0FF-5D8F25069DF3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {882DFE29-3AA0-4A5F-A0FF-5D8F25069DF3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {882DFE29-3AA0-4A5F-A0FF-5D8F25069DF3}.Debug|x64.ActiveCfg = Debug|Any CPU - {882DFE29-3AA0-4A5F-A0FF-5D8F25069DF3}.Debug|x64.Build.0 = Debug|Any CPU - {882DFE29-3AA0-4A5F-A0FF-5D8F25069DF3}.Debug|x86.ActiveCfg = Debug|Any CPU - {882DFE29-3AA0-4A5F-A0FF-5D8F25069DF3}.Debug|x86.Build.0 = Debug|Any CPU - {882DFE29-3AA0-4A5F-A0FF-5D8F25069DF3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {882DFE29-3AA0-4A5F-A0FF-5D8F25069DF3}.Release|Any CPU.Build.0 = Release|Any CPU - {882DFE29-3AA0-4A5F-A0FF-5D8F25069DF3}.Release|x64.ActiveCfg = Release|Any CPU - {882DFE29-3AA0-4A5F-A0FF-5D8F25069DF3}.Release|x64.Build.0 = Release|Any CPU - {882DFE29-3AA0-4A5F-A0FF-5D8F25069DF3}.Release|x86.ActiveCfg = Release|Any CPU - {882DFE29-3AA0-4A5F-A0FF-5D8F25069DF3}.Release|x86.Build.0 = Release|Any CPU - {3C3B30AA-711C-4B2B-9FE6-A1D4EB5DF602}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3C3B30AA-711C-4B2B-9FE6-A1D4EB5DF602}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3C3B30AA-711C-4B2B-9FE6-A1D4EB5DF602}.Debug|x64.ActiveCfg = Debug|Any CPU - {3C3B30AA-711C-4B2B-9FE6-A1D4EB5DF602}.Debug|x64.Build.0 = Debug|Any CPU - {3C3B30AA-711C-4B2B-9FE6-A1D4EB5DF602}.Debug|x86.ActiveCfg = Debug|Any CPU - {3C3B30AA-711C-4B2B-9FE6-A1D4EB5DF602}.Debug|x86.Build.0 = Debug|Any CPU - {3C3B30AA-711C-4B2B-9FE6-A1D4EB5DF602}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3C3B30AA-711C-4B2B-9FE6-A1D4EB5DF602}.Release|Any CPU.Build.0 = Release|Any CPU - {3C3B30AA-711C-4B2B-9FE6-A1D4EB5DF602}.Release|x64.ActiveCfg = Release|Any CPU - {3C3B30AA-711C-4B2B-9FE6-A1D4EB5DF602}.Release|x64.Build.0 = Release|Any CPU - {3C3B30AA-711C-4B2B-9FE6-A1D4EB5DF602}.Release|x86.ActiveCfg = Release|Any CPU - {3C3B30AA-711C-4B2B-9FE6-A1D4EB5DF602}.Release|x86.Build.0 = Release|Any CPU - {0B2C774B-4E9E-42B6-8959-F9A7857EB81E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0B2C774B-4E9E-42B6-8959-F9A7857EB81E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0B2C774B-4E9E-42B6-8959-F9A7857EB81E}.Debug|x64.ActiveCfg = Debug|Any CPU - {0B2C774B-4E9E-42B6-8959-F9A7857EB81E}.Debug|x64.Build.0 = Debug|Any CPU - {0B2C774B-4E9E-42B6-8959-F9A7857EB81E}.Debug|x86.ActiveCfg = Debug|Any CPU - {0B2C774B-4E9E-42B6-8959-F9A7857EB81E}.Debug|x86.Build.0 = Debug|Any CPU - {0B2C774B-4E9E-42B6-8959-F9A7857EB81E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0B2C774B-4E9E-42B6-8959-F9A7857EB81E}.Release|Any CPU.Build.0 = Release|Any CPU - {0B2C774B-4E9E-42B6-8959-F9A7857EB81E}.Release|x64.ActiveCfg = Release|Any CPU - {0B2C774B-4E9E-42B6-8959-F9A7857EB81E}.Release|x64.Build.0 = Release|Any CPU - {0B2C774B-4E9E-42B6-8959-F9A7857EB81E}.Release|x86.ActiveCfg = Release|Any CPU - {0B2C774B-4E9E-42B6-8959-F9A7857EB81E}.Release|x86.Build.0 = Release|Any CPU - {53190342-94F8-4082-BC48-B42449501A96}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {53190342-94F8-4082-BC48-B42449501A96}.Debug|Any CPU.Build.0 = Debug|Any CPU - {53190342-94F8-4082-BC48-B42449501A96}.Debug|x64.ActiveCfg = Debug|Any CPU - {53190342-94F8-4082-BC48-B42449501A96}.Debug|x64.Build.0 = Debug|Any CPU - {53190342-94F8-4082-BC48-B42449501A96}.Debug|x86.ActiveCfg = Debug|Any CPU - {53190342-94F8-4082-BC48-B42449501A96}.Debug|x86.Build.0 = Debug|Any CPU - {53190342-94F8-4082-BC48-B42449501A96}.Release|Any CPU.ActiveCfg = Release|Any CPU - {53190342-94F8-4082-BC48-B42449501A96}.Release|Any CPU.Build.0 = Release|Any CPU - {53190342-94F8-4082-BC48-B42449501A96}.Release|x64.ActiveCfg = Release|Any CPU - {53190342-94F8-4082-BC48-B42449501A96}.Release|x64.Build.0 = Release|Any CPU - {53190342-94F8-4082-BC48-B42449501A96}.Release|x86.ActiveCfg = Release|Any CPU - {53190342-94F8-4082-BC48-B42449501A96}.Release|x86.Build.0 = Release|Any CPU - EndGlobalSection -EndGlobal diff --git a/dotnet/Examples/Ipfs/Ipfs.sln b/dotnet/Examples/Ipfs/Ipfs.sln new file mode 100644 index 000000000..4db41a8af --- /dev/null +++ b/dotnet/Examples/Ipfs/Ipfs.sln @@ -0,0 +1,34 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.26124.0 +MinimumVisualStudioVersion = 15.0.26124.0 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ipfs", "Ipfs\Ipfs.csproj", "{22157DE9-00F2-4404-B270-FA7CB3EB016D}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {22157DE9-00F2-4404-B270-FA7CB3EB016D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {22157DE9-00F2-4404-B270-FA7CB3EB016D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {22157DE9-00F2-4404-B270-FA7CB3EB016D}.Debug|x64.ActiveCfg = Debug|Any CPU + {22157DE9-00F2-4404-B270-FA7CB3EB016D}.Debug|x64.Build.0 = Debug|Any CPU + {22157DE9-00F2-4404-B270-FA7CB3EB016D}.Debug|x86.ActiveCfg = Debug|Any CPU + {22157DE9-00F2-4404-B270-FA7CB3EB016D}.Debug|x86.Build.0 = Debug|Any CPU + {22157DE9-00F2-4404-B270-FA7CB3EB016D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {22157DE9-00F2-4404-B270-FA7CB3EB016D}.Release|Any CPU.Build.0 = Release|Any CPU + {22157DE9-00F2-4404-B270-FA7CB3EB016D}.Release|x64.ActiveCfg = Release|Any CPU + {22157DE9-00F2-4404-B270-FA7CB3EB016D}.Release|x64.Build.0 = Release|Any CPU + {22157DE9-00F2-4404-B270-FA7CB3EB016D}.Release|x86.ActiveCfg = Release|Any CPU + {22157DE9-00F2-4404-B270-FA7CB3EB016D}.Release|x86.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal diff --git a/dotnet/Examples/Ipfs/Ipfs/Ipfs.csproj b/dotnet/Examples/Ipfs/Ipfs/Ipfs.csproj new file mode 100644 index 000000000..4e5def3e7 --- /dev/null +++ b/dotnet/Examples/Ipfs/Ipfs/Ipfs.csproj @@ -0,0 +1,12 @@ + + + + Exe + netcoreapp3.1 + + + + + + + diff --git a/dotnet/Examples/Ipfs/Ipfs/Program.cs b/dotnet/Examples/Ipfs/Ipfs/Program.cs new file mode 100644 index 000000000..569aea8ed --- /dev/null +++ b/dotnet/Examples/Ipfs/Ipfs/Program.cs @@ -0,0 +1,27 @@ +using System; +using System.Text; +using System.Threading.Tasks; +using In3; + +namespace Ipfs +{ + class Program + { + static async Task Main() + { + // Content to be stored + string toStore = "LOREM_IPSUM"; + + // Connect to ipfs. + IN3 ipfsClient = IN3.ForChain(Chain.Ipfs); + + // Store the hash since it will be needed to fetch the content back. + string hash = await ipfsClient.Ipfs.Put(toStore); + + // + byte[] storedBytes = await ipfsClient.Ipfs.Get(hash); + string storedStging = Encoding.UTF8.GetString(storedBytes, 0, storedBytes.Length); + Console.Out.WriteLine($"The stored string is: {storedStging}"); + } + } +} diff --git a/dotnet/Examples/Logs/Logs.sln b/dotnet/Examples/Logs/Logs.sln new file mode 100644 index 000000000..45acbf33f --- /dev/null +++ b/dotnet/Examples/Logs/Logs.sln @@ -0,0 +1,34 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.26124.0 +MinimumVisualStudioVersion = 15.0.26124.0 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Logs", "Logs\Logs.csproj", "{05D5D280-9D63-45DC-9FD0-9A7D1A5BBFF5}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {05D5D280-9D63-45DC-9FD0-9A7D1A5BBFF5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {05D5D280-9D63-45DC-9FD0-9A7D1A5BBFF5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {05D5D280-9D63-45DC-9FD0-9A7D1A5BBFF5}.Debug|x64.ActiveCfg = Debug|Any CPU + {05D5D280-9D63-45DC-9FD0-9A7D1A5BBFF5}.Debug|x64.Build.0 = Debug|Any CPU + {05D5D280-9D63-45DC-9FD0-9A7D1A5BBFF5}.Debug|x86.ActiveCfg = Debug|Any CPU + {05D5D280-9D63-45DC-9FD0-9A7D1A5BBFF5}.Debug|x86.Build.0 = Debug|Any CPU + {05D5D280-9D63-45DC-9FD0-9A7D1A5BBFF5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {05D5D280-9D63-45DC-9FD0-9A7D1A5BBFF5}.Release|Any CPU.Build.0 = Release|Any CPU + {05D5D280-9D63-45DC-9FD0-9A7D1A5BBFF5}.Release|x64.ActiveCfg = Release|Any CPU + {05D5D280-9D63-45DC-9FD0-9A7D1A5BBFF5}.Release|x64.Build.0 = Release|Any CPU + {05D5D280-9D63-45DC-9FD0-9A7D1A5BBFF5}.Release|x86.ActiveCfg = Release|Any CPU + {05D5D280-9D63-45DC-9FD0-9A7D1A5BBFF5}.Release|x86.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal diff --git a/dotnet/Examples/Logs/Logs/Logs.csproj b/dotnet/Examples/Logs/Logs/Logs.csproj new file mode 100644 index 000000000..4e5def3e7 --- /dev/null +++ b/dotnet/Examples/Logs/Logs/Logs.csproj @@ -0,0 +1,12 @@ + + + + Exe + netcoreapp3.1 + + + + + + + diff --git a/dotnet/Examples/Logs/Logs/Program.cs b/dotnet/Examples/Logs/Logs/Program.cs new file mode 100644 index 000000000..134a1e088 --- /dev/null +++ b/dotnet/Examples/Logs/Logs/Program.cs @@ -0,0 +1,42 @@ +using System; +using System.Threading; +using System.Threading.Tasks; +using In3; +using In3.Eth1; + +namespace Logs +{ + class Program + { + static async Task Main() + { + // Define an upper limit for poll since we dont want our application potentially running forever. + int maxIterations = 500; + int oneSecond = 1000; // in ms + + // Connect to mainnet. + IN3 mainnetClient = IN3.ForChain(Chain.Mainnet); + + // Create a filter object pointing, in this case, to an "eventful" contract address. + LogFilter tetherUsFilter = new LogFilter {Address = "0xdAC17F958D2ee523a2206206994597C13D831ec7"}; + + // Create the filter to be polled for logs. + long filterId = await mainnetClient.Eth1.NewLogFilter(tetherUsFilter); + + // Loop to initiate the poll for the logs. + for (int i = 0; i < maxIterations; i++) + { + // Query for the log events since the creation of the filter or the previous poll (this method in NOT idempotent as it retrieves a diff). + Log[] tetherLogs = await mainnetClient.Eth1.GetFilterChangesFromLogs(filterId); + if (tetherLogs.Length > 0) + { + Console.Out.WriteLine("Logs found: " + tetherLogs.Length); + break; + } + + // Wait before next query. + Thread.Sleep(oneSecond); + } + } + } +} diff --git a/dotnet/Examples/SendTransaction/SendTransaction.sln b/dotnet/Examples/SendTransaction/SendTransaction.sln new file mode 100644 index 000000000..3380eb768 --- /dev/null +++ b/dotnet/Examples/SendTransaction/SendTransaction.sln @@ -0,0 +1,34 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.26124.0 +MinimumVisualStudioVersion = 15.0.26124.0 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SendTransaction", "SendTransaction\SendTransaction.csproj", "{DF986F88-74A2-49F2-9F04-ED54B510BAF9}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {DF986F88-74A2-49F2-9F04-ED54B510BAF9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DF986F88-74A2-49F2-9F04-ED54B510BAF9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DF986F88-74A2-49F2-9F04-ED54B510BAF9}.Debug|x64.ActiveCfg = Debug|Any CPU + {DF986F88-74A2-49F2-9F04-ED54B510BAF9}.Debug|x64.Build.0 = Debug|Any CPU + {DF986F88-74A2-49F2-9F04-ED54B510BAF9}.Debug|x86.ActiveCfg = Debug|Any CPU + {DF986F88-74A2-49F2-9F04-ED54B510BAF9}.Debug|x86.Build.0 = Debug|Any CPU + {DF986F88-74A2-49F2-9F04-ED54B510BAF9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DF986F88-74A2-49F2-9F04-ED54B510BAF9}.Release|Any CPU.Build.0 = Release|Any CPU + {DF986F88-74A2-49F2-9F04-ED54B510BAF9}.Release|x64.ActiveCfg = Release|Any CPU + {DF986F88-74A2-49F2-9F04-ED54B510BAF9}.Release|x64.Build.0 = Release|Any CPU + {DF986F88-74A2-49F2-9F04-ED54B510BAF9}.Release|x86.ActiveCfg = Release|Any CPU + {DF986F88-74A2-49F2-9F04-ED54B510BAF9}.Release|x86.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal diff --git a/dotnet/Examples/SendTransaction/Program.cs b/dotnet/Examples/SendTransaction/SendTransaction/Program.cs similarity index 100% rename from dotnet/Examples/SendTransaction/Program.cs rename to dotnet/Examples/SendTransaction/SendTransaction/Program.cs diff --git a/dotnet/Examples/SendTransaction/SendTransaction.csproj b/dotnet/Examples/SendTransaction/SendTransaction/SendTransaction.csproj similarity index 77% rename from dotnet/Examples/SendTransaction/SendTransaction.csproj rename to dotnet/Examples/SendTransaction/SendTransaction/SendTransaction.csproj index 48fe68da7..90671bd72 100644 --- a/dotnet/Examples/SendTransaction/SendTransaction.csproj +++ b/dotnet/Examples/SendTransaction/SendTransaction/SendTransaction.csproj @@ -6,7 +6,7 @@ - + From 07a89d533589a6d5899b74e81091a0f2b52d427b Mon Sep 17 00:00:00 2001 From: Simon Jentzsch Date: Wed, 8 Jul 2020 14:55:54 +0200 Subject: [PATCH 18/37] changed logging --- c/src/core/util/bytes.c | 7 ++++--- c/src/core/util/log.c | 4 ++++ c/src/core/util/log.h | 3 +++ c/src/verifier/eth1/full/eth_full.c | 6 ++++-- 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/c/src/core/util/bytes.c b/c/src/core/util/bytes.c index b4d04ae6d..d8e2ecf62 100644 --- a/c/src/core/util/bytes.c +++ b/c/src/core/util/bytes.c @@ -55,7 +55,7 @@ bytes_t* b_new(const uint8_t* data, uint32_t len) { void ba_print(const uint8_t* a, size_t l) { size_t i; if (!a) return; - + int o = in3_log_is_prefix_enabled(); in3_log_disable_prefix(); in3_log_trace(" 0x"); for (i = 0; i < l; i++) in3_log_trace("%02x", a[i]); @@ -63,12 +63,13 @@ void ba_print(const uint8_t* a, size_t l) { if (l < 9) { in3_log_trace(" ( %" PRId64 " ) ", bytes_to_long(a, l)); } - in3_log_enable_prefix(); + if (o) in3_log_enable_prefix(); } void b_print(const bytes_t* a) { size_t i; if (!a) return; + int o = in3_log_is_prefix_enabled(); #ifdef __ZEPHYR__ printk("Bytes: "); for (i = 0; i < a->len; i++) printk("%02x", a->data[i]); @@ -78,7 +79,7 @@ void b_print(const bytes_t* a) { in3_log_trace("Bytes: "); for (i = 0; i < a->len; i++) in3_log_trace("%02x", a->data[i]); in3_log_trace("\n"); - in3_log_enable_prefix(); + if (o) in3_log_enable_prefix(); #endif } diff --git a/c/src/core/util/log.c b/c/src/core/util/log.c index e86461e5c..d4eefdd4b 100644 --- a/c/src/core/util/log.c +++ b/c/src/core/util/log.c @@ -99,6 +99,10 @@ void in3_log_enable_prefix_() { L.enable_prefix = 1; } +int in3_log_is_prefix_enabled_() { + return L.enable_prefix; +} + void in3_log_disable_prefix_() { L.enable_prefix = 0; } diff --git a/c/src/core/util/log.h b/c/src/core/util/log.h index 1617fd042..594d3ed52 100644 --- a/c/src/core/util/log.h +++ b/c/src/core/util/log.h @@ -41,6 +41,7 @@ typedef enum { LOG_TRACE, #define in3_log_set_prefix(prefix) in3_log_set_prefix_(prefix) #define in3_log_enable_prefix() in3_log_enable_prefix_() #define in3_log_disable_prefix() in3_log_disable_prefix_() +#define in3_log_is_prefix_enabled() in3_log_is_prefix_enabled_() #define in3_log(...) in3_log_(__VA_ARGS__) #else #define in3_log_trace(...) @@ -57,6 +58,7 @@ typedef enum { LOG_TRACE, #define in3_log_get_level() LOG_TRACE #define in3_log_set_quiet(enable) #define in3_log_set_prefix(prefix) +#define in3_log_is_prefix_enabled() 0 #define in3_log_enable_prefix() #define in3_log_disable_prefix() #define in3_log(level, file, function, line, ...) \ @@ -82,6 +84,7 @@ void in3_log_set_quiet_(int enable); void in3_log_set_prefix_(const char* prefix); void in3_log_enable_prefix_(); void in3_log_disable_prefix_(); +int in3_log_is_prefix_enabled_(); /* in3_log() function can be made thread-safe using the in3_log_set_lock() function */ void in3_log_(in3_log_level_t level, const char* file, const char* function, int line, const char* fmt, ...); diff --git a/c/src/verifier/eth1/full/eth_full.c b/c/src/verifier/eth1/full/eth_full.c index b81973feb..32b5da620 100644 --- a/c/src/verifier/eth1/full/eth_full.c +++ b/c/src/verifier/eth1/full/eth_full.c @@ -73,12 +73,14 @@ int in3_verify_eth_full(in3_vctx_t* vc) { if (!gas_limit) gas_limit = 0xFFFFFFFFFFFFFF; #if defined(DEBUG) && defined(LOGGING) in3_log_level_t old = in3_log_get_level(); + in3_log_disable_prefix(); in3_log_set_level(LOG_ERROR); #endif int ret = evm_call(vc, address ? address->data : zeros, value ? value->data : zeros, value ? value->len : 1, data ? data->data : zeros, data ? data->len : 0, from ? from->data : zeros, gas_limit, vc->chain->chain_id, &result); #if defined(DEBUG) && defined(LOGGING) in3_log_set_level(old); + in3_log_enable_prefix(); #endif switch (ret) { @@ -109,8 +111,8 @@ int in3_verify_eth_full(in3_vctx_t* vc) { b_free(result); if (!res) { in3_log_debug("mismatching result\n"); - // b_print(result); - // b_print(d_bytes(vc->result)); + b_print(result); + b_print(d_bytes(vc->result)); } if (vc->ctx->error) return IN3_EINVAL; return res ? 0 : vc_err(vc, "The result does not match the proven result"); From 4aa4f033d8b6ef538e0e4eeb62cbdf7843e36256 Mon Sep 17 00:00:00 2001 From: Simon Jentzsch Date: Wed, 8 Jul 2020 15:59:17 +0200 Subject: [PATCH 19/37] format debug output --- c/src/core/client/execute.c | 22 +++++++++++++++++++--- c/src/core/util/stringbuilder.c | 28 ++++++++++++++++++++++++++++ c/src/core/util/stringbuilder.h | 1 + c/src/core/util/utils.c | 2 +- 4 files changed, 49 insertions(+), 4 deletions(-) diff --git a/c/src/core/client/execute.c b/c/src/core/client/execute.c index 43049f458..89e7a38d2 100644 --- a/c/src/core/client/execute.c +++ b/c/src/core/client/execute.c @@ -718,11 +718,20 @@ static void in3_handle_rpc_next(in3_ctx_t* ctx, ctx_req_transports_t* transports node_match_t* w = ctx->nodes; int i = 0; for (; w; i++, w = w->next) { - if (ctx->raw_response[i].state != IN3_WAITING && ctx->raw_response[i].data.data) + if (ctx->raw_response[i].state != IN3_WAITING && ctx->raw_response[i].data.data) { + char* data = ctx->raw_response[i].data.data; +#ifdef DEBUG + data = format_json(data); +#endif + in3_log_trace(ctx->raw_response[i].state ? "... response(%i): \n... " COLOR_RED_STR "\n" : "... response(%i): \n... " COLOR_GREEN_STR "\n", - i, ctx->raw_response[i].data.data); + i, data); +#ifdef DEBUG + _free(data); +#endif + } } #endif return; @@ -756,10 +765,17 @@ void in3_handle_rpc(in3_ctx_t* ctx, ctx_req_transports_t* transports) { // debug output for (unsigned int i = 0; i < request->urls_len; i++) { if (request->ctx->raw_response[i].state != IN3_WAITING) { + char* data = request->ctx->raw_response[i].data.data; +#ifdef DEBUG + data = format_json(data); +#endif in3_log_trace(request->ctx->raw_response[i].state ? "... response(%i): \n... " COLOR_RED_STR "\n" : "... response(%i): \n... " COLOR_GREEN_STR "\n", - i, request->ctx->raw_response[i].data.data); + i, data); +#ifdef DEBUG + _free(data); +#endif } } diff --git a/c/src/core/util/stringbuilder.c b/c/src/core/util/stringbuilder.c index 2eb51f32c..eca371d64 100644 --- a/c/src/core/util/stringbuilder.c +++ b/c/src/core/util/stringbuilder.c @@ -197,4 +197,32 @@ void sb_free(sb_t* sb) { if (sb == NULL) return; if (sb->data != NULL) _free(sb->data); _free(sb); +} + +char* format_json(const char* json) { + sb_t _sb = {0}, level = {0}; + sb_t* sb = &_sb; + sb_add_char(&level, '\n'); + for (char c = *json; c; c = *(++json)) { + switch (c) { + case '{': + sb_add_char(sb, c); + sb_add_chars(&level, " "); + sb_add_range(sb, level.data, 0, level.len); + break; + case '}': + if (level.len > 2) level.len -= 2; + sb_add_range(sb, level.data, 0, level.len); + sb_add_char(sb, c); + break; + case ',': + sb_add_char(sb, c); + sb_add_range(sb, level.data, 0, level.len); + break; + default: + sb_add_char(sb, c); + } + } + _free(level.data); + return _sb.data; } \ No newline at end of file diff --git a/c/src/core/util/stringbuilder.h b/c/src/core/util/stringbuilder.h index f97f42d53..96125d60c 100644 --- a/c/src/core/util/stringbuilder.h +++ b/c/src/core/util/stringbuilder.h @@ -72,5 +72,6 @@ sb_t* sb_add_bytes(sb_t* sb, const char* prefix, const bytes_t* bytes, int len, sb_t* sb_add_hexuint_l(sb_t* sb, uintmax_t uint, size_t l); /**< add a integer value as hexcoded, 0x-prefixed string*/ sb_t* sb_add_escaped_chars(sb_t* sb, const char* chars); /**< add chars but escapes all quotes */ sb_t* sb_add_int(sb_t* sb, uint64_t val); /**< adds a numeric value to the stringbuilder */ +char* format_json(const char* json); /**< format a json string and returns a new string, which needs to be freed */ #endif diff --git a/c/src/core/util/utils.c b/c/src/core/util/utils.c index b1d131a74..2f779e62c 100644 --- a/c/src/core/util/utils.c +++ b/c/src/core/util/utils.c @@ -393,4 +393,4 @@ int64_t parse_float_val(const char* data, int32_t expo) { if (neg) val = 0 - val; for (; expo > 0; expo--) val *= 10; return val; -} \ No newline at end of file +} From 03f8e641c6ca546438cbd0d6140c590cb96bb8d9 Mon Sep 17 00:00:00 2001 From: Simon Jentzsch Date: Wed, 8 Jul 2020 16:00:05 +0200 Subject: [PATCH 20/37] no debug print in eth_full --- c/src/verifier/eth1/full/eth_full.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/c/src/verifier/eth1/full/eth_full.c b/c/src/verifier/eth1/full/eth_full.c index 32b5da620..591286ea0 100644 --- a/c/src/verifier/eth1/full/eth_full.c +++ b/c/src/verifier/eth1/full/eth_full.c @@ -111,8 +111,8 @@ int in3_verify_eth_full(in3_vctx_t* vc) { b_free(result); if (!res) { in3_log_debug("mismatching result\n"); - b_print(result); - b_print(d_bytes(vc->result)); + // b_print(result); + // b_print(d_bytes(vc->result)); } if (vc->ctx->error) return IN3_EINVAL; return res ? 0 : vc_err(vc, "The result does not match the proven result"); From b6d29c326a8c4389c49bd8fe6884ac3f21f5aba5 Mon Sep 17 00:00:00 2001 From: Simon Jentzsch Date: Wed, 8 Jul 2020 17:10:38 +0200 Subject: [PATCH 21/37] format --- c/src/core/client/execute.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/c/src/core/client/execute.c b/c/src/core/client/execute.c index 89e7a38d2..da21af1a2 100644 --- a/c/src/core/client/execute.c +++ b/c/src/core/client/execute.c @@ -708,7 +708,7 @@ static void transport_cleanup(in3_ctx_t* ctx, ctx_req_transports_t* transports, } static void in3_handle_rpc_next(in3_ctx_t* ctx, ctx_req_transports_t* transports) { - in3_log_debug("waiting for the next response...."); + in3_log_debug("waiting for the next respone ...\n"); ctx = in3_ctx_last_waiting(ctx); for (int i = 0; i < transports->len; i++) { if (transports->req[i].ctx == ctx) { @@ -725,9 +725,9 @@ static void in3_handle_rpc_next(in3_ctx_t* ctx, ctx_req_transports_t* transports #endif in3_log_trace(ctx->raw_response[i].state - ? "... response(%i): \n... " COLOR_RED_STR "\n" - : "... response(%i): \n... " COLOR_GREEN_STR "\n", - i, data); + ? "... response(%s): \n... " COLOR_RED_STR "\n" + : "... response(%s): \n... " COLOR_GREEN_STR "\n", + w->node->url, data); #ifdef DEBUG _free(data); #endif @@ -763,16 +763,17 @@ void in3_handle_rpc(in3_ctx_t* ctx, ctx_req_transports_t* transports) { ctx->client->transport(request); // debug output - for (unsigned int i = 0; i < request->urls_len; i++) { + node_match_t* node = request->ctx->nodes; + for (unsigned int i = 0; i < request->urls_len; i++, node = node ? node->next : NULL) { if (request->ctx->raw_response[i].state != IN3_WAITING) { char* data = request->ctx->raw_response[i].data.data; #ifdef DEBUG data = format_json(data); #endif in3_log_trace(request->ctx->raw_response[i].state - ? "... response(%i): \n... " COLOR_RED_STR "\n" - : "... response(%i): \n... " COLOR_GREEN_STR "\n", - i, data); + ? "... response(%s): \n... " COLOR_RED_STR "\n" + : "... response(%s): \n... " COLOR_GREEN_STR "\n", + node ? node->node->url : "intern", data); #ifdef DEBUG _free(data); #endif From deebc84a476f47205e61813244e2eb94a18956f4 Mon Sep 17 00:00:00 2001 From: Simon Jentzsch Date: Wed, 8 Jul 2020 18:21:53 +0200 Subject: [PATCH 22/37] fixed nodelist crash when racecondition causes pointers to freed nodes --- .vscode/launch.json | 17 +++-- c/include/in3/client.h | 2 +- c/include/in3/context.h | 17 +++-- c/include/in3/log.h | 3 + c/include/in3/stringbuilder.h | 1 + c/src/cmd/in3/main.c | 2 +- c/src/core/client/client.h | 2 +- c/src/core/client/context.h | 17 +++-- c/src/core/client/execute.c | 123 ++++++++++++++++++------------- c/src/core/client/nodelist.c | 21 +++--- c/src/core/client/nodelist.h | 2 +- c/test/unit_tests/test_request.c | 8 +- 12 files changed, 128 insertions(+), 87 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 603a59018..ca068b7f2 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -29,11 +29,15 @@ "name": "in3 cmd", "program": "${workspaceFolder}/build/bin/in3", "cwd": "${workspaceFolder}", + "externalConsole": true, "args": [ - "-c", - "btc", - "getblock", - "000000000000000000103b2395f6cd94221b10d02eb9be5850303c0534307220", + "-ccache", + "-a", + "3", + "call", + "totalNodes():uint", + "-to", + "0x6c095a05764a23156efd9d603eada144a9b1af33", "-debug" ] }, @@ -60,7 +64,8 @@ "name": "run test", "program": "${workspaceFolder}/build/test/runner", "args": [ - "../c/test/testdata/requests/in3_invalid_block.json", + "../c/test/testdata/requests/in3_total_nodes.json", + "-d", "-t", "1" ], @@ -77,7 +82,7 @@ "type": "lldb", "request": "launch", "name": "run rpcapi test", - "program": "${workspaceFolder}/build/test/test_rpc_api", + "program": "${workspaceFolder}/build/test/test_request", "cwd": "${workspaceFolder}/build" }, { diff --git a/c/include/in3/client.h b/c/include/in3/client.h index a2e958156..a15eb7472 100644 --- a/c/include/in3/client.h +++ b/c/include/in3/client.h @@ -227,7 +227,7 @@ typedef struct in3_chain { chain_id_t chain_id; /**< chain_id, which could be a free or based on the public ethereum networkId*/ in3_chain_type_t type; /**< chaintype */ uint64_t last_block; /**< last blocknumber the nodeList was updated, which is used to detect changed in the nodelist*/ - int nodelist_length; /**< number of nodes in the nodeList */ + unsigned int nodelist_length; /**< number of nodes in the nodeList */ in3_node_t* nodelist; /**< array of nodes */ in3_node_weight_t* weights; /**< stats and weights recorded for each node */ bytes_t** init_addresses; /**< array of addresses of nodes that should always part of the nodeList */ diff --git a/c/include/in3/context.h b/c/include/in3/context.h index ca0d561b0..ebae2dad4 100644 --- a/c/include/in3/context.h +++ b/c/include/in3/context.h @@ -62,11 +62,11 @@ typedef enum ctx_type { * This will be used when picking the nodes to send the request to. A linked list of these structs desribe the result. */ typedef struct weight { - in3_node_t* node; /**< the node definition including the url */ - in3_node_weight_t* weight; /**< the current weight and blacklisting-stats */ - float s; /**< The starting value */ - float w; /**< weight value */ - struct weight* next; /**< next in the linkedlist or NULL if this is the last element*/ + unsigned int index; /**< index of the node in the nodelist */ + bool blocked; /**< if true this node has been blocked for sending wrong responses */ + uint32_t s; /**< The starting value */ + uint32_t w; /**< weight value */ + struct weight* next; /**< next in the linkedlist or NULL if this is the last element*/ } node_match_t; /** @@ -445,4 +445,11 @@ NONULL void in3_ctx_add_response( int data_len /**< the length of the data or the the string (use -1 if data is a null terminated string)*/ ); +NONULL static inline in3_node_t* ctx_get_node(const in3_chain_t* chain, const node_match_t* node) { + return node->index < chain->nodelist_length ? chain->nodelist + node->index : NULL; +} +NONULL static inline in3_node_weight_t* ctx_get_node_weight(const in3_chain_t* chain, const node_match_t* node) { + return node->index < chain->nodelist_length ? chain->weights + node->index : NULL; +} + #endif diff --git a/c/include/in3/log.h b/c/include/in3/log.h index 1617fd042..594d3ed52 100644 --- a/c/include/in3/log.h +++ b/c/include/in3/log.h @@ -41,6 +41,7 @@ typedef enum { LOG_TRACE, #define in3_log_set_prefix(prefix) in3_log_set_prefix_(prefix) #define in3_log_enable_prefix() in3_log_enable_prefix_() #define in3_log_disable_prefix() in3_log_disable_prefix_() +#define in3_log_is_prefix_enabled() in3_log_is_prefix_enabled_() #define in3_log(...) in3_log_(__VA_ARGS__) #else #define in3_log_trace(...) @@ -57,6 +58,7 @@ typedef enum { LOG_TRACE, #define in3_log_get_level() LOG_TRACE #define in3_log_set_quiet(enable) #define in3_log_set_prefix(prefix) +#define in3_log_is_prefix_enabled() 0 #define in3_log_enable_prefix() #define in3_log_disable_prefix() #define in3_log(level, file, function, line, ...) \ @@ -82,6 +84,7 @@ void in3_log_set_quiet_(int enable); void in3_log_set_prefix_(const char* prefix); void in3_log_enable_prefix_(); void in3_log_disable_prefix_(); +int in3_log_is_prefix_enabled_(); /* in3_log() function can be made thread-safe using the in3_log_set_lock() function */ void in3_log_(in3_log_level_t level, const char* file, const char* function, int line, const char* fmt, ...); diff --git a/c/include/in3/stringbuilder.h b/c/include/in3/stringbuilder.h index f97f42d53..96125d60c 100644 --- a/c/include/in3/stringbuilder.h +++ b/c/include/in3/stringbuilder.h @@ -72,5 +72,6 @@ sb_t* sb_add_bytes(sb_t* sb, const char* prefix, const bytes_t* bytes, int len, sb_t* sb_add_hexuint_l(sb_t* sb, uintmax_t uint, size_t l); /**< add a integer value as hexcoded, 0x-prefixed string*/ sb_t* sb_add_escaped_chars(sb_t* sb, const char* chars); /**< add chars but escapes all quotes */ sb_t* sb_add_int(sb_t* sb, uint64_t val); /**< adds a numeric value to the stringbuilder */ +char* format_json(const char* json); /**< format a json string and returns a new string, which needs to be freed */ #endif diff --git a/c/src/cmd/in3/main.c b/c/src/cmd/in3/main.c index 4cd658c3a..c92fff051 100644 --- a/c/src/cmd/in3/main.c +++ b/c/src/cmd/in3/main.c @@ -954,7 +954,7 @@ int main(int argc, char* argv[]) { if (run_test_request == 1) more = "WEIGHT : LAST_BLOCK"; if (run_test_request == 2) more = "WEIGHT : NAME VERSION : RUNNING : HEALTH : LAST_BLOCK"; printf(" : %-45s : %7s : %5s : %5s: %s\n------------------------------------------------------------------------------------------------\n", "URL", "BL", "CNT", "AVG", more); - for (int i = 0; i < chain->nodelist_length; i++) { + for (unsigned int i = 0; i < chain->nodelist_length; i++) { in3_ctx_t* ctx = NULL; char* health_s = NULL; if (run_test_request) { diff --git a/c/src/core/client/client.h b/c/src/core/client/client.h index f8a11b8ae..e2e6b364f 100644 --- a/c/src/core/client/client.h +++ b/c/src/core/client/client.h @@ -227,7 +227,7 @@ typedef struct in3_chain { chain_id_t chain_id; /**< chain_id, which could be a free or based on the public ethereum networkId*/ in3_chain_type_t type; /**< chaintype */ uint64_t last_block; /**< last blocknumber the nodeList was updated, which is used to detect changed in the nodelist*/ - int nodelist_length; /**< number of nodes in the nodeList */ + unsigned int nodelist_length; /**< number of nodes in the nodeList */ in3_node_t* nodelist; /**< array of nodes */ in3_node_weight_t* weights; /**< stats and weights recorded for each node */ bytes_t** init_addresses; /**< array of addresses of nodes that should always part of the nodeList */ diff --git a/c/src/core/client/context.h b/c/src/core/client/context.h index 320914f7d..641436fc9 100644 --- a/c/src/core/client/context.h +++ b/c/src/core/client/context.h @@ -62,11 +62,11 @@ typedef enum ctx_type { * This will be used when picking the nodes to send the request to. A linked list of these structs desribe the result. */ typedef struct weight { - in3_node_t* node; /**< the node definition including the url */ - in3_node_weight_t* weight; /**< the current weight and blacklisting-stats */ - float s; /**< The starting value */ - float w; /**< weight value */ - struct weight* next; /**< next in the linkedlist or NULL if this is the last element*/ + unsigned int index; /**< index of the node in the nodelist */ + bool blocked; /**< if true this node has been blocked for sending wrong responses */ + uint32_t s; /**< The starting value */ + uint32_t w; /**< weight value */ + struct weight* next; /**< next in the linkedlist or NULL if this is the last element*/ } node_match_t; /** @@ -445,4 +445,11 @@ NONULL void in3_ctx_add_response( int data_len /**< the length of the data or the the string (use -1 if data is a null terminated string)*/ ); +NONULL static inline in3_node_t* ctx_get_node(const in3_chain_t* chain, const node_match_t* node) { + return node->index < chain->nodelist_length ? chain->nodelist + node->index : NULL; +} +NONULL static inline in3_node_weight_t* ctx_get_node_weight(const in3_chain_t* chain, const node_match_t* node) { + return node->index < chain->nodelist_length ? chain->weights + node->index : NULL; +} + #endif diff --git a/c/src/core/client/execute.c b/c/src/core/client/execute.c index da21af1a2..31517931b 100644 --- a/c/src/core/client/execute.c +++ b/c/src/core/client/execute.c @@ -100,7 +100,8 @@ NONULL static bool auto_ask_sig(const in3_ctx_t* ctx) { NONULL static in3_ret_t pick_signers(in3_ctx_t* ctx, d_token_t* request) { - const in3_t* c = ctx->client; + const in3_t* c = ctx->client; + const in3_chain_t* chain = in3_find_chain(c, c->chain_id); if (in3_ctx_get_proof(ctx) == PROOF_NONE && !auto_ask_sig(ctx)) return IN3_OK; @@ -121,9 +122,11 @@ NONULL static in3_ret_t pick_signers(in3_ctx_t* ctx, d_token_t* request) { ctx->signers_length = node_count; ctx->signers = _malloc(sizeof(bytes_t) * node_count); const node_match_t* w = signer_nodes; + in3_node_t* n = NULL; for (int i = 0; i < node_count; i++) { - ctx->signers[i].len = w->node->address->len; - ctx->signers[i].data = w->node->address->data; + n = ctx_get_node(chain, w); + ctx->signers[i].len = n->address->len; + ctx->signers[i].data = n->address->data; w = w->next; } if (signer_nodes) in3_ctx_free_nodes(signer_nodes); @@ -296,12 +299,14 @@ NONULL static in3_ret_t ctx_parse_response(in3_ctx_t* ctx, char* response_data, return IN3_OK; } -NONULL static void blacklist_node(node_match_t* node_weight) { - if (node_weight && node_weight->weight) { +NONULL static void blacklist_node(in3_chain_t* chain, node_match_t* node_weight) { + if (node_weight && !node_weight->blocked) { + in3_node_weight_t* w = ctx_get_node_weight(chain, node_weight); + if (!w) return; // blacklist the node - node_weight->weight->blacklisted_until = in3_time(NULL) + BLACKLISTTIME; - node_weight->weight = NULL; // setting the weight to NULL means we reject the response. - in3_log_debug("Blacklisting node for unverifiable response: %s\n", node_weight->node->url); + w->blacklisted_until = in3_time(NULL) + BLACKLISTTIME; + node_weight->blocked = true; + in3_log_debug("Blacklisting node for unverifiable response: %s\n", ctx_get_node(chain, node_weight)->url); } } @@ -328,21 +333,23 @@ static void check_autoupdate(const in3_ctx_t* ctx, in3_chain_t* chain, d_token_t if (d_get_longk(response_in3, K_LAST_NODE_LIST) > chain->last_block) { if (chain->nodelist_upd8_params == NULL) chain->nodelist_upd8_params = _malloc(sizeof(*(chain->nodelist_upd8_params))); - - // overwrite old params since we have a newer nodelist update now - memcpy(chain->nodelist_upd8_params->node, node->node->address->data, node->node->address->len); - chain->nodelist_upd8_params->exp_last_block = d_get_longk(response_in3, K_LAST_NODE_LIST); - chain->nodelist_upd8_params->timestamp = in3_time(NULL) + update_waittime(d_get_longk(response_in3, K_LAST_NODE_LIST), - d_get_longk(response_in3, K_CURRENT_BLOCK), - ctx->client->replace_latest_block, - chain->avg_block_time); + in3_node_t* n = ctx_get_node(chain, node); + if (n) { + // overwrite old params since we have a newer nodelist update now + memcpy(chain->nodelist_upd8_params->node, n->address->data, n->address->len); + chain->nodelist_upd8_params->exp_last_block = d_get_longk(response_in3, K_LAST_NODE_LIST); + chain->nodelist_upd8_params->timestamp = in3_time(NULL) + update_waittime(d_get_longk(response_in3, K_LAST_NODE_LIST), + d_get_longk(response_in3, K_CURRENT_BLOCK), + ctx->client->replace_latest_block, + chain->avg_block_time); + } } if (chain->whitelist && d_get_longk(response_in3, K_LAST_WHITE_LIST) > chain->whitelist->last_block) chain->whitelist->needs_update = true; } -static inline bool is_blacklisted(const node_match_t* node_weight) { return node_weight && node_weight->weight == NULL; } +static inline bool is_blacklisted(const node_match_t* node_weight) { return node_weight && node_weight->blocked; } static bool is_user_error(d_token_t* error, char** err_msg) { *err_msg = d_type(error) == T_STRING ? d_string(error) : d_get_stringk(error, K_MESSAGE); @@ -351,9 +358,9 @@ static bool is_user_error(d_token_t* error, char** err_msg) { return *err_msg && strncmp(*err_msg, "Error:", 6) && strncmp(*err_msg, "TypeError:", 10); } -static in3_ret_t handle_error_response(in3_ctx_t* ctx, node_match_t* node, in3_response_t* response) { +static in3_ret_t handle_error_response(in3_ctx_t* ctx, node_match_t* node, in3_response_t* response, in3_chain_t* chain) { if (is_blacklisted(node)) return IN3_ERPC; // already handled - if (node) blacklist_node(node); // we block this node + if (node) blacklist_node(chain, node); // we block this node ctx_set_error(ctx, response->data.len ? response->data.data : "no response from node", IN3_ERPC); // and copy the error to the ctx if (response->data.data) { // free up memory // clean up invalid data @@ -365,13 +372,14 @@ static in3_ret_t handle_error_response(in3_ctx_t* ctx, node_match_t* node, in3_r return IN3_ERPC; } -static void clean_up_ctx(in3_ctx_t* ctx, node_match_t* node) { +static void clean_up_ctx(in3_ctx_t* ctx, node_match_t* node, in3_chain_t* chain) { if (ctx->verification_state != IN3_OK && ctx->verification_state != IN3_WAITING) ctx->verification_state = IN3_WAITING; if (ctx->error) _free(ctx->error); if (ctx->responses) _free(ctx->responses); if (ctx->response_context) json_free(ctx->response_context); - ctx->error = NULL; - if (node && node->weight) node->weight->blacklisted_until = 0; // we reset the blacklisted, because if the response was correct, no need to blacklist, otherwise we will set the blacklisted_until anyway + ctx->error = NULL; + in3_node_weight_t* w = node ? ctx_get_node_weight(chain, node) : NULL; + if (w) w->blacklisted_until = 0; // we reset the blacklisted, because if the response was correct, no need to blacklist, otherwise we will set the blacklisted_until anyway } static in3_ret_t handle_payment(in3_ctx_t* ctx, node_match_t* node, int index) { @@ -411,22 +419,22 @@ static in3_ret_t verify_response(in3_ctx_t* ctx, in3_chain_t* chain, in3_verifie in3_ret_t res = IN3_OK; if (response->state || !response->data.len) // reponse has an error - return handle_error_response(ctx, node, response); + return handle_error_response(ctx, node, response, chain); // we need to clean up the previos responses if set - clean_up_ctx(ctx, node); + clean_up_ctx(ctx, node, chain); // parse if (ctx_parse_response(ctx, response->data.data, response->data.len)) { // in case of an error we get a error-code and error is set in the ctx? - if (node) blacklist_node(node); // so we need to block the node. + if (node) blacklist_node(chain, node); // so we need to block the node. return ctx->verification_state; } // check each request for (uint_fast16_t i = 0; i < ctx->len; i++) { - // find the verifier - in3_vctx_t vc; + in3_node_t* n = node ? ctx_get_node(chain, node) : NULL; + in3_vctx_t vc; vc.ctx = ctx; vc.chain = chain; vc.request = ctx->requests[i]; @@ -444,24 +452,24 @@ static in3_ret_t verify_response(in3_ctx_t* ctx, in3_chain_t* chain, in3_verifie if (!vc.result && ctx->attempt < ctx->client->max_attempts - 1) { char* err_msg; // if we don't have a result, the node reported an error - if (is_user_error(d_get(ctx->responses[i], K_ERROR), &err_msg)) { - node->weight = NULL; // we mark it as blacklisted, but not blacklist it in the nodelist, since it was not the nodes fault. - in3_log_debug("we have a user-error from %s, so we reject the response, but don't blacklist ..\n", node ? node->node->url : "intern"); + if (is_user_error(d_get(ctx->responses[i], K_ERROR), &err_msg) || !node) { + if (node) node->blocked = true; // we mark it as blacklisted, but not blacklist it in the nodelist, since it was not the nodes fault. + in3_log_debug("we have a user-error from %s, so we reject the response, but don't blacklist ..\n", n ? n->url : "intern"); continue; } else { - in3_log_debug("we have a system-error from %s, so we block it ..\n", node ? node->node->url : "intern"); - blacklist_node(node); + in3_log_debug("we have a system-error from %s, so we block it ..\n", n ? n->url : "intern"); + blacklist_node(chain, node); return ctx_set_error(ctx, err_msg ? err_msg : "Invalid response", IN3_EINVAL); } } - // we have a verifier? - if (verifier) { + // we only verify, if there is a verifier, but also a node, which means we do not verify internal responses. + if (verifier && node) { res = ctx->verification_state = verifier->verify(&vc); if (res == IN3_WAITING) return res; if (res) { - blacklist_node(node); + blacklist_node(chain, node); return res; } } @@ -471,12 +479,13 @@ static in3_ret_t verify_response(in3_ctx_t* ctx, in3_chain_t* chain, in3_verifie return (ctx->verification_state = IN3_OK); } -static void handle_times(node_match_t* node, in3_response_t* response) { - if (node && node->weight && response && response->time) { - node->weight->response_count++; - node->weight->total_response_time += response->time; - response->time = 0; // make sure we count the time only once - } +static void handle_times(in3_chain_t* chain, node_match_t* node, in3_response_t* response) { + if (!node || node->blocked || !response || !response->time) return; + in3_node_weight_t* w = ctx_get_node_weight(chain, node); + if (!w) return; + w->response_count++; + w->total_response_time += response->time; + response->time = 0; // make sure we count the time only once } static in3_ret_t find_valid_result(in3_ctx_t* ctx, int nodes_count, in3_response_t* response, in3_chain_t* chain, in3_verifier_t* verifier) { @@ -487,18 +496,21 @@ static in3_ret_t find_valid_result(in3_ctx_t* ctx, int nodes_count, in3_response // blacklist nodes for missing response for (int n = 0; n < nodes_count; n++, node = node ? node->next : NULL) { + // get the connected node + const in3_node_t* node_data = node ? ctx_get_node(chain, node) : NULL; + // if the response is still pending, we skip... if (response[n].state == IN3_WAITING) { still_pending = true; - in3_log_debug("request from node %s is still pending ..\n", node ? node->node->url : "intern"); + in3_log_debug("request from node %s is still pending ..\n", node_data ? node_data->url : "intern"); continue; } - handle_times(node, response + n); + handle_times(chain, node, response + n); state = verify_response(ctx, chain, verifier, node, response + n); if (state == IN3_OK) { - in3_log_debug("accepted response from %s\n", node ? node->node->url : "intern"); + in3_log_debug("accepted response from %s\n", node_data ? node_data->url : "intern"); break; } else if (state == IN3_WAITING) return state; @@ -564,13 +576,15 @@ NONULL in3_request_t* in3_create_request(in3_ctx_t* ctx) { int nodes_count = ctx_nodes_len(ctx->nodes); char** urls = nodes_count ? _malloc(sizeof(char*) * nodes_count) : NULL; node_match_t* node = ctx->nodes; + in3_chain_t* chain = in3_find_chain(ctx->client, ctx->client->chain_id); bool multichain = false; for (int n = 0; n < nodes_count; n++) { - urls[n] = node->node->url; + in3_node_t* node_data = ctx_get_node(chain, node); + urls[n] = node_data->url; // if the multichain-prop is set we need to specify the chain_id in the request - if (in3_node_props_get(node->node->props, NODE_PROP_MULTICHAIN)) multichain = true; + if (in3_node_props_get(node_data->props, NODE_PROP_MULTICHAIN)) multichain = true; // cif we use_http, we need to malloc a new string, so we also need to free it later! if (ctx->client->flags & FLAGS_HTTP) urls[n] = convert_to_http_url(urls[n]); @@ -709,7 +723,8 @@ static void transport_cleanup(in3_ctx_t* ctx, ctx_req_transports_t* transports, static void in3_handle_rpc_next(in3_ctx_t* ctx, ctx_req_transports_t* transports) { in3_log_debug("waiting for the next respone ...\n"); - ctx = in3_ctx_last_waiting(ctx); + ctx = in3_ctx_last_waiting(ctx); + const in3_chain_t* chain = in3_find_chain(ctx->client, ctx->client->chain_id); for (int i = 0; i < transports->len; i++) { if (transports->req[i].ctx == ctx) { in3_request_t req = {.action = REQ_ACTION_RECEIVE, .ctx = ctx, .cptr = transports->req[i].ptr, .urls_len = 0, .urls = NULL, .payload = NULL}; @@ -719,7 +734,8 @@ static void in3_handle_rpc_next(in3_ctx_t* ctx, ctx_req_transports_t* transports int i = 0; for (; w; i++, w = w->next) { if (ctx->raw_response[i].state != IN3_WAITING && ctx->raw_response[i].data.data) { - char* data = ctx->raw_response[i].data.data; + in3_node_t* node = ctx_get_node(chain, w); + char* data = ctx->raw_response[i].data.data; #ifdef DEBUG data = format_json(data); #endif @@ -727,7 +743,7 @@ static void in3_handle_rpc_next(in3_ctx_t* ctx, ctx_req_transports_t* transports in3_log_trace(ctx->raw_response[i].state ? "... response(%s): \n... " COLOR_RED_STR "\n" : "... response(%s): \n... " COLOR_GREEN_STR "\n", - w->node->url, data); + node ? node->url : "intern", data); #ifdef DEBUG _free(data); #endif @@ -763,17 +779,20 @@ void in3_handle_rpc(in3_ctx_t* ctx, ctx_req_transports_t* transports) { ctx->client->transport(request); // debug output - node_match_t* node = request->ctx->nodes; + node_match_t* node = request->ctx->nodes; + const in3_chain_t* chain = in3_find_chain(ctx->client, ctx->client->chain_id); + for (unsigned int i = 0; i < request->urls_len; i++, node = node ? node->next : NULL) { if (request->ctx->raw_response[i].state != IN3_WAITING) { - char* data = request->ctx->raw_response[i].data.data; + char* data = request->ctx->raw_response[i].data.data; + const in3_node_t* node_data = node ? ctx_get_node(chain, node) : NULL; #ifdef DEBUG data = format_json(data); #endif in3_log_trace(request->ctx->raw_response[i].state ? "... response(%s): \n... " COLOR_RED_STR "\n" : "... response(%s): \n... " COLOR_GREEN_STR "\n", - node ? node->node->url : "intern", data); + node_data ? node_data->url : "intern", data); #ifdef DEBUG _free(data); #endif diff --git a/c/src/core/client/nodelist.c b/c/src/core/client/nodelist.c index 72a64e0ff..d43f52b41 100644 --- a/c/src/core/client/nodelist.c +++ b/c/src/core/client/nodelist.c @@ -410,11 +410,11 @@ node_match_t* in3_node_list_fill_weight(in3_t* c, chain_id_t chain_id, in3_node_ SKIP_FILTERING: current = _malloc(sizeof(node_match_t)); if (!first) first = current; - current->node = node_def; - current->weight = weight_def; - current->next = NULL; - current->s = weight_sum; - current->w = in3_node_calculate_weight(weight_def, node_def->capacity, now); + current->index = i; + current->blocked = false; + current->next = NULL; + current->s = weight_sum; + current->w = in3_node_calculate_weight(weight_def, node_def->capacity, now); weight_sum += current->w; found++; if (prev) prev->next = current; @@ -537,17 +537,16 @@ in3_ret_t in3_node_list_pick_nodes(in3_ctx_t* ctx, node_match_t** nodes, int req // check if we already added it, next = first; while (next) { - if (next->node == current->node) break; + if (next->index == current->index) break; next = next->next; } if (!next) { added++; - next = _calloc(1, sizeof(node_match_t)); - next->s = current->s; - next->w = current->w; - next->weight = current->weight; - next->node = current->node; + next = _calloc(1, sizeof(node_match_t)); + next->s = current->s; + next->w = current->w; + next->index = current->index; if (!first) first = next; if (last) { diff --git a/c/src/core/client/nodelist.h b/c/src/core/client/nodelist.h index 768cb9256..dfe6b40ed 100644 --- a/c/src/core/client/nodelist.h +++ b/c/src/core/client/nodelist.h @@ -97,7 +97,7 @@ NONULL static inline bool nodelist_not_first_upd8(const in3_chain_t* chain) { } NONULL static inline void blacklist_node_addr(const in3_chain_t* chain, const address_t node_addr, uint64_t secs_from_now) { - for (int i = 0; i < chain->nodelist_length; ++i) + for (unsigned int i = 0; i < chain->nodelist_length; ++i) if (!memcmp(chain->nodelist[i].address->data, node_addr, chain->nodelist[i].address->len)) chain->weights[i].blacklisted_until = in3_time(NULL) + secs_from_now; } diff --git a/c/test/unit_tests/test_request.c b/c/test/unit_tests/test_request.c index 15e9a1be7..dfe5f0c86 100644 --- a/c/test/unit_tests/test_request.c +++ b/c/test/unit_tests/test_request.c @@ -160,8 +160,8 @@ static void test_partial_response() { in3_ctx_add_response(req->ctx, 0, true, "500 from server", -1); TEST_ASSERT_EQUAL(IN3_WAITING, in3_ctx_execute(ctx)); TEST_ASSERT_EQUAL(IN3_WAITING, in3_ctx_execute(ctx)); // calling twice will give the same result - TEST_ASSERT_NULL(ctx->nodes->weight); // first node is blacklisted - TEST_ASSERT_NOT_NULL(ctx->nodes->next->weight); // second node is not blacklisted + TEST_ASSERT_TRUE(ctx->nodes->blocked); // first node is blacklisted + TEST_ASSERT_FALSE(ctx->nodes->next->blocked); // second node is not blacklisted // now we have a valid response and should get a accaptable response in3_ctx_add_response(req->ctx, 2, false, "{\"result\":\"0x100\"}", -1); @@ -187,8 +187,8 @@ static void test_retry_response() { // first response is an error we expect a waiting since the transport has not passed all responses yet in3_ctx_add_response(req->ctx, 0, true, "500 from server", -1); TEST_ASSERT_EQUAL(IN3_WAITING, in3_ctx_execute(ctx)); // calling twice will give the same result - TEST_ASSERT_NULL(ctx->nodes->weight); // first node is blacklisted - TEST_ASSERT_NOT_NULL(ctx->nodes->next->weight); // second node is not blacklisted + TEST_ASSERT_TRUE(ctx->nodes->blocked); // first node is blacklisted + TEST_ASSERT_FALSE(ctx->nodes->next->blocked); // second node is not blacklisted TEST_ASSERT_NOT_NULL(ctx->raw_response); // we still keep the raw response in3_ctx_add_response(req->ctx, 1, false, "{\"error\":\"Error:no internet\"}", -1); From 6ce85ef3fdf1554050aa1f6b2b4f1615d17080b4 Mon Sep 17 00:00:00 2001 From: Simon Jentzsch Date: Wed, 8 Jul 2020 19:53:57 +0200 Subject: [PATCH 23/37] fixed unsigned --- c/include/in3/client.h | 4 ++-- c/src/core/client/cache.c | 2 +- c/src/core/client/client.h | 4 ++-- c/src/core/client/client_init.c | 10 +++++----- c/src/core/client/execute.c | 14 +++++--------- c/src/core/client/nodelist.c | 14 +++++++------- 6 files changed, 22 insertions(+), 26 deletions(-) diff --git a/c/include/in3/client.h b/c/include/in3/client.h index a15eb7472..0d6f7ab00 100644 --- a/c/include/in3/client.h +++ b/c/include/in3/client.h @@ -615,8 +615,8 @@ NONULL in3_ret_t in3_cache_init( * My return NULL if not found. */ NONULL in3_chain_t* in3_find_chain( - in3_t* c /**< the incubed client */, - chain_id_t chain_id /**< chain_id */ + const in3_t* c /**< the incubed client */, + chain_id_t chain_id /**< chain_id */ ); /** diff --git a/c/src/core/client/cache.c b/c/src/core/client/cache.c index 6b2d7135f..59e7c59be 100644 --- a/c/src/core/client/cache.c +++ b/c/src/core/client/cache.c @@ -146,7 +146,7 @@ in3_ret_t in3_cache_store_nodelist(in3_t* c, in3_chain_t* chain) { bb_write_int(bb, chain->nodelist_length); bb_write_raw_bytes(bb, chain->weights, chain->nodelist_length * sizeof(in3_node_weight_t)); - for (int i = 0; i < chain->nodelist_length; i++) { + for (unsigned int i = 0; i < chain->nodelist_length; i++) { const in3_node_t* n = chain->nodelist + i; bb_write_int(bb, n->capacity); bb_write_int(bb, n->index); diff --git a/c/src/core/client/client.h b/c/src/core/client/client.h index e2e6b364f..ab46e7d7f 100644 --- a/c/src/core/client/client.h +++ b/c/src/core/client/client.h @@ -615,8 +615,8 @@ NONULL in3_ret_t in3_cache_init( * My return NULL if not found. */ NONULL in3_chain_t* in3_find_chain( - in3_t* c /**< the incubed client */, - chain_id_t chain_id /**< chain_id */ + const in3_t* c /**< the incubed client */, + chain_id_t chain_id /**< chain_id */ ); /** diff --git a/c/src/core/client/client_init.c b/c/src/core/client/client_init.c index a71a20b28..39d701012 100644 --- a/c/src/core/client/client_init.c +++ b/c/src/core/client/client_init.c @@ -309,7 +309,7 @@ static in3_ret_t in3_client_init(in3_t* c, chain_id_t chain_id) { return IN3_OK; } -in3_chain_t* in3_find_chain(in3_t* c, chain_id_t chain_id) { +in3_chain_t* in3_find_chain(const in3_t* c, chain_id_t chain_id) { // shortcut for single chain if (c->chains_length == 1) return c->chains->chain_id == chain_id ? c->chains : NULL; @@ -372,7 +372,7 @@ in3_ret_t in3_client_add_node(in3_t* c, chain_id_t chain_id, char* url, in3_node if (!chain) return IN3_EFIND; in3_node_t* node = NULL; int node_index = chain->nodelist_length; - for (int i = 0; i < chain->nodelist_length; i++) { + for (unsigned int i = 0; i < chain->nodelist_length; i++) { if (memcmp(chain->nodelist[i].address->data, address, 20) == 0) { node = chain->nodelist + i; node_index = i; @@ -412,7 +412,7 @@ in3_ret_t in3_client_remove_node(in3_t* c, chain_id_t chain_id, address_t addres in3_chain_t* chain = in3_find_chain(c, chain_id); if (!chain) return IN3_EFIND; int node_index = -1; - for (int i = 0; i < chain->nodelist_length; i++) { + for (unsigned int i = 0; i < chain->nodelist_length; i++) { if (memcmp(chain->nodelist[i].address->data, address, 20) == 0) { node_index = i; break; @@ -424,7 +424,7 @@ in3_ret_t in3_client_remove_node(in3_t* c, chain_id_t chain_id, address_t addres if (chain->nodelist[node_index].address) b_free(chain->nodelist[node_index].address); - if (node_index < chain->nodelist_length - 1) { + if (node_index < ((signed) chain->nodelist_length) - 1) { memmove(chain->nodelist + node_index, chain->nodelist + node_index + 1, sizeof(in3_node_t) * (chain->nodelist_length - 1 - node_index)); memmove(chain->weights + node_index, chain->weights + node_index + 1, sizeof(in3_node_weight_t) * (chain->nodelist_length - 1 - node_index)); } @@ -614,7 +614,7 @@ char* in3_get_config(in3_t* c) { add_bool(sb, ',', "needsUpdate", chain->nodelist_upd8_params != NULL); add_uint(sb, ',', "avgBlockTime", chain->avg_block_time); sb_add_chars(sb, ",\"nodeList\":["); - for (int j = 0; j < chain->nodelist_length; j++) { + for (unsigned int j = 0; j < chain->nodelist_length; j++) { if ((chain->nodelist[j].attrs & ATTR_BOOT_NODE) == 0) continue; if (sb->data[sb->len - 1] != '[') sb_add_char(sb, ','); add_string(sb, '{', "url", chain->nodelist[j].url); diff --git a/c/src/core/client/execute.c b/c/src/core/client/execute.c index 31517931b..d46aa38da 100644 --- a/c/src/core/client/execute.c +++ b/c/src/core/client/execute.c @@ -723,30 +723,26 @@ static void transport_cleanup(in3_ctx_t* ctx, ctx_req_transports_t* transports, static void in3_handle_rpc_next(in3_ctx_t* ctx, ctx_req_transports_t* transports) { in3_log_debug("waiting for the next respone ...\n"); - ctx = in3_ctx_last_waiting(ctx); - const in3_chain_t* chain = in3_find_chain(ctx->client, ctx->client->chain_id); + ctx = in3_ctx_last_waiting(ctx); for (int i = 0; i < transports->len; i++) { if (transports->req[i].ctx == ctx) { in3_request_t req = {.action = REQ_ACTION_RECEIVE, .ctx = ctx, .cptr = transports->req[i].ptr, .urls_len = 0, .urls = NULL, .payload = NULL}; ctx->client->transport(&req); #ifdef DEBUG - node_match_t* w = ctx->nodes; - int i = 0; + const in3_chain_t* chain = in3_find_chain(ctx->client, ctx->client->chain_id); + node_match_t* w = ctx->nodes; + int i = 0; for (; w; i++, w = w->next) { if (ctx->raw_response[i].state != IN3_WAITING && ctx->raw_response[i].data.data) { in3_node_t* node = ctx_get_node(chain, w); char* data = ctx->raw_response[i].data.data; -#ifdef DEBUG - data = format_json(data); -#endif + data = format_json(data); in3_log_trace(ctx->raw_response[i].state ? "... response(%s): \n... " COLOR_RED_STR "\n" : "... response(%s): \n... " COLOR_GREEN_STR "\n", node ? node->url : "intern", data); -#ifdef DEBUG _free(data); -#endif } } #endif diff --git a/c/src/core/client/nodelist.c b/c/src/core/client/nodelist.c index d43f52b41..05c642c53 100644 --- a/c/src/core/client/nodelist.c +++ b/c/src/core/client/nodelist.c @@ -78,8 +78,8 @@ NONULL static in3_ret_t fill_chain(in3_chain_t* chain, in3_ctx_t* ctx, d_token_t const uint64_t now = (uint64_t) _now; // read the nodes - d_token_t *nodes = d_get(result, K_NODES), *t; - int len = d_len(nodes); + d_token_t * nodes = d_get(result, K_NODES), *t; + unsigned int len = d_len(nodes); if (!nodes || d_type(nodes) != T_ARRAY) return ctx_set_error(ctx, "No Nodes in the result", IN3_EINVALDT); @@ -100,7 +100,7 @@ NONULL static in3_ret_t fill_chain(in3_chain_t* chain, in3_ctx_t* ctx, d_token_t d_token_t* node = NULL; // set new values - for (int i = 0; i < len; i++) { + for (unsigned int i = 0; i < len; i++) { in3_node_t* n = newList + i; node = node ? d_next(node) : d_get_at(nodes, i); if (!node) { @@ -133,7 +133,7 @@ NONULL static in3_ret_t fill_chain(in3_chain_t* chain, in3_ctx_t* ctx, d_token_t // restore the nodeweights if the address was known in the old nodeList if (chain->nodelist_length <= i || !b_cmp(chain->nodelist[i].address, n->address)) { old_index = -1; - for (int j = 0; j < chain->nodelist_length; j++) { + for (unsigned int j = 0; j < chain->nodelist_length; j++) { if (b_cmp(chain->nodelist[j].address, n->address)) { old_index = j; break; @@ -175,11 +175,11 @@ NONULL void in3_client_run_chain_whitelisting(in3_chain_t* chain) { if (!chain->whitelist) return; - for (int j = 0; j < chain->nodelist_length; ++j) + for (unsigned int j = 0; j < chain->nodelist_length; ++j) BIT_CLEAR(chain->nodelist[j].attrs, ATTR_WHITELISTED); for (size_t i = 0; i < chain->whitelist->addresses.len / 20; i += 20) { - for (int j = 0; j < chain->nodelist_length; ++j) + for (unsigned int j = 0; j < chain->nodelist_length; ++j) if (!memcmp(chain->whitelist->addresses.data + i, chain->nodelist[j].address, 20)) BIT_SET(chain->nodelist[j].attrs, ATTR_WHITELISTED); } @@ -567,7 +567,7 @@ in3_ret_t in3_node_list_pick_nodes(in3_ctx_t* ctx, node_match_t** nodes, int req /** removes all nodes and their weights from the nodelist */ void in3_nodelist_clear(in3_chain_t* chain) { - for (int i = 0; i < chain->nodelist_length; i++) { + for (unsigned int i = 0; i < chain->nodelist_length; i++) { if (chain->nodelist[i].url) _free(chain->nodelist[i].url); if (chain->nodelist[i].address) b_free(chain->nodelist[i].address); } From d8efa846677b8bf25e86653cf4318ab6b30cce05 Mon Sep 17 00:00:00 2001 From: Simon Jentzsch Date: Thu, 9 Jul 2020 00:00:36 +0200 Subject: [PATCH 24/37] add -fi/fo opttions --- c/src/cmd/in3/CMakeLists.txt | 2 +- c/src/cmd/in3/main.c | 5 ++ c/src/cmd/in3/recorder.c | 142 +++++++++++++++++++++++++++++++++++ c/src/cmd/in3/recorder.h | 11 +++ 4 files changed, 159 insertions(+), 1 deletion(-) create mode 100644 c/src/cmd/in3/recorder.c create mode 100644 c/src/cmd/in3/recorder.h diff --git a/c/src/cmd/in3/CMakeLists.txt b/c/src/cmd/in3/CMakeLists.txt index f538eb348..2c8d860f3 100644 --- a/c/src/cmd/in3/CMakeLists.txt +++ b/c/src/cmd/in3/CMakeLists.txt @@ -41,7 +41,7 @@ if (LEDGER_NANO) set(LIBS ${LIBS} ledger_signer) endif() -add_executable(in3 main.c in3_storage.c) +add_executable(in3 main.c in3_storage.c recorder.c) target_compile_definitions(in3 PRIVATE _XOPEN_SOURCE=600) target_link_libraries(in3 init pk_signer ${LIBS} -lm) diff --git a/c/src/cmd/in3/main.c b/c/src/cmd/in3/main.c index c92fff051..62c9498fc 100644 --- a/c/src/cmd/in3/main.c +++ b/c/src/cmd/in3/main.c @@ -71,6 +71,7 @@ #include "../../verifier/eth1/nano/chainspec.h" #include "../../verifier/in3_init.h" #include "in3_storage.h" +#include "recorder.h" #include #include #include @@ -766,6 +767,10 @@ int main(int argc, char* argv[]) { run_test_request = 1; else if (strcmp(argv[i], "-thr") == 0) run_test_request = 2; + else if (strcmp(argv[i], "-fo") == 0) + recorder_write_start(c, argv[++i]); + else if (strcmp(argv[i], "-fi") == 0) + recorder_read_start(c, argv[++i]); else if (strcmp(argv[i], "-nl") == 0) set_nodelist(c, argv[++i], false); else if (strcmp(argv[i], "-bn") == 0) diff --git a/c/src/cmd/in3/recorder.c b/c/src/cmd/in3/recorder.c new file mode 100644 index 000000000..6ce90a071 --- /dev/null +++ b/c/src/cmd/in3/recorder.c @@ -0,0 +1,142 @@ +#include "recorder.h" +#include "../../core/client/context_internal.h" +#include "../../core/client/keys.h" +#include +#include +static void die(char* msg) { + fprintf(stderr, COLORT_RED "Error: %s" COLORT_RESET "\n", msg); + exit(EXIT_FAILURE); +} + +typedef struct { + char* file; + in3_transport_send transport; + FILE* f; +} recorder_out_t; + +typedef struct { + char* name; + char** args; + int argl; +} recorder_entry_t; + +static recorder_out_t out = { + .file = NULL, + .transport = NULL, + .f = NULL}; + +static int rand_out(void* s) { + UNUSED_VAR(s); + int r = rand(); + fprintf(out.f, ":: rand %i\n\n", r); + fflush(out.f); + return r; +} + +recorder_entry_t read_entry(sb_t* sb) { + recorder_entry_t entry = {0}; + + char buffer[1024]; + while (fgets(buffer, 1023, out.f)) { + int l = strlen(buffer); + if (buffer[l - 1] == '\n') + buffer[--l] = 0; + if (!l) break; + if (!entry.name) { + char* ptr = strtok(buffer + 3, " "); + entry.name = _strdupn(ptr, -1); + while ((ptr = strtok(NULL, " "))) { + entry.args = entry.argl ? _realloc(entry.args, sizeof(char*) * (entry.argl + 1), sizeof(char*) * entry.argl) : _malloc(sizeof(char*)); + entry.args[entry.argl++] = _strdupn(ptr, -1); + } + } else + sb_add_chars(sb, buffer); + } + + return entry; +} +static void entry_free(recorder_entry_t* e, sb_t* sb) { + if (e->name) _free(e->name); + for (int i = 0; i < e->argl; i++) _free(e->args[i]); + _free(e->args); + if (sb && sb->data) _free(sb->data); + if (sb) *sb = (sb_t){0}; +} +static int rand_in(void* s) { + UNUSED_VAR(s); + sb_t sb = {0}; + recorder_entry_t entry = read_entry(&sb); + if (!entry.name || strcmp(entry.name, "rand")) die("expected rand in recorder!"); + if (entry.argl != 1) die("expect one arg for random"); + int r = atoi(entry.args[0]); + entry_free(&entry, &sb); + + return r; +} + +static in3_ret_t recorder_transport_in(in3_request_t* req) { + sb_t sb = {0}; + recorder_entry_t entry = {0}; + switch (req->action) { + case REQ_ACTION_SEND: + entry = read_entry(&sb); + if (!entry.name || strcmp(entry.name, "request")) die("expected request in recorder!"); + entry_free(&entry, &sb); + + case REQ_ACTION_RECEIVE: + entry = read_entry(&sb); + if (!entry.name || strcmp(entry.name, "response")) die("expected response in recorder!"); + in3_response_t* r = req->ctx->raw_response + atoi(entry.args[0]); + sb_add_chars(&r->data, sb.data); + r->state = atoi(entry.args[3]); + r->time = atoi(entry.args[4]); + + entry_free(&entry, &sb); + break; + default: + break; + } + return 0; +} +static in3_ret_t recorder_transport_out(in3_request_t* req) { + in3_chain_t* chain = in3_find_chain(req->ctx->client, req->ctx->client->chain_id); + node_match_t* m = req->ctx->nodes; + in3_ret_t res = out.transport(req); + if (req->action == REQ_ACTION_SEND) { + fprintf(out.f, ":: request "); + for (int i = 0; m; i++, m = m->next) + fprintf(out.f, "%s ", ctx_get_node(chain, m)->url); + fprintf(out.f, "\n %s\n\n", req->payload); + fflush(out.f); + } + if (req->action != REQ_ACTION_CLEANUP) { + m = req->ctx->nodes; + for (int i = 0; m; i++, m = m->next) { + in3_response_t* r = req->ctx->raw_response + i; + if (r->time) { + fprintf(out.f, ":: response %i %s %s %i %i\n", i, d_get_stringk(req->ctx->requests[0], K_METHOD), ctx_get_node(chain, m)->url, r->state, r->time); + char* data = format_json(r->data.data ? r->data.data : ""); + fprintf(out.f, "%s\n\n", data); + fflush(out.f); + _free(data); + } + } + } + return res; +} + +void recorder_write_start(in3_t* c, char* file) { + out.file = file; + out.transport = c->transport; + c->transport = recorder_transport_out; + out.f = fopen(file, "w"); + in3_set_func_rand(rand_out); +} + +void recorder_read_start(in3_t* c, char* file) { + out.file = file; + out.transport = c->transport; + c->transport = recorder_transport_in; + out.f = fopen(file, "r"); + in3_set_func_rand(rand_in); +} \ No newline at end of file diff --git a/c/src/cmd/in3/recorder.h b/c/src/cmd/in3/recorder.h new file mode 100644 index 000000000..41b13fe1b --- /dev/null +++ b/c/src/cmd/in3/recorder.h @@ -0,0 +1,11 @@ +#include "../../core/client/client.h" +#include "../../core/util/data.h" +#include "../../core/util/debug.h" +#include "../../core/util/log.h" +#include "../../core/util/mem.h" +#include +#include +#include + +void recorder_write_start(in3_t* c, char* file); +void recorder_read_start(in3_t* c, char* file); From 1ddb83d054eb3f861c4c621517c1e347ce00f9a1 Mon Sep 17 00:00:00 2001 From: Simon Jentzsch Date: Thu, 9 Jul 2020 06:52:04 +0200 Subject: [PATCH 25/37] add cache --- c/src/cmd/in3/recorder.c | 133 ++++++++++++++++++++++++++------------- 1 file changed, 91 insertions(+), 42 deletions(-) diff --git a/c/src/cmd/in3/recorder.c b/c/src/cmd/in3/recorder.c index 6ce90a071..7e1f49442 100644 --- a/c/src/cmd/in3/recorder.c +++ b/c/src/cmd/in3/recorder.c @@ -9,27 +9,30 @@ static void die(char* msg) { } typedef struct { - char* file; - in3_transport_send transport; - FILE* f; -} recorder_out_t; + char* file; + in3_transport_send transport; + FILE* f; + in3_storage_handler_t* cache; +} recorder_t; typedef struct { char* name; char** args; int argl; + } recorder_entry_t; -static recorder_out_t out = { +static recorder_t rec = { .file = NULL, .transport = NULL, - .f = NULL}; + .f = NULL, + .cache = NULL}; static int rand_out(void* s) { UNUSED_VAR(s); int r = rand(); - fprintf(out.f, ":: rand %i\n\n", r); - fflush(out.f); + fprintf(rec.f, ":: rand %i\n\n", r); + fflush(rec.f); return r; } @@ -37,7 +40,7 @@ recorder_entry_t read_entry(sb_t* sb) { recorder_entry_t entry = {0}; char buffer[1024]; - while (fgets(buffer, 1023, out.f)) { + while (fgets(buffer, 1023, rec.f)) { int l = strlen(buffer); if (buffer[l - 1] == '\n') buffer[--l] = 0; @@ -77,47 +80,44 @@ static int rand_in(void* s) { static in3_ret_t recorder_transport_in(in3_request_t* req) { sb_t sb = {0}; recorder_entry_t entry = {0}; - switch (req->action) { - case REQ_ACTION_SEND: - entry = read_entry(&sb); - if (!entry.name || strcmp(entry.name, "request")) die("expected request in recorder!"); - entry_free(&entry, &sb); - - case REQ_ACTION_RECEIVE: - entry = read_entry(&sb); - if (!entry.name || strcmp(entry.name, "response")) die("expected response in recorder!"); - in3_response_t* r = req->ctx->raw_response + atoi(entry.args[0]); - sb_add_chars(&r->data, sb.data); - r->state = atoi(entry.args[3]); - r->time = atoi(entry.args[4]); - - entry_free(&entry, &sb); - break; - default: - break; + if (req->action == REQ_ACTION_SEND) { + entry = read_entry(&sb); + if (!entry.name || strcmp(entry.name, "request")) die("expected request in recorder!"); + entry_free(&entry, &sb); + req->cptr = &rec; + } + if (req->action != REQ_ACTION_CLEANUP) { + entry = read_entry(&sb); + if (!entry.name || strcmp(entry.name, "response")) die("expected response in recorder!"); + in3_response_t* r = req->ctx->raw_response + atoi(entry.args[0]); + sb_add_chars(&r->data, sb.data); + r->state = atoi(entry.args[3]); + r->time = atoi(entry.args[4]); + entry_free(&entry, &sb); } + return 0; } static in3_ret_t recorder_transport_out(in3_request_t* req) { in3_chain_t* chain = in3_find_chain(req->ctx->client, req->ctx->client->chain_id); node_match_t* m = req->ctx->nodes; - in3_ret_t res = out.transport(req); + in3_ret_t res = rec.transport(req); if (req->action == REQ_ACTION_SEND) { - fprintf(out.f, ":: request "); + fprintf(rec.f, ":: request "); for (int i = 0; m; i++, m = m->next) - fprintf(out.f, "%s ", ctx_get_node(chain, m)->url); - fprintf(out.f, "\n %s\n\n", req->payload); - fflush(out.f); + fprintf(rec.f, "%s ", ctx_get_node(chain, m)->url); + fprintf(rec.f, "\n %s\n\n", req->payload); + fflush(rec.f); } if (req->action != REQ_ACTION_CLEANUP) { m = req->ctx->nodes; for (int i = 0; m; i++, m = m->next) { in3_response_t* r = req->ctx->raw_response + i; if (r->time) { - fprintf(out.f, ":: response %i %s %s %i %i\n", i, d_get_stringk(req->ctx->requests[0], K_METHOD), ctx_get_node(chain, m)->url, r->state, r->time); + fprintf(rec.f, ":: response %i %s %s %i %i\n", i, d_get_stringk(req->ctx->requests[0], K_METHOD), ctx_get_node(chain, m)->url, r->state, r->time); char* data = format_json(r->data.data ? r->data.data : ""); - fprintf(out.f, "%s\n\n", data); - fflush(out.f); + fprintf(rec.f, "%s\n\n", data); + fflush(rec.f); _free(data); } } @@ -125,18 +125,67 @@ static in3_ret_t recorder_transport_out(in3_request_t* req) { return res; } +bytes_t* rec_get_item_in(void* cptr, const char* key) { + UNUSED_VAR(cptr); + UNUSED_VAR(key); + sb_t sb = {0}; + recorder_entry_t entry = read_entry(&sb); + if (!entry.name || strcmp(entry.name, "cache")) die("expected cache in recorder!"); + if (entry.argl != 2) die("expect 2 args for cache"); + if (strcmp(key, entry.args[0])) die("wrong cache key"); + bytes_t* found = atoi(entry.args[1]) ? hex_to_new_bytes(sb.data, sb.len) : NULL; + entry_free(&entry, &sb); + + return found; +} + +void rec_set_item_in(void* cptr, const char* key, bytes_t* content) { + UNUSED_VAR(cptr); + UNUSED_VAR(key); + UNUSED_VAR(content); +} + +void rec_clear_in(void* cptr) { + UNUSED_VAR(cptr); +} + +bytes_t* rec_get_item_out(void* cptr, const char* key) { + if (!rec.cache) return NULL; + bytes_t* found = rec.cache->get_item(cptr, key); + fprintf(rec.f, ":: cache %s %i\n", key, found ? 1 : 0); + if (found) { + char* hex = alloca(found->len * 2 + 1); + bytes_to_hex(found->data, found->len, hex); + fprintf(rec.f, "%s\n\n", hex); + } else + fprintf(rec.f, "\n"); + + return found; +} + +void rec_set_item_out(void* cptr, const char* key, bytes_t* content) { + if (rec.cache) rec.cache->set_item(cptr, key, content); +} + +void rec_clear_out(void* cptr) { + if (rec.cache) rec.cache->clear(cptr); +} + void recorder_write_start(in3_t* c, char* file) { - out.file = file; - out.transport = c->transport; + rec.file = file; + rec.transport = c->transport; c->transport = recorder_transport_out; - out.f = fopen(file, "w"); + rec.f = fopen(file, "w"); + rec.cache = c->cache; in3_set_func_rand(rand_out); + in3_set_storage_handler(c, rec_get_item_out, rec_set_item_out, rec_clear_out, &rec); } void recorder_read_start(in3_t* c, char* file) { - out.file = file; - out.transport = c->transport; + rec.file = file; + rec.transport = c->transport; c->transport = recorder_transport_in; - out.f = fopen(file, "r"); + rec.f = fopen(file, "r"); in3_set_func_rand(rand_in); -} \ No newline at end of file + in3_set_storage_handler(c, rec_get_item_in, rec_set_item_in, rec_clear_in, &rec); +} From 932e7b43d77f01eb9c11e333e5624113075c2627 Mon Sep 17 00:00:00 2001 From: Simon Jentzsch Date: Thu, 9 Jul 2020 09:51:37 +0200 Subject: [PATCH 26/37] fixed retry-bug in case of failed nodelist update --- c/src/core/client/execute.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/c/src/core/client/execute.c b/c/src/core/client/execute.c index d46aa38da..8213eb5f8 100644 --- a/c/src/core/client/execute.c +++ b/c/src/core/client/execute.c @@ -457,7 +457,7 @@ static in3_ret_t verify_response(in3_ctx_t* ctx, in3_chain_t* chain, in3_verifie in3_log_debug("we have a user-error from %s, so we reject the response, but don't blacklist ..\n", n ? n->url : "intern"); continue; } else { - in3_log_debug("we have a system-error from %s, so we block it ..\n", n ? n->url : "intern"); + if (!node->blocked) in3_log_debug("we have a system-error from %s, so we block it ..\n", n ? n->url : "intern"); blacklist_node(chain, node); return ctx_set_error(ctx, err_msg ? err_msg : "Invalid response", IN3_EINVAL); } @@ -733,7 +733,7 @@ static void in3_handle_rpc_next(in3_ctx_t* ctx, ctx_req_transports_t* transports node_match_t* w = ctx->nodes; int i = 0; for (; w; i++, w = w->next) { - if (ctx->raw_response[i].state != IN3_WAITING && ctx->raw_response[i].data.data) { + if (ctx->raw_response[i].state != IN3_WAITING && ctx->raw_response[i].data.data && ctx->raw_response[i].time) { in3_node_t* node = ctx_get_node(chain, w); char* data = ctx->raw_response[i].data.data; data = format_json(data); @@ -912,7 +912,7 @@ in3_ctx_state_t in3_ctx_exec_state(in3_ctx_t* ctx) { } in3_ret_t in3_ctx_execute(in3_ctx_t* ctx) { - in3_ret_t ret; + in3_ret_t ret = IN3_OK; // if there is an error it does not make sense to execute. if (ctx->error) return (ctx->verification_state && ctx->verification_state != IN3_WAITING) ? ctx->verification_state : IN3_EUNKNOWN; @@ -955,17 +955,15 @@ in3_ret_t in3_ctx_execute(in3_ctx_t* ctx) { filter.props = (ctx->client->node_props & 0xFFFFFFFF) | NODE_PROP_DATA | ((ctx->client->flags & FLAGS_HTTP) ? NODE_PROP_HTTP : 0) | (in3_ctx_get_proof(ctx) != PROOF_NONE ? NODE_PROP_PROOF : 0); if ((ret = in3_node_list_pick_nodes(ctx, &ctx->nodes, ctx->client->request_count, filter)) == IN3_OK) { if ((ret = pick_signers(ctx, ctx->requests[0])) < 0) - return ctx_set_error(ctx, "error configuring the config for request", ret); + return ctx_set_error(ctx, "error configuring the config for request", ret < 0 && ret != IN3_WAITING && ctx_is_allowed_to_fail(ctx) ? IN3_EIGNORE : ret); #ifdef PAY - // now we have the nodes, we can prepare the payment if (ctx->client->pay && ctx->client->pay->prepare && (ret = ctx->client->pay->prepare(ctx, ctx->client->pay->cptr)) != IN3_OK) return ret; #endif - } else // since we could not get the nodes, we either report it as error or wait. - return ctx_set_error(ctx, "could not find any node", ret); + return ctx_set_error(ctx, "could not find any node", ret < 0 && ret != IN3_WAITING && ctx_is_allowed_to_fail(ctx) ? IN3_EIGNORE : ret); } // if we still don't have an response, we keep on waiting From a9a21956ab48096b3de7557100f90ee594070846 Mon Sep 17 00:00:00 2001 From: Enrico Rockstroh Date: Thu, 9 Jul 2020 09:59:31 +0200 Subject: [PATCH 27/37] re-enable nuget deploy with new API key --- dotnet/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dotnet/ci.yml b/dotnet/ci.yml index d6b445578..03450fa20 100644 --- a/dotnet/ci.yml +++ b/dotnet/ci.yml @@ -80,7 +80,7 @@ dotnet_arm: tags: - arm -.disabled-release_nuget: +release_nuget: stage: deploy image: docker.slock.it/build-images/dotnet-core-sdk:3.1 tags: @@ -93,7 +93,7 @@ dotnet_arm: - dotnet_macos script: - dotnet pack -c Release NuspecFile=${NUSPEC_FILE} -Properties "version=${CI_COMMIT_TAG}" - - dotnet nuget push dotnet/In3/bin/Release/Slockit.In3.${CI_COMMIT_TAG}.nupkg -k {NUGET_API_KEY} -s https://api.nuget.org/v3/index.json + - dotnet nuget push dotnet/In3/bin/Release/Slockit.In3.${CI_COMMIT_TAG}.nupkg -k {NUGET_GALLERY_API_KEY} -s https://api.nuget.org/v3/index.json artifacts: paths: - dotnet/In3/bin/Release/Slockit.In3.${CI_COMMIT_TAG}.nupkg From efc80b336bda09124b8c84e0185f10e67e804349 Mon Sep 17 00:00:00 2001 From: Simon Jentzsch Date: Thu, 9 Jul 2020 10:59:02 +0200 Subject: [PATCH 28/37] better errors --- c/src/core/client/execute.c | 8 ++++++++ c/src/verifier/eth1/basic/eth_account.c | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/c/src/core/client/execute.c b/c/src/core/client/execute.c index 8213eb5f8..eed542e93 100644 --- a/c/src/core/client/execute.c +++ b/c/src/core/client/execute.c @@ -469,6 +469,14 @@ static in3_ret_t verify_response(in3_ctx_t* ctx, in3_chain_t* chain, in3_verifie if (res == IN3_WAITING) return res; if (res) { + // before we blacklist the node, we remove the data and replace it with the error-message + // this is needed in case it will be cleared and we don't want to lose the error message + if (ctx->error && ctx->raw_response[i].data.data) { + _free(ctx->raw_response->data.data); + int l = strlen(ctx->error); + ctx->raw_response[i].state = res; + ctx->raw_response[i].data = (sb_t){.data = _strdupn(ctx->error, l), .allocted = l + 1, .len = l}; + } blacklist_node(chain, node); return res; } diff --git a/c/src/verifier/eth1/basic/eth_account.c b/c/src/verifier/eth1/basic/eth_account.c index 0fbe72c7a..20e72b0f2 100644 --- a/c/src/verifier/eth1/basic/eth_account.c +++ b/c/src/verifier/eth1/basic/eth_account.c @@ -35,6 +35,7 @@ #include "../../../core/client/context.h" #include "../../../core/client/keys.h" #include "../../../core/util/data.h" +#include "../../../core/util/log.h" #include "../../../core/util/mem.h" #include "../../../third-party/crypto/bignum.h" #include "../../../verifier/eth1/nano/eth_nano.h" @@ -73,7 +74,7 @@ static in3_ret_t verify_proof(in3_vctx_t* vc, bytes_t* header, d_token_t* accoun if (!trie_verify_proof(&root, &path, proof, is_not_existened(account) ? NULL : account_raw)) { _free(proof); b_free(account_raw); - return vc_err(vc, "invalid account proof"); + return vc_err(vc, "invalid account proof where blockheader does not match the rootstate, which might be a microfork"); } _free(proof); b_free(account_raw); From 246c81704bc788210b282279a7cb93a44a62e848 Mon Sep 17 00:00:00 2001 From: leonardocardoso Date: Wed, 8 Jul 2020 14:45:01 +0200 Subject: [PATCH 29/37] Fix targets path for native discovery on dotnet binding --- dotnet/In3/In3.csproj | 2 +- dotnet/ci.yml | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/dotnet/In3/In3.csproj b/dotnet/In3/In3.csproj index c94692dcb..ce34834b9 100644 --- a/dotnet/In3/In3.csproj +++ b/dotnet/In3/In3.csproj @@ -31,7 +31,7 @@ true - build + \ diff --git a/dotnet/ci.yml b/dotnet/ci.yml index 03450fa20..3b1098ff2 100644 --- a/dotnet/ci.yml +++ b/dotnet/ci.yml @@ -92,8 +92,9 @@ release_nuget: - dotnet_arm - dotnet_macos script: - - dotnet pack -c Release NuspecFile=${NUSPEC_FILE} -Properties "version=${CI_COMMIT_TAG}" - - dotnet nuget push dotnet/In3/bin/Release/Slockit.In3.${CI_COMMIT_TAG}.nupkg -k {NUGET_GALLERY_API_KEY} -s https://api.nuget.org/v3/index.json + - cd dotnet + - dotnet pack -c Release -p:version=${CI_COMMIT_TAG} + - dotnet nuget push In3/bin/Release/Slockit.In3.${CI_COMMIT_TAG}.nupkg -k {NUGET_GALLERY_API_KEY} -s https://api.nuget.org/v3/index.json artifacts: paths: - dotnet/In3/bin/Release/Slockit.In3.${CI_COMMIT_TAG}.nupkg From 52d6dfb0583684a54a8084b0857abb89389ba526 Mon Sep 17 00:00:00 2001 From: Simon Jentzsch Date: Thu, 9 Jul 2020 13:18:56 +0200 Subject: [PATCH 30/37] cleaning up to avoid double verification --- c/src/core/client/execute.c | 10 +++++----- java/src/in3_jni.c | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/c/src/core/client/execute.c b/c/src/core/client/execute.c index eed542e93..d9fc60b94 100644 --- a/c/src/core/client/execute.c +++ b/c/src/core/client/execute.c @@ -471,11 +471,11 @@ static in3_ret_t verify_response(in3_ctx_t* ctx, in3_chain_t* chain, in3_verifie if (res) { // before we blacklist the node, we remove the data and replace it with the error-message // this is needed in case it will be cleared and we don't want to lose the error message - if (ctx->error && ctx->raw_response[i].data.data) { - _free(ctx->raw_response->data.data); - int l = strlen(ctx->error); - ctx->raw_response[i].state = res; - ctx->raw_response[i].data = (sb_t){.data = _strdupn(ctx->error, l), .allocted = l + 1, .len = l}; + if (ctx->error && response->data.data) { + _free(response->data.data); + int l = strlen(ctx->error); + response->state = res; + response->data = (sb_t){.data = _strdupn(ctx->error, l), .allocted = l + 1, .len = l}; } blacklist_node(chain, node); return res; diff --git a/java/src/in3_jni.c b/java/src/in3_jni.c index e89bcefb1..1c3cb1bc8 100644 --- a/java/src/in3_jni.c +++ b/java/src/in3_jni.c @@ -630,7 +630,7 @@ void in3_set_jclient_config(in3_t* c, jobject jclient) { jclass jnodeconfigclass = (*jni)->FindClass(jni, "in3/config/NodeConfiguration"); - for (int i = 0; i < chain.nodelist_length; i++) { + for (unsigned int i = 0; i < chain.nodelist_length; i++) { in3_node_t node = chain.nodelist[i]; jobject jnodeconfigobj = (*jni)->NewObject(jni, jnodeconfigclass, (*jni)->GetMethodID(jni, jnodeconfigclass, "", "(Lin3/config/ChainConfiguration;)V"), jchainconfigobj); jmethodID set_address_mid = (*jni)->GetMethodID(jni, jnodeconfigclass, "setAddress", "(Ljava/lang/String;)V"); From 0a61c37eaa52d7ee776ba04a94d06064adb2318e Mon Sep 17 00:00:00 2001 From: Simon Jentzsch Date: Thu, 9 Jul 2020 13:59:49 +0200 Subject: [PATCH 31/37] better logging --- c/src/core/client/execute.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/c/src/core/client/execute.c b/c/src/core/client/execute.c index d9fc60b94..06dc728d4 100644 --- a/c/src/core/client/execute.c +++ b/c/src/core/client/execute.c @@ -518,7 +518,7 @@ static in3_ret_t find_valid_result(in3_ctx_t* ctx, int nodes_count, in3_response state = verify_response(ctx, chain, verifier, node, response + n); if (state == IN3_OK) { - in3_log_debug("accepted response from %s\n", node_data ? node_data->url : "intern"); + in3_log_debug(COLOR_GREEN "accepted response for %s from %s\n" COLOR_RESET, d_get_stringk(ctx->requests[0], K_METHOD), node_data ? node_data->url : "intern"); break; } else if (state == IN3_WAITING) return state; @@ -939,7 +939,7 @@ in3_ret_t in3_ctx_execute(in3_ctx_t* ctx) { return ctx_set_error(ctx, ctx->required->error ? ctx->required->error : "error handling subrequest", ret); } - in3_log_debug("ctx_execute %s ... attempt = %i\n", d_get_stringk(ctx->requests[0], K_METHOD), ctx->error, ctx->attempt); + in3_log_debug("ctx_execute %s ... attempt %i\n", d_get_stringk(ctx->requests[0], K_METHOD), ctx->attempt + 1); switch (ctx->type) { case CT_RPC: { From 831eb0c432d268579dd1877e3605fb75a8a96ac6 Mon Sep 17 00:00:00 2001 From: Simon Jentzsch Date: Thu, 9 Jul 2020 16:19:40 +0200 Subject: [PATCH 32/37] add time --- c/src/cmd/in3/recorder.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/c/src/cmd/in3/recorder.c b/c/src/cmd/in3/recorder.c index 7e1f49442..01bc40816 100644 --- a/c/src/cmd/in3/recorder.c +++ b/c/src/cmd/in3/recorder.c @@ -13,6 +13,7 @@ typedef struct { in3_transport_send transport; FILE* f; in3_storage_handler_t* cache; + uint64_t time; } recorder_t; typedef struct { @@ -26,7 +27,8 @@ static recorder_t rec = { .file = NULL, .transport = NULL, .f = NULL, - .cache = NULL}; + .cache = NULL, + .time = 0}; static int rand_out(void* s) { UNUSED_VAR(s); @@ -170,6 +172,10 @@ void rec_set_item_out(void* cptr, const char* key, bytes_t* content) { void rec_clear_out(void* cptr) { if (rec.cache) rec.cache->clear(cptr); } +uint64_t static_time(void* t) { + UNUSED_VAR(t); + return rec.time; +} void recorder_write_start(in3_t* c, char* file) { rec.file = file; @@ -179,6 +185,7 @@ void recorder_write_start(in3_t* c, char* file) { rec.cache = c->cache; in3_set_func_rand(rand_out); in3_set_storage_handler(c, rec_get_item_out, rec_set_item_out, rec_clear_out, &rec); + fprintf(rec.f, ":: time %u\n\n", (uint32_t) in3_time(NULL)); } void recorder_read_start(in3_t* c, char* file) { @@ -188,4 +195,9 @@ void recorder_read_start(in3_t* c, char* file) { rec.f = fopen(file, "r"); in3_set_func_rand(rand_in); in3_set_storage_handler(c, rec_get_item_in, rec_set_item_in, rec_clear_in, &rec); + sb_t sb; + recorder_entry_t entry = read_entry(&sb); + rec.time = atoll(entry.args[0]); + entry_free(&entry, &sb); + in3_set_func_time(static_time); } From 113f451746e7dad14d5823bc9a6aba3f51598ea2 Mon Sep 17 00:00:00 2001 From: Simon Jentzsch Date: Thu, 9 Jul 2020 16:28:19 +0200 Subject: [PATCH 33/37] fix time --- c/src/cmd/in3/recorder.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/c/src/cmd/in3/recorder.c b/c/src/cmd/in3/recorder.c index 01bc40816..9f1c9e9b5 100644 --- a/c/src/cmd/in3/recorder.c +++ b/c/src/cmd/in3/recorder.c @@ -195,7 +195,7 @@ void recorder_read_start(in3_t* c, char* file) { rec.f = fopen(file, "r"); in3_set_func_rand(rand_in); in3_set_storage_handler(c, rec_get_item_in, rec_set_item_in, rec_clear_in, &rec); - sb_t sb; + sb_t sb = {0}; recorder_entry_t entry = read_entry(&sb); rec.time = atoll(entry.args[0]); entry_free(&entry, &sb); From 78bc17c595daae744a048fca326586ceed9f7504 Mon Sep 17 00:00:00 2001 From: Simon Jentzsch Date: Thu, 9 Jul 2020 17:18:54 +0200 Subject: [PATCH 34/37] remove warning --- c/src/cmd/in3/recorder.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/c/src/cmd/in3/recorder.c b/c/src/cmd/in3/recorder.c index 9f1c9e9b5..8064c923c 100644 --- a/c/src/cmd/in3/recorder.c +++ b/c/src/cmd/in3/recorder.c @@ -197,7 +197,7 @@ void recorder_read_start(in3_t* c, char* file) { in3_set_storage_handler(c, rec_get_item_in, rec_set_item_in, rec_clear_in, &rec); sb_t sb = {0}; recorder_entry_t entry = read_entry(&sb); - rec.time = atoll(entry.args[0]); + rec.time = entry.argl >= 1 ? atoll(entry.args[0]) : 0; entry_free(&entry, &sb); in3_set_func_time(static_time); } From c9a1f0b453b815341cec28ea4d3deb357a0ce21e Mon Sep 17 00:00:00 2001 From: Simon Jentzsch Date: Thu, 9 Jul 2020 20:31:11 +0200 Subject: [PATCH 35/37] fixed memory leak --- c/src/core/client/execute.c | 2 +- c/src/verifier/eth1/evm/accounts.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/c/src/core/client/execute.c b/c/src/core/client/execute.c index 06dc728d4..0e4c1354b 100644 --- a/c/src/core/client/execute.c +++ b/c/src/core/client/execute.c @@ -814,7 +814,7 @@ void in3_handle_rpc(in3_ctx_t* ctx, ctx_req_transports_t* transports) { } } if (index == -1) { - transports->req = transports->len ? _realloc(transports->req, sizeof(ctx_req_t) * (transports->len + 1), sizeof(ctx_req_t) * transports->len) : _malloc(sizeof(ctx_req_t) * transports->len); + transports->req = transports->len ? _realloc(transports->req, sizeof(ctx_req_t) * (transports->len + 1), sizeof(ctx_req_t) * transports->len) : _malloc(sizeof(ctx_req_t)); index = transports->len++; } diff --git a/c/src/verifier/eth1/evm/accounts.c b/c/src/verifier/eth1/evm/accounts.c index f3a21200a..3ba5be090 100644 --- a/c/src/verifier/eth1/evm/accounts.c +++ b/c/src/verifier/eth1/evm/accounts.c @@ -68,7 +68,7 @@ account_t* evm_get_account(evm_t* evm, address_t adr, wlen_t create) { } // get balance, nonce and code - uint8_t *balance, *nonce, *code_size; + uint8_t *balance = NULL, *nonce = NULL, *code_size = NULL; int l_balance = evm->env(evm, EVM_ENV_BALANCE, adr, 20, &balance, 0, 0); int l_code_size = evm->env(evm, EVM_ENV_CODE_SIZE, adr, 20, &code_size, 0, 0); int l_nonce = evm->env(evm, EVM_ENV_NONCE, adr, 20, &nonce, 0, 0); From 98d512d532d281c880155a7510059df653033d14 Mon Sep 17 00:00:00 2001 From: Simon Jentzsch Date: Thu, 9 Jul 2020 21:18:06 +0200 Subject: [PATCH 36/37] fixed memory issue --- c/src/cmd/in3/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/c/src/cmd/in3/main.c b/c/src/cmd/in3/main.c index 62c9498fc..485203126 100644 --- a/c/src/cmd/in3/main.c +++ b/c/src/cmd/in3/main.c @@ -1256,7 +1256,7 @@ int main(int argc, char* argv[]) { // if the result is a string, we remove the quotes if (result[0] == '"' && result[strlen(result) - 1] == '"') { - memmove(result, result + 1, strlen(result) + 1); + memmove(result, result + 1, strlen(result) - 1); result[strlen(result) - 1] = 0; } From 087d7bffc5d2f4813b5e60b1cee0ec00545d6df8 Mon Sep 17 00:00:00 2001 From: Simon Jentzsch Date: Thu, 9 Jul 2020 21:48:03 +0200 Subject: [PATCH 37/37] fix result stripping --- c/src/cmd/in3/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/c/src/cmd/in3/main.c b/c/src/cmd/in3/main.c index 485203126..31a810f71 100644 --- a/c/src/cmd/in3/main.c +++ b/c/src/cmd/in3/main.c @@ -1256,7 +1256,7 @@ int main(int argc, char* argv[]) { // if the result is a string, we remove the quotes if (result[0] == '"' && result[strlen(result) - 1] == '"') { - memmove(result, result + 1, strlen(result) - 1); + memmove(result, result + 1, strlen(result)); result[strlen(result) - 1] = 0; }