chore: fork libarchive3-sys
This commit is contained in:
parent
7be4d83ca3
commit
fb610c9287
11 changed files with 958 additions and 6 deletions
|
|
@ -32,6 +32,7 @@ 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 {
|
||||
|
|
|
|||
|
|
@ -16,16 +16,23 @@ pub trait Archive: Handle + Sized {
|
|||
|
||||
fn open<P: AsRef<Path>>(builder: Builder, path: P) -> crate::Result<Self>;
|
||||
|
||||
fn entries<'a>(&'a mut self) -> Entries<'a, Self> {
|
||||
fn entries(&mut self) -> Entries<'_, Self> {
|
||||
Entries::new(self)
|
||||
}
|
||||
|
||||
fn filter(&mut self, index: i32) -> ReadFilter {
|
||||
/// Try to map a filter code to the ReadFilter enum.
|
||||
fn filter(&mut self, index: i32) -> Option<ReadFilter> {
|
||||
let res = unsafe { ffi::archive_filter_code(self.handle_mut(), index) };
|
||||
|
||||
match res {
|
||||
0 => ReadFilter::None,
|
||||
_ => panic!("Unknown filter type"),
|
||||
0 => Some(ReadFilter::None),
|
||||
1 => Some(ReadFilter::Gzip),
|
||||
2 => Some(ReadFilter::Bzip2),
|
||||
3 => Some(ReadFilter::Compress),
|
||||
5 => Some(ReadFilter::Lzma),
|
||||
6 => Some(ReadFilter::Xz),
|
||||
// 14 =>Some( ReadFilter::Zstd),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue