From 0c0352b4b111bd7ada24b4e5eea6bb8d10bd5296 Mon Sep 17 00:00:00 2001 From: ko1N Date: Sun, 18 Dec 2022 22:15:16 +0100 Subject: [PATCH] Added auto-clear argument which enables auto-clear functionality of status registers in pcileech; Added feature-gate to prevent re-generating bindings which removes the requirement of having libclang installed; Added more build-pipelines --- .github/workflows/build.yml | 47 +- .github/workflows/nightly-build.yml | 57 + .github/workflows/release.yml | 4 +- .gitignore | 1 + Cargo.lock | 505 ++-- README.md | 10 +- install.rhai | 2 +- install.sh | 19 - leechcore-sys/Cargo.toml | 8 +- leechcore-sys/build.rs | 42 +- leechcore-sys/src/leechcore | 2 +- leechcore-sys/src/leechcore.rs | 3550 +++++++++++++++++++++++++++ memflow-pcileech/Cargo.toml | 15 +- memflow-pcileech/src/lib.rs | 71 +- 14 files changed, 3961 insertions(+), 372 deletions(-) create mode 100644 .github/workflows/nightly-build.yml delete mode 100755 install.sh create mode 100644 leechcore-sys/src/leechcore.rs diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 94f1c5d..b7d5c5b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,7 +7,7 @@ env: jobs: - build_ubuntu_x86-64: + build_ubuntu_x86-64_bundled: name: Build for ubuntu-latest (x86-64) runs-on: ubuntu-latest steps: @@ -17,13 +17,46 @@ jobs: - name: install libusb-1.0 run: sudo apt-get install libusb-1.0-0-dev - name: build - run: cargo build --workspace --all-features --verbose + run: cargo build --workspace --verbose - name: run tests run: cargo test --workspace --verbose - name: build examples - run: cargo build --workspace --all-features --examples --verbose + run: cargo build --workspace --examples --verbose - build_windows_x86-64: + build_ubuntu_x86-64_bindgen: + name: Build for ubuntu-latest (x86-64) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + submodules: 'true' + - name: install libusb-1.0 + run: sudo apt-get install libusb-1.0-0-dev + - name: build + run: cargo build --workspace --features bindgen --verbose + - name: run tests + run: cargo test --workspace --features bindgen --verbose + - name: build examples + run: cargo build --workspace --features bindgen --examples --verbose + + build_windows_x86-64_bundled: + name: Build for windows-latest (x86-64) + runs-on: windows-latest + steps: + - uses: actions/checkout@v2 + with: + submodules: 'true' + - name: build + shell: bash + run: cargo build --workspace --verbose + - name: run tests + shell: bash + run: cargo test --workspace --verbose + - name: build examples + shell: bash + run: cargo build --workspace --examples --verbose + + build_windows_x86-64_bindgen: name: Build for windows-latest (x86-64) runs-on: windows-latest steps: @@ -39,13 +72,13 @@ jobs: run: echo "LIBCLANG_PATH=$((gcm clang).source -replace "clang.exe")" >> $env:GITHUB_ENV - name: build shell: bash - run: cargo build --workspace --all-features --verbose + run: cargo build --workspace --features bindgen --verbose - name: run tests shell: bash - run: cargo test --workspace --verbose + run: cargo test --workspace --features bindgen --verbose - name: build examples shell: bash - run: cargo build --workspace --all-features --examples --verbose + run: cargo build --workspace --features bindgen --examples --verbose lint: runs-on: ubuntu-latest diff --git a/.github/workflows/nightly-build.yml b/.github/workflows/nightly-build.yml new file mode 100644 index 0000000..ded5d37 --- /dev/null +++ b/.github/workflows/nightly-build.yml @@ -0,0 +1,57 @@ +name: Nightly build + +on: + push: + branch: + - 'main' + +env: + CARGO_TERM_COLOR: always + +jobs: + + build_ubuntu_x86-64: + name: Publish binary builds for linux (x86-64) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + submodules: 'true' + - name: install libusb-1.0 + run: sudo apt-get install libusb-1.0-0-dev + - name: Download renamer + run: curl -sSf https://raw.githubusercontent.com/memflow/memflowup/master/target_rename.sh > target_rename.sh + - name: build + run: cargo build --workspace --verbose + - name: Rename and collect artifacts + id: artifacts + run: echo "::set-output name=artifact::$(sh ./target_rename.sh "x86_64-unknown-linux-gnu" | head -n 1)" + - name: Upload build artifacts + uses: softprops/action-gh-release@v1 + with: + tag_name: nightly + files: | + ${{ steps.artifacts.outputs.artifact }} + + build_windows_x86-64: + name: Publish binary builds for windows (x86-64) + runs-on: windows-latest + steps: + - uses: actions/checkout@v2 + with: + submodules: 'true' + - name: Download renamer + run: curl -sSf https://raw.githubusercontent.com/memflow/memflowup/master/target_rename.sh > target_rename.sh + - name: build + shell: bash + run: cargo build --workspace --verbose + - name: Rename and collect artifacts + id: artifacts + shell: bash + run: echo "::set-output name=artifact::$(sh ./target_rename.sh "x86_64-pc-windows-msvc" | head -n 1)" + - name: Upload build artifacts + uses: softprops/action-gh-release@v1 + with: + tag_name: nightly + files: | + ${{ steps.artifacts.outputs.artifact }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c7c8352..f6d798a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,7 +19,7 @@ jobs: - name: install libusb-1.0 run: sudo apt-get install libusb-1.0-0-dev - name: build - run: cargo build --release --workspace --all-features --verbose + run: cargo build --release --workspace --verbose - uses: actions/upload-artifact@v2 with: name: library-ubuntu @@ -41,7 +41,7 @@ jobs: run: echo "LIBCLANG_PATH=$((gcm clang).source -replace "clang.exe")" >> $env:GITHUB_ENV - name: build shell: bash - run: cargo build --release --workspace --all-features --verbose + run: cargo build --release --workspace --verbose - uses: actions/upload-artifact@v2 with: name: library-windows diff --git a/.gitignore b/.gitignore index 054b65f..0eba907 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ **/*.rs.bk *.swp .vscode +TODO.md \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index 8e2f143..b744551 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "abi_stable" -version = "0.10.4" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7725ddc1a1204829816071550fdffafe7e66498e7a99e5f703da71801101ccb9" +checksum = "faf4283d41d6fcc0b114075d641b73b673d7d34375fb6ecf86fc880328036f0f" dependencies = [ "abi_stable_derive", "abi_stable_shared", @@ -15,6 +15,7 @@ dependencies = [ "generational-arena", "libloading", "lock_api", + "once_cell", "parking_lot", "paste", "repr_offset", @@ -68,22 +69,13 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "0.7.18" +version = "0.7.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" +checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" dependencies = [ "memchr", ] -[[package]] -name = "android_system_properties" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7ed72e1635e121ca3e79420540282af22da58be50de153d36f81ddc6b83aa9e" -dependencies = [ - "libc", -] - [[package]] name = "as_derive_utils" version = "0.10.3" @@ -96,17 +88,6 @@ dependencies = [ "syn", ] -[[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 = "autocfg" version = "1.1.0" @@ -115,21 +96,19 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "base64" -version = "0.13.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "bindgen" -version = "0.60.1" +version = "0.63.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "062dddbc1ba4aca46de6338e2bf87771414c335f7b2f2036e8f3e9befebf88e6" +checksum = "36d860121800b2a9a94f9b5604b332d5cffb234ce17609ea479d723dbc9d3885" dependencies = [ "bitflags", "cexpr", "clang-sys", - "clap", - "env_logger", "lazy_static", "lazycell", "log", @@ -139,6 +118,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", + "syn", "which", ] @@ -156,15 +136,15 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bumpalo" -version = "3.10.0" +version = "3.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37ccbd214614c6783386c1af30caf03192f17891059cecc394b4fb119e363de3" +checksum = "572f695136211188308f16ad2ca5c851a712c464060ae6974944458eb83880ba" [[package]] name = "cc" -version = "1.0.73" +version = "1.0.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" +checksum = "a20104e2335ce8a659d6dd92a51a767a0c062599c73b343fd152cb401e828c3d" [[package]] name = "cexpr" @@ -189,21 +169,22 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "cglue" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a83ef0a0d6f7a8db45b93b31fde7058968d9ec7aea2d9777413f30a6c82b69e" +checksum = "0781c9468d801a834bed4252f3fd3a536b4f82199bca9f099d713e3732b860a7" dependencies = [ "abi_stable", "cglue-macro", "no-std-compat", + "rustc_version 0.4.0", "serde", ] [[package]] name = "cglue-gen" -version = "0.2.5" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4572f04c2b1d888a8f61b09ebcc4f313a307501d8ccb30eb40233dba5f9c7b0" +checksum = "f713559a7e76bef29ef6eafb64d05fca776a177bb369be02bbea342dc42ffce8" dependencies = [ "itertools", "lazy_static", @@ -215,9 +196,9 @@ dependencies = [ [[package]] name = "cglue-macro" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8285aff09f786d2f084779793728e050af8c446c32f240778d01f7e095c91614" +checksum = "cf28b8c74a050973c9972edfad2f32f404bc1ff6725e37d003e7d55504dec1cf" dependencies = [ "cglue-gen", "proc-macro2", @@ -225,21 +206,6 @@ dependencies = [ "syn", ] -[[package]] -name = "chrono" -version = "0.4.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfd4d1b31faaa3a89d7934dbded3111da0d2ef28e3ebccdb4f0179f5929d1ef1" -dependencies = [ - "iana-time-zone", - "js-sys", - "num-integer", - "num-traits", - "time", - "wasm-bindgen", - "winapi", -] - [[package]] name = "chunked_transfer" version = "1.4.0" @@ -248,40 +214,15 @@ checksum = "fff857943da45f546682664a79488be82e69e43c1a7a2307679ab9afb3a66d2e" [[package]] name = "clang-sys" -version = "1.3.3" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a050e2153c5be08febd6734e29298e844fdb0fa21aeddd63b4eb7baa106c69b" +checksum = "fa2e27ae6ab525c3d369ded447057bca5438d86dc3a68f6faafb8269ba82ebf3" dependencies = [ "glob", "libc", "libloading", ] -[[package]] -name = "clap" -version = "3.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29e724a68d9319343bb3328c9cc2dfde263f4b3142ee1059a9980580171c954b" -dependencies = [ - "atty", - "bitflags", - "clap_lex", - "indexmap", - "once_cell", - "strsim", - "termcolor", - "textwrap", -] - -[[package]] -name = "clap_lex" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" -dependencies = [ - "os_str_bytes", -] - [[package]] name = "coarsetime" version = "0.1.22" @@ -290,43 +231,37 @@ checksum = "454038500439e141804c655b4cd1bc6a70bcb95cd2bc9463af5661b6956f0e46" dependencies = [ "libc", "once_cell", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi", "wasm-bindgen", ] [[package]] name = "console" -version = "0.15.1" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89eab4d20ce20cea182308bca13088fecea9c05f6776cf287205d41a0ed3c847" +checksum = "c050367d967ced717c04b65d8c619d863ef9292ce0c5760028655a2fb298718c" dependencies = [ "encode_unicode", + "lazy_static", "libc", - "once_cell", "terminal_size", "winapi", ] -[[package]] -name = "core-foundation-sys" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" - [[package]] name = "core_extensions" -version = "1.5.2" +version = "1.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79b110b7cd430bd590fa60a5ba58a383488dab61912318bfb05d968a80cdda6d" +checksum = "92c71dc07c9721607e7a16108336048ee978c3a8b129294534272e8bac96c0ee" dependencies = [ "core_extensions_proc_macros", ] [[package]] name = "core_extensions_proc_macros" -version = "1.5.1" +version = "1.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c348a81513f573054124b9f10e258a654a0519b65f2dba0142307bd3c7b5b8b6" +checksum = "69f3b219d28b6e3b4ac87bc1fc522e0803ab22e055da177bff0068c4150c61a6" [[package]] name = "crc32fast" @@ -349,19 +284,18 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.11" +version = "0.8.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51887d4adc7b564537b15adcfb307936f8075dfcd5f00dde9a9f1d29383682bc" +checksum = "4fb766fa798726286dbbb842f174001dab8abc7b627a1dd86e0b7222a95d929f" dependencies = [ "cfg-if 1.0.0", - "once_cell", ] [[package]] name = "ctor" -version = "0.1.23" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdffe87e1d521a10f9696f833fe502293ea446d7f256c06128293a4119bdf4cb" +checksum = "6d2301688392eb071b0bf1a37be05c469d3cc4dbbd95df672fe28ab021e6a096" dependencies = [ "quote", "syn", @@ -408,6 +342,12 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "47a802a2cad0ff4dfc4f3110da174b7a6928c315cae523e88638cfb72941b4d5" +[[package]] +name = "dataview" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50eb3a329e19d78c3a3dfa4ec5a51ecb84fa3a20c06edad04be25356018218f9" + [[package]] name = "dirs" version = "4.0.0" @@ -430,9 +370,9 @@ dependencies = [ [[package]] name = "either" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f107b87b6afc2a64fd13cac55fe06d6c8859f12d4b14cbcdd2c67d0976781be" +checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797" [[package]] name = "encode_unicode" @@ -440,19 +380,6 @@ version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" -[[package]] -name = "env_logger" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b2cf0344971ee6c64c31be0d530793fba457d322dfec2810c453d0ef228f9c3" -dependencies = [ - "atty", - "humantime", - "log", - "regex", - "termcolor", -] - [[package]] name = "fallible-iterator" version = "0.2.0" @@ -461,15 +388,15 @@ checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" [[package]] name = "fixed-slice-vec" -version = "0.8.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fafbcddfce402d6170ee6e5037f032dd96233ce73c66f7d83a4150fb76814b44" +checksum = "1bb23c599a9ff5b981529099902fe5de8d55ecc8c1f451542da17b8d2d65326e" [[package]] name = "flate2" -version = "1.0.24" +version = "1.0.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f82b0f4c27ad9f8bfd1f3208d882da2b09c301bc1c828fd3a00d0216d2fbbff6" +checksum = "a8a2db397cb1c8772f31494cb8917e48cd1e64f0fa7efac59fbd741a0a8ce841" dependencies = [ "crc32fast", "miniz_oxide", @@ -483,11 +410,10 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "form_urlencoded" -version = "1.0.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191" +checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" dependencies = [ - "matches", "percent-encoding", ] @@ -502,13 +428,13 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.7" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eb1a864a501629691edf6c15a593b7a51eebaa1e8468e9ddc623de7c9b58ec6" +checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" dependencies = [ "cfg-if 1.0.0", "libc", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi", ] [[package]] @@ -537,34 +463,6 @@ dependencies = [ "ahash", ] -[[package]] -name = "hermit-abi" -version = "0.1.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] - -[[package]] -name = "humantime" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" - -[[package]] -name = "iana-time-zone" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef5528d9c2817db4e10cc78f8d4c8228906e5854f389ff6b076cee3572a09d35" -dependencies = [ - "android_system_properties", - "core-foundation-sys", - "js-sys", - "wasm-bindgen", - "winapi", -] - [[package]] name = "ident_case" version = "1.0.1" @@ -573,25 +471,14 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "idna" -version = "0.2.3" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" +checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" dependencies = [ - "matches", "unicode-bidi", "unicode-normalization", ] -[[package]] -name = "indexmap" -version = "1.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e" -dependencies = [ - "autocfg", - "hashbrown", -] - [[package]] name = "indicatif" version = "0.16.2" @@ -615,24 +502,24 @@ dependencies = [ [[package]] name = "itertools" -version = "0.10.3" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9a9d19fa1e79b6215ff29b9d6880b706147f16e9b1dbb1e4e5947b5b02bc5e3" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" dependencies = [ "either", ] [[package]] name = "itoa" -version = "1.0.3" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8af84674fe1f223a982c933a0ee1086ac4d4052aa0fb8060c12c6ad838e754" +checksum = "fad582f4b9e86b6caa621cabeb0963332d92eea04729ab12892c2533951e6440" [[package]] name = "js-sys" -version = "0.3.59" +version = "0.3.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "258451ab10b34f8af53416d1fdab72c22e805f0c92a1136d59470ec0b11138b2" +checksum = "c3fac17f7123a73ca62df411b1bf727ccc805daa070338fda671c86dac1bdc27" dependencies = [ "wasm-bindgen", ] @@ -651,7 +538,7 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "leechcore-sys" -version = "0.2.0-beta5" +version = "0.2.0-beta9" dependencies = [ "bindgen", "cc", @@ -661,15 +548,15 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.132" +version = "0.2.138" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8371e4e5341c3a96db127eb2465ac681ced4c433e01dd0e938adbef26ba93ba5" +checksum = "db6d7e329c562c5dfab7a46a2afabc8b987ab9a4834c9d1ca04dc54c1546cef8" [[package]] name = "libloading" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efbc0f03f9a775e9f6aed295c6a1ba2253c5757a9e03d55c6caa46a681abcddd" +checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" dependencies = [ "cfg-if 1.0.0", "winapi", @@ -677,9 +564,9 @@ dependencies = [ [[package]] name = "lock_api" -version = "0.4.7" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327fa5b6a6940e4699ec49a9beae1ea4845c6bab9314e4f84ac68742139d8c53" +checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" dependencies = [ "autocfg", "scopeguard", @@ -694,12 +581,6 @@ dependencies = [ "cfg-if 1.0.0", ] -[[package]] -name = "matches" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" - [[package]] name = "memchr" version = "2.5.0" @@ -708,16 +589,16 @@ checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" [[package]] name = "memflow" -version = "0.2.0-beta7" +version = "0.2.0-beta9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2e55eeeec513cd77a4410920f40458a8e08fc5715a313041c0b22455144b9cb" +checksum = "3ea78623ea71c6431aa4be344b7592836b258e1b172583df1287f9448458a1b1" dependencies = [ "abi_stable", "bitflags", "bumpalo", "cglue", "coarsetime", - "dataview", + "dataview 1.0.1", "dirs", "fixed-slice-vec", "goblin", @@ -752,9 +633,8 @@ dependencies = [ [[package]] name = "memflow-pcileech" -version = "0.2.0-beta7" +version = "0.2.0-beta9" dependencies = [ - "clap", "leechcore-sys", "log", "memflow", @@ -764,9 +644,26 @@ dependencies = [ [[package]] name = "memflow-win32" -version = "0.2.0-beta7" +version = "0.2.0-beta9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab360d173af4a380a4350854a99f7fb615673bfba3b119d18da06475cf56e0e5" +checksum = "c8240e7f1dc4cfbcd85062ecb9a4d539e5189a0a2462573f34de7675303b9a4f" +dependencies = [ + "log", + "memflow", + "memflow-win32-defs", + "no-std-compat", + "pelite", + "regex", + "serde", + "toml", + "widestring", +] + +[[package]] +name = "memflow-win32-defs" +version = "0.2.0-beta9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90c84438f5451b99b427a7ddce9e0c6df580174a608f674d8f2644472e6b8468" dependencies = [ "dirs", "indicatif", @@ -774,13 +671,9 @@ dependencies = [ "memflow", "no-std-compat", "pdb", - "pelite", "progress-streams", - "regex", "serde", - "toml", "ureq", - "widestring", ] [[package]] @@ -801,9 +694,9 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.5.3" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f5c75688da582b8ffc1f1799e9db273f32133c49e048f614d22ec3256773ccc" +checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa" dependencies = [ "adler", ] @@ -825,22 +718,12 @@ dependencies = [ ] [[package]] -name = "num-integer" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" -dependencies = [ - "autocfg", - "num-traits", -] - -[[package]] -name = "num-traits" -version = "0.2.15" +name = "num_threads" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +checksum = "2819ce041d2ee131036f4fc9d6ae7ae125a3a40e97ba64d04fe799ad9dabbb44" dependencies = [ - "autocfg", + "libc", ] [[package]] @@ -851,15 +734,9 @@ checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" [[package]] name = "once_cell" -version = "1.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "074864da206b4973b84eb91683020dbefd6a8c3f0f38e054d93954e891935e4e" - -[[package]] -name = "os_str_bytes" -version = "6.3.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ff7415e9ae3fff1225851df9e0d9e4e5479f947619774677a63572e55e80eff" +checksum = "da32515d9f6e6e489d7bc9d84c71b060db7247dc035bbe44eac88cf87486d8d5" [[package]] name = "parking_lot" @@ -874,9 +751,9 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.8.5" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d76e8e1493bcac0d2766c42737f34458f1c8c50c0d23bcb24ea953affb273216" +checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc" dependencies = [ "cfg-if 1.0.0", "instant", @@ -888,9 +765,9 @@ dependencies = [ [[package]] name = "paste" -version = "1.0.8" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9423e2b32f7a043629287a536f21951e8c6a82482d0acb1eeebfc90bc2225b22" +checksum = "d01a5bd0424d00070b0098dd17ebca6f961a959dead1dbcbbbc1d1cd8d3deeba" [[package]] name = "pdb" @@ -915,7 +792,7 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8c270b1a0c279bbcb4cff3d2294121731c48ee68f0435d26cf71018a853cb890" dependencies = [ - "dataview", + "dataview 0.1.2", "no-std-compat", "pelite-macros", "serde", @@ -929,15 +806,15 @@ checksum = "7a7cf3f8ecebb0f4895f4892a8be0a0dc81b498f9d56735cb769dc31bf00815b" [[package]] name = "percent-encoding" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" +checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" [[package]] name = "pkg-config" -version = "0.3.25" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1df8c4ec4b0627e53bdf214615ad287367e482558cf84b109250b37464dc03ae" +checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160" [[package]] name = "plain" @@ -947,20 +824,19 @@ checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" [[package]] name = "proc-macro-crate" -version = "1.2.1" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eda0fc3b0fb7c975631757e14d9049da17374063edb6ebbcbc54d880d4fe94e9" +checksum = "e17d47ce914bf4de440332250b0edd23ce48c005f59fab39d3335866b114f11a" dependencies = [ - "once_cell", "thiserror", "toml", ] [[package]] name = "proc-macro2" -version = "1.0.43" +version = "1.0.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a2ca2c61bc9f3d74d2886294ab7b9853abd9c1ad903a3ac7815c58989bb7bab" +checksum = "57a8eca9f9c4ffde41714334dee777596264c7825420f521abc92b5b5deb63a5" dependencies = [ "unicode-ident", ] @@ -973,18 +849,18 @@ checksum = "e965d96c8162c607b0cd8d66047ad3c9fd35273c134d994327882c6e47f986a7" [[package]] name = "quote" -version = "1.0.21" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" +checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" dependencies = [ "proc-macro2", ] [[package]] name = "rangemap" -version = "1.0.3" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ea2d559b3970fe7aa56ce7432a3702ff4b20a57b543ae08b4850ee629353ea6" +checksum = "4ed5f515fe4093fa60900ac1918c9ea73f18189114588ec9b99941e22cc2aedd" [[package]] name = "redox_syscall" @@ -1008,9 +884,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.6.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c4eb3267174b8c6c2f654116623910a0fef09c4753f8dd83db29c48a0df988b" +checksum = "e076559ef8e241f2ae3479e36f97bd5741c0330689e217ad51ce2c76808b868a" dependencies = [ "aho-corasick", "memchr", @@ -1019,9 +895,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.6.27" +version = "0.6.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244" +checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" [[package]] name = "repr_offset" @@ -1068,14 +944,14 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver 1.0.13", + "semver 1.0.16", ] [[package]] name = "rustls" -version = "0.20.6" +version = "0.20.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aab8ee6c7097ed6057f43c187a62418d0c05a4bd5f18b3571db50ee0f9ce033" +checksum = "539a2bfe908f471bfa933876bd1eb6a19cf2176d375f82ef7f99530a40e48c2c" dependencies = [ "log", "ring", @@ -1085,15 +961,15 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.9" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97477e48b4cf8603ad5f7aaf897467cf42ab4218a38ef76fb14c2d6773a6d6a8" +checksum = "5583e89e108996506031660fe09baa5011b9dd0341b89029313006d1fb508d70" [[package]] name = "ryu" -version = "1.0.11" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" +checksum = "7b4b9743ed687d4b4bcedf9ff5eaa7398495ae14e61cba0a295704edbc7decde" [[package]] name = "scopeguard" @@ -1148,9 +1024,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.13" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93f6841e709003d68bb2deee8c343572bf446003ec20a583e76f7b15cebf3711" +checksum = "58bc9567378fc7690d6b2addae4e60ac2eeea07becb2c64b9f218b53865cba2a" [[package]] name = "semver-parser" @@ -1160,18 +1036,18 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.143" +version = "1.0.151" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53e8e5d5b70924f74ff5c6d64d9a5acd91422117c60f48c4e07855238a254553" +checksum = "97fed41fc1a24994d044e6db6935e69511a1153b52c15eb42493b26fa87feba0" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.143" +version = "1.0.151" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3d8e8de557aee63c26b85b947f5e59b690d0454c753f3adeb5cd7835ab88391" +checksum = "255abe9a125a985c05190d687b320c12f9b1f0b99445e608c21ba0782c719ad8" dependencies = [ "proc-macro2", "quote", @@ -1180,9 +1056,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.83" +version = "1.0.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38dd04e3c8279e75b31ef29dbdceebfe5ad89f4d0937213c53f7d49d01b3d5a7" +checksum = "877c235533714907a8c2464236f5c4b2a17262ef1bd71f38f35ea592c8da6883" dependencies = [ "itoa", "ryu", @@ -1197,20 +1073,20 @@ checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3" [[package]] name = "simplelog" -version = "0.11.2" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1348164456f72ca0116e4538bdaabb0ddb622c7d9f16387c725af3e96d6001c" +checksum = "48dfff04aade74dd495b007c831cd6f4e0cee19c344dd9dc0884c0289b70a786" dependencies = [ - "chrono", "log", "termcolor", + "time", ] [[package]] name = "smallvec" -version = "1.9.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fd0db749597d91ff862fd1d55ea87f7855a744a8425a64695b6fca237d1dad1" +checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" [[package]] name = "spin" @@ -1226,9 +1102,9 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "syn" -version = "1.0.99" +version = "1.0.107" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58dbef6ec655055e20b86b15a8cc6d439cca19b667537ac6a1369572d151ab13" +checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" dependencies = [ "proc-macro2", "quote", @@ -1254,26 +1130,20 @@ dependencies = [ "winapi", ] -[[package]] -name = "textwrap" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1141d4d61095b28419e22cb0bbf02755f5e54e0526f97f1e3d1d160e60885fb" - [[package]] name = "thiserror" -version = "1.0.32" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5f6586b7f764adc0231f4c79be7b920e766bb2f3e51b3661cdb263828f19994" +checksum = "6a9cd18aa97d5c45c6603caea1da6628790b37f7a34b6ca89522331c5180fed0" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.32" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12bafc5b54507e0149cdf1b145a5d80ab80a90bcd9275df43d4fff68460f6c21" +checksum = "1fb327af4685e4d03fa8cbcf1716380da910eeb2bb8be417e7f9fd3fb164f36f" dependencies = [ "proc-macro2", "quote", @@ -1282,13 +1152,31 @@ dependencies = [ [[package]] name = "time" -version = "0.1.44" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255" +checksum = "a561bf4617eebd33bca6434b988f39ed798e527f51a1e797d0ee4f61c0a38376" dependencies = [ + "itoa", "libc", - "wasi 0.10.0+wasi-snapshot-preview1", - "winapi", + "num_threads", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e153e1f1acaef8acc537e68b44906d2db6436e2b35ac2c6b42640fff91f00fd" + +[[package]] +name = "time-macros" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d967f99f534ca7e495c575c62638eebc2898a8c84c119b89e250477bc4ba16b2" +dependencies = [ + "time-core", ] [[package]] @@ -1308,9 +1196,9 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "toml" -version = "0.5.9" +version = "0.5.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d82e1a7758622a465f8cee077614c73484dac5b836c02ff6a40d5d1010324d7" +checksum = "1333c76748e868a4d9d1017b5ab53171dfd095f70c712fdb4653a406547f598f" dependencies = [ "serde", ] @@ -1344,15 +1232,15 @@ checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" [[package]] name = "unicode-ident" -version = "1.0.3" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4f5b37a154999a8f3f98cc23a628d850e154479cd94decf3414696e12e31aaf" +checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" [[package]] name = "unicode-normalization" -version = "0.1.21" +version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "854cbdc4f7bc6ae19c820d44abdc3277ac3e1b2b93db20a636825d9322fb60e6" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" dependencies = [ "tinyvec", ] @@ -1382,13 +1270,12 @@ dependencies = [ [[package]] name = "url" -version = "2.2.2" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507c383b2d33b5fc35d1861e77e6b383d158b2da5e14fe51b83dfedf6fd578c" +checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" dependencies = [ "form_urlencoded", "idna", - "matches", "percent-encoding", ] @@ -1410,12 +1297,6 @@ version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3ca98349dda8a60ae74e04fd90c7fb4d6a4fbe01e6d3be095478aa0b76f6c0c" -[[package]] -name = "wasi" -version = "0.10.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" - [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -1424,9 +1305,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.82" +version = "0.2.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc7652e3f6c4706c8d9cd54832c4a4ccb9b5336e2c3bd154d5cccfbf1c1f5f7d" +checksum = "7c53b543413a17a202f4be280a7e5c62a1c69345f5de525ee64f8cfdbc954994" dependencies = [ "cfg-if 1.0.0", "wasm-bindgen-macro", @@ -1434,13 +1315,13 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.82" +version = "0.2.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "662cd44805586bd52971b9586b1df85cdbbd9112e4ef4d8f41559c334dc6ac3f" +checksum = "5491a68ab4500fa6b4d726bd67408630c3dbe9c4fe7bda16d5c82a1fd8c7340a" dependencies = [ "bumpalo", + "lazy_static", "log", - "once_cell", "proc-macro2", "quote", "syn", @@ -1449,9 +1330,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.82" +version = "0.2.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b260f13d3012071dfb1512849c033b1925038373aea48ced3012c09df952c602" +checksum = "c441e177922bc58f1e12c022624b6216378e5febc2f0533e41ba443d505b80aa" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1459,9 +1340,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.82" +version = "0.2.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5be8e654bdd9b79216c2929ab90721aa82faf65c48cdf08bdc4e7f51357b80da" +checksum = "7d94ac45fcf608c1f45ef53e748d35660f168490c10b23704c7779ab8f5c3048" dependencies = [ "proc-macro2", "quote", @@ -1472,15 +1353,15 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.82" +version = "0.2.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6598dd0bd3c7d51095ff6531a5b23e02acdc81804e30d8f07afb77b7215a140a" +checksum = "6a89911bd99e5f3659ec4acf9c4d93b0a90fe4a2a11f15328472058edc5261be" [[package]] name = "web-sys" -version = "0.3.59" +version = "0.3.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed055ab27f941423197eb86b2035720b1a3ce40504df082cac2ecc6ed73335a1" +checksum = "2fed94beee57daf8dd7d51f2b15dc2bcde92d7a72304cdf662a4371008b71b90" dependencies = [ "js-sys", "wasm-bindgen", @@ -1498,22 +1379,22 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.22.4" +version = "0.22.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1c760f0d366a6c24a02ed7816e23e691f5d92291f94d15e836006fd11b04daf" +checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87" dependencies = [ "webpki", ] [[package]] name = "which" -version = "4.2.5" +version = "4.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c4fb54e6113b6a8772ee41c3404fb0301ac79604489467e0a9ce1f3e97c24ae" +checksum = "1c831fbbee9e129a8cf93e7747a82da9d95ba8e16621cae60ec2cdc849bacb7b" dependencies = [ "either", - "lazy_static", "libc", + "once_cell", ] [[package]] diff --git a/README.md b/README.md index 4b3407c..f21c874 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ git submodule update --init Install the following build tools: - gcc -- clang +- clang (only required when selecting feature `bindgen`) - libusb-1.0 (only required on linux) Make sure that libclang can be found by either adding it to your `PATH` or via the `LIBCLANG_PATH` environment variable. @@ -54,11 +54,17 @@ Remarks: The `install.sh` script does currently not place the `leechcore_ft601_d ### Building the stand-alone connector for dynamic loading To compile a dynamic library for use with the connector inventory use the following command: +``` +cargo build --release +``` +If you want to manually execute bindgen at buildtime (e.g. when changing/updating the underlying pcileech repository) then use the following command to build: ``` -cargo build --release --all-features +cargo build --release --features bindgen ``` +Note: This requires `clang` (libclang) to be installed on your system. + As mentioned above the `leechcore_ft601_driver_linux.so` or `FTD3XX.dll` have to be placed in the same folder the connector library is placed in. ### Using the library in a rust project diff --git a/install.rhai b/install.rhai index c92e091..1f53aaa 100644 --- a/install.rhai +++ b/install.rhai @@ -2,7 +2,7 @@ // builds the connector from a given path (never called by the engine directly) fn build_from_path(ctx, repo_path) { info("Installing connector"); - cargo("build --release --all-features", repo_path); + cargo("build --release", repo_path); ctx.copy_cargo_plugin_artifact(repo_path, name_to_lib(ctx.crate_name())); // TODO: download leechcore_ft601_driver_linux diff --git a/install.sh b/install.sh deleted file mode 100755 index a185e5b..0000000 --- a/install.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash - -cargo build --release --all-features - -# install connector to system dir -if [ ! -z "$1" ] && [ $1 = "--system" ]; then - echo "installing connector system-wide in /usr/lib/memflow" - if [[ ! -d /usr/lib/memflow ]]; then - sudo mkdir /usr/lib/memflow - fi - sudo cp target/release/libmemflow_pcileech.so /usr/lib/memflow/libmemflow_pcileech.7.so -fi - -# install connector in user dir -echo "installing connector for user in ~/.local/lib/memflow" -if [[ ! -d ~/.local/lib/memflow ]]; then - mkdir -p ~/.local/lib/memflow -fi -cp target/release/libmemflow_pcileech.so ~/.local/lib/memflow/libmemflow_pcileech.7.so diff --git a/leechcore-sys/Cargo.toml b/leechcore-sys/Cargo.toml index 382780c..6018396 100644 --- a/leechcore-sys/Cargo.toml +++ b/leechcore-sys/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "leechcore-sys" -version = "0.2.0-beta5" +version = "0.2.0-beta9" authors = ["ko1N "] edition = "2018" readme = "../README.md" @@ -13,5 +13,9 @@ ctor = "0.1" [build-dependencies] cc = "1.0" -bindgen = "^0.60.1" pkg-config = "0.3" +bindgen = { version = "^0.63.0", optional = true } + +[features] +default = [ ] +bindgen = [ "dep:bindgen" ] diff --git a/leechcore-sys/build.rs b/leechcore-sys/build.rs index df8823b..00b394b 100644 --- a/leechcore-sys/build.rs +++ b/leechcore-sys/build.rs @@ -1,10 +1,12 @@ -extern crate bindgen; extern crate cc; extern crate pkg_config; -use std::env; -use std::path::PathBuf; +#[cfg(bindgen)] +extern crate bindgen; + +use std::path::{Path, PathBuf}; use std::process::Command; +use std::{env, fs}; #[cfg(target_os = "windows")] fn os_define() -> &'static str { @@ -98,14 +100,8 @@ fn build_leechcore(target: &str) { println!("cargo:rustc-link-lib=static=leechcore"); } -fn main() { - let target = env::var("TARGET").unwrap(); - let out_dir = PathBuf::from(env::var("OUT_DIR").unwrap()); - - // build leechcore - build_leechcore(&target); - - // generate bindings +#[cfg(bindgen)] +fn gen_leechcore>(target: &str, out_dir: P) { let mut builder = bindgen::builder() .clang_arg(format!("-D{} -D_GNU_SOURCE", os_define())) .header("./src/leechcore/leechcore/leechcore.h"); @@ -120,8 +116,30 @@ fn main() { .generate() .unwrap_or_else(|err| panic!("Failed to generate bindings: {:?}", err)); - let bindings_path = out_dir.join("leechcore.rs"); + let bindings_path = out_dir.as_ref().to_path_buf().join("leechcore.rs"); bindings .write_to_file(&bindings_path) .unwrap_or_else(|_| panic!("Failed to write {}", bindings_path.display())); } + +#[cfg(not(bindgen))] +fn gen_leechcore>(_target: &str, out_dir: P) { + let manifest_dir = PathBuf::from(env::var("CARGO_MANIFEST_DIR").unwrap()); + + let bindings_src_path = manifest_dir.join("src").join("leechcore.rs"); + let bindings_dst_path = out_dir.as_ref().to_path_buf().join("leechcore.rs"); + + fs::copy(bindings_src_path, bindings_dst_path) + .expect("Failed to copy leechcore.rs bindings to OUT_DIR"); +} + +fn main() { + let target = env::var("TARGET").unwrap(); + let out_dir = PathBuf::from(env::var("OUT_DIR").unwrap()); + + // build leechcore + build_leechcore(&target); + + // generate or copy bindings + gen_leechcore(&target, out_dir); +} diff --git a/leechcore-sys/src/leechcore b/leechcore-sys/src/leechcore index 7a8b693..94d2abd 160000 --- a/leechcore-sys/src/leechcore +++ b/leechcore-sys/src/leechcore @@ -1 +1 @@ -Subproject commit 7a8b693be0e750d548c6a38dd1864a360dac6db4 +Subproject commit 94d2abdb39c515790558feaff31cb4a65c3e1307 diff --git a/leechcore-sys/src/leechcore.rs b/leechcore-sys/src/leechcore.rs new file mode 100644 index 0000000..d87e84f --- /dev/null +++ b/leechcore-sys/src/leechcore.rs @@ -0,0 +1,3550 @@ +/* automatically generated by rust-bindgen 0.63.0 */ + +#[repr(C)] +#[derive(Default)] +pub struct __IncompleteArrayField(::std::marker::PhantomData, [T; 0]); +impl __IncompleteArrayField { + #[inline] + pub const fn new() -> Self { + __IncompleteArrayField(::std::marker::PhantomData, []) + } + #[inline] + pub fn as_ptr(&self) -> *const T { + self as *const _ as *const T + } + #[inline] + pub fn as_mut_ptr(&mut self) -> *mut T { + self as *mut _ as *mut T + } + #[inline] + pub unsafe fn as_slice(&self, len: usize) -> &[T] { + ::std::slice::from_raw_parts(self.as_ptr(), len) + } + #[inline] + pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { + ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) + } +} +impl ::std::fmt::Debug for __IncompleteArrayField { + fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + fmt.write_str("__IncompleteArrayField") + } +} +pub const _INTTYPES_H: u32 = 1; +pub const _FEATURES_H: u32 = 1; +pub const _DEFAULT_SOURCE: u32 = 1; +pub const __GLIBC_USE_ISOC2X: u32 = 0; +pub const __USE_ISOC11: u32 = 1; +pub const __USE_ISOC99: u32 = 1; +pub const __USE_ISOC95: u32 = 1; +pub const __USE_POSIX_IMPLICITLY: u32 = 1; +pub const _POSIX_SOURCE: u32 = 1; +pub const _POSIX_C_SOURCE: u32 = 200809; +pub const __USE_POSIX: u32 = 1; +pub const __USE_POSIX2: u32 = 1; +pub const __USE_POSIX199309: u32 = 1; +pub const __USE_POSIX199506: u32 = 1; +pub const __USE_XOPEN2K: u32 = 1; +pub const __USE_XOPEN2K8: u32 = 1; +pub const _ATFILE_SOURCE: u32 = 1; +pub const __WORDSIZE: u32 = 64; +pub const __WORDSIZE_TIME64_COMPAT32: u32 = 1; +pub const __SYSCALL_WORDSIZE: u32 = 64; +pub const __TIMESIZE: u32 = 64; +pub const __USE_MISC: u32 = 1; +pub const __USE_ATFILE: u32 = 1; +pub const __USE_FORTIFY_LEVEL: u32 = 0; +pub const __GLIBC_USE_DEPRECATED_GETS: u32 = 0; +pub const __GLIBC_USE_DEPRECATED_SCANF: u32 = 0; +pub const _STDC_PREDEF_H: u32 = 1; +pub const __STDC_IEC_559__: u32 = 1; +pub const __STDC_IEC_60559_BFP__: u32 = 201404; +pub const __STDC_IEC_559_COMPLEX__: u32 = 1; +pub const __STDC_IEC_60559_COMPLEX__: u32 = 201404; +pub const __STDC_ISO_10646__: u32 = 201706; +pub const __GNU_LIBRARY__: u32 = 6; +pub const __GLIBC__: u32 = 2; +pub const __GLIBC_MINOR__: u32 = 36; +pub const _SYS_CDEFS_H: u32 = 1; +pub const __glibc_c99_flexarr_available: u32 = 1; +pub const __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI: u32 = 0; +pub const __HAVE_GENERIC_SELECTION: u32 = 1; +pub const _STDINT_H: u32 = 1; +pub const __GLIBC_USE_LIB_EXT2: u32 = 0; +pub const __GLIBC_USE_IEC_60559_BFP_EXT: u32 = 0; +pub const __GLIBC_USE_IEC_60559_BFP_EXT_C2X: u32 = 0; +pub const __GLIBC_USE_IEC_60559_EXT: u32 = 0; +pub const __GLIBC_USE_IEC_60559_FUNCS_EXT: u32 = 0; +pub const __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X: u32 = 0; +pub const __GLIBC_USE_IEC_60559_TYPES_EXT: u32 = 0; +pub const _BITS_TYPES_H: u32 = 1; +pub const _BITS_TYPESIZES_H: u32 = 1; +pub const __OFF_T_MATCHES_OFF64_T: u32 = 1; +pub const __INO_T_MATCHES_INO64_T: u32 = 1; +pub const __RLIM_T_MATCHES_RLIM64_T: u32 = 1; +pub const __STATFS_MATCHES_STATFS64: u32 = 1; +pub const __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64: u32 = 1; +pub const __FD_SETSIZE: u32 = 1024; +pub const _BITS_TIME64_H: u32 = 1; +pub const _BITS_WCHAR_H: u32 = 1; +pub const _BITS_STDINT_INTN_H: u32 = 1; +pub const _BITS_STDINT_UINTN_H: u32 = 1; +pub const INT8_MIN: i32 = -128; +pub const INT16_MIN: i32 = -32768; +pub const INT32_MIN: i32 = -2147483648; +pub const INT8_MAX: u32 = 127; +pub const INT16_MAX: u32 = 32767; +pub const INT32_MAX: u32 = 2147483647; +pub const UINT8_MAX: u32 = 255; +pub const UINT16_MAX: u32 = 65535; +pub const UINT32_MAX: u32 = 4294967295; +pub const INT_LEAST8_MIN: i32 = -128; +pub const INT_LEAST16_MIN: i32 = -32768; +pub const INT_LEAST32_MIN: i32 = -2147483648; +pub const INT_LEAST8_MAX: u32 = 127; +pub const INT_LEAST16_MAX: u32 = 32767; +pub const INT_LEAST32_MAX: u32 = 2147483647; +pub const UINT_LEAST8_MAX: u32 = 255; +pub const UINT_LEAST16_MAX: u32 = 65535; +pub const UINT_LEAST32_MAX: u32 = 4294967295; +pub const INT_FAST8_MIN: i32 = -128; +pub const INT_FAST16_MIN: i64 = -9223372036854775808; +pub const INT_FAST32_MIN: i64 = -9223372036854775808; +pub const INT_FAST8_MAX: u32 = 127; +pub const INT_FAST16_MAX: u64 = 9223372036854775807; +pub const INT_FAST32_MAX: u64 = 9223372036854775807; +pub const UINT_FAST8_MAX: u32 = 255; +pub const UINT_FAST16_MAX: i32 = -1; +pub const UINT_FAST32_MAX: i32 = -1; +pub const INTPTR_MIN: i64 = -9223372036854775808; +pub const INTPTR_MAX: u64 = 9223372036854775807; +pub const UINTPTR_MAX: i32 = -1; +pub const PTRDIFF_MIN: i64 = -9223372036854775808; +pub const PTRDIFF_MAX: u64 = 9223372036854775807; +pub const SIG_ATOMIC_MIN: i32 = -2147483648; +pub const SIG_ATOMIC_MAX: u32 = 2147483647; +pub const SIZE_MAX: i32 = -1; +pub const WINT_MIN: u32 = 0; +pub const WINT_MAX: u32 = 4294967295; +pub const ____gwchar_t_defined: u32 = 1; +pub const __PRI64_PREFIX: &[u8; 2usize] = b"l\0"; +pub const __PRIPTR_PREFIX: &[u8; 2usize] = b"l\0"; +pub const PRId8: &[u8; 2usize] = b"d\0"; +pub const PRId16: &[u8; 2usize] = b"d\0"; +pub const PRId32: &[u8; 2usize] = b"d\0"; +pub const PRId64: &[u8; 3usize] = b"ld\0"; +pub const PRIdLEAST8: &[u8; 2usize] = b"d\0"; +pub const PRIdLEAST16: &[u8; 2usize] = b"d\0"; +pub const PRIdLEAST32: &[u8; 2usize] = b"d\0"; +pub const PRIdLEAST64: &[u8; 3usize] = b"ld\0"; +pub const PRIdFAST8: &[u8; 2usize] = b"d\0"; +pub const PRIdFAST16: &[u8; 3usize] = b"ld\0"; +pub const PRIdFAST32: &[u8; 3usize] = b"ld\0"; +pub const PRIdFAST64: &[u8; 3usize] = b"ld\0"; +pub const PRIi8: &[u8; 2usize] = b"i\0"; +pub const PRIi16: &[u8; 2usize] = b"i\0"; +pub const PRIi32: &[u8; 2usize] = b"i\0"; +pub const PRIi64: &[u8; 3usize] = b"li\0"; +pub const PRIiLEAST8: &[u8; 2usize] = b"i\0"; +pub const PRIiLEAST16: &[u8; 2usize] = b"i\0"; +pub const PRIiLEAST32: &[u8; 2usize] = b"i\0"; +pub const PRIiLEAST64: &[u8; 3usize] = b"li\0"; +pub const PRIiFAST8: &[u8; 2usize] = b"i\0"; +pub const PRIiFAST16: &[u8; 3usize] = b"li\0"; +pub const PRIiFAST32: &[u8; 3usize] = b"li\0"; +pub const PRIiFAST64: &[u8; 3usize] = b"li\0"; +pub const PRIo8: &[u8; 2usize] = b"o\0"; +pub const PRIo16: &[u8; 2usize] = b"o\0"; +pub const PRIo32: &[u8; 2usize] = b"o\0"; +pub const PRIo64: &[u8; 3usize] = b"lo\0"; +pub const PRIoLEAST8: &[u8; 2usize] = b"o\0"; +pub const PRIoLEAST16: &[u8; 2usize] = b"o\0"; +pub const PRIoLEAST32: &[u8; 2usize] = b"o\0"; +pub const PRIoLEAST64: &[u8; 3usize] = b"lo\0"; +pub const PRIoFAST8: &[u8; 2usize] = b"o\0"; +pub const PRIoFAST16: &[u8; 3usize] = b"lo\0"; +pub const PRIoFAST32: &[u8; 3usize] = b"lo\0"; +pub const PRIoFAST64: &[u8; 3usize] = b"lo\0"; +pub const PRIu8: &[u8; 2usize] = b"u\0"; +pub const PRIu16: &[u8; 2usize] = b"u\0"; +pub const PRIu32: &[u8; 2usize] = b"u\0"; +pub const PRIu64: &[u8; 3usize] = b"lu\0"; +pub const PRIuLEAST8: &[u8; 2usize] = b"u\0"; +pub const PRIuLEAST16: &[u8; 2usize] = b"u\0"; +pub const PRIuLEAST32: &[u8; 2usize] = b"u\0"; +pub const PRIuLEAST64: &[u8; 3usize] = b"lu\0"; +pub const PRIuFAST8: &[u8; 2usize] = b"u\0"; +pub const PRIuFAST16: &[u8; 3usize] = b"lu\0"; +pub const PRIuFAST32: &[u8; 3usize] = b"lu\0"; +pub const PRIuFAST64: &[u8; 3usize] = b"lu\0"; +pub const PRIx8: &[u8; 2usize] = b"x\0"; +pub const PRIx16: &[u8; 2usize] = b"x\0"; +pub const PRIx32: &[u8; 2usize] = b"x\0"; +pub const PRIx64: &[u8; 3usize] = b"lx\0"; +pub const PRIxLEAST8: &[u8; 2usize] = b"x\0"; +pub const PRIxLEAST16: &[u8; 2usize] = b"x\0"; +pub const PRIxLEAST32: &[u8; 2usize] = b"x\0"; +pub const PRIxLEAST64: &[u8; 3usize] = b"lx\0"; +pub const PRIxFAST8: &[u8; 2usize] = b"x\0"; +pub const PRIxFAST16: &[u8; 3usize] = b"lx\0"; +pub const PRIxFAST32: &[u8; 3usize] = b"lx\0"; +pub const PRIxFAST64: &[u8; 3usize] = b"lx\0"; +pub const PRIX8: &[u8; 2usize] = b"X\0"; +pub const PRIX16: &[u8; 2usize] = b"X\0"; +pub const PRIX32: &[u8; 2usize] = b"X\0"; +pub const PRIX64: &[u8; 3usize] = b"lX\0"; +pub const PRIXLEAST8: &[u8; 2usize] = b"X\0"; +pub const PRIXLEAST16: &[u8; 2usize] = b"X\0"; +pub const PRIXLEAST32: &[u8; 2usize] = b"X\0"; +pub const PRIXLEAST64: &[u8; 3usize] = b"lX\0"; +pub const PRIXFAST8: &[u8; 2usize] = b"X\0"; +pub const PRIXFAST16: &[u8; 3usize] = b"lX\0"; +pub const PRIXFAST32: &[u8; 3usize] = b"lX\0"; +pub const PRIXFAST64: &[u8; 3usize] = b"lX\0"; +pub const PRIdMAX: &[u8; 3usize] = b"ld\0"; +pub const PRIiMAX: &[u8; 3usize] = b"li\0"; +pub const PRIoMAX: &[u8; 3usize] = b"lo\0"; +pub const PRIuMAX: &[u8; 3usize] = b"lu\0"; +pub const PRIxMAX: &[u8; 3usize] = b"lx\0"; +pub const PRIXMAX: &[u8; 3usize] = b"lX\0"; +pub const PRIdPTR: &[u8; 3usize] = b"ld\0"; +pub const PRIiPTR: &[u8; 3usize] = b"li\0"; +pub const PRIoPTR: &[u8; 3usize] = b"lo\0"; +pub const PRIuPTR: &[u8; 3usize] = b"lu\0"; +pub const PRIxPTR: &[u8; 3usize] = b"lx\0"; +pub const PRIXPTR: &[u8; 3usize] = b"lX\0"; +pub const SCNd8: &[u8; 4usize] = b"hhd\0"; +pub const SCNd16: &[u8; 3usize] = b"hd\0"; +pub const SCNd32: &[u8; 2usize] = b"d\0"; +pub const SCNd64: &[u8; 3usize] = b"ld\0"; +pub const SCNdLEAST8: &[u8; 4usize] = b"hhd\0"; +pub const SCNdLEAST16: &[u8; 3usize] = b"hd\0"; +pub const SCNdLEAST32: &[u8; 2usize] = b"d\0"; +pub const SCNdLEAST64: &[u8; 3usize] = b"ld\0"; +pub const SCNdFAST8: &[u8; 4usize] = b"hhd\0"; +pub const SCNdFAST16: &[u8; 3usize] = b"ld\0"; +pub const SCNdFAST32: &[u8; 3usize] = b"ld\0"; +pub const SCNdFAST64: &[u8; 3usize] = b"ld\0"; +pub const SCNi8: &[u8; 4usize] = b"hhi\0"; +pub const SCNi16: &[u8; 3usize] = b"hi\0"; +pub const SCNi32: &[u8; 2usize] = b"i\0"; +pub const SCNi64: &[u8; 3usize] = b"li\0"; +pub const SCNiLEAST8: &[u8; 4usize] = b"hhi\0"; +pub const SCNiLEAST16: &[u8; 3usize] = b"hi\0"; +pub const SCNiLEAST32: &[u8; 2usize] = b"i\0"; +pub const SCNiLEAST64: &[u8; 3usize] = b"li\0"; +pub const SCNiFAST8: &[u8; 4usize] = b"hhi\0"; +pub const SCNiFAST16: &[u8; 3usize] = b"li\0"; +pub const SCNiFAST32: &[u8; 3usize] = b"li\0"; +pub const SCNiFAST64: &[u8; 3usize] = b"li\0"; +pub const SCNu8: &[u8; 4usize] = b"hhu\0"; +pub const SCNu16: &[u8; 3usize] = b"hu\0"; +pub const SCNu32: &[u8; 2usize] = b"u\0"; +pub const SCNu64: &[u8; 3usize] = b"lu\0"; +pub const SCNuLEAST8: &[u8; 4usize] = b"hhu\0"; +pub const SCNuLEAST16: &[u8; 3usize] = b"hu\0"; +pub const SCNuLEAST32: &[u8; 2usize] = b"u\0"; +pub const SCNuLEAST64: &[u8; 3usize] = b"lu\0"; +pub const SCNuFAST8: &[u8; 4usize] = b"hhu\0"; +pub const SCNuFAST16: &[u8; 3usize] = b"lu\0"; +pub const SCNuFAST32: &[u8; 3usize] = b"lu\0"; +pub const SCNuFAST64: &[u8; 3usize] = b"lu\0"; +pub const SCNo8: &[u8; 4usize] = b"hho\0"; +pub const SCNo16: &[u8; 3usize] = b"ho\0"; +pub const SCNo32: &[u8; 2usize] = b"o\0"; +pub const SCNo64: &[u8; 3usize] = b"lo\0"; +pub const SCNoLEAST8: &[u8; 4usize] = b"hho\0"; +pub const SCNoLEAST16: &[u8; 3usize] = b"ho\0"; +pub const SCNoLEAST32: &[u8; 2usize] = b"o\0"; +pub const SCNoLEAST64: &[u8; 3usize] = b"lo\0"; +pub const SCNoFAST8: &[u8; 4usize] = b"hho\0"; +pub const SCNoFAST16: &[u8; 3usize] = b"lo\0"; +pub const SCNoFAST32: &[u8; 3usize] = b"lo\0"; +pub const SCNoFAST64: &[u8; 3usize] = b"lo\0"; +pub const SCNx8: &[u8; 4usize] = b"hhx\0"; +pub const SCNx16: &[u8; 3usize] = b"hx\0"; +pub const SCNx32: &[u8; 2usize] = b"x\0"; +pub const SCNx64: &[u8; 3usize] = b"lx\0"; +pub const SCNxLEAST8: &[u8; 4usize] = b"hhx\0"; +pub const SCNxLEAST16: &[u8; 3usize] = b"hx\0"; +pub const SCNxLEAST32: &[u8; 2usize] = b"x\0"; +pub const SCNxLEAST64: &[u8; 3usize] = b"lx\0"; +pub const SCNxFAST8: &[u8; 4usize] = b"hhx\0"; +pub const SCNxFAST16: &[u8; 3usize] = b"lx\0"; +pub const SCNxFAST32: &[u8; 3usize] = b"lx\0"; +pub const SCNxFAST64: &[u8; 3usize] = b"lx\0"; +pub const SCNdMAX: &[u8; 3usize] = b"ld\0"; +pub const SCNiMAX: &[u8; 3usize] = b"li\0"; +pub const SCNoMAX: &[u8; 3usize] = b"lo\0"; +pub const SCNuMAX: &[u8; 3usize] = b"lu\0"; +pub const SCNxMAX: &[u8; 3usize] = b"lx\0"; +pub const SCNdPTR: &[u8; 3usize] = b"ld\0"; +pub const SCNiPTR: &[u8; 3usize] = b"li\0"; +pub const SCNoPTR: &[u8; 3usize] = b"lo\0"; +pub const SCNuPTR: &[u8; 3usize] = b"lu\0"; +pub const SCNxPTR: &[u8; 3usize] = b"lx\0"; +pub const _STDLIB_H: u32 = 1; +pub const WNOHANG: u32 = 1; +pub const WUNTRACED: u32 = 2; +pub const WSTOPPED: u32 = 2; +pub const WEXITED: u32 = 4; +pub const WCONTINUED: u32 = 8; +pub const WNOWAIT: u32 = 16777216; +pub const __WNOTHREAD: u32 = 536870912; +pub const __WALL: u32 = 1073741824; +pub const __WCLONE: u32 = 2147483648; +pub const __W_CONTINUED: u32 = 65535; +pub const __WCOREFLAG: u32 = 128; +pub const __HAVE_FLOAT128: u32 = 0; +pub const __HAVE_DISTINCT_FLOAT128: u32 = 0; +pub const __HAVE_FLOAT64X: u32 = 1; +pub const __HAVE_FLOAT64X_LONG_DOUBLE: u32 = 1; +pub const __HAVE_FLOAT16: u32 = 0; +pub const __HAVE_FLOAT32: u32 = 1; +pub const __HAVE_FLOAT64: u32 = 1; +pub const __HAVE_FLOAT32X: u32 = 1; +pub const __HAVE_FLOAT128X: u32 = 0; +pub const __HAVE_DISTINCT_FLOAT16: u32 = 0; +pub const __HAVE_DISTINCT_FLOAT32: u32 = 0; +pub const __HAVE_DISTINCT_FLOAT64: u32 = 0; +pub const __HAVE_DISTINCT_FLOAT32X: u32 = 0; +pub const __HAVE_DISTINCT_FLOAT64X: u32 = 0; +pub const __HAVE_DISTINCT_FLOAT128X: u32 = 0; +pub const __HAVE_FLOATN_NOT_TYPEDEF: u32 = 0; +pub const __ldiv_t_defined: u32 = 1; +pub const __lldiv_t_defined: u32 = 1; +pub const RAND_MAX: u32 = 2147483647; +pub const EXIT_FAILURE: u32 = 1; +pub const EXIT_SUCCESS: u32 = 0; +pub const _SYS_TYPES_H: u32 = 1; +pub const __clock_t_defined: u32 = 1; +pub const __clockid_t_defined: u32 = 1; +pub const __time_t_defined: u32 = 1; +pub const __timer_t_defined: u32 = 1; +pub const __BIT_TYPES_DEFINED__: u32 = 1; +pub const _ENDIAN_H: u32 = 1; +pub const _BITS_ENDIAN_H: u32 = 1; +pub const __LITTLE_ENDIAN: u32 = 1234; +pub const __BIG_ENDIAN: u32 = 4321; +pub const __PDP_ENDIAN: u32 = 3412; +pub const _BITS_ENDIANNESS_H: u32 = 1; +pub const __BYTE_ORDER: u32 = 1234; +pub const __FLOAT_WORD_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 _BITS_BYTESWAP_H: u32 = 1; +pub const _BITS_UINTN_IDENTITY_H: u32 = 1; +pub const _SYS_SELECT_H: u32 = 1; +pub const __sigset_t_defined: u32 = 1; +pub const __timeval_defined: u32 = 1; +pub const _STRUCT_TIMESPEC: u32 = 1; +pub const FD_SETSIZE: u32 = 1024; +pub const _BITS_PTHREADTYPES_COMMON_H: u32 = 1; +pub const _THREAD_SHARED_TYPES_H: u32 = 1; +pub const _BITS_PTHREADTYPES_ARCH_H: u32 = 1; +pub const __SIZEOF_PTHREAD_MUTEX_T: u32 = 40; +pub const __SIZEOF_PTHREAD_ATTR_T: u32 = 56; +pub const __SIZEOF_PTHREAD_RWLOCK_T: u32 = 56; +pub const __SIZEOF_PTHREAD_BARRIER_T: u32 = 32; +pub const __SIZEOF_PTHREAD_MUTEXATTR_T: u32 = 4; +pub const __SIZEOF_PTHREAD_COND_T: u32 = 48; +pub const __SIZEOF_PTHREAD_CONDATTR_T: u32 = 4; +pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: u32 = 8; +pub const __SIZEOF_PTHREAD_BARRIERATTR_T: u32 = 4; +pub const _THREAD_MUTEX_INTERNAL_H: u32 = 1; +pub const __PTHREAD_MUTEX_HAVE_PREV: u32 = 1; +pub const __have_pthread_attr_t: u32 = 1; +pub const _ALLOCA_H: u32 = 1; +pub const MAX_PATH: u32 = 260; +pub const LC_CONFIG_VERSION: u32 = 3237806082; +pub const LC_CONFIG_ERRORINFO_VERSION: u32 = 3237871618; +pub const LC_CONFIG_PRINTF_ENABLED: u32 = 1; +pub const LC_CONFIG_PRINTF_V: u32 = 2; +pub const LC_CONFIG_PRINTF_VV: u32 = 4; +pub const LC_CONFIG_PRINTF_VVV: u32 = 8; +pub const MEM_SCATTER_VERSION: u32 = 3237871618; +pub const MEM_SCATTER_STACK_SIZE: u32 = 12; +pub const LC_OPT_CORE_PRINTF_ENABLE: u64 = 4611686022722355200; +pub const LC_OPT_CORE_VERBOSE: u64 = 4611686027017322496; +pub const LC_OPT_CORE_VERBOSE_EXTRA: u64 = 4611686031312289792; +pub const LC_OPT_CORE_VERBOSE_EXTRA_TLP: u64 = 4611686035607257088; +pub const LC_OPT_CORE_VERSION_MAJOR: u64 = 4611686039902224384; +pub const LC_OPT_CORE_VERSION_MINOR: u64 = 4611686044197191680; +pub const LC_OPT_CORE_VERSION_REVISION: u64 = 4611686048492158976; +pub const LC_OPT_CORE_ADDR_MAX: u64 = 1152921538966585344; +pub const LC_OPT_CORE_STATISTICS_CALL_COUNT: u64 = 4611686057082093568; +pub const LC_OPT_CORE_STATISTICS_CALL_TIME: u64 = 4611686061377060864; +pub const LC_OPT_CORE_VOLATILE: u64 = 1152921551851487232; +pub const LC_OPT_CORE_READONLY: u64 = 1152921556146454528; +pub const LC_OPT_MEMORYINFO_VALID: u64 = 144115192370823168; +pub const LC_OPT_MEMORYINFO_FLAG_32BIT: u64 = 144115200960757760; +pub const LC_OPT_MEMORYINFO_FLAG_PAE: u64 = 144115205255725056; +pub const LC_OPT_MEMORYINFO_OS_VERSION_MINOR: u64 = 144115209550692352; +pub const LC_OPT_MEMORYINFO_OS_VERSION_MAJOR: u64 = 144115213845659648; +pub const LC_OPT_MEMORYINFO_OS_DTB: u64 = 144115218140626944; +pub const LC_OPT_MEMORYINFO_OS_PFN: u64 = 144115222435594240; +pub const LC_OPT_MEMORYINFO_OS_PsLoadedModuleList: u64 = 144115226730561536; +pub const LC_OPT_MEMORYINFO_OS_PsActiveProcessHead: u64 = 144115231025528832; +pub const LC_OPT_MEMORYINFO_OS_MACHINE_IMAGE_TP: u64 = 144115235320496128; +pub const LC_OPT_MEMORYINFO_OS_NUM_PROCESSORS: u64 = 144115239615463424; +pub const LC_OPT_MEMORYINFO_OS_SYSTEMTIME: u64 = 144115243910430720; +pub const LC_OPT_MEMORYINFO_OS_UPTIME: u64 = 144115248205398016; +pub const LC_OPT_MEMORYINFO_OS_KERNELBASE: u64 = 144115252500365312; +pub const LC_OPT_MEMORYINFO_OS_KERNELHINT: u64 = 144115256795332608; +pub const LC_OPT_MEMORYINFO_OS_KdDebuggerDataBlock: u64 = 144115261090299904; +pub const LC_OPT_FPGA_PROBE_MAXPAGES: u64 = 216172786408751104; +pub const LC_OPT_FPGA_MAX_SIZE_RX: u64 = 216172794998685696; +pub const LC_OPT_FPGA_MAX_SIZE_TX: u64 = 216172799293652992; +pub const LC_OPT_FPGA_DELAY_PROBE_READ: u64 = 216172803588620288; +pub const LC_OPT_FPGA_DELAY_PROBE_WRITE: u64 = 216172807883587584; +pub const LC_OPT_FPGA_DELAY_WRITE: u64 = 216172812178554880; +pub const LC_OPT_FPGA_DELAY_READ: u64 = 216172816473522176; +pub const LC_OPT_FPGA_RETRY_ON_ERROR: u64 = 216172820768489472; +pub const LC_OPT_FPGA_DEVICE_ID: u64 = 216173331869597696; +pub const LC_OPT_FPGA_FPGA_ID: u64 = 216173336164564992; +pub const LC_OPT_FPGA_VERSION_MAJOR: u64 = 216173340459532288; +pub const LC_OPT_FPGA_VERSION_MINOR: u64 = 216173344754499584; +pub const LC_OPT_FPGA_ALGO_TINY: u64 = 216173349049466880; +pub const LC_OPT_FPGA_ALGO_SYNCHRONOUS: u64 = 216173353344434176; +pub const LC_OPT_FPGA_CFGSPACE_XILINX: u64 = 216173357639401472; +pub const LC_OPT_FPGA_TLP_READ_CB_WITHINFO: u64 = 216173400589074432; +pub const LC_OPT_FPGA_TLP_READ_CB_FILTERCPL: u64 = 216173404884041728; +pub const LC_OPT_FPGA_TLP_READ_CB_BACKGROUND_THREAD: u64 = 216173409179009024; +pub const LC_CMD_FPGA_WRITE_TLP: u64 = 1103806595072; +pub const LC_CMD_FPGA_LISTEN_TLP: u64 = 1108101562368; +pub const LC_CMD_FPGA_PCIECFGSPACE: u64 = 1112396529664; +pub const LC_CMD_FPGA_CFGREGPCIE: u64 = 1116691496960; +pub const LC_CMD_FPGA_CFGREGCFG: u64 = 1120986464256; +pub const LC_CMD_FPGA_CFGREGDRP: u64 = 1125281431552; +pub const LC_CMD_FPGA_CFGREGCFG_MARKWR: u64 = 1129576398848; +pub const LC_CMD_FPGA_CFGREGPCIE_MARKWR: u64 = 1133871366144; +pub const LC_CMD_FPGA_CFGREG_DEBUGPRINT: u64 = 1142461300736; +pub const LC_CMD_FPGA_PROBE: u64 = 1146756268032; +pub const LC_CMD_FPGA_CFGSPACE_SHADOW_RD: u64 = 1151051235328; +pub const LC_CMD_FPGA_CFGSPACE_SHADOW_WR: u64 = 1155346202624; +pub const LC_CMD_FPGA_TLP_WRITE_SINGLE: u64 = 1168231104512; +pub const LC_CMD_FPGA_TLP_WRITE_MULTIPLE: u64 = 1172526071808; +pub const LC_CMD_FPGA_TLP_TOSTRING: u64 = 1176821039104; +pub const LC_CMD_FPGA_TLP_READ_FUNCTION_CALLBACK: u64 = 1181116006400; +pub const LC_CMD_FILE_DUMPHEADER_GET: u64 = 2203318222848; +pub const LC_CMD_STATISTICS_GET: u64 = 4611687117939015680; +pub const LC_CMD_MEMMAP_GET: u64 = 4611688217450643456; +pub const LC_CMD_MEMMAP_SET: u64 = 4611689316962271232; +pub const LC_CMD_MEMMAP_GET_STRUCT: u64 = 4611690416473899008; +pub const LC_CMD_MEMMAP_SET_STRUCT: u64 = 4611691515985526784; +pub const LC_CMD_AGENT_EXEC_PYTHON: i64 = -9223372032559808512; +pub const LC_CMD_AGENT_EXIT_PROCESS: i64 = -9223372028264841216; +pub const LC_CMD_AGENT_VFS_LIST: i64 = -9223372023969873920; +pub const LC_CMD_AGENT_VFS_READ: i64 = -9223372019674906624; +pub const LC_CMD_AGENT_VFS_WRITE: i64 = -9223372015379939328; +pub const LC_CMD_AGENT_VFS_OPT_GET: i64 = -9223372011084972032; +pub const LC_CMD_AGENT_VFS_OPT_SET: i64 = -9223372006790004736; +pub const LC_CMD_AGENT_VFS_REQ_VERSION: u32 = 4276944897; +pub const LC_CMD_AGENT_VFS_RSP_VERSION: u32 = 4277010433; +pub const LC_STATISTICS_VERSION: u32 = 3785424898; +pub const LC_STATISTICS_ID_OPEN: u32 = 0; +pub const LC_STATISTICS_ID_READ: u32 = 1; +pub const LC_STATISTICS_ID_READSCATTER: u32 = 2; +pub const LC_STATISTICS_ID_WRITE: u32 = 3; +pub const LC_STATISTICS_ID_WRITESCATTER: u32 = 4; +pub const LC_STATISTICS_ID_GETOPTION: u32 = 5; +pub const LC_STATISTICS_ID_SETOPTION: u32 = 6; +pub const LC_STATISTICS_ID_COMMAND: u32 = 7; +pub const LC_STATISTICS_ID_MAX: u32 = 7; +pub type __u_char = ::std::os::raw::c_uchar; +pub type __u_short = ::std::os::raw::c_ushort; +pub type __u_int = ::std::os::raw::c_uint; +pub type __u_long = ::std::os::raw::c_ulong; +pub type __int8_t = ::std::os::raw::c_schar; +pub type __uint8_t = ::std::os::raw::c_uchar; +pub type __int16_t = ::std::os::raw::c_short; +pub type __uint16_t = ::std::os::raw::c_ushort; +pub type __int32_t = ::std::os::raw::c_int; +pub type __uint32_t = ::std::os::raw::c_uint; +pub type __int64_t = ::std::os::raw::c_long; +pub type __uint64_t = ::std::os::raw::c_ulong; +pub type __int_least8_t = __int8_t; +pub type __uint_least8_t = __uint8_t; +pub type __int_least16_t = __int16_t; +pub type __uint_least16_t = __uint16_t; +pub type __int_least32_t = __int32_t; +pub type __uint_least32_t = __uint32_t; +pub type __int_least64_t = __int64_t; +pub type __uint_least64_t = __uint64_t; +pub type __quad_t = ::std::os::raw::c_long; +pub type __u_quad_t = ::std::os::raw::c_ulong; +pub type __intmax_t = ::std::os::raw::c_long; +pub type __uintmax_t = ::std::os::raw::c_ulong; +pub type __dev_t = ::std::os::raw::c_ulong; +pub type __uid_t = ::std::os::raw::c_uint; +pub type __gid_t = ::std::os::raw::c_uint; +pub type __ino_t = ::std::os::raw::c_ulong; +pub type __ino64_t = ::std::os::raw::c_ulong; +pub type __mode_t = ::std::os::raw::c_uint; +pub type __nlink_t = ::std::os::raw::c_ulong; +pub type __off_t = ::std::os::raw::c_long; +pub type __off64_t = ::std::os::raw::c_long; +pub type __pid_t = ::std::os::raw::c_int; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __fsid_t { + pub __val: [::std::os::raw::c_int; 2usize], +} +#[test] +fn bindgen_test_layout___fsid_t() { + const UNINIT: ::std::mem::MaybeUninit<__fsid_t> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::<__fsid_t>(), + 8usize, + concat!("Size of: ", stringify!(__fsid_t)) + ); + assert_eq!( + ::std::mem::align_of::<__fsid_t>(), + 4usize, + concat!("Alignment of ", stringify!(__fsid_t)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).__val) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(__fsid_t), + "::", + stringify!(__val) + ) + ); +} +pub type __clock_t = ::std::os::raw::c_long; +pub type __rlim_t = ::std::os::raw::c_ulong; +pub type __rlim64_t = ::std::os::raw::c_ulong; +pub type __id_t = ::std::os::raw::c_uint; +pub type __time_t = ::std::os::raw::c_long; +pub type __useconds_t = ::std::os::raw::c_uint; +pub type __suseconds_t = ::std::os::raw::c_long; +pub type __suseconds64_t = ::std::os::raw::c_long; +pub type __daddr_t = ::std::os::raw::c_int; +pub type __key_t = ::std::os::raw::c_int; +pub type __clockid_t = ::std::os::raw::c_int; +pub type __timer_t = *mut ::std::os::raw::c_void; +pub type __blksize_t = ::std::os::raw::c_long; +pub type __blkcnt_t = ::std::os::raw::c_long; +pub type __blkcnt64_t = ::std::os::raw::c_long; +pub type __fsblkcnt_t = ::std::os::raw::c_ulong; +pub type __fsblkcnt64_t = ::std::os::raw::c_ulong; +pub type __fsfilcnt_t = ::std::os::raw::c_ulong; +pub type __fsfilcnt64_t = ::std::os::raw::c_ulong; +pub type __fsword_t = ::std::os::raw::c_long; +pub type __ssize_t = ::std::os::raw::c_long; +pub type __syscall_slong_t = ::std::os::raw::c_long; +pub type __syscall_ulong_t = ::std::os::raw::c_ulong; +pub type __loff_t = __off64_t; +pub type __caddr_t = *mut ::std::os::raw::c_char; +pub type __intptr_t = ::std::os::raw::c_long; +pub type __socklen_t = ::std::os::raw::c_uint; +pub type __sig_atomic_t = ::std::os::raw::c_int; +pub type int_least8_t = __int_least8_t; +pub type int_least16_t = __int_least16_t; +pub type int_least32_t = __int_least32_t; +pub type int_least64_t = __int_least64_t; +pub type uint_least8_t = __uint_least8_t; +pub type uint_least16_t = __uint_least16_t; +pub type uint_least32_t = __uint_least32_t; +pub type uint_least64_t = __uint_least64_t; +pub type int_fast8_t = ::std::os::raw::c_schar; +pub type int_fast16_t = ::std::os::raw::c_long; +pub type int_fast32_t = ::std::os::raw::c_long; +pub type int_fast64_t = ::std::os::raw::c_long; +pub type uint_fast8_t = ::std::os::raw::c_uchar; +pub type uint_fast16_t = ::std::os::raw::c_ulong; +pub type uint_fast32_t = ::std::os::raw::c_ulong; +pub type uint_fast64_t = ::std::os::raw::c_ulong; +pub type intmax_t = __intmax_t; +pub type uintmax_t = __uintmax_t; +pub type __gwchar_t = ::std::os::raw::c_int; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct imaxdiv_t { + pub quot: ::std::os::raw::c_long, + pub rem: ::std::os::raw::c_long, +} +#[test] +fn bindgen_test_layout_imaxdiv_t() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(imaxdiv_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(imaxdiv_t)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).quot) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(imaxdiv_t), + "::", + stringify!(quot) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rem) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(imaxdiv_t), + "::", + stringify!(rem) + ) + ); +} +extern "C" { + pub fn imaxabs(__n: intmax_t) -> intmax_t; +} +extern "C" { + pub fn imaxdiv(__numer: intmax_t, __denom: intmax_t) -> imaxdiv_t; +} +extern "C" { + pub fn strtoimax( + __nptr: *const ::std::os::raw::c_char, + __endptr: *mut *mut ::std::os::raw::c_char, + __base: ::std::os::raw::c_int, + ) -> intmax_t; +} +extern "C" { + pub fn strtoumax( + __nptr: *const ::std::os::raw::c_char, + __endptr: *mut *mut ::std::os::raw::c_char, + __base: ::std::os::raw::c_int, + ) -> uintmax_t; +} +extern "C" { + pub fn wcstoimax( + __nptr: *const __gwchar_t, + __endptr: *mut *mut __gwchar_t, + __base: ::std::os::raw::c_int, + ) -> intmax_t; +} +extern "C" { + pub fn wcstoumax( + __nptr: *const __gwchar_t, + __endptr: *mut *mut __gwchar_t, + __base: ::std::os::raw::c_int, + ) -> uintmax_t; +} +pub type wchar_t = ::std::os::raw::c_int; +pub type _Float32 = f32; +pub type _Float64 = f64; +pub type _Float32x = f64; +pub type _Float64x = u128; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct div_t { + pub quot: ::std::os::raw::c_int, + pub rem: ::std::os::raw::c_int, +} +#[test] +fn bindgen_test_layout_div_t() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(div_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(div_t)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).quot) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(div_t), + "::", + stringify!(quot) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rem) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(div_t), + "::", + stringify!(rem) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct ldiv_t { + pub quot: ::std::os::raw::c_long, + pub rem: ::std::os::raw::c_long, +} +#[test] +fn bindgen_test_layout_ldiv_t() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(ldiv_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(ldiv_t)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).quot) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(ldiv_t), + "::", + stringify!(quot) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rem) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(ldiv_t), + "::", + stringify!(rem) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct lldiv_t { + pub quot: ::std::os::raw::c_longlong, + pub rem: ::std::os::raw::c_longlong, +} +#[test] +fn bindgen_test_layout_lldiv_t() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(lldiv_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(lldiv_t)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).quot) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(lldiv_t), + "::", + stringify!(quot) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rem) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(lldiv_t), + "::", + stringify!(rem) + ) + ); +} +extern "C" { + pub fn __ctype_get_mb_cur_max() -> usize; +} +extern "C" { + pub fn atof(__nptr: *const ::std::os::raw::c_char) -> f64; +} +extern "C" { + pub fn atoi(__nptr: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn atol(__nptr: *const ::std::os::raw::c_char) -> ::std::os::raw::c_long; +} +extern "C" { + pub fn atoll(__nptr: *const ::std::os::raw::c_char) -> ::std::os::raw::c_longlong; +} +extern "C" { + pub fn strtod( + __nptr: *const ::std::os::raw::c_char, + __endptr: *mut *mut ::std::os::raw::c_char, + ) -> f64; +} +extern "C" { + pub fn strtof( + __nptr: *const ::std::os::raw::c_char, + __endptr: *mut *mut ::std::os::raw::c_char, + ) -> f32; +} +extern "C" { + pub fn strtold( + __nptr: *const ::std::os::raw::c_char, + __endptr: *mut *mut ::std::os::raw::c_char, + ) -> u128; +} +extern "C" { + pub fn strtol( + __nptr: *const ::std::os::raw::c_char, + __endptr: *mut *mut ::std::os::raw::c_char, + __base: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_long; +} +extern "C" { + pub fn strtoul( + __nptr: *const ::std::os::raw::c_char, + __endptr: *mut *mut ::std::os::raw::c_char, + __base: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_ulong; +} +extern "C" { + pub fn strtoq( + __nptr: *const ::std::os::raw::c_char, + __endptr: *mut *mut ::std::os::raw::c_char, + __base: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_longlong; +} +extern "C" { + pub fn strtouq( + __nptr: *const ::std::os::raw::c_char, + __endptr: *mut *mut ::std::os::raw::c_char, + __base: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_ulonglong; +} +extern "C" { + pub fn strtoll( + __nptr: *const ::std::os::raw::c_char, + __endptr: *mut *mut ::std::os::raw::c_char, + __base: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_longlong; +} +extern "C" { + pub fn strtoull( + __nptr: *const ::std::os::raw::c_char, + __endptr: *mut *mut ::std::os::raw::c_char, + __base: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_ulonglong; +} +extern "C" { + pub fn l64a(__n: ::std::os::raw::c_long) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn a64l(__s: *const ::std::os::raw::c_char) -> ::std::os::raw::c_long; +} +pub type u_char = __u_char; +pub type u_short = __u_short; +pub type u_int = __u_int; +pub type u_long = __u_long; +pub type quad_t = __quad_t; +pub type u_quad_t = __u_quad_t; +pub type fsid_t = __fsid_t; +pub type loff_t = __loff_t; +pub type ino_t = __ino_t; +pub type dev_t = __dev_t; +pub type gid_t = __gid_t; +pub type mode_t = __mode_t; +pub type nlink_t = __nlink_t; +pub type uid_t = __uid_t; +pub type off_t = __off_t; +pub type pid_t = __pid_t; +pub type id_t = __id_t; +pub type daddr_t = __daddr_t; +pub type caddr_t = __caddr_t; +pub type key_t = __key_t; +pub type clock_t = __clock_t; +pub type clockid_t = __clockid_t; +pub type time_t = __time_t; +pub type timer_t = __timer_t; +pub type ulong = ::std::os::raw::c_ulong; +pub type ushort = ::std::os::raw::c_ushort; +pub type uint = ::std::os::raw::c_uint; +pub type u_int8_t = __uint8_t; +pub type u_int16_t = __uint16_t; +pub type u_int32_t = __uint32_t; +pub type u_int64_t = __uint64_t; +pub type register_t = ::std::os::raw::c_long; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __sigset_t { + pub __val: [::std::os::raw::c_ulong; 16usize], +} +#[test] +fn bindgen_test_layout___sigset_t() { + const UNINIT: ::std::mem::MaybeUninit<__sigset_t> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::<__sigset_t>(), + 128usize, + concat!("Size of: ", stringify!(__sigset_t)) + ); + assert_eq!( + ::std::mem::align_of::<__sigset_t>(), + 8usize, + concat!("Alignment of ", stringify!(__sigset_t)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).__val) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(__sigset_t), + "::", + stringify!(__val) + ) + ); +} +pub type sigset_t = __sigset_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct timeval { + pub tv_sec: __time_t, + pub tv_usec: __suseconds_t, +} +#[test] +fn bindgen_test_layout_timeval() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(timeval)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(timeval)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tv_sec) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(timeval), + "::", + stringify!(tv_sec) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tv_usec) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(timeval), + "::", + stringify!(tv_usec) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct timespec { + pub tv_sec: __time_t, + pub tv_nsec: __syscall_slong_t, +} +#[test] +fn bindgen_test_layout_timespec() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(timespec)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(timespec)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tv_sec) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(timespec), + "::", + stringify!(tv_sec) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tv_nsec) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(timespec), + "::", + stringify!(tv_nsec) + ) + ); +} +pub type suseconds_t = __suseconds_t; +pub type __fd_mask = ::std::os::raw::c_long; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct fd_set { + pub __fds_bits: [__fd_mask; 16usize], +} +#[test] +fn bindgen_test_layout_fd_set() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 128usize, + concat!("Size of: ", stringify!(fd_set)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(fd_set)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).__fds_bits) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(fd_set), + "::", + stringify!(__fds_bits) + ) + ); +} +pub type fd_mask = __fd_mask; +extern "C" { + pub fn select( + __nfds: ::std::os::raw::c_int, + __readfds: *mut fd_set, + __writefds: *mut fd_set, + __exceptfds: *mut fd_set, + __timeout: *mut timeval, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn pselect( + __nfds: ::std::os::raw::c_int, + __readfds: *mut fd_set, + __writefds: *mut fd_set, + __exceptfds: *mut fd_set, + __timeout: *const timespec, + __sigmask: *const __sigset_t, + ) -> ::std::os::raw::c_int; +} +pub type blksize_t = __blksize_t; +pub type blkcnt_t = __blkcnt_t; +pub type fsblkcnt_t = __fsblkcnt_t; +pub type fsfilcnt_t = __fsfilcnt_t; +#[repr(C)] +#[derive(Copy, Clone)] +pub union __atomic_wide_counter { + pub __value64: ::std::os::raw::c_ulonglong, + pub __value32: __atomic_wide_counter__bindgen_ty_1, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __atomic_wide_counter__bindgen_ty_1 { + pub __low: ::std::os::raw::c_uint, + pub __high: ::std::os::raw::c_uint, +} +#[test] +fn bindgen_test_layout___atomic_wide_counter__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit<__atomic_wide_counter__bindgen_ty_1> = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::<__atomic_wide_counter__bindgen_ty_1>(), + 8usize, + concat!("Size of: ", stringify!(__atomic_wide_counter__bindgen_ty_1)) + ); + assert_eq!( + ::std::mem::align_of::<__atomic_wide_counter__bindgen_ty_1>(), + 4usize, + concat!( + "Alignment of ", + stringify!(__atomic_wide_counter__bindgen_ty_1) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).__low) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(__atomic_wide_counter__bindgen_ty_1), + "::", + stringify!(__low) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).__high) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(__atomic_wide_counter__bindgen_ty_1), + "::", + stringify!(__high) + ) + ); +} +#[test] +fn bindgen_test_layout___atomic_wide_counter() { + const UNINIT: ::std::mem::MaybeUninit<__atomic_wide_counter> = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::<__atomic_wide_counter>(), + 8usize, + concat!("Size of: ", stringify!(__atomic_wide_counter)) + ); + assert_eq!( + ::std::mem::align_of::<__atomic_wide_counter>(), + 8usize, + concat!("Alignment of ", stringify!(__atomic_wide_counter)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).__value64) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(__atomic_wide_counter), + "::", + stringify!(__value64) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).__value32) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(__atomic_wide_counter), + "::", + stringify!(__value32) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __pthread_internal_list { + pub __prev: *mut __pthread_internal_list, + pub __next: *mut __pthread_internal_list, +} +#[test] +fn bindgen_test_layout___pthread_internal_list() { + const UNINIT: ::std::mem::MaybeUninit<__pthread_internal_list> = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::<__pthread_internal_list>(), + 16usize, + concat!("Size of: ", stringify!(__pthread_internal_list)) + ); + assert_eq!( + ::std::mem::align_of::<__pthread_internal_list>(), + 8usize, + concat!("Alignment of ", stringify!(__pthread_internal_list)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).__prev) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(__pthread_internal_list), + "::", + stringify!(__prev) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).__next) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(__pthread_internal_list), + "::", + stringify!(__next) + ) + ); +} +pub type __pthread_list_t = __pthread_internal_list; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __pthread_internal_slist { + pub __next: *mut __pthread_internal_slist, +} +#[test] +fn bindgen_test_layout___pthread_internal_slist() { + const UNINIT: ::std::mem::MaybeUninit<__pthread_internal_slist> = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::<__pthread_internal_slist>(), + 8usize, + concat!("Size of: ", stringify!(__pthread_internal_slist)) + ); + assert_eq!( + ::std::mem::align_of::<__pthread_internal_slist>(), + 8usize, + concat!("Alignment of ", stringify!(__pthread_internal_slist)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).__next) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(__pthread_internal_slist), + "::", + stringify!(__next) + ) + ); +} +pub type __pthread_slist_t = __pthread_internal_slist; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __pthread_mutex_s { + pub __lock: ::std::os::raw::c_int, + pub __count: ::std::os::raw::c_uint, + pub __owner: ::std::os::raw::c_int, + pub __nusers: ::std::os::raw::c_uint, + pub __kind: ::std::os::raw::c_int, + pub __spins: ::std::os::raw::c_short, + pub __elision: ::std::os::raw::c_short, + pub __list: __pthread_list_t, +} +#[test] +fn bindgen_test_layout___pthread_mutex_s() { + const UNINIT: ::std::mem::MaybeUninit<__pthread_mutex_s> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::<__pthread_mutex_s>(), + 40usize, + concat!("Size of: ", stringify!(__pthread_mutex_s)) + ); + assert_eq!( + ::std::mem::align_of::<__pthread_mutex_s>(), + 8usize, + concat!("Alignment of ", stringify!(__pthread_mutex_s)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).__lock) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(__pthread_mutex_s), + "::", + stringify!(__lock) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).__count) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(__pthread_mutex_s), + "::", + stringify!(__count) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).__owner) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(__pthread_mutex_s), + "::", + stringify!(__owner) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).__nusers) as usize - ptr as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(__pthread_mutex_s), + "::", + stringify!(__nusers) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).__kind) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(__pthread_mutex_s), + "::", + stringify!(__kind) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).__spins) as usize - ptr as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(__pthread_mutex_s), + "::", + stringify!(__spins) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).__elision) as usize - ptr as usize }, + 22usize, + concat!( + "Offset of field: ", + stringify!(__pthread_mutex_s), + "::", + stringify!(__elision) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).__list) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(__pthread_mutex_s), + "::", + stringify!(__list) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __pthread_rwlock_arch_t { + pub __readers: ::std::os::raw::c_uint, + pub __writers: ::std::os::raw::c_uint, + pub __wrphase_futex: ::std::os::raw::c_uint, + pub __writers_futex: ::std::os::raw::c_uint, + pub __pad3: ::std::os::raw::c_uint, + pub __pad4: ::std::os::raw::c_uint, + pub __cur_writer: ::std::os::raw::c_int, + pub __shared: ::std::os::raw::c_int, + pub __rwelision: ::std::os::raw::c_schar, + pub __pad1: [::std::os::raw::c_uchar; 7usize], + pub __pad2: ::std::os::raw::c_ulong, + pub __flags: ::std::os::raw::c_uint, +} +#[test] +fn bindgen_test_layout___pthread_rwlock_arch_t() { + const UNINIT: ::std::mem::MaybeUninit<__pthread_rwlock_arch_t> = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::<__pthread_rwlock_arch_t>(), + 56usize, + concat!("Size of: ", stringify!(__pthread_rwlock_arch_t)) + ); + assert_eq!( + ::std::mem::align_of::<__pthread_rwlock_arch_t>(), + 8usize, + concat!("Alignment of ", stringify!(__pthread_rwlock_arch_t)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).__readers) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(__pthread_rwlock_arch_t), + "::", + stringify!(__readers) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).__writers) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(__pthread_rwlock_arch_t), + "::", + stringify!(__writers) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).__wrphase_futex) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(__pthread_rwlock_arch_t), + "::", + stringify!(__wrphase_futex) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).__writers_futex) as usize - ptr as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(__pthread_rwlock_arch_t), + "::", + stringify!(__writers_futex) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).__pad3) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(__pthread_rwlock_arch_t), + "::", + stringify!(__pad3) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).__pad4) as usize - ptr as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(__pthread_rwlock_arch_t), + "::", + stringify!(__pad4) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).__cur_writer) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(__pthread_rwlock_arch_t), + "::", + stringify!(__cur_writer) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).__shared) as usize - ptr as usize }, + 28usize, + concat!( + "Offset of field: ", + stringify!(__pthread_rwlock_arch_t), + "::", + stringify!(__shared) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).__rwelision) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(__pthread_rwlock_arch_t), + "::", + stringify!(__rwelision) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).__pad1) as usize - ptr as usize }, + 33usize, + concat!( + "Offset of field: ", + stringify!(__pthread_rwlock_arch_t), + "::", + stringify!(__pad1) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).__pad2) as usize - ptr as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(__pthread_rwlock_arch_t), + "::", + stringify!(__pad2) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).__flags) as usize - ptr as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(__pthread_rwlock_arch_t), + "::", + stringify!(__flags) + ) + ); +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct __pthread_cond_s { + pub __wseq: __atomic_wide_counter, + pub __g1_start: __atomic_wide_counter, + pub __g_refs: [::std::os::raw::c_uint; 2usize], + pub __g_size: [::std::os::raw::c_uint; 2usize], + pub __g1_orig_size: ::std::os::raw::c_uint, + pub __wrefs: ::std::os::raw::c_uint, + pub __g_signals: [::std::os::raw::c_uint; 2usize], +} +#[test] +fn bindgen_test_layout___pthread_cond_s() { + const UNINIT: ::std::mem::MaybeUninit<__pthread_cond_s> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::<__pthread_cond_s>(), + 48usize, + concat!("Size of: ", stringify!(__pthread_cond_s)) + ); + assert_eq!( + ::std::mem::align_of::<__pthread_cond_s>(), + 8usize, + concat!("Alignment of ", stringify!(__pthread_cond_s)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).__wseq) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(__pthread_cond_s), + "::", + stringify!(__wseq) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).__g1_start) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(__pthread_cond_s), + "::", + stringify!(__g1_start) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).__g_refs) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(__pthread_cond_s), + "::", + stringify!(__g_refs) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).__g_size) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(__pthread_cond_s), + "::", + stringify!(__g_size) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).__g1_orig_size) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(__pthread_cond_s), + "::", + stringify!(__g1_orig_size) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).__wrefs) as usize - ptr as usize }, + 36usize, + concat!( + "Offset of field: ", + stringify!(__pthread_cond_s), + "::", + stringify!(__wrefs) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).__g_signals) as usize - ptr as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(__pthread_cond_s), + "::", + stringify!(__g_signals) + ) + ); +} +pub type __tss_t = ::std::os::raw::c_uint; +pub type __thrd_t = ::std::os::raw::c_ulong; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __once_flag { + pub __data: ::std::os::raw::c_int, +} +#[test] +fn bindgen_test_layout___once_flag() { + const UNINIT: ::std::mem::MaybeUninit<__once_flag> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::<__once_flag>(), + 4usize, + concat!("Size of: ", stringify!(__once_flag)) + ); + assert_eq!( + ::std::mem::align_of::<__once_flag>(), + 4usize, + concat!("Alignment of ", stringify!(__once_flag)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).__data) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(__once_flag), + "::", + stringify!(__data) + ) + ); +} +pub type pthread_t = ::std::os::raw::c_ulong; +#[repr(C)] +#[derive(Copy, Clone)] +pub union pthread_mutexattr_t { + pub __size: [::std::os::raw::c_char; 4usize], + pub __align: ::std::os::raw::c_int, +} +#[test] +fn bindgen_test_layout_pthread_mutexattr_t() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 4usize, + concat!("Size of: ", stringify!(pthread_mutexattr_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(pthread_mutexattr_t)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).__size) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pthread_mutexattr_t), + "::", + stringify!(__size) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).__align) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pthread_mutexattr_t), + "::", + stringify!(__align) + ) + ); +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union pthread_condattr_t { + pub __size: [::std::os::raw::c_char; 4usize], + pub __align: ::std::os::raw::c_int, +} +#[test] +fn bindgen_test_layout_pthread_condattr_t() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 4usize, + concat!("Size of: ", stringify!(pthread_condattr_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(pthread_condattr_t)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).__size) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pthread_condattr_t), + "::", + stringify!(__size) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).__align) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pthread_condattr_t), + "::", + stringify!(__align) + ) + ); +} +pub type pthread_key_t = ::std::os::raw::c_uint; +pub type pthread_once_t = ::std::os::raw::c_int; +#[repr(C)] +#[derive(Copy, Clone)] +pub union pthread_attr_t { + pub __size: [::std::os::raw::c_char; 56usize], + pub __align: ::std::os::raw::c_long, +} +#[test] +fn bindgen_test_layout_pthread_attr_t() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 56usize, + concat!("Size of: ", stringify!(pthread_attr_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pthread_attr_t)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).__size) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pthread_attr_t), + "::", + stringify!(__size) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).__align) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pthread_attr_t), + "::", + stringify!(__align) + ) + ); +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union pthread_mutex_t { + pub __data: __pthread_mutex_s, + pub __size: [::std::os::raw::c_char; 40usize], + pub __align: ::std::os::raw::c_long, +} +#[test] +fn bindgen_test_layout_pthread_mutex_t() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 40usize, + concat!("Size of: ", stringify!(pthread_mutex_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pthread_mutex_t)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).__data) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pthread_mutex_t), + "::", + stringify!(__data) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).__size) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pthread_mutex_t), + "::", + stringify!(__size) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).__align) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pthread_mutex_t), + "::", + stringify!(__align) + ) + ); +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union pthread_cond_t { + pub __data: __pthread_cond_s, + pub __size: [::std::os::raw::c_char; 48usize], + pub __align: ::std::os::raw::c_longlong, +} +#[test] +fn bindgen_test_layout_pthread_cond_t() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 48usize, + concat!("Size of: ", stringify!(pthread_cond_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pthread_cond_t)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).__data) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pthread_cond_t), + "::", + stringify!(__data) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).__size) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pthread_cond_t), + "::", + stringify!(__size) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).__align) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pthread_cond_t), + "::", + stringify!(__align) + ) + ); +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union pthread_rwlock_t { + pub __data: __pthread_rwlock_arch_t, + pub __size: [::std::os::raw::c_char; 56usize], + pub __align: ::std::os::raw::c_long, +} +#[test] +fn bindgen_test_layout_pthread_rwlock_t() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 56usize, + concat!("Size of: ", stringify!(pthread_rwlock_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pthread_rwlock_t)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).__data) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pthread_rwlock_t), + "::", + stringify!(__data) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).__size) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pthread_rwlock_t), + "::", + stringify!(__size) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).__align) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pthread_rwlock_t), + "::", + stringify!(__align) + ) + ); +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union pthread_rwlockattr_t { + pub __size: [::std::os::raw::c_char; 8usize], + pub __align: ::std::os::raw::c_long, +} +#[test] +fn bindgen_test_layout_pthread_rwlockattr_t() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(pthread_rwlockattr_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pthread_rwlockattr_t)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).__size) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pthread_rwlockattr_t), + "::", + stringify!(__size) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).__align) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pthread_rwlockattr_t), + "::", + stringify!(__align) + ) + ); +} +pub type pthread_spinlock_t = ::std::os::raw::c_int; +#[repr(C)] +#[derive(Copy, Clone)] +pub union pthread_barrier_t { + pub __size: [::std::os::raw::c_char; 32usize], + pub __align: ::std::os::raw::c_long, +} +#[test] +fn bindgen_test_layout_pthread_barrier_t() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 32usize, + concat!("Size of: ", stringify!(pthread_barrier_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pthread_barrier_t)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).__size) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pthread_barrier_t), + "::", + stringify!(__size) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).__align) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pthread_barrier_t), + "::", + stringify!(__align) + ) + ); +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union pthread_barrierattr_t { + pub __size: [::std::os::raw::c_char; 4usize], + pub __align: ::std::os::raw::c_int, +} +#[test] +fn bindgen_test_layout_pthread_barrierattr_t() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 4usize, + concat!("Size of: ", stringify!(pthread_barrierattr_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(pthread_barrierattr_t)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).__size) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pthread_barrierattr_t), + "::", + stringify!(__size) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).__align) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pthread_barrierattr_t), + "::", + stringify!(__align) + ) + ); +} +extern "C" { + pub fn random() -> ::std::os::raw::c_long; +} +extern "C" { + pub fn srandom(__seed: ::std::os::raw::c_uint); +} +extern "C" { + pub fn initstate( + __seed: ::std::os::raw::c_uint, + __statebuf: *mut ::std::os::raw::c_char, + __statelen: usize, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn setstate(__statebuf: *mut ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct random_data { + pub fptr: *mut i32, + pub rptr: *mut i32, + pub state: *mut i32, + pub rand_type: ::std::os::raw::c_int, + pub rand_deg: ::std::os::raw::c_int, + pub rand_sep: ::std::os::raw::c_int, + pub end_ptr: *mut i32, +} +#[test] +fn bindgen_test_layout_random_data() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 48usize, + concat!("Size of: ", stringify!(random_data)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(random_data)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).fptr) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(random_data), + "::", + stringify!(fptr) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rptr) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(random_data), + "::", + stringify!(rptr) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).state) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(random_data), + "::", + stringify!(state) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rand_type) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(random_data), + "::", + stringify!(rand_type) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rand_deg) as usize - ptr as usize }, + 28usize, + concat!( + "Offset of field: ", + stringify!(random_data), + "::", + stringify!(rand_deg) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rand_sep) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(random_data), + "::", + stringify!(rand_sep) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).end_ptr) as usize - ptr as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(random_data), + "::", + stringify!(end_ptr) + ) + ); +} +extern "C" { + pub fn random_r(__buf: *mut random_data, __result: *mut i32) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn srandom_r( + __seed: ::std::os::raw::c_uint, + __buf: *mut random_data, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn initstate_r( + __seed: ::std::os::raw::c_uint, + __statebuf: *mut ::std::os::raw::c_char, + __statelen: usize, + __buf: *mut random_data, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn setstate_r( + __statebuf: *mut ::std::os::raw::c_char, + __buf: *mut random_data, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn rand() -> ::std::os::raw::c_int; +} +extern "C" { + pub fn srand(__seed: ::std::os::raw::c_uint); +} +extern "C" { + pub fn rand_r(__seed: *mut ::std::os::raw::c_uint) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn drand48() -> f64; +} +extern "C" { + pub fn erand48(__xsubi: *mut ::std::os::raw::c_ushort) -> f64; +} +extern "C" { + pub fn lrand48() -> ::std::os::raw::c_long; +} +extern "C" { + pub fn nrand48(__xsubi: *mut ::std::os::raw::c_ushort) -> ::std::os::raw::c_long; +} +extern "C" { + pub fn mrand48() -> ::std::os::raw::c_long; +} +extern "C" { + pub fn jrand48(__xsubi: *mut ::std::os::raw::c_ushort) -> ::std::os::raw::c_long; +} +extern "C" { + pub fn srand48(__seedval: ::std::os::raw::c_long); +} +extern "C" { + pub fn seed48(__seed16v: *mut ::std::os::raw::c_ushort) -> *mut ::std::os::raw::c_ushort; +} +extern "C" { + pub fn lcong48(__param: *mut ::std::os::raw::c_ushort); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct drand48_data { + pub __x: [::std::os::raw::c_ushort; 3usize], + pub __old_x: [::std::os::raw::c_ushort; 3usize], + pub __c: ::std::os::raw::c_ushort, + pub __init: ::std::os::raw::c_ushort, + pub __a: ::std::os::raw::c_ulonglong, +} +#[test] +fn bindgen_test_layout_drand48_data() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 24usize, + concat!("Size of: ", stringify!(drand48_data)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(drand48_data)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).__x) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(drand48_data), + "::", + stringify!(__x) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).__old_x) as usize - ptr as usize }, + 6usize, + concat!( + "Offset of field: ", + stringify!(drand48_data), + "::", + stringify!(__old_x) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).__c) as usize - ptr as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(drand48_data), + "::", + stringify!(__c) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).__init) as usize - ptr as usize }, + 14usize, + concat!( + "Offset of field: ", + stringify!(drand48_data), + "::", + stringify!(__init) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).__a) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(drand48_data), + "::", + stringify!(__a) + ) + ); +} +extern "C" { + pub fn drand48_r(__buffer: *mut drand48_data, __result: *mut f64) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn erand48_r( + __xsubi: *mut ::std::os::raw::c_ushort, + __buffer: *mut drand48_data, + __result: *mut f64, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn lrand48_r( + __buffer: *mut drand48_data, + __result: *mut ::std::os::raw::c_long, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn nrand48_r( + __xsubi: *mut ::std::os::raw::c_ushort, + __buffer: *mut drand48_data, + __result: *mut ::std::os::raw::c_long, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn mrand48_r( + __buffer: *mut drand48_data, + __result: *mut ::std::os::raw::c_long, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn jrand48_r( + __xsubi: *mut ::std::os::raw::c_ushort, + __buffer: *mut drand48_data, + __result: *mut ::std::os::raw::c_long, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn srand48_r( + __seedval: ::std::os::raw::c_long, + __buffer: *mut drand48_data, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn seed48_r( + __seed16v: *mut ::std::os::raw::c_ushort, + __buffer: *mut drand48_data, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn lcong48_r( + __param: *mut ::std::os::raw::c_ushort, + __buffer: *mut drand48_data, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn arc4random() -> __uint32_t; +} +extern "C" { + pub fn arc4random_buf(__buf: *mut ::std::os::raw::c_void, __size: usize); +} +extern "C" { + pub fn arc4random_uniform(__upper_bound: __uint32_t) -> __uint32_t; +} +extern "C" { + pub fn malloc(__size: ::std::os::raw::c_ulong) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn calloc( + __nmemb: ::std::os::raw::c_ulong, + __size: ::std::os::raw::c_ulong, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn realloc( + __ptr: *mut ::std::os::raw::c_void, + __size: ::std::os::raw::c_ulong, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn free(__ptr: *mut ::std::os::raw::c_void); +} +extern "C" { + pub fn reallocarray( + __ptr: *mut ::std::os::raw::c_void, + __nmemb: usize, + __size: usize, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn alloca(__size: ::std::os::raw::c_ulong) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn valloc(__size: usize) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn posix_memalign( + __memptr: *mut *mut ::std::os::raw::c_void, + __alignment: usize, + __size: usize, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn aligned_alloc( + __alignment: ::std::os::raw::c_ulong, + __size: ::std::os::raw::c_ulong, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn abort() -> !; +} +extern "C" { + pub fn atexit(__func: ::std::option::Option) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn at_quick_exit( + __func: ::std::option::Option, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn on_exit( + __func: ::std::option::Option< + unsafe extern "C" fn( + __status: ::std::os::raw::c_int, + __arg: *mut ::std::os::raw::c_void, + ), + >, + __arg: *mut ::std::os::raw::c_void, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn exit(__status: ::std::os::raw::c_int) -> !; +} +extern "C" { + pub fn quick_exit(__status: ::std::os::raw::c_int) -> !; +} +extern "C" { + pub fn _Exit(__status: ::std::os::raw::c_int) -> !; +} +extern "C" { + pub fn getenv(__name: *const ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn putenv(__string: *mut ::std::os::raw::c_char) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn setenv( + __name: *const ::std::os::raw::c_char, + __value: *const ::std::os::raw::c_char, + __replace: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn unsetenv(__name: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn clearenv() -> ::std::os::raw::c_int; +} +extern "C" { + pub fn mktemp(__template: *mut ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn mkstemp(__template: *mut ::std::os::raw::c_char) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn mkstemps( + __template: *mut ::std::os::raw::c_char, + __suffixlen: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn mkdtemp(__template: *mut ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn system(__command: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn realpath( + __name: *const ::std::os::raw::c_char, + __resolved: *mut ::std::os::raw::c_char, + ) -> *mut ::std::os::raw::c_char; +} +pub type __compar_fn_t = ::std::option::Option< + unsafe extern "C" fn( + arg1: *const ::std::os::raw::c_void, + arg2: *const ::std::os::raw::c_void, + ) -> ::std::os::raw::c_int, +>; +extern "C" { + pub fn bsearch( + __key: *const ::std::os::raw::c_void, + __base: *const ::std::os::raw::c_void, + __nmemb: usize, + __size: usize, + __compar: __compar_fn_t, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn qsort( + __base: *mut ::std::os::raw::c_void, + __nmemb: usize, + __size: usize, + __compar: __compar_fn_t, + ); +} +extern "C" { + pub fn abs(__x: ::std::os::raw::c_int) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn labs(__x: ::std::os::raw::c_long) -> ::std::os::raw::c_long; +} +extern "C" { + pub fn llabs(__x: ::std::os::raw::c_longlong) -> ::std::os::raw::c_longlong; +} +extern "C" { + pub fn div(__numer: ::std::os::raw::c_int, __denom: ::std::os::raw::c_int) -> div_t; +} +extern "C" { + pub fn ldiv(__numer: ::std::os::raw::c_long, __denom: ::std::os::raw::c_long) -> ldiv_t; +} +extern "C" { + pub fn lldiv( + __numer: ::std::os::raw::c_longlong, + __denom: ::std::os::raw::c_longlong, + ) -> lldiv_t; +} +extern "C" { + pub fn ecvt( + __value: f64, + __ndigit: ::std::os::raw::c_int, + __decpt: *mut ::std::os::raw::c_int, + __sign: *mut ::std::os::raw::c_int, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn fcvt( + __value: f64, + __ndigit: ::std::os::raw::c_int, + __decpt: *mut ::std::os::raw::c_int, + __sign: *mut ::std::os::raw::c_int, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn gcvt( + __value: f64, + __ndigit: ::std::os::raw::c_int, + __buf: *mut ::std::os::raw::c_char, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn qecvt( + __value: u128, + __ndigit: ::std::os::raw::c_int, + __decpt: *mut ::std::os::raw::c_int, + __sign: *mut ::std::os::raw::c_int, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn qfcvt( + __value: u128, + __ndigit: ::std::os::raw::c_int, + __decpt: *mut ::std::os::raw::c_int, + __sign: *mut ::std::os::raw::c_int, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn qgcvt( + __value: u128, + __ndigit: ::std::os::raw::c_int, + __buf: *mut ::std::os::raw::c_char, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn ecvt_r( + __value: f64, + __ndigit: ::std::os::raw::c_int, + __decpt: *mut ::std::os::raw::c_int, + __sign: *mut ::std::os::raw::c_int, + __buf: *mut ::std::os::raw::c_char, + __len: usize, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn fcvt_r( + __value: f64, + __ndigit: ::std::os::raw::c_int, + __decpt: *mut ::std::os::raw::c_int, + __sign: *mut ::std::os::raw::c_int, + __buf: *mut ::std::os::raw::c_char, + __len: usize, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn qecvt_r( + __value: u128, + __ndigit: ::std::os::raw::c_int, + __decpt: *mut ::std::os::raw::c_int, + __sign: *mut ::std::os::raw::c_int, + __buf: *mut ::std::os::raw::c_char, + __len: usize, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn qfcvt_r( + __value: u128, + __ndigit: ::std::os::raw::c_int, + __decpt: *mut ::std::os::raw::c_int, + __sign: *mut ::std::os::raw::c_int, + __buf: *mut ::std::os::raw::c_char, + __len: usize, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn mblen(__s: *const ::std::os::raw::c_char, __n: usize) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn mbtowc( + __pwc: *mut wchar_t, + __s: *const ::std::os::raw::c_char, + __n: usize, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn wctomb(__s: *mut ::std::os::raw::c_char, __wchar: wchar_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn mbstowcs(__pwcs: *mut wchar_t, __s: *const ::std::os::raw::c_char, __n: usize) -> usize; +} +extern "C" { + pub fn wcstombs(__s: *mut ::std::os::raw::c_char, __pwcs: *const wchar_t, __n: usize) -> usize; +} +extern "C" { + pub fn rpmatch(__response: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn getsubopt( + __optionp: *mut *mut ::std::os::raw::c_char, + __tokens: *const *mut ::std::os::raw::c_char, + __valuep: *mut *mut ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn getloadavg(__loadavg: *mut f64, __nelem: ::std::os::raw::c_int) + -> ::std::os::raw::c_int; +} +pub type VOID = ::std::os::raw::c_void; +pub type PVOID = *mut ::std::os::raw::c_void; +pub type HANDLE = *mut ::std::os::raw::c_void; +pub type PHANDLE = *mut *mut ::std::os::raw::c_void; +pub type HMODULE = *mut ::std::os::raw::c_void; +pub type QWORD = ::std::os::raw::c_ulonglong; +pub type PQWORD = *mut ::std::os::raw::c_ulonglong; +pub type ULONG64 = ::std::os::raw::c_ulonglong; +pub type PULONG64 = *mut ::std::os::raw::c_ulonglong; +pub type SIZE_T = usize; +pub type PSIZE_T = *mut usize; +pub type FILETIME = u64; +pub type PFILETIME = *mut u64; +pub type DWORD = u32; +pub type PDWORD = *mut u32; +pub type LPDWORD = *mut u32; +pub type BOOL = u32; +pub type PBOOL = *mut u32; +pub type NTSTATUS = u32; +pub type WORD = u16; +pub type PWORD = *mut u16; +pub type BYTE = u8; +pub type PBYTE = *mut u8; +pub type LPBYTE = *mut u8; +pub type UCHAR = u8; +pub type CHAR = ::std::os::raw::c_char; +pub type PCHAR = *mut ::std::os::raw::c_char; +pub type LPSTR = *mut ::std::os::raw::c_char; +pub type LPCSTR = *mut ::std::os::raw::c_char; +pub type WCHAR = u16; +pub type PWCHAR = *mut u16; +pub type LPWSTR = *mut u16; +pub type LPCWSTR = *mut u16; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct LC_CONFIG { + pub dwVersion: DWORD, + pub dwPrintfVerbosity: DWORD, + pub szDevice: [CHAR; 260usize], + pub szRemote: [CHAR; 260usize], + pub pfn_printf_opt: ::std::option::Option< + unsafe extern "C" fn(_Format: *const ::std::os::raw::c_char, ...) -> ::std::os::raw::c_int, + >, + pub paMax: QWORD, + pub fVolatile: BOOL, + pub fWritable: BOOL, + pub fRemote: BOOL, + pub fRemoteDisableCompress: BOOL, + pub szDeviceName: [CHAR; 260usize], +} +#[test] +fn bindgen_test_layout_LC_CONFIG() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 824usize, + concat!("Size of: ", stringify!(LC_CONFIG)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(LC_CONFIG)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).dwVersion) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(LC_CONFIG), + "::", + stringify!(dwVersion) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).dwPrintfVerbosity) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(LC_CONFIG), + "::", + stringify!(dwPrintfVerbosity) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).szDevice) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(LC_CONFIG), + "::", + stringify!(szDevice) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).szRemote) as usize - ptr as usize }, + 268usize, + concat!( + "Offset of field: ", + stringify!(LC_CONFIG), + "::", + stringify!(szRemote) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfn_printf_opt) as usize - ptr as usize }, + 528usize, + concat!( + "Offset of field: ", + stringify!(LC_CONFIG), + "::", + stringify!(pfn_printf_opt) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).paMax) as usize - ptr as usize }, + 536usize, + concat!( + "Offset of field: ", + stringify!(LC_CONFIG), + "::", + stringify!(paMax) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).fVolatile) as usize - ptr as usize }, + 544usize, + concat!( + "Offset of field: ", + stringify!(LC_CONFIG), + "::", + stringify!(fVolatile) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).fWritable) as usize - ptr as usize }, + 548usize, + concat!( + "Offset of field: ", + stringify!(LC_CONFIG), + "::", + stringify!(fWritable) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).fRemote) as usize - ptr as usize }, + 552usize, + concat!( + "Offset of field: ", + stringify!(LC_CONFIG), + "::", + stringify!(fRemote) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).fRemoteDisableCompress) as usize - ptr as usize }, + 556usize, + concat!( + "Offset of field: ", + stringify!(LC_CONFIG), + "::", + stringify!(fRemoteDisableCompress) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).szDeviceName) as usize - ptr as usize }, + 560usize, + concat!( + "Offset of field: ", + stringify!(LC_CONFIG), + "::", + stringify!(szDeviceName) + ) + ); +} +pub type PLC_CONFIG = *mut LC_CONFIG; +#[repr(C)] +#[derive(Debug)] +pub struct tdLC_CONFIG_ERRORINFO { + pub dwVersion: DWORD, + pub cbStruct: DWORD, + pub _FutureUse: [DWORD; 16usize], + pub fUserInputRequest: BOOL, + pub cwszUserText: DWORD, + pub wszUserText: __IncompleteArrayField, +} +#[test] +fn bindgen_test_layout_tdLC_CONFIG_ERRORINFO() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 80usize, + concat!("Size of: ", stringify!(tdLC_CONFIG_ERRORINFO)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(tdLC_CONFIG_ERRORINFO)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).dwVersion) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(tdLC_CONFIG_ERRORINFO), + "::", + stringify!(dwVersion) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).cbStruct) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(tdLC_CONFIG_ERRORINFO), + "::", + stringify!(cbStruct) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr)._FutureUse) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(tdLC_CONFIG_ERRORINFO), + "::", + stringify!(_FutureUse) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).fUserInputRequest) as usize - ptr as usize }, + 72usize, + concat!( + "Offset of field: ", + stringify!(tdLC_CONFIG_ERRORINFO), + "::", + stringify!(fUserInputRequest) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).cwszUserText) as usize - ptr as usize }, + 76usize, + concat!( + "Offset of field: ", + stringify!(tdLC_CONFIG_ERRORINFO), + "::", + stringify!(cwszUserText) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).wszUserText) as usize - ptr as usize }, + 80usize, + concat!( + "Offset of field: ", + stringify!(tdLC_CONFIG_ERRORINFO), + "::", + stringify!(wszUserText) + ) + ); +} +pub type LC_CONFIG_ERRORINFO = tdLC_CONFIG_ERRORINFO; +pub type PLC_CONFIG_ERRORINFO = *mut tdLC_CONFIG_ERRORINFO; +pub type PPLC_CONFIG_ERRORINFO = *mut *mut tdLC_CONFIG_ERRORINFO; +extern "C" { + pub fn LcCreate(pLcCreateConfig: PLC_CONFIG) -> HANDLE; +} +extern "C" { + pub fn LcCreateEx( + pLcCreateConfig: PLC_CONFIG, + ppLcCreateErrorInfo: PPLC_CONFIG_ERRORINFO, + ) -> HANDLE; +} +extern "C" { + pub fn LcClose(hLC: HANDLE) -> VOID; +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tdMEM_SCATTER { + pub version: DWORD, + pub f: BOOL, + pub qwA: QWORD, + pub __bindgen_anon_1: tdMEM_SCATTER__bindgen_ty_1, + pub cb: DWORD, + pub iStack: DWORD, + pub vStack: [QWORD; 12usize], +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tdMEM_SCATTER__bindgen_ty_1 { + pub pb: PBYTE, + pub _Filler: QWORD, +} +#[test] +fn bindgen_test_layout_tdMEM_SCATTER__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(tdMEM_SCATTER__bindgen_ty_1)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(tdMEM_SCATTER__bindgen_ty_1)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pb) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(tdMEM_SCATTER__bindgen_ty_1), + "::", + stringify!(pb) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr)._Filler) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(tdMEM_SCATTER__bindgen_ty_1), + "::", + stringify!(_Filler) + ) + ); +} +#[test] +fn bindgen_test_layout_tdMEM_SCATTER() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 128usize, + concat!("Size of: ", stringify!(tdMEM_SCATTER)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(tdMEM_SCATTER)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).version) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(tdMEM_SCATTER), + "::", + stringify!(version) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).f) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(tdMEM_SCATTER), + "::", + stringify!(f) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).qwA) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(tdMEM_SCATTER), + "::", + stringify!(qwA) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).cb) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(tdMEM_SCATTER), + "::", + stringify!(cb) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).iStack) as usize - ptr as usize }, + 28usize, + concat!( + "Offset of field: ", + stringify!(tdMEM_SCATTER), + "::", + stringify!(iStack) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).vStack) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(tdMEM_SCATTER), + "::", + stringify!(vStack) + ) + ); +} +pub type MEM_SCATTER = tdMEM_SCATTER; +pub type PMEM_SCATTER = *mut tdMEM_SCATTER; +pub type PPMEM_SCATTER = *mut *mut tdMEM_SCATTER; +extern "C" { + pub fn LcMemFree(pv: PVOID) -> VOID; +} +extern "C" { + pub fn LcAllocScatter1(cMEMs: DWORD, pppMEMs: *mut PPMEM_SCATTER) -> BOOL; +} +extern "C" { + pub fn LcAllocScatter2( + cbData: DWORD, + pbData: PBYTE, + cMEMs: DWORD, + pppMEMs: *mut PPMEM_SCATTER, + ) -> BOOL; +} +extern "C" { + pub fn LcAllocScatter3( + pbDataFirstPage: PBYTE, + pbDataLastPage: PBYTE, + cbData: DWORD, + pbData: PBYTE, + cMEMs: DWORD, + pppMEMs: *mut PPMEM_SCATTER, + ) -> BOOL; +} +extern "C" { + pub fn LcReadScatter(hLC: HANDLE, cMEMs: DWORD, ppMEMs: PPMEM_SCATTER) -> VOID; +} +extern "C" { + pub fn LcRead(hLC: HANDLE, pa: QWORD, cb: DWORD, pb: PBYTE) -> BOOL; +} +extern "C" { + pub fn LcWriteScatter(hLC: HANDLE, cMEMs: DWORD, ppMEMs: PPMEM_SCATTER) -> VOID; +} +extern "C" { + pub fn LcWrite(hLC: HANDLE, pa: QWORD, cb: DWORD, pb: PBYTE) -> BOOL; +} +extern "C" { + pub fn LcGetOption(hLC: HANDLE, fOption: QWORD, pqwValue: PQWORD) -> BOOL; +} +extern "C" { + pub fn LcSetOption(hLC: HANDLE, fOption: QWORD, qwValue: QWORD) -> BOOL; +} +extern "C" { + pub fn LcCommand( + hLC: HANDLE, + fCommand: QWORD, + cbDataIn: DWORD, + pbDataIn: PBYTE, + ppbDataOut: *mut PBYTE, + pcbDataOut: PDWORD, + ) -> BOOL; +} +#[repr(C)] +pub struct tdLC_CMD_AGENT_VFS_REQ { + pub dwVersion: DWORD, + pub _FutureUse: DWORD, + pub uszPathFile: [CHAR; 520usize], + pub __bindgen_anon_1: tdLC_CMD_AGENT_VFS_REQ__bindgen_ty_1, + pub dwLength: DWORD, + pub cb: DWORD, + pub pb: __IncompleteArrayField, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tdLC_CMD_AGENT_VFS_REQ__bindgen_ty_1 { + pub qwOffset: QWORD, + pub fOption: QWORD, +} +#[test] +fn bindgen_test_layout_tdLC_CMD_AGENT_VFS_REQ__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!( + "Size of: ", + stringify!(tdLC_CMD_AGENT_VFS_REQ__bindgen_ty_1) + ) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!( + "Alignment of ", + stringify!(tdLC_CMD_AGENT_VFS_REQ__bindgen_ty_1) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).qwOffset) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(tdLC_CMD_AGENT_VFS_REQ__bindgen_ty_1), + "::", + stringify!(qwOffset) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).fOption) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(tdLC_CMD_AGENT_VFS_REQ__bindgen_ty_1), + "::", + stringify!(fOption) + ) + ); +} +#[test] +fn bindgen_test_layout_tdLC_CMD_AGENT_VFS_REQ() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 544usize, + concat!("Size of: ", stringify!(tdLC_CMD_AGENT_VFS_REQ)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(tdLC_CMD_AGENT_VFS_REQ)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).dwVersion) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(tdLC_CMD_AGENT_VFS_REQ), + "::", + stringify!(dwVersion) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr)._FutureUse) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(tdLC_CMD_AGENT_VFS_REQ), + "::", + stringify!(_FutureUse) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).uszPathFile) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(tdLC_CMD_AGENT_VFS_REQ), + "::", + stringify!(uszPathFile) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).dwLength) as usize - ptr as usize }, + 536usize, + concat!( + "Offset of field: ", + stringify!(tdLC_CMD_AGENT_VFS_REQ), + "::", + stringify!(dwLength) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).cb) as usize - ptr as usize }, + 540usize, + concat!( + "Offset of field: ", + stringify!(tdLC_CMD_AGENT_VFS_REQ), + "::", + stringify!(cb) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pb) as usize - ptr as usize }, + 544usize, + concat!( + "Offset of field: ", + stringify!(tdLC_CMD_AGENT_VFS_REQ), + "::", + stringify!(pb) + ) + ); +} +pub type LC_CMD_AGENT_VFS_REQ = tdLC_CMD_AGENT_VFS_REQ; +pub type PLC_CMD_AGENT_VFS_REQ = *mut tdLC_CMD_AGENT_VFS_REQ; +#[repr(C)] +#[derive(Debug)] +pub struct tdLC_CMD_AGENT_VFS_RSP { + pub dwVersion: DWORD, + pub dwStatus: DWORD, + pub cbReadWrite: DWORD, + pub _FutureUse: [DWORD; 2usize], + pub cb: DWORD, + pub pb: __IncompleteArrayField, +} +#[test] +fn bindgen_test_layout_tdLC_CMD_AGENT_VFS_RSP() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 24usize, + concat!("Size of: ", stringify!(tdLC_CMD_AGENT_VFS_RSP)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(tdLC_CMD_AGENT_VFS_RSP)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).dwVersion) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(tdLC_CMD_AGENT_VFS_RSP), + "::", + stringify!(dwVersion) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).dwStatus) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(tdLC_CMD_AGENT_VFS_RSP), + "::", + stringify!(dwStatus) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).cbReadWrite) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(tdLC_CMD_AGENT_VFS_RSP), + "::", + stringify!(cbReadWrite) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr)._FutureUse) as usize - ptr as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(tdLC_CMD_AGENT_VFS_RSP), + "::", + stringify!(_FutureUse) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).cb) as usize - ptr as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(tdLC_CMD_AGENT_VFS_RSP), + "::", + stringify!(cb) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pb) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(tdLC_CMD_AGENT_VFS_RSP), + "::", + stringify!(pb) + ) + ); +} +pub type LC_CMD_AGENT_VFS_RSP = tdLC_CMD_AGENT_VFS_RSP; +pub type PLC_CMD_AGENT_VFS_RSP = *mut tdLC_CMD_AGENT_VFS_RSP; +extern "C" { + pub static mut LC_STATISTICS_NAME: [LPCSTR; 8usize]; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tdLC_STATISTICS { + pub dwVersion: DWORD, + pub _Reserved: DWORD, + pub qwFreq: QWORD, + pub Call: [tdLC_STATISTICS__bindgen_ty_1; 8usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tdLC_STATISTICS__bindgen_ty_1 { + pub c: QWORD, + pub tm: QWORD, +} +#[test] +fn bindgen_test_layout_tdLC_STATISTICS__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(tdLC_STATISTICS__bindgen_ty_1)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(tdLC_STATISTICS__bindgen_ty_1)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).c) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(tdLC_STATISTICS__bindgen_ty_1), + "::", + stringify!(c) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tm) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(tdLC_STATISTICS__bindgen_ty_1), + "::", + stringify!(tm) + ) + ); +} +#[test] +fn bindgen_test_layout_tdLC_STATISTICS() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 144usize, + concat!("Size of: ", stringify!(tdLC_STATISTICS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(tdLC_STATISTICS)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).dwVersion) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(tdLC_STATISTICS), + "::", + stringify!(dwVersion) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr)._Reserved) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(tdLC_STATISTICS), + "::", + stringify!(_Reserved) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).qwFreq) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(tdLC_STATISTICS), + "::", + stringify!(qwFreq) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).Call) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(tdLC_STATISTICS), + "::", + stringify!(Call) + ) + ); +} +pub type LC_STATISTICS = tdLC_STATISTICS; +pub type PLC_STATISTICS = *mut tdLC_STATISTICS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tdLC_MEMMAP_ENTRY { + pub pa: QWORD, + pub cb: QWORD, + pub paRemap: QWORD, +} +#[test] +fn bindgen_test_layout_tdLC_MEMMAP_ENTRY() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 24usize, + concat!("Size of: ", stringify!(tdLC_MEMMAP_ENTRY)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(tdLC_MEMMAP_ENTRY)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pa) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(tdLC_MEMMAP_ENTRY), + "::", + stringify!(pa) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).cb) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(tdLC_MEMMAP_ENTRY), + "::", + stringify!(cb) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).paRemap) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(tdLC_MEMMAP_ENTRY), + "::", + stringify!(paRemap) + ) + ); +} +pub type LC_MEMMAP_ENTRY = tdLC_MEMMAP_ENTRY; +pub type PLC_MEMMAP_ENTRY = *mut tdLC_MEMMAP_ENTRY; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tdLC_TLP { + pub cb: DWORD, + pub _Reserved1: DWORD, + pub pb: PBYTE, +} +#[test] +fn bindgen_test_layout_tdLC_TLP() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(tdLC_TLP)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(tdLC_TLP)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).cb) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(tdLC_TLP), + "::", + stringify!(cb) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr)._Reserved1) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(tdLC_TLP), + "::", + stringify!(_Reserved1) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pb) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(tdLC_TLP), + "::", + stringify!(pb) + ) + ); +} +pub type LC_TLP = tdLC_TLP; +pub type PLC_TLP = *mut tdLC_TLP; +pub type PLC_TLP_READ_FUNCTION_CALLBACK = ::std::option::Option< + unsafe extern "C" fn( + ctx: PVOID, + cbTlp: DWORD, + pbTlp: PBYTE, + cbInfo: DWORD, + szInfo: LPSTR, + ) -> VOID, +>; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tdLC_TLP_CALLBACK { + pub ctx: PVOID, + pub pfn: PLC_TLP_READ_FUNCTION_CALLBACK, +} +#[test] +fn bindgen_test_layout_tdLC_TLP_CALLBACK() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(tdLC_TLP_CALLBACK)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(tdLC_TLP_CALLBACK)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ctx) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(tdLC_TLP_CALLBACK), + "::", + stringify!(ctx) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfn) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(tdLC_TLP_CALLBACK), + "::", + stringify!(pfn) + ) + ); +} +pub type LC_TLP_CALLBACK = tdLC_TLP_CALLBACK; +pub type PLC_TLP_CALLBACK = *mut tdLC_TLP_CALLBACK; diff --git a/memflow-pcileech/Cargo.toml b/memflow-pcileech/Cargo.toml index 5fd00a3..4d4d860 100644 --- a/memflow-pcileech/Cargo.toml +++ b/memflow-pcileech/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "memflow-pcileech" -version = "0.2.0-beta7" +version = "0.2.0-beta9" authors = ["ko1N "] edition = "2018" description = "qemu procfs connector for leechcore/pcileech" @@ -16,14 +16,17 @@ categories = [ "api-bindings", "memory-management", "os" ] crate-type = ["lib", "cdylib"] [dependencies] -memflow = { version = "^0.2.0-beta7", features = ["plugins", "memmapfiles"] } -leechcore-sys = { version = "0.2.0-beta1", path = "../leechcore-sys" } +memflow = { version = "^0.2.0-beta9", features = ["plugins", "memmapfiles"] } +leechcore-sys = { version = "0.2.0-beta9", path = "../leechcore-sys" } log = "^0.4.14" [dev-dependencies] -clap = { version = "^3.0.5", features = ["cargo"] } -simplelog = "^0.11.1" -memflow-win32 = { version = "^0.2.0-beta7" } +simplelog = "^0.12.0" +memflow-win32 = { version = "^0.2.0-beta9" } + +[features] +default = [ ] +bindgen = [ "leechcore-sys/bindgen" ] [[example]] name = "read_phys" diff --git a/memflow-pcileech/src/lib.rs b/memflow-pcileech/src/lib.rs index 47851f2..71a824e 100644 --- a/memflow-pcileech/src/lib.rs +++ b/memflow-pcileech/src/lib.rs @@ -1,3 +1,4 @@ +use ::std::ptr::null_mut; use std::ffi::c_void; use std::os::raw::c_char; use std::path::Path; @@ -5,6 +6,7 @@ use std::ptr; use std::slice; use std::sync::{Arc, Mutex}; +use log::warn; use log::{error, info}; use memflow::cglue; @@ -63,22 +65,30 @@ unsafe impl Send for PciLeech {} // TODO: proper drop + free impl -> LcMemFree(pLcErrorInfo); #[allow(clippy::mutex_atomic)] impl PciLeech { - pub fn new(device: &str) -> Result { - Self::new_internal(device, None) + pub fn new(device: &str, auto_clear: bool) -> Result { + Self::new_internal(device, None, auto_clear) } - pub fn with_mem_map_file>(device: &str, path: P) -> Result { + pub fn with_mem_map_file>( + device: &str, + path: P, + auto_clear: bool, + ) -> Result { info!( "loading memory mappings from file: {}", path.as_ref().to_string_lossy() ); let mem_map = MemoryMap::open(path)?; info!("{:?}", mem_map); - Self::new_internal(device, Some(mem_map)) + Self::new_internal(device, Some(mem_map), auto_clear) } #[allow(clippy::mutex_atomic)] - fn new_internal(device: &str, mem_map: Option>) -> Result { + fn new_internal( + device: &str, + mem_map: Option>, + auto_clear: bool, + ) -> Result { // open device let mut conf = build_lc_config(device); let err = std::ptr::null_mut::(); @@ -90,6 +100,50 @@ impl PciLeech { .log_error(&format!("unable to create leechcore context: {:?}", err))); } + // TODO: allow handling these errors properly + /* + typedef struct tdLC_CONFIG_ERRORINFO { + DWORD dwVersion; // must equal LC_CONFIG_ERRORINFO_VERSION + DWORD cbStruct; + DWORD _FutureUse[16]; + BOOL fUserInputRequest; + DWORD cwszUserText; + WCHAR wszUserText[]; + } LC_CONFIG_ERRORINFO, *PLC_CONFIG_ERRORINFO, **PPLC_CONFIG_ERRORINFO; + */ + + if auto_clear { + let (mut id, mut version_major, mut version_minor) = (0, 0, 0); + unsafe { + LcGetOption(handle, LC_OPT_FPGA_FPGA_ID, &mut id); + LcGetOption(handle, LC_OPT_FPGA_VERSION_MAJOR, &mut version_major); + LcGetOption(handle, LC_OPT_FPGA_VERSION_MINOR, &mut version_minor); + } + if version_major >= 4 && (version_major >= 5 || version_minor >= 7) { + // enable auto-clear of status register [master abort]. + info!("Trying to enable status register auto-clear"); + let mut data = [0x10, 0x00, 0x10, 0x00]; + if unsafe { + LcCommand( + handle, + LC_CMD_FPGA_CFGREGPCIE_MARKWR | 0x002, + data.len() as u32, + data.as_mut_ptr(), + null_mut(), + null_mut(), + ) + } != 0 + { + info!("Successfully enabled status register auto-clear"); + } else { + warn!("Could not enable status register auto-clear"); + } + } else { + return Err(Error(ErrorOrigin::Connector, ErrorKind::Configuration) + .log_error("Could not enable status register auto-clear due to outdated bitstream. Auto-clear is only available for bitstreams 4.7 and newer.")); + } + } + Ok(Self { handle: Arc::new(Mutex::new(handle)), conf, @@ -419,6 +473,7 @@ fn validator() -> ArgsValidator { .arg(ArgDescriptor::new("default").description("the target device to be used by LeechCore")) .arg(ArgDescriptor::new("device").description("the target device to be used by LeechCore")) .arg(ArgDescriptor::new("memmap").description("the memory map file of the target machine")) + .arg(ArgDescriptor::new("auto-clear").description("tries to enable the status register auto-clear function (only available for bitstreams 4.7 and upwards)")) } /// Creates a new PciLeech Connector instance. @@ -437,11 +492,11 @@ pub fn create_connector(args: &ConnectorArgs) -> Result { Error(ErrorOrigin::Connector, ErrorKind::ArgValidation) .log_error("'device' argument is missing") })?; - + let auto_clear = args.get("auto-clear").is_some(); if let Some(memmap) = args.get("memmap") { - PciLeech::with_mem_map_file(device, memmap) + PciLeech::with_mem_map_file(device, memmap, auto_clear) } else { - PciLeech::new(device) + PciLeech::new(device, auto_clear) } } Err(err) => {