commit | 29585c1d6ae555c1488e7bdaab9494655dc0d0c4 | [log] [tgz] |
---|---|---|
author | David Brazdil <[email protected]> | Tue Jan 24 18:55:48 2023 +0000 |
committer | Automerger Merge Worker <[email protected]> | Tue Jan 24 18:55:48 2023 +0000 |
tree | 123d42d80ee66cda8e4ac2c0dbb56d9c16fefa83 | |
parent | 7ff13bf7fed1ee318753fb1052a9b731560227fa [diff] | |
parent | 5f47f6e7a2de5e806dd49ed3baef4a1b7f3a81cb [diff] |
Update TEST_MAPPING am: c4a85ccc20 am: f84a84c74b am: 5f47f6e7a2 Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/libz-sys/+/2399247 Change-Id: I7d66402e6dd1a0161d90f3f25aec069b308349d8 Signed-off-by: Automerger Merge Worker <[email protected]>
A common library for linking libz
to rust programs (also known as zlib).
This also serves as the source for the libz-ng-sys
crate, which builds zlib-ng natively (not in zlib-compat mode). See README-zng.md
for details.
This crate provides bindings to the raw low-level C API. For a higher-level safe API to work with DEFLATE, zlib, or gzip streams, see flate2
. flate2
also supports alternative implementations, including slower but pure Rust implementations.
This crate supports building either the high-performance zlib-ng (in zlib-compat mode), or the widely available stock zlib.
By default, libz-sys
uses stock zlib, primarily because doing so allows the use of a shared system zlib library if available.
Any application or library designed for zlib should work with zlib-ng in zlib-compat mode, as long as it doesn‘t make assumptions about the exact size or output of the deflated data (e.g. “compressing this data produces exactly this many bytes”), and as long as you don’t also dynamically pull in a copy of stock zlib (which will produce conflicting symbols). Nonetheless, for maximum compatibility, every library crate in a build must opt into allowing zlib-ng; if any library crate in your dependency graph wants stock zlib, libz-sys
will use stock zlib.
Library crates depending on libz-sys
should use:
libz-sys = { version = "1.1.0", default-features = false, features = ["libc"] }
(Omit the libc
feature if you don't require the corresponding functions.)
This allows higher-level crates depending on your library to opt into zlib-ng if desired.
Building zlib-ng requires cmake
.
This project is licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in libz-sys
by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.