• Home
Name Date Size #Lines LOC

..--

patches/04-Jul-2025-1211

src/04-Jul-2025-438375

zng/04-Jul-2025-568445

.android-checksum.jsonD04-Jul-20251.6 KiB11

.cargo-checksum.jsonD04-Jul-202520.8 KiB11

Android.bpD04-Jul-2025978 3935

Cargo.tomlD04-Jul-20252.4 KiB10797

LICENSED04-Jul-202510.6 KiB202169

LICENSE-APACHED04-Jul-202510.6 KiB202169

METADATAD04-Jul-2025410 1817

MODULE_LICENSE_APACHE2D04-Jul-20250

README-zng.mdD04-Jul-20252.3 KiB5842

README.androidD04-Jul-2025250 64

README.mdD04-Jul-20253.1 KiB8157

TEST_MAPPINGD04-Jul-2025683 3231

android_config.tomlD04-Jul-2025123 54

build.rsD04-Jul-20257.7 KiB245191

cargo_embargo.jsonD04-Jul-202547 54

README-zng.md

1# libz-ng-sys
2
3A library for linking zlib-ng (`libz-ng`) to Rust programs natively, rather
4than in zlib-compat mode.
5
6zlib-ng is a high-performance implementation of zlib. zlib-ng supports building
7in two modes: zlib-compat mode, in which it provides the same API as zlib and
8generally works as a drop-in replacement, and native mode, in which it provides
9its own API. The native API is almost identical to the zlib-compat API, except
10that some types use more correct sizes (rather than the sizes required for zlib
11compatibility), and the functions all have a `zng_` prefix. The latter allows
12zlib and zlib-ng to coexist in the same program.
13
14This crate provides bindings to the native zlib-ng API. However, for simplicity
15of porting, this crate exports the same API as libz-sys (without the `zng_`
16prefixes), making it easier to write Rust software compatible with both
17libz-sys and libz-ng-sys.
18
19# High-level API
20
21This crate provides bindings to the raw low-level C API. For a higher-level
22safe API to work with DEFLATE, zlib, or gzip streams, see
23[`flate2`](https://docs.rs/flate2). `flate2` supports many different
24implementations.
25
26# Development
27
28This crate is built from [the same sources as
29`libz-sys`](https://github.com/rust-lang/libz-sys). From within those sources,
30`Cargo.toml` is the manifest for `libz-sys`, and `Cargo-zng.toml` is the
31manifest for `libz-ng-sys`. The script `./cargo-zng` invokes Cargo on a
32temporary copy of the sources with `Cargo-zng.toml` replacing `Cargo.toml`; for
33instance, use `./cargo-zng publish` to publish `libz-ng-sys`.
34
35# Minimum Supported Rust Version (MSRV) Policy
36
37This crate uses the same MSRV policy as the
38[`flate2`](https://crates.io/crates/flate2) crate: This crate supports the
39current and previous stable versions of Rust. Older versions of Rust may work,
40but we don't guarantee these will continue to work.
41
42# License
43
44This project is licensed under either of
45
46 * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or
47   https://www.apache.org/licenses/LICENSE-2.0)
48 * MIT license ([LICENSE-MIT](LICENSE-MIT) or
49   https://opensource.org/license/mit/)
50
51at your option.
52
53### Contribution
54
55Unless you explicitly state otherwise, any contribution intentionally submitted
56for inclusion in this crate by you, as defined in the Apache-2.0 license, shall
57be dual licensed as above, without any additional terms or conditions.
58

README.android

1This package is imported to Android and uses Android's external/zlib
2header files and compilation flags to generate bindings.
3
4If features are changed for the libz-sys crate, please ensure those
5features are changed in the libz_bindgen_build module.
6

README.md

1# libz-sys
2
3A common library for linking `libz` to Rust programs (also known as zlib).
4
5[Documentation](https://docs.rs/libz-sys)
6
7This also serves as the source for the `libz-ng-sys` crate, which builds
8zlib-ng natively (not in zlib-compat mode). See
9[`README-zng.md`](README-zng.md) for details.
10
11# High-level API
12
13This crate provides bindings to the raw low-level C API. For a higher-level
14safe API to work with DEFLATE, zlib, or gzip streams, see
15[`flate2`](https://docs.rs/flate2). `flate2` also supports alternative
16implementations, including slower but pure Rust implementations.
17
18# zlib-ng
19
20This crate supports building either the high-performance zlib-ng (in
21zlib-compat mode), or the widely available stock zlib.
22
23By default, `libz-sys` uses stock zlib, primarily because doing so allows the
24use of a shared system zlib library if available.
25
26Any application or library designed for zlib should work with zlib-ng in
27zlib-compat mode, as long as it doesn't make assumptions about the exact size
28or output of the deflated data (e.g. "compressing this data produces exactly
29this many bytes"), and as long as you don't also dynamically pull in a copy of
30stock zlib (which will produce conflicting symbols). Nonetheless, for maximum
31compatibility, every library crate in a build must opt into allowing zlib-ng;
32if any library crate in your dependency graph wants stock zlib, `libz-sys` will
33use stock zlib.
34
35Library crates depending on `libz-sys` should use:
36
37```toml
38libz-sys = { version = "1.1", default-features = false, features = ["libc"] }
39```
40
41(Omit the `libc` feature if you don't require the corresponding functions.)
42
43This allows higher-level crates depending on your library to opt into zlib-ng
44if desired.
45
46Building zlib-ng requires `cmake` unless the
47`zlib-ng-no-cmake-experimental-community-maintained` feature is enabled,
48in which case `cc` is used instead. Note that this option enables _all_ compiler
49features that are supported for the given target, which may not compile on older
50compilers or targets without certain headers.
51
52Crates that don't require compatibility with the zlib C API, and use zlib
53exclusively from Rust or support the zlib-ng native C API (prefixed with
54`zng_`) can use [`libz-ng-sys`](https://crates.io/crates/libz-ng-sys) instead,
55which allows zlib and zlib-ng to coexist in the same program. See
56[README-zng.md](README-zng.md) for details.
57
58# Minimum Supported Rust Version (MSRV) Policy
59
60This crate uses the same MSRV policy as the
61[`flate2`](https://crates.io/crates/flate2) crate: This crate supports the
62current and previous stable versions of Rust. Older versions of Rust may work,
63but we don't guarantee these will continue to work.
64
65# License
66
67This project is licensed under either of
68
69* Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or
70   <https://www.apache.org/licenses/LICENSE-2.0>)
71* MIT license ([LICENSE-MIT](LICENSE-MIT) or
72   <https://opensource.org/license/mit/>)
73
74at your option.
75
76### Contribution
77
78Unless you explicitly state otherwise, any contribution intentionally submitted
79for inclusion in `libz-sys` by you, as defined in the Apache-2.0 license, shall
80be dual licensed as above, without any additional terms or conditions.
81