8 releases

0.1.7 May 18, 2023
0.1.6 Oct 3, 2022
0.1.5 Jun 17, 2021
0.1.1 Jan 16, 2021

#1281 in Text processing

Download history 232/week @ 2024-02-26 215/week @ 2024-03-04 154/week @ 2024-03-11 210/week @ 2024-03-18 184/week @ 2024-03-25 264/week @ 2024-04-01 286/week @ 2024-04-08 164/week @ 2024-04-15 180/week @ 2024-04-22 138/week @ 2024-04-29 135/week @ 2024-05-06 174/week @ 2024-05-13 143/week @ 2024-05-20 176/week @ 2024-05-27 157/week @ 2024-06-03 147/week @ 2024-06-10

651 downloads per month
Used in 20 crates (2 directly)

MIT license

132 lines

The tectonic_bridge_flate crate

This crate is part of the Tectonic project. It provides a limited C API to the flate2 crate. This API is consumed by other Tectonic crates that include C code that require flate2 functionality.

If your project depends on this crate, Cargo will export for your build script an environment variable named DEP_TECTONIC_BRIDGE_FLATE_INCLUDE, which will be the name of a directory containing the generated tectonic_bridge_flate.h file that exposes this crate’s C API.

You will need to ensure that your Rust code actually references this crate in order for the linker to include the C API symbols. A use statement will suffice:

use tectonic_bridge_flate::flate2;

Cargo features

The flate2 crate provides several Cargo features allowing control over the zlib implementation that it ultimately uses. This crate intentionally does not expose these features, because it is used by other crates that link with system libraries that can be expected to link to the system’s libz. Therefore, the only safe approach at this time is to force the use of the system libz here as well. Once the linking framework is built up, it will become possible to allow for more flexibility in this area.

Updating the generated header

This crate exposes Rust functions to C/C++ code using a header file created by cbindgen. To update the header, run:

cbindgen --output include/tectonic_bridge_flate.h


~25K SLoC