feat: add zstd support to libarchive3-sys
parent
fb610c9287
commit
d86c6b191e
|
@ -1,5 +1,6 @@
|
|||
[workspace]
|
||||
members = [
|
||||
'server',
|
||||
'libarchive'
|
||||
'libarchive',
|
||||
'libarchive3-sys'
|
||||
]
|
||||
|
|
|
@ -1,8 +1,3 @@
|
|||
[workspace]
|
||||
members = [
|
||||
'libarchive3-sys'
|
||||
]
|
||||
|
||||
[package]
|
||||
name = "libarchive"
|
||||
version = "0.1.0"
|
||||
|
@ -12,4 +7,4 @@ edition = "2021"
|
|||
|
||||
[dependencies]
|
||||
libc = ">= 0.2.0"
|
||||
libarchive3-sys = { path = './libarchive3-sys' }
|
||||
libarchive3-sys = { path = '../libarchive3-sys' }
|
||||
|
|
|
@ -18,7 +18,6 @@ pub enum ReadCompression {
|
|||
Rpm,
|
||||
Uu,
|
||||
Xz,
|
||||
// Zstd,
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq, Eq)]
|
||||
|
@ -57,7 +56,7 @@ pub enum ReadFilter {
|
|||
Rpm,
|
||||
Uu,
|
||||
Xz,
|
||||
// Zstd
|
||||
Zstd
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq, Eq)]
|
||||
|
|
|
@ -32,7 +32,6 @@ impl Builder {
|
|||
ReadCompression::Rpm => unsafe { ffi::archive_read_support_compression_rpm(self.handle_mut()) },
|
||||
ReadCompression::Uu => unsafe { ffi::archive_read_support_compression_uu(self.handle_mut()) },
|
||||
ReadCompression::Xz => unsafe { ffi::archive_read_support_compression_xz(self.handle_mut()) },
|
||||
// ReadCompression::Zstd => unsafe { ffi::archive_read_support_compression_zstd(self.handle_mut()) },
|
||||
ReadCompression::Program(prog) => {
|
||||
let c_prog = CString::new(prog).unwrap();
|
||||
unsafe {
|
||||
|
@ -66,6 +65,7 @@ impl Builder {
|
|||
ReadFilter::Rpm => unsafe { ffi::archive_read_support_filter_rpm(self.handle_mut()) },
|
||||
ReadFilter::Uu => unsafe { ffi::archive_read_support_filter_uu(self.handle_mut()) },
|
||||
ReadFilter::Xz => unsafe { ffi::archive_read_support_filter_xz(self.handle_mut()) },
|
||||
ReadFilter::Zstd => unsafe { ffi::archive_read_support_filter_zstd(self.handle_mut()) },
|
||||
ReadFilter::Program(prog) => {
|
||||
let c_prog = CString::new(prog).unwrap();
|
||||
unsafe {
|
||||
|
|
|
@ -31,7 +31,7 @@ pub trait Archive: Handle + Sized {
|
|||
3 => Some(ReadFilter::Compress),
|
||||
5 => Some(ReadFilter::Lzma),
|
||||
6 => Some(ReadFilter::Xz),
|
||||
// 14 =>Some( ReadFilter::Zstd),
|
||||
14 =>Some( ReadFilter::Zstd),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -104,6 +104,7 @@ extern "C" {
|
|||
pub fn archive_read_support_filter_lzip(arg1: *mut Struct_archive) -> c_int;
|
||||
pub fn archive_read_support_filter_lzma(arg1: *mut Struct_archive) -> c_int;
|
||||
pub fn archive_read_support_filter_lzop(arg1: *mut Struct_archive) -> c_int;
|
||||
pub fn archive_read_support_filter_zstd(arg1: *mut Struct_archive) -> c_int;
|
||||
pub fn archive_read_support_filter_none(arg1: *mut Struct_archive) -> c_int;
|
||||
pub fn archive_read_support_filter_program(arg1: *mut Struct_archive,
|
||||
command: *const c_char)
|
Loading…
Reference in New Issue