liblzma-sys-0.3.7/.cargo_vcs_info.json0000644000000001510000000000100133060ustar { "git": { "sha1": "a3002b523b1794ca5c676f0354e6cda8d1d0f4f3" }, "path_in_vcs": "liblzma-sys" }liblzma-sys-0.3.7/Cargo.toml0000644000000031000000000000100113010ustar # THIS FILE IS AUTOMATICALLY GENERATED BY CARGO # # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies # to registry (e.g., crates.io) dependencies. # # If you are reading this file be aware that the original Cargo.toml # will likely look very different (and much more reasonable). # See Cargo.toml.orig for the original contents. [package] edition = "2021" name = "liblzma-sys" version = "0.3.7" authors = [ "Alex Crichton ", "Portable-Network-Archive Developers", ] build = "build.rs" links = "lzma" exclude = [ "xz/.github/", "xz/tests/files/*", ] autobins = false autoexamples = false autotests = false autobenches = false description = """ Raw bindings to liblzma which contains an implementation of LZMA and xz stream encoding/decoding. High level Rust bindings are available in the `liblzma` crate. """ homepage = "https://github.com/portable-network-archive/liblzma-rs" readme = "README.md" keywords = [ "lzma", "xz", "encoding", "wasm", ] categories = ["external-ffi-bindings"] license = "MIT OR Apache-2.0" repository = "https://github.com/portable-network-archive/liblzma-rs" [lib] name = "liblzma_sys" path = "src/lib.rs" [dependencies.libc] version = "0.2.67" [build-dependencies.cc] version = "1.0.49" features = ["parallel"] [build-dependencies.pkg-config] version = "0.3.18" [features] bindgen = [] default = ["bindgen"] parallel = [] static = [] wasm = [ "static", "bindgen", ] liblzma-sys-0.3.7/Cargo.toml.orig0000644000000016360000000000100122540ustar [package] name = "liblzma-sys" version = "0.3.7" authors = ["Alex Crichton ", "Portable-Network-Archive Developers"] build = "build.rs" links = "lzma" license = "MIT OR Apache-2.0" readme = "README.md" keywords = ["lzma", "xz", "encoding", "wasm"] repository = "https://github.com/portable-network-archive/liblzma-rs" homepage = "https://github.com/portable-network-archive/liblzma-rs" description = """ Raw bindings to liblzma which contains an implementation of LZMA and xz stream encoding/decoding. High level Rust bindings are available in the `liblzma` crate. """ categories = ["external-ffi-bindings"] edition = "2021" exclude = ["xz/.github/", "xz/tests/files/*"] [dependencies] libc = "0.2.67" [build-dependencies] cc = { version = "1.0.49", features = ["parallel"] } pkg-config = "0.3.18" [features] default = ["bindgen"] static = [] bindgen = [] parallel = [] wasm = ["static", "bindgen"] liblzma-sys-0.3.7/Cargo.toml.orig000064400000000000000000000016361046102023000147760ustar 00000000000000[package] name = "liblzma-sys" version = "0.3.7" authors = ["Alex Crichton ", "Portable-Network-Archive Developers"] build = "build.rs" links = "lzma" license = "MIT OR Apache-2.0" readme = "README.md" keywords = ["lzma", "xz", "encoding", "wasm"] repository = "https://github.com/portable-network-archive/liblzma-rs" homepage = "https://github.com/portable-network-archive/liblzma-rs" description = """ Raw bindings to liblzma which contains an implementation of LZMA and xz stream encoding/decoding. High level Rust bindings are available in the `liblzma` crate. """ categories = ["external-ffi-bindings"] edition = "2021" exclude = ["xz/.github/", "xz/tests/files/*"] [dependencies] libc = "0.2.67" [build-dependencies] cc = { version = "1.0.49", features = ["parallel"] } pkg-config = "0.3.18" [features] default = ["bindgen"] static = [] bindgen = [] parallel = [] wasm = ["static", "bindgen"] liblzma-sys-0.3.7/LICENSE-APACHE000064400000000000000000000251371046102023000140350ustar 00000000000000 Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. liblzma-sys-0.3.7/LICENSE-MIT000064400000000000000000000021161046102023000135350ustar 00000000000000Copyright (c) 2016-2023 Alex Crichton and Portable-Network-Archive Developers Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. liblzma-sys-0.3.7/README.md000064400000000000000000000032641046102023000133650ustar 00000000000000# liblzma-sys [![CI](https://github.com/Portable-Network-Archive/liblzma-rs/actions/workflows/main.yml/badge.svg)](https://github.com/Portable-Network-Archive/liblzma-rs/actions/workflows/main.yml) [![Crates.io][crates-badge]][crates-url] [crates-badge]: https://img.shields.io/crates/v/liblzma-sys.svg [crates-url]: https://crates.io/crates/liblzma-sys [Documentation](https://docs.rs/liblzma-sys) Raw bindings to liblzma which contains an implementation of LZMA and xz stream encoding/decoding. High level Rust bindings are available in the [liblzma](https://crates.io/crates/liblzma) crate. **This crate is forked from [lzma-sys](https://crates.io/crates/lzma-sys) and `liblzma-sys = "0.1.x"` is fully compatible with `lzma-sys = "0.1.20"`,** so you can migrate simply. ## Migrate from lzma-sys ```diff # Cargo.toml [dependencies] -lzma-sys = "0.1.20" +liblzma-sys = "0.1.20" ``` ```diff // *.rs -use lzma_sys; +use liblzma_sys; ``` ## Version 0.2.x breaking changes - XZ upgraded to 5.4 - Multithreading is disabled by default. This feature is available by enabling the `parallel` feature - Support compile to webassembly ## Version 0.3.x breaking changes - XZ upgraded to 5.6 ## License This project is licensed under either of * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0) * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT) at your option. ### Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in liblzma-sys by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. liblzma-sys-0.3.7/build.rs000064400000000000000000000102211046102023000135420ustar 00000000000000use std::env; use std::fs; use std::path::PathBuf; const SKIP_FILENAMES: &[&str] = &["crc32_small", "crc64_small"]; const MIN_LIBLZMA: &str = "5.6.2"; fn main() { let target = env::var("TARGET").unwrap(); println!("cargo:rerun-if-changed=build.rs"); println!("cargo:rerun-if-env-changed=LZMA_API_STATIC"); let want_static = cfg!(feature = "static") || env::var("LZMA_API_STATIC").is_ok(); let msvc = target.contains("msvc"); // If a static link is desired, we compile from source. // If we're compiling for MSVC, pkg-config runs a risk of picking up MinGW // libraries by accident, so disable it. // // Otherwise, check the system to see if it has a lzma library already // installed that we can use. let pkg = pkg_config::Config::new() .atleast_version(MIN_LIBLZMA) .probe("liblzma"); if !want_static && !msvc && pkg.is_ok() { return; } let want_parallel = cfg!(feature = "parallel"); let out_dir = env::var("OUT_DIR").unwrap(); println!("cargo:root={}", out_dir); let include_dir = env::current_dir().unwrap().join("xz/src/liblzma/api"); println!("cargo:include={}", include_dir.display()); let mut src_files = [ "xz/src/liblzma/common", "xz/src/liblzma/lzma", "xz/src/liblzma/lz", "xz/src/liblzma/check", "xz/src/liblzma/delta", "xz/src/liblzma/rangecoder", "xz/src/liblzma/simple", ] .iter() .flat_map(|dir| read_dir_files(dir)) .chain(vec![ "xz/src/common/tuklib_cpucores.c".into(), "xz/src/common/tuklib_physmem.c".into(), ]) .collect::>(); if !want_parallel { src_files = src_files .into_iter() .filter(|path| !path.file_stem().unwrap().to_str().unwrap().ends_with("mt")) .collect::>(); } // sort to make build reproducible. src_files.sort(); let mut build = cc::Build::new(); if !cfg!(debug_assertions) { build.define("NDEBUG", None); } build .files(src_files) // all C preproc defines are in `./config.h` .define("HAVE_CONFIG_H", "1") .include("xz/src/liblzma/api") .include("xz/src/liblzma/lzma") .include("xz/src/liblzma/lz") .include("xz/src/liblzma/check") .include("xz/src/liblzma/simple") .include("xz/src/liblzma/delta") .include("xz/src/liblzma/common") .include("xz/src/liblzma/rangecoder") .include("xz/src/common") .include(env::current_dir().unwrap()); if !target.ends_with("msvc") { build.flag("-std=c99"); if want_parallel { build.flag("-pthread"); } } if want_parallel { build.define("LZMA_SYS_ENABLE_THREADS", "1"); } if let Ok(s) = env::var("CARGO_CFG_TARGET_ENDIAN") { if s == "big" { build.define("WORDS_BIGENDIAN", None); } } // List out the WASM targets that need wasm-shim. // Note that Emscripten already provides its own C standard library so // wasm32-unknown-emscripten should not be included here. let need_wasm_shim = target == "wasm32-unknown-unknown" || target.starts_with("wasm32-wasi"); if need_wasm_shim { println!("cargo:rerun-if-changed=wasm-shim/stdlib.h"); build.include("wasm-shim/"); } build.compile("liblzma.a"); } fn read_dir_files(dir: &str) -> impl Iterator { fs::read_dir(dir) .unwrap_or_else(|_| panic!("failed to read dir {}", dir)) .filter_map(|ent| { let ent = ent.expect("failed to read entry"); if ent.file_type().unwrap().is_dir() { return None; } let path = ent.path(); if path.extension().unwrap() != "c" { return None; } { let file_stem = path.file_stem().unwrap().to_str().unwrap(); if SKIP_FILENAMES.contains(&file_stem) { return None; } if file_stem.ends_with("tablegen") { return None; } } Some(path) }) } liblzma-sys-0.3.7/config.h000064400000000000000000000030731046102023000135220ustar 00000000000000// Configuration values for `liblzma` // tell `liblzma` to look for standard C99 headers #define HAVE_STDINT_H 1 #define HAVE_STDBOOL_H 1 #define HAVE_STRING_H 1 // enable encoders/decoders #define HAVE_DECODER_LZMA1 1 #define HAVE_DECODER_LZMA2 1 #define HAVE_ENCODER_LZMA1 1 #define HAVE_ENCODER_LZMA2 1 #define HAVE_DECODER_LZ 1 #define HAVE_ENCODER_LZ 1 #define HAVE_DECODER_ARM 1 #define HAVE_ENCODER_ARM 1 #define HAVE_DECODER_ARM64 1 #define HAVE_ENCODER_ARM64 1 #define HAVE_DECODER_ARMTHUMB 1 #define HAVE_ENCODER_ARMTHUMB 1 #define HAVE_DECODER_DELTA 1 #define HAVE_ENCODER_DELTA 1 #define HAVE_DECODER_IA64 1 #define HAVE_ENCODER_IA64 1 #define HAVE_DECODER_POWERPC 1 #define HAVE_ENCODER_POWERPC 1 #define HAVE_DECODER_RISCV 1 #define HAVE_ENCODER_RISCV 1 #define HAVE_DECODER_SPARC 1 #define HAVE_ENCODER_SPARC 1 #define HAVE_DECODER_X86 1 #define HAVE_ENCODER_X86 1 // enable checksums #define HAVE_CHECK_SHA256 1 #define HAVE_CHECK_CRC64 1 #define HAVE_CHECK_CRC32 1 // enable other liblzma stuff #define HAVE_MF_BT2 1 #define HAVE_MF_BT3 1 #define HAVE_MF_BT4 1 #define HAVE_MF_HC3 1 #define HAVE_MF_HC4 1 #if defined(MSC_VER) || defined(WIN32) || defined(WIN64) || defined(_WIN32) #if defined(LZMA_SYS_ENABLE_THREADS) // change to `MYTHREAD_WIN95` if targeting Windows XP or earlier #define MYTHREAD_VISTA 1 #endif #else #define _POSIX_C_SOURCE 199506L #if defined(LZMA_SYS_ENABLE_THREADS) #define MYTHREAD_POSIX 1 #endif #endif #if defined(__sun) #define HAVE_CLOCK_GETTIME 1 #define HAVE_DECL_CLOCK_MONOTONIC 1 #endif liblzma-sys-0.3.7/src/bindgen.rs000064400000000000000000003074001046102023000146500ustar 00000000000000/* automatically generated by rust-bindgen 0.69.4 */ pub const PRId8: &[u8; 4] = b"hhd\0"; pub const PRIi8: &[u8; 4] = b"hhi\0"; pub const PRIo8: &[u8; 4] = b"hho\0"; pub const PRIu8: &[u8; 4] = b"hhu\0"; pub const PRIx8: &[u8; 4] = b"hhx\0"; pub const PRIX8: &[u8; 4] = b"hhX\0"; pub const PRId16: &[u8; 3] = b"hd\0"; pub const PRIi16: &[u8; 3] = b"hi\0"; pub const PRIo16: &[u8; 3] = b"ho\0"; pub const PRIu16: &[u8; 3] = b"hu\0"; pub const PRIx16: &[u8; 3] = b"hx\0"; pub const PRIX16: &[u8; 3] = b"hX\0"; pub const PRId32: &[u8; 2] = b"d\0"; pub const PRIi32: &[u8; 2] = b"i\0"; pub const PRIo32: &[u8; 2] = b"o\0"; pub const PRIu32: &[u8; 2] = b"u\0"; pub const PRIx32: &[u8; 2] = b"x\0"; pub const PRIX32: &[u8; 2] = b"X\0"; pub const PRId64: &[u8; 4] = b"lld\0"; pub const PRIi64: &[u8; 4] = b"lli\0"; pub const PRIo64: &[u8; 4] = b"llo\0"; pub const PRIu64: &[u8; 4] = b"llu\0"; pub const PRIx64: &[u8; 4] = b"llx\0"; pub const PRIX64: &[u8; 4] = b"llX\0"; pub const PRIdLEAST8: &[u8; 4] = b"hhd\0"; pub const PRIiLEAST8: &[u8; 4] = b"hhi\0"; pub const PRIoLEAST8: &[u8; 4] = b"hho\0"; pub const PRIuLEAST8: &[u8; 4] = b"hhu\0"; pub const PRIxLEAST8: &[u8; 4] = b"hhx\0"; pub const PRIXLEAST8: &[u8; 4] = b"hhX\0"; pub const PRIdLEAST16: &[u8; 3] = b"hd\0"; pub const PRIiLEAST16: &[u8; 3] = b"hi\0"; pub const PRIoLEAST16: &[u8; 3] = b"ho\0"; pub const PRIuLEAST16: &[u8; 3] = b"hu\0"; pub const PRIxLEAST16: &[u8; 3] = b"hx\0"; pub const PRIXLEAST16: &[u8; 3] = b"hX\0"; pub const PRIdLEAST32: &[u8; 2] = b"d\0"; pub const PRIiLEAST32: &[u8; 2] = b"i\0"; pub const PRIoLEAST32: &[u8; 2] = b"o\0"; pub const PRIuLEAST32: &[u8; 2] = b"u\0"; pub const PRIxLEAST32: &[u8; 2] = b"x\0"; pub const PRIXLEAST32: &[u8; 2] = b"X\0"; pub const PRIdLEAST64: &[u8; 4] = b"lld\0"; pub const PRIiLEAST64: &[u8; 4] = b"lli\0"; pub const PRIoLEAST64: &[u8; 4] = b"llo\0"; pub const PRIuLEAST64: &[u8; 4] = b"llu\0"; pub const PRIxLEAST64: &[u8; 4] = b"llx\0"; pub const PRIXLEAST64: &[u8; 4] = b"llX\0"; pub const PRIdFAST8: &[u8; 4] = b"hhd\0"; pub const PRIiFAST8: &[u8; 4] = b"hhi\0"; pub const PRIoFAST8: &[u8; 4] = b"hho\0"; pub const PRIuFAST8: &[u8; 4] = b"hhu\0"; pub const PRIxFAST8: &[u8; 4] = b"hhx\0"; pub const PRIXFAST8: &[u8; 4] = b"hhX\0"; pub const PRIdFAST16: &[u8; 3] = b"hd\0"; pub const PRIiFAST16: &[u8; 3] = b"hi\0"; pub const PRIoFAST16: &[u8; 3] = b"ho\0"; pub const PRIuFAST16: &[u8; 3] = b"hu\0"; pub const PRIxFAST16: &[u8; 3] = b"hx\0"; pub const PRIXFAST16: &[u8; 3] = b"hX\0"; pub const PRIdFAST32: &[u8; 2] = b"d\0"; pub const PRIiFAST32: &[u8; 2] = b"i\0"; pub const PRIoFAST32: &[u8; 2] = b"o\0"; pub const PRIuFAST32: &[u8; 2] = b"u\0"; pub const PRIxFAST32: &[u8; 2] = b"x\0"; pub const PRIXFAST32: &[u8; 2] = b"X\0"; pub const PRIdFAST64: &[u8; 4] = b"lld\0"; pub const PRIiFAST64: &[u8; 4] = b"lli\0"; pub const PRIoFAST64: &[u8; 4] = b"llo\0"; pub const PRIuFAST64: &[u8; 4] = b"llu\0"; pub const PRIxFAST64: &[u8; 4] = b"llx\0"; pub const PRIXFAST64: &[u8; 4] = b"llX\0"; pub const PRIdPTR: &[u8; 3] = b"ld\0"; pub const PRIiPTR: &[u8; 3] = b"li\0"; pub const PRIoPTR: &[u8; 3] = b"lo\0"; pub const PRIuPTR: &[u8; 3] = b"lu\0"; pub const PRIxPTR: &[u8; 3] = b"lx\0"; pub const PRIXPTR: &[u8; 3] = b"lX\0"; pub const PRIdMAX: &[u8; 3] = b"jd\0"; pub const PRIiMAX: &[u8; 3] = b"ji\0"; pub const PRIoMAX: &[u8; 3] = b"jo\0"; pub const PRIuMAX: &[u8; 3] = b"ju\0"; pub const PRIxMAX: &[u8; 3] = b"jx\0"; pub const PRIXMAX: &[u8; 3] = b"jX\0"; pub const SCNd8: &[u8; 4] = b"hhd\0"; pub const SCNi8: &[u8; 4] = b"hhi\0"; pub const SCNo8: &[u8; 4] = b"hho\0"; pub const SCNu8: &[u8; 4] = b"hhu\0"; pub const SCNx8: &[u8; 4] = b"hhx\0"; pub const SCNd16: &[u8; 3] = b"hd\0"; pub const SCNi16: &[u8; 3] = b"hi\0"; pub const SCNo16: &[u8; 3] = b"ho\0"; pub const SCNu16: &[u8; 3] = b"hu\0"; pub const SCNx16: &[u8; 3] = b"hx\0"; pub const SCNd32: &[u8; 2] = b"d\0"; pub const SCNi32: &[u8; 2] = b"i\0"; pub const SCNo32: &[u8; 2] = b"o\0"; pub const SCNu32: &[u8; 2] = b"u\0"; pub const SCNx32: &[u8; 2] = b"x\0"; pub const SCNd64: &[u8; 4] = b"lld\0"; pub const SCNi64: &[u8; 4] = b"lli\0"; pub const SCNo64: &[u8; 4] = b"llo\0"; pub const SCNu64: &[u8; 4] = b"llu\0"; pub const SCNx64: &[u8; 4] = b"llx\0"; pub const SCNdLEAST8: &[u8; 4] = b"hhd\0"; pub const SCNiLEAST8: &[u8; 4] = b"hhi\0"; pub const SCNoLEAST8: &[u8; 4] = b"hho\0"; pub const SCNuLEAST8: &[u8; 4] = b"hhu\0"; pub const SCNxLEAST8: &[u8; 4] = b"hhx\0"; pub const SCNdLEAST16: &[u8; 3] = b"hd\0"; pub const SCNiLEAST16: &[u8; 3] = b"hi\0"; pub const SCNoLEAST16: &[u8; 3] = b"ho\0"; pub const SCNuLEAST16: &[u8; 3] = b"hu\0"; pub const SCNxLEAST16: &[u8; 3] = b"hx\0"; pub const SCNdLEAST32: &[u8; 2] = b"d\0"; pub const SCNiLEAST32: &[u8; 2] = b"i\0"; pub const SCNoLEAST32: &[u8; 2] = b"o\0"; pub const SCNuLEAST32: &[u8; 2] = b"u\0"; pub const SCNxLEAST32: &[u8; 2] = b"x\0"; pub const SCNdLEAST64: &[u8; 4] = b"lld\0"; pub const SCNiLEAST64: &[u8; 4] = b"lli\0"; pub const SCNoLEAST64: &[u8; 4] = b"llo\0"; pub const SCNuLEAST64: &[u8; 4] = b"llu\0"; pub const SCNxLEAST64: &[u8; 4] = b"llx\0"; pub const SCNdFAST8: &[u8; 4] = b"hhd\0"; pub const SCNiFAST8: &[u8; 4] = b"hhi\0"; pub const SCNoFAST8: &[u8; 4] = b"hho\0"; pub const SCNuFAST8: &[u8; 4] = b"hhu\0"; pub const SCNxFAST8: &[u8; 4] = b"hhx\0"; pub const SCNdFAST16: &[u8; 3] = b"hd\0"; pub const SCNiFAST16: &[u8; 3] = b"hi\0"; pub const SCNoFAST16: &[u8; 3] = b"ho\0"; pub const SCNuFAST16: &[u8; 3] = b"hu\0"; pub const SCNxFAST16: &[u8; 3] = b"hx\0"; pub const SCNdFAST32: &[u8; 2] = b"d\0"; pub const SCNiFAST32: &[u8; 2] = b"i\0"; pub const SCNoFAST32: &[u8; 2] = b"o\0"; pub const SCNuFAST32: &[u8; 2] = b"u\0"; pub const SCNxFAST32: &[u8; 2] = b"x\0"; pub const SCNdFAST64: &[u8; 4] = b"lld\0"; pub const SCNiFAST64: &[u8; 4] = b"lli\0"; pub const SCNoFAST64: &[u8; 4] = b"llo\0"; pub const SCNuFAST64: &[u8; 4] = b"llu\0"; pub const SCNxFAST64: &[u8; 4] = b"llx\0"; pub const SCNdPTR: &[u8; 3] = b"ld\0"; pub const SCNiPTR: &[u8; 3] = b"li\0"; pub const SCNoPTR: &[u8; 3] = b"lo\0"; pub const SCNuPTR: &[u8; 3] = b"lu\0"; pub const SCNxPTR: &[u8; 3] = b"lx\0"; pub const SCNdMAX: &[u8; 3] = b"jd\0"; pub const SCNiMAX: &[u8; 3] = b"ji\0"; pub const SCNoMAX: &[u8; 3] = b"jo\0"; pub const SCNuMAX: &[u8; 3] = b"ju\0"; pub const SCNxMAX: &[u8; 3] = b"jx\0"; pub const LZMA_H_INTERNAL: u32 = 1; pub const LZMA_VERSION_MAJOR: u32 = 5; pub const LZMA_VERSION_MINOR: u32 = 6; pub const LZMA_VERSION_PATCH: u32 = 2; pub const LZMA_VERSION_COMMIT: &[u8; 1] = b"\0"; pub const LZMA_VERSION_STABILITY_ALPHA: u32 = 0; pub const LZMA_VERSION_STABILITY_BETA: u32 = 1; pub const LZMA_VERSION_STABILITY_STABLE: u32 = 2; pub const LZMA_VERSION_STABILITY_STRING: &[u8; 1] = b"\0"; pub const LZMA_VLI_MAX: lzma_vli = u64::MAX / 2; pub const LZMA_VLI_UNKNOWN: lzma_vli = u64::MAX; pub const LZMA_VLI_BYTES_MAX: usize = 9; pub const LZMA_CHECK_ID_MAX: u32 = 15; pub const LZMA_CHECK_SIZE_MAX: u32 = 64; pub const LZMA_FILTERS_MAX: u32 = 4; pub const LZMA_DELTA_DIST_MIN: u32 = 1; pub const LZMA_DELTA_DIST_MAX: u32 = 256; pub const LZMA_LCLP_MIN: u32 = 0; pub const LZMA_LCLP_MAX: u32 = 4; pub const LZMA_LC_DEFAULT: u32 = 3; pub const LZMA_LP_DEFAULT: u32 = 0; pub const LZMA_PB_MIN: u32 = 0; pub const LZMA_PB_MAX: u32 = 4; pub const LZMA_PB_DEFAULT: u32 = 2; pub const LZMA_STREAM_HEADER_SIZE: u32 = 12; pub const LZMA_BLOCK_HEADER_SIZE_MIN: u32 = 8; pub const LZMA_BLOCK_HEADER_SIZE_MAX: u32 = 1024; #[cfg(target_env = "msvc")] #[doc(hidden)] pub type __enum_ty = ::std::os::raw::c_int; #[cfg(not(target_env = "msvc"))] #[doc(hidden)] pub type __enum_ty = ::std::os::raw::c_uint; pub type wchar_t = ::std::os::raw::c_int; 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_longlong; pub type __uint64_t = ::std::os::raw::c_ulonglong; #[repr(C)] #[derive(Copy, Clone)] pub union __mbstate_t { pub __mbstate8: [::std::os::raw::c_char; 128usize], pub _mbstateL: ::std::os::raw::c_longlong, } #[test] fn bindgen_test_layout___mbstate_t() { const UNINIT: ::std::mem::MaybeUninit<__mbstate_t> = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<__mbstate_t>(), 128usize, concat!("Size of: ", stringify!(__mbstate_t)) ); assert_eq!( ::std::mem::align_of::<__mbstate_t>(), 8usize, concat!("Alignment of ", stringify!(__mbstate_t)) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__mbstate8) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", stringify!(__mbstate_t), "::", stringify!(__mbstate8) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr)._mbstateL) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", stringify!(__mbstate_t), "::", stringify!(_mbstateL) ) ); } pub type __darwin_ptrdiff_t = ::std::os::raw::c_long; pub type __darwin_size_t = ::std::os::raw::c_ulong; pub type __darwin_wchar_t = ::std::os::raw::c_int; pub type __darwin_rune_t = __darwin_wchar_t; pub type __darwin_wint_t = ::std::os::raw::c_int; pub type __darwin_clock_t = ::std::os::raw::c_ulong; pub type __darwin_socklen_t = __uint32_t; pub type __darwin_ssize_t = ::std::os::raw::c_long; pub type __darwin_time_t = ::std::os::raw::c_long; pub type __darwin_blkcnt_t = __int64_t; pub type __darwin_blksize_t = __int32_t; pub type __darwin_dev_t = __int32_t; pub type __darwin_fsblkcnt_t = ::std::os::raw::c_uint; pub type __darwin_fsfilcnt_t = ::std::os::raw::c_uint; pub type __darwin_gid_t = __uint32_t; pub type __darwin_id_t = __uint32_t; pub type __darwin_ino64_t = __uint64_t; pub type __darwin_ino_t = __darwin_ino64_t; pub type __darwin_mode_t = __uint16_t; pub type __darwin_off_t = __int64_t; pub type __darwin_pid_t = __int32_t; pub type __darwin_sigset_t = __uint32_t; pub type __darwin_suseconds_t = __int32_t; pub type __darwin_uid_t = __uint32_t; pub type __darwin_useconds_t = __uint32_t; pub type __darwin_uuid_t = [::std::os::raw::c_uchar; 16usize]; pub type __darwin_uuid_string_t = [::std::os::raw::c_char; 37usize]; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct __darwin_pthread_handler_rec { pub __routine: ::std::option::Option, pub __arg: *mut ::std::os::raw::c_void, pub __next: *mut __darwin_pthread_handler_rec, } #[test] fn bindgen_test_layout___darwin_pthread_handler_rec() { const UNINIT: ::std::mem::MaybeUninit<__darwin_pthread_handler_rec> = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<__darwin_pthread_handler_rec>(), 24usize, concat!("Size of: ", stringify!(__darwin_pthread_handler_rec)) ); assert_eq!( ::std::mem::align_of::<__darwin_pthread_handler_rec>(), 8usize, concat!("Alignment of ", stringify!(__darwin_pthread_handler_rec)) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__routine) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", stringify!(__darwin_pthread_handler_rec), "::", stringify!(__routine) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__arg) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", stringify!(__darwin_pthread_handler_rec), "::", stringify!(__arg) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__next) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", stringify!(__darwin_pthread_handler_rec), "::", stringify!(__next) ) ); } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct _opaque_pthread_attr_t { pub __sig: ::std::os::raw::c_long, pub __opaque: [::std::os::raw::c_char; 56usize], } #[test] fn bindgen_test_layout__opaque_pthread_attr_t() { const UNINIT: ::std::mem::MaybeUninit<_opaque_pthread_attr_t> = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_opaque_pthread_attr_t>(), 64usize, concat!("Size of: ", stringify!(_opaque_pthread_attr_t)) ); assert_eq!( ::std::mem::align_of::<_opaque_pthread_attr_t>(), 8usize, concat!("Alignment of ", stringify!(_opaque_pthread_attr_t)) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__sig) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", stringify!(_opaque_pthread_attr_t), "::", stringify!(__sig) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__opaque) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", stringify!(_opaque_pthread_attr_t), "::", stringify!(__opaque) ) ); } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct _opaque_pthread_cond_t { pub __sig: ::std::os::raw::c_long, pub __opaque: [::std::os::raw::c_char; 40usize], } #[test] fn bindgen_test_layout__opaque_pthread_cond_t() { const UNINIT: ::std::mem::MaybeUninit<_opaque_pthread_cond_t> = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_opaque_pthread_cond_t>(), 48usize, concat!("Size of: ", stringify!(_opaque_pthread_cond_t)) ); assert_eq!( ::std::mem::align_of::<_opaque_pthread_cond_t>(), 8usize, concat!("Alignment of ", stringify!(_opaque_pthread_cond_t)) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__sig) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", stringify!(_opaque_pthread_cond_t), "::", stringify!(__sig) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__opaque) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", stringify!(_opaque_pthread_cond_t), "::", stringify!(__opaque) ) ); } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct _opaque_pthread_condattr_t { pub __sig: ::std::os::raw::c_long, pub __opaque: [::std::os::raw::c_char; 8usize], } #[test] fn bindgen_test_layout__opaque_pthread_condattr_t() { const UNINIT: ::std::mem::MaybeUninit<_opaque_pthread_condattr_t> = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_opaque_pthread_condattr_t>(), 16usize, concat!("Size of: ", stringify!(_opaque_pthread_condattr_t)) ); assert_eq!( ::std::mem::align_of::<_opaque_pthread_condattr_t>(), 8usize, concat!("Alignment of ", stringify!(_opaque_pthread_condattr_t)) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__sig) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", stringify!(_opaque_pthread_condattr_t), "::", stringify!(__sig) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__opaque) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", stringify!(_opaque_pthread_condattr_t), "::", stringify!(__opaque) ) ); } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct _opaque_pthread_mutex_t { pub __sig: ::std::os::raw::c_long, pub __opaque: [::std::os::raw::c_char; 56usize], } #[test] fn bindgen_test_layout__opaque_pthread_mutex_t() { const UNINIT: ::std::mem::MaybeUninit<_opaque_pthread_mutex_t> = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_opaque_pthread_mutex_t>(), 64usize, concat!("Size of: ", stringify!(_opaque_pthread_mutex_t)) ); assert_eq!( ::std::mem::align_of::<_opaque_pthread_mutex_t>(), 8usize, concat!("Alignment of ", stringify!(_opaque_pthread_mutex_t)) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__sig) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", stringify!(_opaque_pthread_mutex_t), "::", stringify!(__sig) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__opaque) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", stringify!(_opaque_pthread_mutex_t), "::", stringify!(__opaque) ) ); } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct _opaque_pthread_mutexattr_t { pub __sig: ::std::os::raw::c_long, pub __opaque: [::std::os::raw::c_char; 8usize], } #[test] fn bindgen_test_layout__opaque_pthread_mutexattr_t() { const UNINIT: ::std::mem::MaybeUninit<_opaque_pthread_mutexattr_t> = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_opaque_pthread_mutexattr_t>(), 16usize, concat!("Size of: ", stringify!(_opaque_pthread_mutexattr_t)) ); assert_eq!( ::std::mem::align_of::<_opaque_pthread_mutexattr_t>(), 8usize, concat!("Alignment of ", stringify!(_opaque_pthread_mutexattr_t)) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__sig) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", stringify!(_opaque_pthread_mutexattr_t), "::", stringify!(__sig) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__opaque) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", stringify!(_opaque_pthread_mutexattr_t), "::", stringify!(__opaque) ) ); } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct _opaque_pthread_once_t { pub __sig: ::std::os::raw::c_long, pub __opaque: [::std::os::raw::c_char; 8usize], } #[test] fn bindgen_test_layout__opaque_pthread_once_t() { const UNINIT: ::std::mem::MaybeUninit<_opaque_pthread_once_t> = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_opaque_pthread_once_t>(), 16usize, concat!("Size of: ", stringify!(_opaque_pthread_once_t)) ); assert_eq!( ::std::mem::align_of::<_opaque_pthread_once_t>(), 8usize, concat!("Alignment of ", stringify!(_opaque_pthread_once_t)) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__sig) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", stringify!(_opaque_pthread_once_t), "::", stringify!(__sig) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__opaque) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", stringify!(_opaque_pthread_once_t), "::", stringify!(__opaque) ) ); } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct _opaque_pthread_rwlock_t { pub __sig: ::std::os::raw::c_long, pub __opaque: [::std::os::raw::c_char; 192usize], } #[test] fn bindgen_test_layout__opaque_pthread_rwlock_t() { const UNINIT: ::std::mem::MaybeUninit<_opaque_pthread_rwlock_t> = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_opaque_pthread_rwlock_t>(), 200usize, concat!("Size of: ", stringify!(_opaque_pthread_rwlock_t)) ); assert_eq!( ::std::mem::align_of::<_opaque_pthread_rwlock_t>(), 8usize, concat!("Alignment of ", stringify!(_opaque_pthread_rwlock_t)) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__sig) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", stringify!(_opaque_pthread_rwlock_t), "::", stringify!(__sig) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__opaque) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", stringify!(_opaque_pthread_rwlock_t), "::", stringify!(__opaque) ) ); } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct _opaque_pthread_rwlockattr_t { pub __sig: ::std::os::raw::c_long, pub __opaque: [::std::os::raw::c_char; 16usize], } #[test] fn bindgen_test_layout__opaque_pthread_rwlockattr_t() { const UNINIT: ::std::mem::MaybeUninit<_opaque_pthread_rwlockattr_t> = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_opaque_pthread_rwlockattr_t>(), 24usize, concat!("Size of: ", stringify!(_opaque_pthread_rwlockattr_t)) ); assert_eq!( ::std::mem::align_of::<_opaque_pthread_rwlockattr_t>(), 8usize, concat!("Alignment of ", stringify!(_opaque_pthread_rwlockattr_t)) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__sig) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", stringify!(_opaque_pthread_rwlockattr_t), "::", stringify!(__sig) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__opaque) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", stringify!(_opaque_pthread_rwlockattr_t), "::", stringify!(__opaque) ) ); } pub type __darwin_nl_item = ::std::os::raw::c_int; pub type __darwin_wctrans_t = ::std::os::raw::c_int; pub type __darwin_wctype_t = __uint32_t; pub type int_least8_t = i8; pub type int_least16_t = i16; pub type int_least32_t = i32; pub type int_least64_t = i64; pub type uint_least8_t = u8; pub type uint_least16_t = u16; pub type uint_least32_t = u32; pub type uint_least64_t = u64; pub type int_fast8_t = i8; pub type int_fast16_t = i16; pub type int_fast32_t = i32; pub type int_fast64_t = i64; pub type uint_fast8_t = u8; pub type uint_fast16_t = u16; pub type uint_fast32_t = u32; pub type uint_fast64_t = u64; pub type u_int8_t = ::std::os::raw::c_uchar; pub type u_int16_t = ::std::os::raw::c_ushort; pub type u_int32_t = ::std::os::raw::c_uint; pub type u_int64_t = ::std::os::raw::c_ulonglong; pub type register_t = i64; pub type user_addr_t = u_int64_t; pub type user_size_t = u_int64_t; pub type user_ssize_t = i64; pub type user_long_t = i64; pub type user_ulong_t = u_int64_t; pub type user_time_t = i64; pub type user_off_t = i64; pub type syscall_arg_t = u_int64_t; pub type intmax_t = ::std::os::raw::c_long; pub type uintmax_t = ::std::os::raw::c_ulong; extern "C" { pub fn imaxabs(j: intmax_t) -> intmax_t; } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct imaxdiv_t { pub quot: intmax_t, pub rem: intmax_t, } #[test] fn bindgen_test_layout_imaxdiv_t() { 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 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 wchar_t, __endptr: *mut *mut wchar_t, __base: ::std::os::raw::c_int, ) -> intmax_t; } extern "C" { pub fn wcstoumax( __nptr: *const wchar_t, __endptr: *mut *mut wchar_t, __base: ::std::os::raw::c_int, ) -> uintmax_t; } extern "C" { pub fn lzma_version_number() -> u32; } extern "C" { pub fn lzma_version_string() -> *const ::std::os::raw::c_char; } pub type lzma_bool = ::std::os::raw::c_uchar; pub const lzma_reserved_enum_LZMA_RESERVED_ENUM: lzma_reserved_enum = 0; pub type lzma_reserved_enum = __enum_ty; pub const lzma_ret_LZMA_OK: lzma_ret = 0; pub const lzma_ret_LZMA_STREAM_END: lzma_ret = 1; pub const lzma_ret_LZMA_NO_CHECK: lzma_ret = 2; pub const lzma_ret_LZMA_UNSUPPORTED_CHECK: lzma_ret = 3; pub const lzma_ret_LZMA_GET_CHECK: lzma_ret = 4; pub const lzma_ret_LZMA_MEM_ERROR: lzma_ret = 5; pub const lzma_ret_LZMA_MEMLIMIT_ERROR: lzma_ret = 6; pub const lzma_ret_LZMA_FORMAT_ERROR: lzma_ret = 7; pub const lzma_ret_LZMA_OPTIONS_ERROR: lzma_ret = 8; pub const lzma_ret_LZMA_DATA_ERROR: lzma_ret = 9; pub const lzma_ret_LZMA_BUF_ERROR: lzma_ret = 10; pub const lzma_ret_LZMA_PROG_ERROR: lzma_ret = 11; pub const lzma_ret_LZMA_SEEK_NEEDED: lzma_ret = 12; pub const lzma_ret_LZMA_RET_INTERNAL1: lzma_ret = 101; pub const lzma_ret_LZMA_RET_INTERNAL2: lzma_ret = 102; pub const lzma_ret_LZMA_RET_INTERNAL3: lzma_ret = 103; pub const lzma_ret_LZMA_RET_INTERNAL4: lzma_ret = 104; pub const lzma_ret_LZMA_RET_INTERNAL5: lzma_ret = 105; pub const lzma_ret_LZMA_RET_INTERNAL6: lzma_ret = 106; pub const lzma_ret_LZMA_RET_INTERNAL7: lzma_ret = 107; pub const lzma_ret_LZMA_RET_INTERNAL8: lzma_ret = 108; pub type lzma_ret = __enum_ty; pub const lzma_action_LZMA_RUN: lzma_action = 0; pub const lzma_action_LZMA_SYNC_FLUSH: lzma_action = 1; pub const lzma_action_LZMA_FULL_FLUSH: lzma_action = 2; pub const lzma_action_LZMA_FULL_BARRIER: lzma_action = 4; pub const lzma_action_LZMA_FINISH: lzma_action = 3; pub type lzma_action = __enum_ty; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct lzma_allocator { pub alloc: ::std::option::Option< unsafe extern "C" fn( opaque: *mut ::std::os::raw::c_void, nmemb: usize, size: usize, ) -> *mut ::std::os::raw::c_void, >, pub free: ::std::option::Option< unsafe extern "C" fn(opaque: *mut ::std::os::raw::c_void, ptr: *mut ::std::os::raw::c_void), >, pub opaque: *mut ::std::os::raw::c_void, } #[test] fn bindgen_test_layout_lzma_allocator() { 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!(lzma_allocator)) ); assert_eq!( ::std::mem::align_of::(), 8usize, concat!("Alignment of ", stringify!(lzma_allocator)) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).alloc) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", stringify!(lzma_allocator), "::", stringify!(alloc) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).free) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", stringify!(lzma_allocator), "::", stringify!(free) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).opaque) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", stringify!(lzma_allocator), "::", stringify!(opaque) ) ); } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct lzma_internal_s { _unused: [u8; 0], } pub type lzma_internal = lzma_internal_s; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct lzma_stream { pub next_in: *const u8, pub avail_in: usize, pub total_in: u64, pub next_out: *mut u8, pub avail_out: usize, pub total_out: u64, pub allocator: *const lzma_allocator, pub internal: *mut lzma_internal, pub reserved_ptr1: *mut ::std::os::raw::c_void, pub reserved_ptr2: *mut ::std::os::raw::c_void, pub reserved_ptr3: *mut ::std::os::raw::c_void, pub reserved_ptr4: *mut ::std::os::raw::c_void, pub seek_pos: u64, pub reserved_int2: u64, pub reserved_int3: usize, pub reserved_int4: usize, pub reserved_enum1: lzma_reserved_enum, pub reserved_enum2: lzma_reserved_enum, } #[test] fn bindgen_test_layout_lzma_stream() { const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 136usize, concat!("Size of: ", stringify!(lzma_stream)) ); assert_eq!( ::std::mem::align_of::(), 8usize, concat!("Alignment of ", stringify!(lzma_stream)) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).next_in) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", stringify!(lzma_stream), "::", stringify!(next_in) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).avail_in) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", stringify!(lzma_stream), "::", stringify!(avail_in) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).total_in) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", stringify!(lzma_stream), "::", stringify!(total_in) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).next_out) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", stringify!(lzma_stream), "::", stringify!(next_out) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).avail_out) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", stringify!(lzma_stream), "::", stringify!(avail_out) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).total_out) as usize - ptr as usize }, 40usize, concat!( "Offset of field: ", stringify!(lzma_stream), "::", stringify!(total_out) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).allocator) as usize - ptr as usize }, 48usize, concat!( "Offset of field: ", stringify!(lzma_stream), "::", stringify!(allocator) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).internal) as usize - ptr as usize }, 56usize, concat!( "Offset of field: ", stringify!(lzma_stream), "::", stringify!(internal) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_ptr1) as usize - ptr as usize }, 64usize, concat!( "Offset of field: ", stringify!(lzma_stream), "::", stringify!(reserved_ptr1) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_ptr2) as usize - ptr as usize }, 72usize, concat!( "Offset of field: ", stringify!(lzma_stream), "::", stringify!(reserved_ptr2) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_ptr3) as usize - ptr as usize }, 80usize, concat!( "Offset of field: ", stringify!(lzma_stream), "::", stringify!(reserved_ptr3) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_ptr4) as usize - ptr as usize }, 88usize, concat!( "Offset of field: ", stringify!(lzma_stream), "::", stringify!(reserved_ptr4) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).seek_pos) as usize - ptr as usize }, 96usize, concat!( "Offset of field: ", stringify!(lzma_stream), "::", stringify!(seek_pos) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_int2) as usize - ptr as usize }, 104usize, concat!( "Offset of field: ", stringify!(lzma_stream), "::", stringify!(reserved_int2) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_int3) as usize - ptr as usize }, 112usize, concat!( "Offset of field: ", stringify!(lzma_stream), "::", stringify!(reserved_int3) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_int4) as usize - ptr as usize }, 120usize, concat!( "Offset of field: ", stringify!(lzma_stream), "::", stringify!(reserved_int4) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_enum1) as usize - ptr as usize }, 128usize, concat!( "Offset of field: ", stringify!(lzma_stream), "::", stringify!(reserved_enum1) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_enum2) as usize - ptr as usize }, 132usize, concat!( "Offset of field: ", stringify!(lzma_stream), "::", stringify!(reserved_enum2) ) ); } extern "C" { pub fn lzma_code(strm: *mut lzma_stream, action: lzma_action) -> lzma_ret; } extern "C" { pub fn lzma_end(strm: *mut lzma_stream); } extern "C" { pub fn lzma_get_progress(strm: *mut lzma_stream, progress_in: *mut u64, progress_out: *mut u64); } extern "C" { pub fn lzma_memusage(strm: *const lzma_stream) -> u64; } extern "C" { pub fn lzma_memlimit_get(strm: *const lzma_stream) -> u64; } extern "C" { pub fn lzma_memlimit_set(strm: *mut lzma_stream, memlimit: u64) -> lzma_ret; } pub type lzma_vli = u64; extern "C" { pub fn lzma_vli_encode( vli: lzma_vli, vli_pos: *mut usize, out: *mut u8, out_pos: *mut usize, out_size: usize, ) -> lzma_ret; } extern "C" { pub fn lzma_vli_decode( vli: *mut lzma_vli, vli_pos: *mut usize, in_: *const u8, in_pos: *mut usize, in_size: usize, ) -> lzma_ret; } extern "C" { pub fn lzma_vli_size(vli: lzma_vli) -> u32; } pub const lzma_check_LZMA_CHECK_NONE: lzma_check = 0; pub const lzma_check_LZMA_CHECK_CRC32: lzma_check = 1; pub const lzma_check_LZMA_CHECK_CRC64: lzma_check = 4; pub const lzma_check_LZMA_CHECK_SHA256: lzma_check = 10; pub type lzma_check = __enum_ty; extern "C" { pub fn lzma_check_is_supported(check: lzma_check) -> lzma_bool; } extern "C" { pub fn lzma_check_size(check: lzma_check) -> u32; } extern "C" { pub fn lzma_crc32(buf: *const u8, size: usize, crc: u32) -> u32; } extern "C" { pub fn lzma_crc64(buf: *const u8, size: usize, crc: u64) -> u64; } extern "C" { pub fn lzma_get_check(strm: *const lzma_stream) -> lzma_check; } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct lzma_filter { pub id: lzma_vli, pub options: *mut ::std::os::raw::c_void, } #[test] fn bindgen_test_layout_lzma_filter() { 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!(lzma_filter)) ); assert_eq!( ::std::mem::align_of::(), 8usize, concat!("Alignment of ", stringify!(lzma_filter)) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).id) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", stringify!(lzma_filter), "::", stringify!(id) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).options) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", stringify!(lzma_filter), "::", stringify!(options) ) ); } extern "C" { pub fn lzma_filter_encoder_is_supported(id: lzma_vli) -> lzma_bool; } extern "C" { pub fn lzma_filter_decoder_is_supported(id: lzma_vli) -> lzma_bool; } extern "C" { pub fn lzma_filters_copy( src: *const lzma_filter, dest: *mut lzma_filter, allocator: *const lzma_allocator, ) -> lzma_ret; } extern "C" { pub fn lzma_filters_free(filters: *mut lzma_filter, allocator: *const lzma_allocator); } extern "C" { pub fn lzma_raw_encoder_memusage(filters: *const lzma_filter) -> u64; } extern "C" { pub fn lzma_raw_decoder_memusage(filters: *const lzma_filter) -> u64; } extern "C" { pub fn lzma_raw_encoder(strm: *mut lzma_stream, filters: *const lzma_filter) -> lzma_ret; } extern "C" { pub fn lzma_raw_decoder(strm: *mut lzma_stream, filters: *const lzma_filter) -> lzma_ret; } extern "C" { pub fn lzma_filters_update(strm: *mut lzma_stream, filters: *const lzma_filter) -> lzma_ret; } extern "C" { pub fn lzma_raw_buffer_encode( filters: *const lzma_filter, allocator: *const lzma_allocator, in_: *const u8, in_size: usize, out: *mut u8, out_pos: *mut usize, out_size: usize, ) -> lzma_ret; } extern "C" { pub fn lzma_raw_buffer_decode( filters: *const lzma_filter, allocator: *const lzma_allocator, in_: *const u8, in_pos: *mut usize, in_size: usize, out: *mut u8, out_pos: *mut usize, out_size: usize, ) -> lzma_ret; } extern "C" { pub fn lzma_properties_size(size: *mut u32, filter: *const lzma_filter) -> lzma_ret; } extern "C" { pub fn lzma_properties_encode(filter: *const lzma_filter, props: *mut u8) -> lzma_ret; } extern "C" { pub fn lzma_properties_decode( filter: *mut lzma_filter, allocator: *const lzma_allocator, props: *const u8, props_size: usize, ) -> lzma_ret; } extern "C" { pub fn lzma_filter_flags_size(size: *mut u32, filter: *const lzma_filter) -> lzma_ret; } extern "C" { pub fn lzma_filter_flags_encode( filter: *const lzma_filter, out: *mut u8, out_pos: *mut usize, out_size: usize, ) -> lzma_ret; } extern "C" { pub fn lzma_filter_flags_decode( filter: *mut lzma_filter, allocator: *const lzma_allocator, in_: *const u8, in_pos: *mut usize, in_size: usize, ) -> lzma_ret; } extern "C" { pub fn lzma_str_to_filters( str_: *const ::std::os::raw::c_char, error_pos: *mut ::std::os::raw::c_int, filters: *mut lzma_filter, flags: u32, allocator: *const lzma_allocator, ) -> *const ::std::os::raw::c_char; } extern "C" { pub fn lzma_str_from_filters( str_: *mut *mut ::std::os::raw::c_char, filters: *const lzma_filter, flags: u32, allocator: *const lzma_allocator, ) -> lzma_ret; } extern "C" { pub fn lzma_str_list_filters( str_: *mut *mut ::std::os::raw::c_char, filter_id: lzma_vli, flags: u32, allocator: *const lzma_allocator, ) -> lzma_ret; } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct lzma_options_bcj { pub start_offset: u32, } #[test] fn bindgen_test_layout_lzma_options_bcj() { 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!(lzma_options_bcj)) ); assert_eq!( ::std::mem::align_of::(), 4usize, concat!("Alignment of ", stringify!(lzma_options_bcj)) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).start_offset) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", stringify!(lzma_options_bcj), "::", stringify!(start_offset) ) ); } pub const lzma_delta_type_LZMA_DELTA_TYPE_BYTE: lzma_delta_type = 0; pub type lzma_delta_type = ::std::os::raw::c_uint; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct lzma_options_delta { pub type_: lzma_delta_type, pub dist: u32, pub reserved_int1: u32, pub reserved_int2: u32, pub reserved_int3: u32, pub reserved_int4: u32, pub reserved_ptr1: *mut ::std::os::raw::c_void, pub reserved_ptr2: *mut ::std::os::raw::c_void, } #[test] fn bindgen_test_layout_lzma_options_delta() { 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!(lzma_options_delta)) ); assert_eq!( ::std::mem::align_of::(), 8usize, concat!("Alignment of ", stringify!(lzma_options_delta)) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", stringify!(lzma_options_delta), "::", stringify!(type_) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).dist) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", stringify!(lzma_options_delta), "::", stringify!(dist) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_int1) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", stringify!(lzma_options_delta), "::", stringify!(reserved_int1) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_int2) as usize - ptr as usize }, 12usize, concat!( "Offset of field: ", stringify!(lzma_options_delta), "::", stringify!(reserved_int2) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_int3) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", stringify!(lzma_options_delta), "::", stringify!(reserved_int3) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_int4) as usize - ptr as usize }, 20usize, concat!( "Offset of field: ", stringify!(lzma_options_delta), "::", stringify!(reserved_int4) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_ptr1) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", stringify!(lzma_options_delta), "::", stringify!(reserved_ptr1) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_ptr2) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", stringify!(lzma_options_delta), "::", stringify!(reserved_ptr2) ) ); } pub const lzma_match_finder_LZMA_MF_HC3: lzma_match_finder = 3; pub const lzma_match_finder_LZMA_MF_HC4: lzma_match_finder = 4; pub const lzma_match_finder_LZMA_MF_BT2: lzma_match_finder = 18; pub const lzma_match_finder_LZMA_MF_BT3: lzma_match_finder = 19; pub const lzma_match_finder_LZMA_MF_BT4: lzma_match_finder = 20; pub type lzma_match_finder = __enum_ty; extern "C" { pub fn lzma_mf_is_supported(match_finder: lzma_match_finder) -> lzma_bool; } pub const lzma_mode_LZMA_MODE_FAST: lzma_mode = 1; pub const lzma_mode_LZMA_MODE_NORMAL: lzma_mode = 2; pub type lzma_mode = __enum_ty; extern "C" { pub fn lzma_mode_is_supported(mode: lzma_mode) -> lzma_bool; } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct lzma_options_lzma { pub dict_size: u32, pub preset_dict: *const u8, pub preset_dict_size: u32, pub lc: u32, pub lp: u32, pub pb: u32, pub mode: lzma_mode, pub nice_len: u32, pub mf: lzma_match_finder, pub depth: u32, pub ext_flags: u32, pub ext_size_low: u32, pub ext_size_high: u32, pub reserved_int4: u32, pub reserved_int5: u32, pub reserved_int6: u32, pub reserved_int7: u32, pub reserved_int8: u32, pub reserved_enum1: lzma_reserved_enum, pub reserved_enum2: lzma_reserved_enum, pub reserved_enum3: lzma_reserved_enum, pub reserved_enum4: lzma_reserved_enum, pub reserved_ptr1: *mut ::std::os::raw::c_void, pub reserved_ptr2: *mut ::std::os::raw::c_void, } #[test] fn bindgen_test_layout_lzma_options_lzma() { const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 112usize, concat!("Size of: ", stringify!(lzma_options_lzma)) ); assert_eq!( ::std::mem::align_of::(), 8usize, concat!("Alignment of ", stringify!(lzma_options_lzma)) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).dict_size) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", stringify!(lzma_options_lzma), "::", stringify!(dict_size) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).preset_dict) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", stringify!(lzma_options_lzma), "::", stringify!(preset_dict) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).preset_dict_size) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", stringify!(lzma_options_lzma), "::", stringify!(preset_dict_size) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).lc) as usize - ptr as usize }, 20usize, concat!( "Offset of field: ", stringify!(lzma_options_lzma), "::", stringify!(lc) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).lp) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", stringify!(lzma_options_lzma), "::", stringify!(lp) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).pb) as usize - ptr as usize }, 28usize, concat!( "Offset of field: ", stringify!(lzma_options_lzma), "::", stringify!(pb) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).mode) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", stringify!(lzma_options_lzma), "::", stringify!(mode) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).nice_len) as usize - ptr as usize }, 36usize, concat!( "Offset of field: ", stringify!(lzma_options_lzma), "::", stringify!(nice_len) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).mf) as usize - ptr as usize }, 40usize, concat!( "Offset of field: ", stringify!(lzma_options_lzma), "::", stringify!(mf) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).depth) as usize - ptr as usize }, 44usize, concat!( "Offset of field: ", stringify!(lzma_options_lzma), "::", stringify!(depth) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).ext_flags) as usize - ptr as usize }, 48usize, concat!( "Offset of field: ", stringify!(lzma_options_lzma), "::", stringify!(ext_flags) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).ext_size_low) as usize - ptr as usize }, 52usize, concat!( "Offset of field: ", stringify!(lzma_options_lzma), "::", stringify!(ext_size_low) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).ext_size_high) as usize - ptr as usize }, 56usize, concat!( "Offset of field: ", stringify!(lzma_options_lzma), "::", stringify!(ext_size_high) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_int4) as usize - ptr as usize }, 60usize, concat!( "Offset of field: ", stringify!(lzma_options_lzma), "::", stringify!(reserved_int4) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_int5) as usize - ptr as usize }, 64usize, concat!( "Offset of field: ", stringify!(lzma_options_lzma), "::", stringify!(reserved_int5) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_int6) as usize - ptr as usize }, 68usize, concat!( "Offset of field: ", stringify!(lzma_options_lzma), "::", stringify!(reserved_int6) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_int7) as usize - ptr as usize }, 72usize, concat!( "Offset of field: ", stringify!(lzma_options_lzma), "::", stringify!(reserved_int7) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_int8) as usize - ptr as usize }, 76usize, concat!( "Offset of field: ", stringify!(lzma_options_lzma), "::", stringify!(reserved_int8) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_enum1) as usize - ptr as usize }, 80usize, concat!( "Offset of field: ", stringify!(lzma_options_lzma), "::", stringify!(reserved_enum1) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_enum2) as usize - ptr as usize }, 84usize, concat!( "Offset of field: ", stringify!(lzma_options_lzma), "::", stringify!(reserved_enum2) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_enum3) as usize - ptr as usize }, 88usize, concat!( "Offset of field: ", stringify!(lzma_options_lzma), "::", stringify!(reserved_enum3) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_enum4) as usize - ptr as usize }, 92usize, concat!( "Offset of field: ", stringify!(lzma_options_lzma), "::", stringify!(reserved_enum4) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_ptr1) as usize - ptr as usize }, 96usize, concat!( "Offset of field: ", stringify!(lzma_options_lzma), "::", stringify!(reserved_ptr1) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_ptr2) as usize - ptr as usize }, 104usize, concat!( "Offset of field: ", stringify!(lzma_options_lzma), "::", stringify!(reserved_ptr2) ) ); } extern "C" { pub fn lzma_lzma_preset(options: *mut lzma_options_lzma, preset: u32) -> lzma_bool; } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct lzma_mt { pub flags: u32, pub threads: u32, pub block_size: u64, pub timeout: u32, pub preset: u32, pub filters: *const lzma_filter, pub check: lzma_check, pub reserved_enum1: lzma_reserved_enum, pub reserved_enum2: lzma_reserved_enum, pub reserved_enum3: lzma_reserved_enum, pub reserved_int1: u32, pub reserved_int2: u32, pub reserved_int3: u32, pub reserved_int4: u32, pub memlimit_threading: u64, pub memlimit_stop: u64, pub reserved_int7: u64, pub reserved_int8: u64, pub reserved_ptr1: *mut ::std::os::raw::c_void, pub reserved_ptr2: *mut ::std::os::raw::c_void, pub reserved_ptr3: *mut ::std::os::raw::c_void, pub reserved_ptr4: *mut ::std::os::raw::c_void, } #[test] fn bindgen_test_layout_lzma_mt() { 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!(lzma_mt)) ); assert_eq!( ::std::mem::align_of::(), 8usize, concat!("Alignment of ", stringify!(lzma_mt)) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", stringify!(lzma_mt), "::", stringify!(flags) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).threads) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", stringify!(lzma_mt), "::", stringify!(threads) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).block_size) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", stringify!(lzma_mt), "::", stringify!(block_size) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).timeout) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", stringify!(lzma_mt), "::", stringify!(timeout) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).preset) as usize - ptr as usize }, 20usize, concat!( "Offset of field: ", stringify!(lzma_mt), "::", stringify!(preset) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).filters) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", stringify!(lzma_mt), "::", stringify!(filters) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).check) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", stringify!(lzma_mt), "::", stringify!(check) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_enum1) as usize - ptr as usize }, 36usize, concat!( "Offset of field: ", stringify!(lzma_mt), "::", stringify!(reserved_enum1) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_enum2) as usize - ptr as usize }, 40usize, concat!( "Offset of field: ", stringify!(lzma_mt), "::", stringify!(reserved_enum2) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_enum3) as usize - ptr as usize }, 44usize, concat!( "Offset of field: ", stringify!(lzma_mt), "::", stringify!(reserved_enum3) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_int1) as usize - ptr as usize }, 48usize, concat!( "Offset of field: ", stringify!(lzma_mt), "::", stringify!(reserved_int1) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_int2) as usize - ptr as usize }, 52usize, concat!( "Offset of field: ", stringify!(lzma_mt), "::", stringify!(reserved_int2) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_int3) as usize - ptr as usize }, 56usize, concat!( "Offset of field: ", stringify!(lzma_mt), "::", stringify!(reserved_int3) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_int4) as usize - ptr as usize }, 60usize, concat!( "Offset of field: ", stringify!(lzma_mt), "::", stringify!(reserved_int4) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).memlimit_threading) as usize - ptr as usize }, 64usize, concat!( "Offset of field: ", stringify!(lzma_mt), "::", stringify!(memlimit_threading) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).memlimit_stop) as usize - ptr as usize }, 72usize, concat!( "Offset of field: ", stringify!(lzma_mt), "::", stringify!(memlimit_stop) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_int7) as usize - ptr as usize }, 80usize, concat!( "Offset of field: ", stringify!(lzma_mt), "::", stringify!(reserved_int7) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_int8) as usize - ptr as usize }, 88usize, concat!( "Offset of field: ", stringify!(lzma_mt), "::", stringify!(reserved_int8) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_ptr1) as usize - ptr as usize }, 96usize, concat!( "Offset of field: ", stringify!(lzma_mt), "::", stringify!(reserved_ptr1) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_ptr2) as usize - ptr as usize }, 104usize, concat!( "Offset of field: ", stringify!(lzma_mt), "::", stringify!(reserved_ptr2) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_ptr3) as usize - ptr as usize }, 112usize, concat!( "Offset of field: ", stringify!(lzma_mt), "::", stringify!(reserved_ptr3) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_ptr4) as usize - ptr as usize }, 120usize, concat!( "Offset of field: ", stringify!(lzma_mt), "::", stringify!(reserved_ptr4) ) ); } extern "C" { pub fn lzma_easy_encoder_memusage(preset: u32) -> u64; } extern "C" { pub fn lzma_easy_decoder_memusage(preset: u32) -> u64; } extern "C" { pub fn lzma_easy_encoder(strm: *mut lzma_stream, preset: u32, check: lzma_check) -> lzma_ret; } extern "C" { pub fn lzma_easy_buffer_encode( preset: u32, check: lzma_check, allocator: *const lzma_allocator, in_: *const u8, in_size: usize, out: *mut u8, out_pos: *mut usize, out_size: usize, ) -> lzma_ret; } extern "C" { pub fn lzma_stream_encoder( strm: *mut lzma_stream, filters: *const lzma_filter, check: lzma_check, ) -> lzma_ret; } extern "C" { pub fn lzma_stream_encoder_mt_memusage(options: *const lzma_mt) -> u64; } extern "C" { pub fn lzma_stream_encoder_mt(strm: *mut lzma_stream, options: *const lzma_mt) -> lzma_ret; } extern "C" { pub fn lzma_mt_block_size(filters: *const lzma_filter) -> u64; } extern "C" { pub fn lzma_alone_encoder( strm: *mut lzma_stream, options: *const lzma_options_lzma, ) -> lzma_ret; } extern "C" { pub fn lzma_stream_buffer_bound(uncompressed_size: usize) -> usize; } extern "C" { pub fn lzma_stream_buffer_encode( filters: *mut lzma_filter, check: lzma_check, allocator: *const lzma_allocator, in_: *const u8, in_size: usize, out: *mut u8, out_pos: *mut usize, out_size: usize, ) -> lzma_ret; } extern "C" { pub fn lzma_microlzma_encoder( strm: *mut lzma_stream, options: *const lzma_options_lzma, ) -> lzma_ret; } extern "C" { pub fn lzma_stream_decoder(strm: *mut lzma_stream, memlimit: u64, flags: u32) -> lzma_ret; } extern "C" { pub fn lzma_stream_decoder_mt(strm: *mut lzma_stream, options: *const lzma_mt) -> lzma_ret; } extern "C" { pub fn lzma_auto_decoder(strm: *mut lzma_stream, memlimit: u64, flags: u32) -> lzma_ret; } extern "C" { pub fn lzma_alone_decoder(strm: *mut lzma_stream, memlimit: u64) -> lzma_ret; } extern "C" { pub fn lzma_lzip_decoder(strm: *mut lzma_stream, memlimit: u64, flags: u32) -> lzma_ret; } extern "C" { pub fn lzma_stream_buffer_decode( memlimit: *mut u64, flags: u32, allocator: *const lzma_allocator, in_: *const u8, in_pos: *mut usize, in_size: usize, out: *mut u8, out_pos: *mut usize, out_size: usize, ) -> lzma_ret; } extern "C" { pub fn lzma_microlzma_decoder( strm: *mut lzma_stream, comp_size: u64, uncomp_size: u64, uncomp_size_is_exact: lzma_bool, dict_size: u32, ) -> lzma_ret; } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct lzma_stream_flags { pub version: u32, pub backward_size: lzma_vli, pub check: lzma_check, pub reserved_enum1: lzma_reserved_enum, pub reserved_enum2: lzma_reserved_enum, pub reserved_enum3: lzma_reserved_enum, pub reserved_enum4: lzma_reserved_enum, pub reserved_bool1: lzma_bool, pub reserved_bool2: lzma_bool, pub reserved_bool3: lzma_bool, pub reserved_bool4: lzma_bool, pub reserved_bool5: lzma_bool, pub reserved_bool6: lzma_bool, pub reserved_bool7: lzma_bool, pub reserved_bool8: lzma_bool, pub reserved_int1: u32, pub reserved_int2: u32, } #[test] fn bindgen_test_layout_lzma_stream_flags() { 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!(lzma_stream_flags)) ); assert_eq!( ::std::mem::align_of::(), 8usize, concat!("Alignment of ", stringify!(lzma_stream_flags)) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).version) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", stringify!(lzma_stream_flags), "::", stringify!(version) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).backward_size) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", stringify!(lzma_stream_flags), "::", stringify!(backward_size) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).check) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", stringify!(lzma_stream_flags), "::", stringify!(check) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_enum1) as usize - ptr as usize }, 20usize, concat!( "Offset of field: ", stringify!(lzma_stream_flags), "::", stringify!(reserved_enum1) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_enum2) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", stringify!(lzma_stream_flags), "::", stringify!(reserved_enum2) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_enum3) as usize - ptr as usize }, 28usize, concat!( "Offset of field: ", stringify!(lzma_stream_flags), "::", stringify!(reserved_enum3) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_enum4) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", stringify!(lzma_stream_flags), "::", stringify!(reserved_enum4) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_bool1) as usize - ptr as usize }, 36usize, concat!( "Offset of field: ", stringify!(lzma_stream_flags), "::", stringify!(reserved_bool1) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_bool2) as usize - ptr as usize }, 37usize, concat!( "Offset of field: ", stringify!(lzma_stream_flags), "::", stringify!(reserved_bool2) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_bool3) as usize - ptr as usize }, 38usize, concat!( "Offset of field: ", stringify!(lzma_stream_flags), "::", stringify!(reserved_bool3) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_bool4) as usize - ptr as usize }, 39usize, concat!( "Offset of field: ", stringify!(lzma_stream_flags), "::", stringify!(reserved_bool4) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_bool5) as usize - ptr as usize }, 40usize, concat!( "Offset of field: ", stringify!(lzma_stream_flags), "::", stringify!(reserved_bool5) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_bool6) as usize - ptr as usize }, 41usize, concat!( "Offset of field: ", stringify!(lzma_stream_flags), "::", stringify!(reserved_bool6) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_bool7) as usize - ptr as usize }, 42usize, concat!( "Offset of field: ", stringify!(lzma_stream_flags), "::", stringify!(reserved_bool7) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_bool8) as usize - ptr as usize }, 43usize, concat!( "Offset of field: ", stringify!(lzma_stream_flags), "::", stringify!(reserved_bool8) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_int1) as usize - ptr as usize }, 44usize, concat!( "Offset of field: ", stringify!(lzma_stream_flags), "::", stringify!(reserved_int1) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_int2) as usize - ptr as usize }, 48usize, concat!( "Offset of field: ", stringify!(lzma_stream_flags), "::", stringify!(reserved_int2) ) ); } extern "C" { pub fn lzma_stream_header_encode(options: *const lzma_stream_flags, out: *mut u8) -> lzma_ret; } extern "C" { pub fn lzma_stream_footer_encode(options: *const lzma_stream_flags, out: *mut u8) -> lzma_ret; } extern "C" { pub fn lzma_stream_header_decode(options: *mut lzma_stream_flags, in_: *const u8) -> lzma_ret; } extern "C" { pub fn lzma_stream_footer_decode(options: *mut lzma_stream_flags, in_: *const u8) -> lzma_ret; } extern "C" { pub fn lzma_stream_flags_compare( a: *const lzma_stream_flags, b: *const lzma_stream_flags, ) -> lzma_ret; } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct lzma_block { pub version: u32, pub header_size: u32, pub check: lzma_check, pub compressed_size: lzma_vli, pub uncompressed_size: lzma_vli, pub filters: *mut lzma_filter, pub raw_check: [u8; 64usize], pub reserved_ptr1: *mut ::std::os::raw::c_void, pub reserved_ptr2: *mut ::std::os::raw::c_void, pub reserved_ptr3: *mut ::std::os::raw::c_void, pub reserved_int1: u32, pub reserved_int2: u32, pub reserved_int3: lzma_vli, pub reserved_int4: lzma_vli, pub reserved_int5: lzma_vli, pub reserved_int6: lzma_vli, pub reserved_int7: lzma_vli, pub reserved_int8: lzma_vli, pub reserved_enum1: lzma_reserved_enum, pub reserved_enum2: lzma_reserved_enum, pub reserved_enum3: lzma_reserved_enum, pub reserved_enum4: lzma_reserved_enum, pub ignore_check: lzma_bool, pub reserved_bool2: lzma_bool, pub reserved_bool3: lzma_bool, pub reserved_bool4: lzma_bool, pub reserved_bool5: lzma_bool, pub reserved_bool6: lzma_bool, pub reserved_bool7: lzma_bool, pub reserved_bool8: lzma_bool, } #[test] fn bindgen_test_layout_lzma_block() { const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 208usize, concat!("Size of: ", stringify!(lzma_block)) ); assert_eq!( ::std::mem::align_of::(), 8usize, concat!("Alignment of ", stringify!(lzma_block)) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).version) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", stringify!(lzma_block), "::", stringify!(version) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).header_size) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", stringify!(lzma_block), "::", stringify!(header_size) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).check) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", stringify!(lzma_block), "::", stringify!(check) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).compressed_size) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", stringify!(lzma_block), "::", stringify!(compressed_size) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).uncompressed_size) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", stringify!(lzma_block), "::", stringify!(uncompressed_size) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).filters) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", stringify!(lzma_block), "::", stringify!(filters) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).raw_check) as usize - ptr as usize }, 40usize, concat!( "Offset of field: ", stringify!(lzma_block), "::", stringify!(raw_check) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_ptr1) as usize - ptr as usize }, 104usize, concat!( "Offset of field: ", stringify!(lzma_block), "::", stringify!(reserved_ptr1) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_ptr2) as usize - ptr as usize }, 112usize, concat!( "Offset of field: ", stringify!(lzma_block), "::", stringify!(reserved_ptr2) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_ptr3) as usize - ptr as usize }, 120usize, concat!( "Offset of field: ", stringify!(lzma_block), "::", stringify!(reserved_ptr3) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_int1) as usize - ptr as usize }, 128usize, concat!( "Offset of field: ", stringify!(lzma_block), "::", stringify!(reserved_int1) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_int2) as usize - ptr as usize }, 132usize, concat!( "Offset of field: ", stringify!(lzma_block), "::", stringify!(reserved_int2) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_int3) as usize - ptr as usize }, 136usize, concat!( "Offset of field: ", stringify!(lzma_block), "::", stringify!(reserved_int3) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_int4) as usize - ptr as usize }, 144usize, concat!( "Offset of field: ", stringify!(lzma_block), "::", stringify!(reserved_int4) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_int5) as usize - ptr as usize }, 152usize, concat!( "Offset of field: ", stringify!(lzma_block), "::", stringify!(reserved_int5) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_int6) as usize - ptr as usize }, 160usize, concat!( "Offset of field: ", stringify!(lzma_block), "::", stringify!(reserved_int6) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_int7) as usize - ptr as usize }, 168usize, concat!( "Offset of field: ", stringify!(lzma_block), "::", stringify!(reserved_int7) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_int8) as usize - ptr as usize }, 176usize, concat!( "Offset of field: ", stringify!(lzma_block), "::", stringify!(reserved_int8) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_enum1) as usize - ptr as usize }, 184usize, concat!( "Offset of field: ", stringify!(lzma_block), "::", stringify!(reserved_enum1) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_enum2) as usize - ptr as usize }, 188usize, concat!( "Offset of field: ", stringify!(lzma_block), "::", stringify!(reserved_enum2) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_enum3) as usize - ptr as usize }, 192usize, concat!( "Offset of field: ", stringify!(lzma_block), "::", stringify!(reserved_enum3) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_enum4) as usize - ptr as usize }, 196usize, concat!( "Offset of field: ", stringify!(lzma_block), "::", stringify!(reserved_enum4) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).ignore_check) as usize - ptr as usize }, 200usize, concat!( "Offset of field: ", stringify!(lzma_block), "::", stringify!(ignore_check) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_bool2) as usize - ptr as usize }, 201usize, concat!( "Offset of field: ", stringify!(lzma_block), "::", stringify!(reserved_bool2) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_bool3) as usize - ptr as usize }, 202usize, concat!( "Offset of field: ", stringify!(lzma_block), "::", stringify!(reserved_bool3) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_bool4) as usize - ptr as usize }, 203usize, concat!( "Offset of field: ", stringify!(lzma_block), "::", stringify!(reserved_bool4) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_bool5) as usize - ptr as usize }, 204usize, concat!( "Offset of field: ", stringify!(lzma_block), "::", stringify!(reserved_bool5) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_bool6) as usize - ptr as usize }, 205usize, concat!( "Offset of field: ", stringify!(lzma_block), "::", stringify!(reserved_bool6) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_bool7) as usize - ptr as usize }, 206usize, concat!( "Offset of field: ", stringify!(lzma_block), "::", stringify!(reserved_bool7) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_bool8) as usize - ptr as usize }, 207usize, concat!( "Offset of field: ", stringify!(lzma_block), "::", stringify!(reserved_bool8) ) ); } extern "C" { pub fn lzma_block_header_size(block: *mut lzma_block) -> lzma_ret; } extern "C" { pub fn lzma_block_header_encode(block: *const lzma_block, out: *mut u8) -> lzma_ret; } extern "C" { pub fn lzma_block_header_decode( block: *mut lzma_block, allocator: *const lzma_allocator, in_: *const u8, ) -> lzma_ret; } extern "C" { pub fn lzma_block_compressed_size(block: *mut lzma_block, unpadded_size: lzma_vli) -> lzma_ret; } extern "C" { pub fn lzma_block_unpadded_size(block: *const lzma_block) -> lzma_vli; } extern "C" { pub fn lzma_block_total_size(block: *const lzma_block) -> lzma_vli; } extern "C" { pub fn lzma_block_encoder(strm: *mut lzma_stream, block: *mut lzma_block) -> lzma_ret; } extern "C" { pub fn lzma_block_decoder(strm: *mut lzma_stream, block: *mut lzma_block) -> lzma_ret; } extern "C" { pub fn lzma_block_buffer_bound(uncompressed_size: usize) -> usize; } extern "C" { pub fn lzma_block_buffer_encode( block: *mut lzma_block, allocator: *const lzma_allocator, in_: *const u8, in_size: usize, out: *mut u8, out_pos: *mut usize, out_size: usize, ) -> lzma_ret; } extern "C" { pub fn lzma_block_uncomp_encode( block: *mut lzma_block, in_: *const u8, in_size: usize, out: *mut u8, out_pos: *mut usize, out_size: usize, ) -> lzma_ret; } extern "C" { pub fn lzma_block_buffer_decode( block: *mut lzma_block, allocator: *const lzma_allocator, in_: *const u8, in_pos: *mut usize, in_size: usize, out: *mut u8, out_pos: *mut usize, out_size: usize, ) -> lzma_ret; } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct lzma_index_s { _unused: [u8; 0], } pub type lzma_index = lzma_index_s; #[repr(C)] #[derive(Copy, Clone)] pub struct lzma_index_iter { pub stream: lzma_index_iter__bindgen_ty_1, pub block: lzma_index_iter__bindgen_ty_2, pub internal: [lzma_index_iter__bindgen_ty_3; 6usize], } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct lzma_index_iter__bindgen_ty_1 { pub flags: *const lzma_stream_flags, pub reserved_ptr1: *const ::std::os::raw::c_void, pub reserved_ptr2: *const ::std::os::raw::c_void, pub reserved_ptr3: *const ::std::os::raw::c_void, pub number: lzma_vli, pub block_count: lzma_vli, pub compressed_offset: lzma_vli, pub uncompressed_offset: lzma_vli, pub compressed_size: lzma_vli, pub uncompressed_size: lzma_vli, pub padding: lzma_vli, pub reserved_vli1: lzma_vli, pub reserved_vli2: lzma_vli, pub reserved_vli3: lzma_vli, pub reserved_vli4: lzma_vli, } #[test] fn bindgen_test_layout_lzma_index_iter__bindgen_ty_1() { const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 120usize, concat!("Size of: ", stringify!(lzma_index_iter__bindgen_ty_1)) ); assert_eq!( ::std::mem::align_of::(), 8usize, concat!("Alignment of ", stringify!(lzma_index_iter__bindgen_ty_1)) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", stringify!(lzma_index_iter__bindgen_ty_1), "::", stringify!(flags) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_ptr1) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", stringify!(lzma_index_iter__bindgen_ty_1), "::", stringify!(reserved_ptr1) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_ptr2) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", stringify!(lzma_index_iter__bindgen_ty_1), "::", stringify!(reserved_ptr2) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_ptr3) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", stringify!(lzma_index_iter__bindgen_ty_1), "::", stringify!(reserved_ptr3) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).number) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", stringify!(lzma_index_iter__bindgen_ty_1), "::", stringify!(number) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).block_count) as usize - ptr as usize }, 40usize, concat!( "Offset of field: ", stringify!(lzma_index_iter__bindgen_ty_1), "::", stringify!(block_count) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).compressed_offset) as usize - ptr as usize }, 48usize, concat!( "Offset of field: ", stringify!(lzma_index_iter__bindgen_ty_1), "::", stringify!(compressed_offset) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).uncompressed_offset) as usize - ptr as usize }, 56usize, concat!( "Offset of field: ", stringify!(lzma_index_iter__bindgen_ty_1), "::", stringify!(uncompressed_offset) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).compressed_size) as usize - ptr as usize }, 64usize, concat!( "Offset of field: ", stringify!(lzma_index_iter__bindgen_ty_1), "::", stringify!(compressed_size) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).uncompressed_size) as usize - ptr as usize }, 72usize, concat!( "Offset of field: ", stringify!(lzma_index_iter__bindgen_ty_1), "::", stringify!(uncompressed_size) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).padding) as usize - ptr as usize }, 80usize, concat!( "Offset of field: ", stringify!(lzma_index_iter__bindgen_ty_1), "::", stringify!(padding) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_vli1) as usize - ptr as usize }, 88usize, concat!( "Offset of field: ", stringify!(lzma_index_iter__bindgen_ty_1), "::", stringify!(reserved_vli1) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_vli2) as usize - ptr as usize }, 96usize, concat!( "Offset of field: ", stringify!(lzma_index_iter__bindgen_ty_1), "::", stringify!(reserved_vli2) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_vli3) as usize - ptr as usize }, 104usize, concat!( "Offset of field: ", stringify!(lzma_index_iter__bindgen_ty_1), "::", stringify!(reserved_vli3) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_vli4) as usize - ptr as usize }, 112usize, concat!( "Offset of field: ", stringify!(lzma_index_iter__bindgen_ty_1), "::", stringify!(reserved_vli4) ) ); } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct lzma_index_iter__bindgen_ty_2 { pub number_in_file: lzma_vli, pub compressed_file_offset: lzma_vli, pub uncompressed_file_offset: lzma_vli, pub number_in_stream: lzma_vli, pub compressed_stream_offset: lzma_vli, pub uncompressed_stream_offset: lzma_vli, pub uncompressed_size: lzma_vli, pub unpadded_size: lzma_vli, pub total_size: lzma_vli, pub reserved_vli1: lzma_vli, pub reserved_vli2: lzma_vli, pub reserved_vli3: lzma_vli, pub reserved_vli4: lzma_vli, pub reserved_ptr1: *const ::std::os::raw::c_void, pub reserved_ptr2: *const ::std::os::raw::c_void, pub reserved_ptr3: *const ::std::os::raw::c_void, pub reserved_ptr4: *const ::std::os::raw::c_void, } #[test] fn bindgen_test_layout_lzma_index_iter__bindgen_ty_2() { const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 136usize, concat!("Size of: ", stringify!(lzma_index_iter__bindgen_ty_2)) ); assert_eq!( ::std::mem::align_of::(), 8usize, concat!("Alignment of ", stringify!(lzma_index_iter__bindgen_ty_2)) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).number_in_file) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", stringify!(lzma_index_iter__bindgen_ty_2), "::", stringify!(number_in_file) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).compressed_file_offset) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", stringify!(lzma_index_iter__bindgen_ty_2), "::", stringify!(compressed_file_offset) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).uncompressed_file_offset) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", stringify!(lzma_index_iter__bindgen_ty_2), "::", stringify!(uncompressed_file_offset) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).number_in_stream) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", stringify!(lzma_index_iter__bindgen_ty_2), "::", stringify!(number_in_stream) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).compressed_stream_offset) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", stringify!(lzma_index_iter__bindgen_ty_2), "::", stringify!(compressed_stream_offset) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).uncompressed_stream_offset) as usize - ptr as usize }, 40usize, concat!( "Offset of field: ", stringify!(lzma_index_iter__bindgen_ty_2), "::", stringify!(uncompressed_stream_offset) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).uncompressed_size) as usize - ptr as usize }, 48usize, concat!( "Offset of field: ", stringify!(lzma_index_iter__bindgen_ty_2), "::", stringify!(uncompressed_size) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).unpadded_size) as usize - ptr as usize }, 56usize, concat!( "Offset of field: ", stringify!(lzma_index_iter__bindgen_ty_2), "::", stringify!(unpadded_size) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).total_size) as usize - ptr as usize }, 64usize, concat!( "Offset of field: ", stringify!(lzma_index_iter__bindgen_ty_2), "::", stringify!(total_size) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_vli1) as usize - ptr as usize }, 72usize, concat!( "Offset of field: ", stringify!(lzma_index_iter__bindgen_ty_2), "::", stringify!(reserved_vli1) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_vli2) as usize - ptr as usize }, 80usize, concat!( "Offset of field: ", stringify!(lzma_index_iter__bindgen_ty_2), "::", stringify!(reserved_vli2) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_vli3) as usize - ptr as usize }, 88usize, concat!( "Offset of field: ", stringify!(lzma_index_iter__bindgen_ty_2), "::", stringify!(reserved_vli3) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_vli4) as usize - ptr as usize }, 96usize, concat!( "Offset of field: ", stringify!(lzma_index_iter__bindgen_ty_2), "::", stringify!(reserved_vli4) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_ptr1) as usize - ptr as usize }, 104usize, concat!( "Offset of field: ", stringify!(lzma_index_iter__bindgen_ty_2), "::", stringify!(reserved_ptr1) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_ptr2) as usize - ptr as usize }, 112usize, concat!( "Offset of field: ", stringify!(lzma_index_iter__bindgen_ty_2), "::", stringify!(reserved_ptr2) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_ptr3) as usize - ptr as usize }, 120usize, concat!( "Offset of field: ", stringify!(lzma_index_iter__bindgen_ty_2), "::", stringify!(reserved_ptr3) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved_ptr4) as usize - ptr as usize }, 128usize, concat!( "Offset of field: ", stringify!(lzma_index_iter__bindgen_ty_2), "::", stringify!(reserved_ptr4) ) ); } #[repr(C)] #[derive(Copy, Clone)] pub union lzma_index_iter__bindgen_ty_3 { pub p: *const ::std::os::raw::c_void, pub s: usize, pub v: lzma_vli, } #[test] fn bindgen_test_layout_lzma_index_iter__bindgen_ty_3() { 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!(lzma_index_iter__bindgen_ty_3)) ); assert_eq!( ::std::mem::align_of::(), 8usize, concat!("Alignment of ", stringify!(lzma_index_iter__bindgen_ty_3)) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).p) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", stringify!(lzma_index_iter__bindgen_ty_3), "::", stringify!(p) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).s) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", stringify!(lzma_index_iter__bindgen_ty_3), "::", stringify!(s) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).v) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", stringify!(lzma_index_iter__bindgen_ty_3), "::", stringify!(v) ) ); } #[test] fn bindgen_test_layout_lzma_index_iter() { const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 304usize, concat!("Size of: ", stringify!(lzma_index_iter)) ); assert_eq!( ::std::mem::align_of::(), 8usize, concat!("Alignment of ", stringify!(lzma_index_iter)) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).stream) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", stringify!(lzma_index_iter), "::", stringify!(stream) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).block) as usize - ptr as usize }, 120usize, concat!( "Offset of field: ", stringify!(lzma_index_iter), "::", stringify!(block) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).internal) as usize - ptr as usize }, 256usize, concat!( "Offset of field: ", stringify!(lzma_index_iter), "::", stringify!(internal) ) ); } pub const lzma_index_iter_mode_LZMA_INDEX_ITER_ANY: lzma_index_iter_mode = 0; pub const lzma_index_iter_mode_LZMA_INDEX_ITER_STREAM: lzma_index_iter_mode = 1; pub const lzma_index_iter_mode_LZMA_INDEX_ITER_BLOCK: lzma_index_iter_mode = 2; pub const lzma_index_iter_mode_LZMA_INDEX_ITER_NONEMPTY_BLOCK: lzma_index_iter_mode = 3; pub type lzma_index_iter_mode = ::std::os::raw::c_uint; extern "C" { pub fn lzma_index_memusage(streams: lzma_vli, blocks: lzma_vli) -> u64; } extern "C" { pub fn lzma_index_memused(i: *const lzma_index) -> u64; } extern "C" { pub fn lzma_index_init(allocator: *const lzma_allocator) -> *mut lzma_index; } extern "C" { pub fn lzma_index_end(i: *mut lzma_index, allocator: *const lzma_allocator); } extern "C" { pub fn lzma_index_append( i: *mut lzma_index, allocator: *const lzma_allocator, unpadded_size: lzma_vli, uncompressed_size: lzma_vli, ) -> lzma_ret; } extern "C" { pub fn lzma_index_stream_flags( i: *mut lzma_index, stream_flags: *const lzma_stream_flags, ) -> lzma_ret; } extern "C" { pub fn lzma_index_checks(i: *const lzma_index) -> u32; } extern "C" { pub fn lzma_index_stream_padding(i: *mut lzma_index, stream_padding: lzma_vli) -> lzma_ret; } extern "C" { pub fn lzma_index_stream_count(i: *const lzma_index) -> lzma_vli; } extern "C" { pub fn lzma_index_block_count(i: *const lzma_index) -> lzma_vli; } extern "C" { pub fn lzma_index_size(i: *const lzma_index) -> lzma_vli; } extern "C" { pub fn lzma_index_stream_size(i: *const lzma_index) -> lzma_vli; } extern "C" { pub fn lzma_index_total_size(i: *const lzma_index) -> lzma_vli; } extern "C" { pub fn lzma_index_file_size(i: *const lzma_index) -> lzma_vli; } extern "C" { pub fn lzma_index_uncompressed_size(i: *const lzma_index) -> lzma_vli; } extern "C" { pub fn lzma_index_iter_init(iter: *mut lzma_index_iter, i: *const lzma_index); } extern "C" { pub fn lzma_index_iter_rewind(iter: *mut lzma_index_iter); } extern "C" { pub fn lzma_index_iter_next( iter: *mut lzma_index_iter, mode: lzma_index_iter_mode, ) -> lzma_bool; } extern "C" { pub fn lzma_index_iter_locate(iter: *mut lzma_index_iter, target: lzma_vli) -> lzma_bool; } extern "C" { pub fn lzma_index_cat( dest: *mut lzma_index, src: *mut lzma_index, allocator: *const lzma_allocator, ) -> lzma_ret; } extern "C" { pub fn lzma_index_dup( i: *const lzma_index, allocator: *const lzma_allocator, ) -> *mut lzma_index; } extern "C" { pub fn lzma_index_encoder(strm: *mut lzma_stream, i: *const lzma_index) -> lzma_ret; } extern "C" { pub fn lzma_index_decoder( strm: *mut lzma_stream, i: *mut *mut lzma_index, memlimit: u64, ) -> lzma_ret; } extern "C" { pub fn lzma_index_buffer_encode( i: *const lzma_index, out: *mut u8, out_pos: *mut usize, out_size: usize, ) -> lzma_ret; } extern "C" { pub fn lzma_index_buffer_decode( i: *mut *mut lzma_index, memlimit: *mut u64, allocator: *const lzma_allocator, in_: *const u8, in_pos: *mut usize, in_size: usize, ) -> lzma_ret; } extern "C" { pub fn lzma_file_info_decoder( strm: *mut lzma_stream, dest_index: *mut *mut lzma_index, memlimit: u64, file_size: u64, ) -> lzma_ret; } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct lzma_index_hash_s { _unused: [u8; 0], } pub type lzma_index_hash = lzma_index_hash_s; extern "C" { pub fn lzma_index_hash_init( index_hash: *mut lzma_index_hash, allocator: *const lzma_allocator, ) -> *mut lzma_index_hash; } extern "C" { pub fn lzma_index_hash_end(index_hash: *mut lzma_index_hash, allocator: *const lzma_allocator); } extern "C" { pub fn lzma_index_hash_append( index_hash: *mut lzma_index_hash, unpadded_size: lzma_vli, uncompressed_size: lzma_vli, ) -> lzma_ret; } extern "C" { pub fn lzma_index_hash_decode( index_hash: *mut lzma_index_hash, in_: *const u8, in_pos: *mut usize, in_size: usize, ) -> lzma_ret; } extern "C" { pub fn lzma_index_hash_size(index_hash: *const lzma_index_hash) -> lzma_vli; } extern "C" { pub fn lzma_physmem() -> u64; } extern "C" { pub fn lzma_cputhreads() -> u32; } liblzma-sys-0.3.7/src/bindgen_wrap.rs000064400000000000000000000061141046102023000156770ustar 00000000000000pub use crate::bindgen::*; // lzma_action pub const LZMA_RUN: lzma_action = lzma_action_LZMA_RUN; pub const LZMA_SYNC_FLUSH: lzma_action = lzma_action_LZMA_SYNC_FLUSH; pub const LZMA_FULL_FLUSH: lzma_action = lzma_action_LZMA_FULL_FLUSH; pub const LZMA_FULL_BARRIER: lzma_action = lzma_action_LZMA_FULL_BARRIER; pub const LZMA_FINISH: lzma_action = lzma_action_LZMA_FINISH; // lzma_check pub const LZMA_CHECK_NONE: lzma_check = lzma_check_LZMA_CHECK_NONE; pub const LZMA_CHECK_CRC32: lzma_check = lzma_check_LZMA_CHECK_CRC32; pub const LZMA_CHECK_CRC64: lzma_check = lzma_check_LZMA_CHECK_CRC64; pub const LZMA_CHECK_SHA256: lzma_check = lzma_check_LZMA_CHECK_SHA256; // lzma_mode pub const LZMA_MODE_FAST: lzma_mode = lzma_mode_LZMA_MODE_FAST; pub const LZMA_MODE_NORMAL: lzma_mode = lzma_mode_LZMA_MODE_NORMAL; // lzma_match_finder pub const LZMA_MF_HC3: lzma_match_finder = lzma_match_finder_LZMA_MF_HC3; pub const LZMA_MF_HC4: lzma_match_finder = lzma_match_finder_LZMA_MF_HC4; pub const LZMA_MF_BT2: lzma_match_finder = lzma_match_finder_LZMA_MF_BT2; pub const LZMA_MF_BT3: lzma_match_finder = lzma_match_finder_LZMA_MF_BT3; pub const LZMA_MF_BT4: lzma_match_finder = lzma_match_finder_LZMA_MF_BT4; // macros pub const LZMA_TELL_NO_CHECK: u32 = 0x01; pub const LZMA_TELL_UNSUPPORTED_CHECK: u32 = 0x02; pub const LZMA_TELL_ANY_CHECK: u32 = 0x04; pub const LZMA_IGNORE_CHECK: u32 = 0x10; pub const LZMA_CONCATENATED: u32 = 0x08; pub const LZMA_PRESET_DEFAULT: u32 = 6; pub const LZMA_PRESET_LEVEL_MASK: u32 = 0x1f; pub const LZMA_PRESET_EXTREME: u32 = 1 << 31; pub const LZMA_DICT_SIZE_MIN: u32 = 4096; pub const LZMA_DICT_SIZE_DEFAULT: u32 = 1 << 23; pub const LZMA_BACKWARD_SIZE_MIN: lzma_vli = 4; pub const LZMA_BACKWARD_SIZE_MAX: lzma_vli = 1 << 34; // filters pub const LZMA_FILTER_X86: lzma_vli = 0x04; pub const LZMA_FILTER_POWERPC: lzma_vli = 0x05; pub const LZMA_FILTER_IA64: lzma_vli = 0x06; pub const LZMA_FILTER_ARM: lzma_vli = 0x07; pub const LZMA_FILTER_ARMTHUMB: lzma_vli = 0x08; pub const LZMA_FILTER_SPARC: lzma_vli = 0x09; pub const LZMA_FILTER_ARM64: lzma_vli = 0x0A; pub const LZMA_FILTER_DELTA: lzma_vli = 0x03; pub const LZMA_FILTER_RISCV: lzma_vli = 0x0B; pub const LZMA_FILTER_LZMA1: lzma_vli = 0x4000000000000001; pub const LZMA_FILTER_LZMA2: lzma_vli = 0x21; // status pub const LZMA_OK: lzma_ret = lzma_ret_LZMA_OK; pub const LZMA_STREAM_END: lzma_ret = lzma_ret_LZMA_STREAM_END; pub const LZMA_NO_CHECK: lzma_ret = lzma_ret_LZMA_NO_CHECK; pub const LZMA_UNSUPPORTED_CHECK: lzma_ret = lzma_ret_LZMA_UNSUPPORTED_CHECK; pub const LZMA_GET_CHECK: lzma_ret = lzma_ret_LZMA_GET_CHECK; pub const LZMA_MEM_ERROR: lzma_ret = lzma_ret_LZMA_MEM_ERROR; pub const LZMA_MEMLIMIT_ERROR: lzma_ret = lzma_ret_LZMA_MEMLIMIT_ERROR; pub const LZMA_FORMAT_ERROR: lzma_ret = lzma_ret_LZMA_FORMAT_ERROR; pub const LZMA_OPTIONS_ERROR: lzma_ret = lzma_ret_LZMA_OPTIONS_ERROR; pub const LZMA_DATA_ERROR: lzma_ret = lzma_ret_LZMA_DATA_ERROR; pub const LZMA_BUF_ERROR: lzma_ret = lzma_ret_LZMA_BUF_ERROR; pub const LZMA_PROG_ERROR: lzma_ret = lzma_ret_LZMA_PROG_ERROR; pub const LZMA_SEEK_NEEDED: lzma_ret = lzma_ret_LZMA_SEEK_NEEDED; liblzma-sys-0.3.7/src/lib.rs000064400000000000000000000004631046102023000140070ustar 00000000000000#![allow(bad_style)] #[cfg(feature = "bindgen")] mod bindgen; #[cfg(feature = "bindgen")] mod bindgen_wrap; #[cfg(not(feature = "bindgen"))] mod manual; #[cfg(target_arch = "wasm32")] mod wasm_shim; #[cfg(feature = "bindgen")] pub use bindgen_wrap::*; #[cfg(not(feature = "bindgen"))] pub use manual::*; liblzma-sys-0.3.7/src/manual.rs000064400000000000000000000276001046102023000145200ustar 00000000000000use libc::{c_char, c_uchar, c_void, size_t}; use std::u64; #[cfg(target_env = "msvc")] #[doc(hidden)] pub type __enum_ty = libc::c_int; #[cfg(not(target_env = "msvc"))] #[doc(hidden)] pub type __enum_ty = libc::c_uint; pub type lzma_bool = c_uchar; pub type lzma_ret = __enum_ty; pub type lzma_action = __enum_ty; type lzma_reserved_enum = __enum_ty; pub type lzma_check = __enum_ty; pub type lzma_vli = u64; pub type lzma_mode = __enum_ty; pub type lzma_match_finder = __enum_ty; pub const LZMA_OK: lzma_ret = 0; pub const LZMA_STREAM_END: lzma_ret = 1; pub const LZMA_NO_CHECK: lzma_ret = 2; pub const LZMA_UNSUPPORTED_CHECK: lzma_ret = 3; pub const LZMA_GET_CHECK: lzma_ret = 4; pub const LZMA_MEM_ERROR: lzma_ret = 5; pub const LZMA_MEMLIMIT_ERROR: lzma_ret = 6; pub const LZMA_FORMAT_ERROR: lzma_ret = 7; pub const LZMA_OPTIONS_ERROR: lzma_ret = 8; pub const LZMA_DATA_ERROR: lzma_ret = 9; pub const LZMA_BUF_ERROR: lzma_ret = 10; pub const LZMA_PROG_ERROR: lzma_ret = 11; pub const LZMA_SEEK_NEEDED: lzma_ret = 12; pub const LZMA_RUN: lzma_action = 0; pub const LZMA_SYNC_FLUSH: lzma_action = 1; pub const LZMA_FULL_FLUSH: lzma_action = 2; pub const LZMA_FULL_BARRIER: lzma_action = 4; pub const LZMA_FINISH: lzma_action = 3; pub const LZMA_CHECK_NONE: lzma_check = 0; pub const LZMA_CHECK_CRC32: lzma_check = 1; pub const LZMA_CHECK_CRC64: lzma_check = 4; pub const LZMA_CHECK_SHA256: lzma_check = 10; pub const LZMA_MODE_FAST: lzma_mode = 1; pub const LZMA_MODE_NORMAL: lzma_mode = 2; pub const LZMA_MF_HC3: lzma_match_finder = 0x03; pub const LZMA_MF_HC4: lzma_match_finder = 0x04; pub const LZMA_MF_BT2: lzma_match_finder = 0x12; pub const LZMA_MF_BT3: lzma_match_finder = 0x13; pub const LZMA_MF_BT4: lzma_match_finder = 0x14; pub const LZMA_TELL_NO_CHECK: u32 = 0x01; pub const LZMA_TELL_UNSUPPORTED_CHECK: u32 = 0x02; pub const LZMA_TELL_ANY_CHECK: u32 = 0x04; pub const LZMA_IGNORE_CHECK: u32 = 0x10; pub const LZMA_CONCATENATED: u32 = 0x08; pub const LZMA_PRESET_DEFAULT: u32 = 6; pub const LZMA_PRESET_LEVEL_MASK: u32 = 0x1f; pub const LZMA_PRESET_EXTREME: u32 = 1 << 31; pub const LZMA_DICT_SIZE_MIN: u32 = 4096; pub const LZMA_DICT_SIZE_DEFAULT: u32 = 1 << 23; pub const LZMA_LCLP_MIN: u32 = 0; pub const LZMA_LCLP_MAX: u32 = 4; pub const LZMA_LC_DEFAULT: u32 = 3; pub const LZMA_LP_DEFAULT: u32 = 0; pub const LZMA_PB_MIN: u32 = 0; pub const LZMA_PB_MAX: u32 = 4; pub const LZMA_PB_DEFAULT: u32 = 2; pub const LZMA_BACKWARD_SIZE_MIN: lzma_vli = 4; pub const LZMA_BACKWARD_SIZE_MAX: lzma_vli = 1 << 34; pub const LZMA_VLI_MAX: lzma_vli = u64::MAX / 2; pub const LZMA_VLI_UNKNOWN: lzma_vli = u64::MAX; pub const LZMA_VLI_BYTES_MAX: usize = 9; pub const LZMA_FILTER_X86: lzma_vli = 0x04; pub const LZMA_FILTER_POWERPC: lzma_vli = 0x05; pub const LZMA_FILTER_IA64: lzma_vli = 0x06; pub const LZMA_FILTER_ARM: lzma_vli = 0x07; pub const LZMA_FILTER_ARMTHUMB: lzma_vli = 0x08; pub const LZMA_FILTER_SPARC: lzma_vli = 0x09; pub const LZMA_FILTER_ARM64: lzma_vli = 0x0A; pub const LZMA_FILTER_DELTA: lzma_vli = 0x03; pub const LZMA_FILTER_RISCV: lzma_vli = 0x0B; pub const LZMA_FILTER_LZMA1: lzma_vli = 0x4000000000000001; pub const LZMA_FILTER_LZMA2: lzma_vli = 0x21; #[repr(C)] pub struct lzma_allocator { pub alloc: Option *mut c_void>, pub free: Option, pub opaque: *mut c_void, } pub enum lzma_internal {} #[repr(C)] pub struct lzma_stream { pub next_in: *const u8, pub avail_in: size_t, pub total_in: u64, pub next_out: *mut u8, pub avail_out: size_t, pub total_out: u64, pub allocator: *const lzma_allocator, internal: *mut lzma_internal, reserved_ptr1: *mut c_void, reserved_ptr2: *mut c_void, reserved_ptr3: *mut c_void, reserved_ptr4: *mut c_void, reserved_int1: u64, reserved_int2: u64, reserved_int3: size_t, reserved_int4: size_t, reserved_enum1: lzma_reserved_enum, reserved_enum2: lzma_reserved_enum, } #[repr(C)] pub struct lzma_filter { pub id: lzma_vli, pub options: *mut c_void, } #[cfg(feature = "parallel")] #[repr(C)] pub struct lzma_mt { pub flags: u32, pub threads: u32, pub block_size: u64, pub timeout: u32, pub preset: u32, pub filters: *const lzma_filter, pub check: lzma_check, reserved_enum1: lzma_reserved_enum, reserved_enum2: lzma_reserved_enum, reserved_enum3: lzma_reserved_enum, reserved_int1: u32, reserved_int2: u32, reserved_int3: u32, reserved_int4: u32, pub memlimit_threading: u64, pub memlimit_stop: u64, reserved_int7: u64, reserved_int8: u64, reserved_ptr1: *mut c_void, reserved_ptr2: *mut c_void, reserved_ptr3: *mut c_void, reserved_ptr4: *mut c_void, } #[repr(C)] #[derive(Copy, Clone)] pub struct lzma_options_lzma { pub dict_size: u32, pub preset_dict: *const u8, pub preset_dict_size: u32, pub lc: u32, pub lp: u32, pub pb: u32, pub mode: lzma_mode, pub nice_len: u32, pub mf: lzma_match_finder, pub depth: u32, reserved_int1: u32, reserved_int2: u32, reserved_int3: u32, reserved_int4: u32, reserved_int5: u32, reserved_int6: u32, reserved_int7: u32, reserved_int8: u32, reserved_enum1: lzma_reserved_enum, reserved_enum2: lzma_reserved_enum, reserved_enum3: lzma_reserved_enum, reserved_enum4: lzma_reserved_enum, reserved_ptr1: *mut c_void, reserved_ptr2: *mut c_void, } #[repr(C)] pub struct lzma_stream_flags { pub version: u32, pub backward_size: lzma_vli, pub check: lzma_check, reserved_enum1: lzma_reserved_enum, reserved_enum2: lzma_reserved_enum, reserved_enum3: lzma_reserved_enum, reserved_enum4: lzma_reserved_enum, reserved_bool1: lzma_bool, reserved_bool2: lzma_bool, reserved_bool3: lzma_bool, reserved_bool4: lzma_bool, reserved_bool5: lzma_bool, reserved_bool6: lzma_bool, reserved_bool7: lzma_bool, reserved_bool8: lzma_bool, reserved_int1: u32, reserved_int2: u32, } #[repr(C)] pub struct lzma_options_bcj { pub start_offset: u32, } extern "C" { pub fn lzma_code(strm: *mut lzma_stream, action: lzma_action) -> lzma_ret; pub fn lzma_end(strm: *mut lzma_stream); pub fn lzma_get_progress(strm: *mut lzma_stream, progress_in: *mut u64, progress_out: *mut u64); pub fn lzma_memusage(strm: *const lzma_stream) -> u64; pub fn lzma_memlimit_get(strm: *const lzma_stream) -> u64; pub fn lzma_memlimit_set(strm: *mut lzma_stream, memlimit: u64) -> lzma_ret; pub fn lzma_easy_encoder_memusage(preset: u32) -> u64; pub fn lzma_easy_decoder_memusage(preset: u32) -> u64; pub fn lzma_easy_encoder(strm: *mut lzma_stream, preset: u32, check: lzma_check) -> lzma_ret; pub fn lzma_easy_buffer_encode( preset: u32, check: lzma_check, allocator: *const lzma_allocator, input: *const u8, in_size: size_t, out: *mut u8, out_pos: *mut size_t, out_size: size_t, ) -> lzma_ret; pub fn lzma_stream_encoder( strm: *mut lzma_stream, filters: *const lzma_filter, check: lzma_check, ) -> lzma_ret; #[cfg(feature = "parallel")] pub fn lzma_stream_encoder_mt_memusage(options: *const lzma_mt) -> u64; #[cfg(feature = "parallel")] pub fn lzma_stream_encoder_mt(strm: *mut lzma_stream, options: *const lzma_mt) -> lzma_ret; #[cfg(feature = "parallel")] pub fn lzma_stream_decoder_mt(strm: *mut lzma_stream, options: *const lzma_mt) -> lzma_ret; #[cfg(feature = "parallel")] pub fn lzma_mt_block_size(filters: *const crate::lzma_filter) -> u64; pub fn lzma_alone_encoder( strm: *mut lzma_stream, options: *const lzma_options_lzma, ) -> lzma_ret; pub fn lzma_stream_buffer_bound(uncompressed_size: size_t) -> size_t; pub fn lzma_stream_buffer_encode( filters: *mut lzma_filter, check: lzma_check, allocator: *const lzma_allocator, input: *const u8, in_size: size_t, out: *mut u8, out_pos: *mut size_t, out_size: size_t, ) -> lzma_ret; pub fn lzma_stream_decoder(strm: *mut lzma_stream, memlimit: u64, flags: u32) -> lzma_ret; pub fn lzma_auto_decoder(strm: *mut lzma_stream, memlimit: u64, flags: u32) -> lzma_ret; pub fn lzma_alone_decoder(strm: *mut lzma_stream, memlimit: u64) -> lzma_ret; pub fn lzma_lzip_decoder(strm: *mut lzma_stream, memlimit: u64, flags: u32) -> lzma_ret; pub fn lzma_stream_buffer_decode( memlimit: *mut u64, flags: u32, allocator: *const lzma_allocator, input: *const u8, in_pos: *mut size_t, in_size: size_t, out: *mut u8, out_pos: *mut size_t, out_size: size_t, ) -> lzma_ret; pub fn lzma_check_is_supported(check: lzma_check) -> lzma_bool; pub fn lzma_check_size(check: lzma_check) -> u32; pub fn lzma_crc32(buf: *const u8, size: size_t, crc: u32) -> u32; pub fn lzma_crc64(buf: *const u8, size: size_t, crc: u64) -> u64; pub fn lzma_get_check(strm: *const lzma_stream) -> lzma_check; pub fn lzma_filter_encoder_is_supported(id: lzma_vli) -> lzma_bool; pub fn lzma_filter_decoder_is_supported(id: lzma_vli) -> lzma_bool; pub fn lzma_filters_copy( src: *const lzma_filter, dest: *mut lzma_filter, allocator: *const lzma_allocator, ) -> lzma_ret; pub fn lzma_raw_encoder_memusage(filters: *const lzma_filter) -> u64; pub fn lzma_raw_decoder_memusage(filters: *const lzma_filter) -> u64; pub fn lzma_raw_encoder(strm: *mut lzma_stream, filters: *const lzma_filter) -> lzma_ret; pub fn lzma_raw_decoder(strm: *mut lzma_stream, filters: *const lzma_filter) -> lzma_ret; pub fn lzma_filters_update(strm: *mut lzma_stream, filters: *const lzma_filter) -> lzma_ret; pub fn lzma_raw_buffer_encode( filters: *const lzma_filter, allocator: *const lzma_allocator, input: *const u8, in_size: size_t, out: *mut u8, out_pos: *mut size_t, out_size: size_t, ) -> lzma_ret; pub fn lzma_raw_buffer_decode( filters: *const lzma_filter, allocator: *const lzma_allocator, input: *const u8, in_pos: *mut size_t, in_size: size_t, out: *mut u8, out_pos: *mut size_t, out_size: size_t, ) -> lzma_ret; pub fn lzma_properties_size(size: *mut u32, filter: *const lzma_filter) -> lzma_ret; pub fn lzma_properties_encode(filter: *const lzma_filter, props: *mut u8) -> lzma_ret; pub fn lzma_properties_decode( filter: *mut lzma_filter, allocator: *const lzma_allocator, props: *const u8, props_size: size_t, ) -> lzma_ret; pub fn lzma_physmem() -> u64; pub fn lzma_cputhreads() -> u32; pub fn lzma_stream_header_encode(options: *const lzma_stream_flags, out: *mut u8) -> lzma_ret; pub fn lzma_stream_footer_encode(options: *const lzma_stream_flags, out: *mut u8) -> lzma_ret; pub fn lzma_stream_header_decode(options: *mut lzma_stream_flags, input: *const u8) -> lzma_ret; pub fn lzma_stream_footer_decode(options: *mut lzma_stream_flags, input: *const u8) -> lzma_ret; pub fn lzma_stream_flags_compare( a: *const lzma_stream_flags, b: *const lzma_stream_flags, ) -> lzma_ret; pub fn lzma_version_number() -> u32; pub fn lzma_version_string() -> *const c_char; pub fn lzma_vli_encode( vli: lzma_vli, vli_pos: *mut size_t, out: *mut u8, out_pos: *mut size_t, out_size: size_t, ) -> lzma_ret; pub fn lzma_vli_decode( vli: *mut lzma_vli, vli_pos: *mut size_t, input: *const u8, in_pos: *mut size_t, in_size: size_t, ) -> lzma_ret; pub fn lzma_vli_size(vli: lzma_vli) -> u32; pub fn lzma_lzma_preset(options: *mut lzma_options_lzma, preset: u32) -> lzma_bool; pub fn lzma_mf_is_supported(mf: lzma_match_finder) -> lzma_bool; } liblzma-sys-0.3.7/src/wasm_shim.rs000064400000000000000000000047751046102023000152420ustar 00000000000000use core::ffi::{c_char, c_int, c_void}; use std::alloc::{alloc, dealloc, Layout}; #[no_mangle] pub extern "C" fn rust_lzma_wasm_shim_malloc(size: usize) -> *mut c_void { unsafe { let layout = Layout::from_size_align_unchecked(size, 1); alloc(layout).cast() } } #[no_mangle] pub extern "C" fn rust_lzma_wasm_shim_calloc(nmemb: usize, size: usize) -> *mut c_void { unsafe { let layout = Layout::from_size_align_unchecked(size * nmemb, 1); alloc(layout).cast() } } #[no_mangle] pub unsafe extern "C" fn rust_lzma_wasm_shim_free(ptr: *mut c_void) { if ptr == std::ptr::null_mut() { return; } // layout is not actually used let layout = Layout::from_size_align_unchecked(1, 1); dealloc(ptr.cast(), layout); } #[no_mangle] pub extern "C" fn rust_lzma_wasm_shim_memcmp( str1: *const c_void, str2: *const c_void, n: usize, ) -> i32 { // Safety: function contracts requires str1 and str2 at least `n`-long. unsafe { let str1: &[u8] = core::slice::from_raw_parts(str1 as *const u8, n); let str2: &[u8] = core::slice::from_raw_parts(str2 as *const u8, n); match str1.cmp(str2) { core::cmp::Ordering::Less => -1, core::cmp::Ordering::Equal => 0, core::cmp::Ordering::Greater => 1, } } } #[no_mangle] pub unsafe extern "C" fn rust_lzma_wasm_shim_memcpy( dest: *mut c_void, src: *const c_void, n: usize, ) -> *mut c_void { core::ptr::copy_nonoverlapping(src as *const u8, dest as *mut u8, n); dest } #[no_mangle] pub unsafe extern "C" fn rust_lzma_wasm_shim_memmove( dest: *mut c_void, src: *const c_void, n: usize, ) -> *mut c_void { core::ptr::copy(src as *const u8, dest as *mut u8, n); dest } #[no_mangle] pub unsafe extern "C" fn rust_lzma_wasm_shim_memset( dest: *mut c_void, c: c_int, n: usize, ) -> *mut c_void { core::ptr::write_bytes(dest as *mut u8, c as u8, n); dest } #[no_mangle] pub unsafe extern "C" fn rust_lzma_wasm_shim_strlen(s: *const c_char) -> usize { let str = unsafe { std::ffi::CStr::from_ptr(s) }; str.to_bytes().len() } #[no_mangle] pub unsafe extern "C" fn rust_lzma_wasm_shim_memchr( s: *const c_void, c: c_int, n: usize, ) -> *mut c_void { let s_slice = unsafe { core::slice::from_raw_parts(s as *const u8, n) }; s_slice .iter() .position(|&r| r == c as u8) .map_or(core::ptr::null_mut(), |p| unsafe { s.add(p) as *mut c_void }) } liblzma-sys-0.3.7/wasm-shim/assert.h000064400000000000000000000001171046102023000154570ustar 00000000000000#ifndef _ASSERT_H #define _ASSERT_H #define assert(expr) #endif // _ASSERT_H liblzma-sys-0.3.7/wasm-shim/stdlib.h000064400000000000000000000007351046102023000154450ustar 00000000000000#include #ifndef _STDLIB_H #define _STDLIB_H 1 void *rust_lzma_wasm_shim_malloc(size_t size); void *rust_lzma_wasm_shim_calloc(size_t nmemb, size_t size); void rust_lzma_wasm_shim_free(void *ptr); inline void *malloc(size_t size) { return rust_lzma_wasm_shim_malloc(size); } inline void *calloc(size_t nmemb, size_t size) { return rust_lzma_wasm_shim_calloc(nmemb, size); } inline void free(void *ptr) { rust_lzma_wasm_shim_free(ptr); } #endif // _STDLIB_H liblzma-sys-0.3.7/wasm-shim/string.h000064400000000000000000000022141046102023000154640ustar 00000000000000#include #ifndef _STRING_H #define _STRING_H 1 int rust_lzma_wasm_shim_memcmp(const void *str1, const void *str2, size_t n); void *rust_lzma_wasm_shim_memcpy(void *restrict dest, const void *restrict src, size_t n); void *rust_lzma_wasm_shim_memmove(void *dest, const void *src, size_t n); void *rust_lzma_wasm_shim_memset(void *dest, int c, size_t n); size_t rust_lzma_wasm_shim_strlen(const char *s); void *rust_lzma_wasm_shim_memchr(const void *s, int c, size_t n); inline int memcmp(const void *str1, const void *str2, size_t n) { return rust_lzma_wasm_shim_memcmp(str1, str2, n); } inline void *memcpy(void *restrict dest, const void *restrict src, size_t n) { return rust_lzma_wasm_shim_memcpy(dest, src, n); } inline void *memmove(void *dest, const void *src, size_t n) { return rust_lzma_wasm_shim_memmove(dest, src, n); } inline void *memset(void *dest, int c, size_t n) { return rust_lzma_wasm_shim_memset(dest, c, n); } inline void *memchr(const void *s, int c, size_t n) { return rust_lzma_wasm_shim_memchr(s, c, n); } inline size_t strlen(const char *s) { return rust_lzma_wasm_shim_strlen(s); } #endif // _STRING_H