Skip to content

Commit

Permalink
add deflateReset
Browse files Browse the repository at this point in the history
  • Loading branch information
folkertdev committed Feb 26, 2024
1 parent a35ed91 commit 32d4d55
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions libz-rs-sys/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,13 @@ pub unsafe extern "C" fn deflateEnd(strm: *mut z_stream) -> i32 {
}
}

pub unsafe extern "C" fn deflateReset(strm: *mut z_stream) -> i32 {
match DeflateStream::from_stream_mut(strm) {
Some(stream) => zlib_rs::deflate::reset(stream) as _,
None => ReturnCode::StreamError as _,
}
}

pub unsafe extern "C" fn deflateInit_(
strm: z_streamp,
level: c_int,
Expand Down
2 changes: 1 addition & 1 deletion zlib-rs/src/deflate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ pub fn end(stream: &mut DeflateStream) -> ReturnCode {
}
}

fn reset(stream: &mut DeflateStream) -> ReturnCode {
pub fn reset(stream: &mut DeflateStream) -> ReturnCode {
let ret = reset_keep(stream);

if ret == ReturnCode::Ok {
Expand Down

0 comments on commit 32d4d55

Please sign in to comment.