ZA3236E56J2OSKXR4AWHFBTQTA64RCWMTXVZH65AIC5TK4E3DALQC
6XB4RDRQIINYARVQUO3U3ZG7652UIUXBUF33U7JEJ7ASRI47EKHAC
HEFGMMUMJ2GGJGF2BEKF7EUL24AO53WJTXKBJSEGT64AV3Y4TBZQC
IB4L4N5M765IYALNZENJRKOGUPBRK2AMAB6IRNWPDCKNKKRMOB5AC
IH334Q5ACWE4TNQYYOOF6GWV6CRXOEM6542NVNPA6HRIZ3CBFKEAC
HELRYMZKHZW4S2IEYXA4IE7VOYYL7FH6TVHGFHJ4J3KRBBLHPQPAC
UPRY2FELRWZCL5FGUS3EKS2RXEY7D2FGXYGLJWDNJT23PHITRWMAC
}
unsafe extern "C" fn zstd_seekable_read<R: io::Read + io::Seek>(
opaque: *mut c_void,
buffer: *mut c_void,
n: size_t,
) -> c_int {
let mut b: Box<R> = Box::from_raw(opaque as *mut R);
let s = slice::from_raw_parts_mut(buffer as *mut u8, n as usize);
let result = if b.read_exact(s).is_ok() { 0 } else { 1 };
mem::forget(b);
result
unsafe extern "C" fn zstd_seekable_seek<R: io::Read + io::Seek>(
opaque: *mut c_void,
offset: c_longlong,
origin: c_int,
) -> c_int {
let mut b: Box<R> = Box::from_raw(opaque as *mut R);
use io::SeekFrom;
let origin = if origin == SEEK_SET {
SeekFrom::Start(offset as u64)
} else if origin == SEEK_CUR {
SeekFrom::Current(offset as i64)
} else {
SeekFrom::End(offset as i64)
};
let result = if b.seek(origin).is_ok() { 0 } else { 1 };
mem::forget(b);
result
}
}
/*
#[doc = " Explicit context"]
pub type ZSTD_CCtx = ZSTD_CCtx_s;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ZSTD_DCtx_s {
_unused: [u8; 0],
}
pub type ZSTD_DCtx = ZSTD_DCtx_s;
#[doc = " Streaming"]
pub type ZSTD_outBuffer = ZSTD_outBuffer_s;
pub type ZSTD_CStream = ZSTD_CCtx;
extern "C" {
pub type ZSTD_DStream = ZSTD_DCtx;
extern "C" {
}
extern "C" {
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub type ZSTD_seekable = ZSTD_seekable_s;
extern "C" {
}
extern "C" {
}
extern "C" {
}
*/