feat: add zstd support to libarchive3-sys

main
Jef Roosens 2023-07-13 10:54:29 +02:00
parent fb610c9287
commit d86c6b191e
Signed by: Jef Roosens
GPG Key ID: B75D4F293C7052DB
11 changed files with 7 additions and 11 deletions

View File

@ -1,5 +1,6 @@
[workspace]
members = [
'server',
'libarchive'
'libarchive',
'libarchive3-sys'
]

View File

@ -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' }

View File

@ -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)]

View File

@ -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 {

View File

@ -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,
}
}

View File

@ -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)