Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for the seekable format #310

Merged
merged 1 commit into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions zstd-safe/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,12 @@ arrays = []
no_asm = ["zstd-sys/no_asm"]
doc-cfg = []
zdict_builder = ["zstd-sys/zdict_builder"]
seekable = ["zstd-sys/seekable"]

# These two are for cross-language LTO.
# Will only work if `clang` is used to build the C library.
fat-lto = ["zstd-sys/fat-lto"]
thin-lto = ["zstd-sys/thin-lto"]

[lints.rust]
non_upper_case_globals = "allow"
6 changes: 6 additions & 0 deletions zstd-safe/src/constants_seekable.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// This file has been generated by ./update_consts.sh
pub const SEEKABLE_FRAMEINDEX_TOOLARGE: u64 = zstd_sys::ZSTD_SEEKABLE_FRAMEINDEX_TOOLARGE as u64;
pub const SEEKABLE_MAGICNUMBER: u32 = zstd_sys::ZSTD_SEEKABLE_MAGICNUMBER;
pub const SEEKABLE_MAX_FRAME_DECOMPRESSED_SIZE: u32 = zstd_sys::ZSTD_SEEKABLE_MAX_FRAME_DECOMPRESSED_SIZE;
pub const SEEKABLE_MAXFRAMES: u32 = zstd_sys::ZSTD_SEEKABLE_MAXFRAMES;
pub const seekTableFooterSize: u32 = zstd_sys::ZSTD_seekTableFooterSize;
6 changes: 6 additions & 0 deletions zstd-safe/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ extern crate std;
#[cfg(test)]
mod tests;

#[cfg(feature = "seekable")]
pub mod seekable;

// Re-export zstd-sys
pub use zstd_sys;

Expand All @@ -48,6 +51,9 @@ include!("constants.rs");
#[cfg(feature = "experimental")]
include!("constants_experimental.rs");

#[cfg(feature = "seekable")]
include!("constants_seekable.rs");

/// Represents the compression level used by zstd.
pub type CompressionLevel = i32;

Expand Down
Loading
Loading