#![allow(clippy::too_many_arguments)]
#[allow(unused_imports)]
use crate::support::{BorrowedSlice, Bytes};
#[repr(i32)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
pub enum RootFormat {
Unknown = 0,
Wow = 1,
WowTvfs = 2,
Diablo3 = 3,
Diablo4 = 4,
Tvfs = 5,
Mndx = 6,
Overwatch = 7,
Agent = 8,
}
impl TryFrom<i32> for RootFormat {
type Error = crate::Error;
fn try_from(v: i32) -> Result<Self, crate::Error> {
match v {
0 => Ok(RootFormat::Unknown),
1 => Ok(RootFormat::Wow),
2 => Ok(RootFormat::WowTvfs),
3 => Ok(RootFormat::Diablo3),
4 => Ok(RootFormat::Diablo4),
5 => Ok(RootFormat::Tvfs),
6 => Ok(RootFormat::Mndx),
7 => Ok(RootFormat::Overwatch),
8 => Ok(RootFormat::Agent),
other => Err(crate::Error::UnknownEnum {
name: "RootFormat",
value: other,
}),
}
}
}
#[repr(i32)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
pub enum FileIdHint {
None = 0,
Meta = 1,
Payload = 2,
Paylow = 3,
Paymed = 4,
}
impl TryFrom<i32> for FileIdHint {
type Error = crate::Error;
fn try_from(v: i32) -> Result<Self, crate::Error> {
match v {
0 => Ok(FileIdHint::None),
1 => Ok(FileIdHint::Meta),
2 => Ok(FileIdHint::Payload),
3 => Ok(FileIdHint::Paylow),
4 => Ok(FileIdHint::Paymed),
other => Err(crate::Error::UnknownEnum {
name: "FileIdHint",
value: other,
}),
}
}
}
#[derive(Clone, Debug, PartialEq)]
pub struct FindEntry {
pub c_key: Vec<u8>,
pub file_size: u64,
pub locale_flags: u32,
pub content_flags: u32,
pub file_data_id: i32,
pub path: String,
}
pub struct CreateOptions {
pub(crate) raw: core::ptr::NonNull<ffi::whiteout_CascCreateOptions>,
}
impl Drop for CreateOptions {
fn drop(&mut self) {
unsafe { ffi::whiteout_casc_CascCreateOptions_delete(self.raw.as_ptr()) }
}
}
impl CreateOptions {
#[allow(dead_code)] pub(crate) unsafe fn from_raw(raw: *mut ffi::whiteout_CascCreateOptions) -> Option<Self> {
core::ptr::NonNull::new(raw).map(|raw| CreateOptions { raw })
}
}
unsafe impl Send for CreateOptions {}
impl core::fmt::Debug for CreateOptions {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
f.debug_struct("CreateOptions").finish_non_exhaustive()
}
}
impl CreateOptions {
pub fn new() -> Self {
unsafe {
let raw = ffi::whiteout_casc_CascCreateOptions_new();
Self::from_raw(raw).expect("native CreateOptions allocation failed")
}
}
pub fn product(&self) -> String {
unsafe {
crate::support::take_string(ffi::whiteout_casc_CascCreateOptions_get_product(
self.raw.as_ptr(),
))
}
}
pub fn set_product(&mut self, value: &str) {
let value = std::ffi::CString::new(value).unwrap_or_default();
unsafe {
ffi::whiteout_casc_CascCreateOptions_set_product(self.raw.as_ptr(), value.as_ptr())
}
}
pub fn version(&self) -> String {
unsafe {
crate::support::take_string(ffi::whiteout_casc_CascCreateOptions_get_version(
self.raw.as_ptr(),
))
}
}
pub fn set_version(&mut self, value: &str) {
let value = std::ffi::CString::new(value).unwrap_or_default();
unsafe {
ffi::whiteout_casc_CascCreateOptions_set_version(self.raw.as_ptr(), value.as_ptr())
}
}
pub fn archive_max_size(&self) -> u32 {
unsafe { ffi::whiteout_casc_CascCreateOptions_get_archiveMaxSize(self.raw.as_ptr()) }
}
pub fn set_archive_max_size(&mut self, value: u32) {
unsafe { ffi::whiteout_casc_CascCreateOptions_set_archiveMaxSize(self.raw.as_ptr(), value) }
}
pub fn blte_frame_size(&self) -> u32 {
unsafe { ffi::whiteout_casc_CascCreateOptions_get_blteFrameSize(self.raw.as_ptr()) }
}
pub fn set_blte_frame_size(&mut self, value: u32) {
unsafe { ffi::whiteout_casc_CascCreateOptions_set_blteFrameSize(self.raw.as_ptr(), value) }
}
pub fn root_format(&self) -> RootFormat {
unsafe { ffi::whiteout_casc_CascCreateOptions_get_rootFormat(self.raw.as_ptr()) }
.try_into()
.expect("unknown enum discriminant from the native library")
}
pub fn set_root_format(&mut self, value: RootFormat) {
unsafe {
ffi::whiteout_casc_CascCreateOptions_set_rootFormat(self.raw.as_ptr(), value as i32)
}
}
}
impl Default for CreateOptions {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Debug, PartialEq)]
pub struct WriteOptions {
pub locale_flags: u32,
pub content_flags: u32,
pub compress: bool,
}
impl Default for WriteOptions {
fn default() -> Self {
unsafe {
let h = ffi::whiteout_casc_CascWriteOptions_new();
let out = WriteOptions {
locale_flags: ffi::whiteout_casc_CascWriteOptions_get_localeFlags(h),
content_flags: ffi::whiteout_casc_CascWriteOptions_get_contentFlags(h),
compress: ffi::whiteout_casc_CascWriteOptions_get_compress(h) != 0,
};
ffi::whiteout_casc_CascWriteOptions_delete(h);
out
}
}
}
impl WriteOptions {
#[allow(dead_code)] pub(crate) unsafe fn to_native(&self) -> *mut ffi::whiteout_CascWriteOptions {
unsafe {
let h = ffi::whiteout_casc_CascWriteOptions_new();
ffi::whiteout_casc_CascWriteOptions_set_localeFlags(h, self.locale_flags);
ffi::whiteout_casc_CascWriteOptions_set_contentFlags(h, self.content_flags);
ffi::whiteout_casc_CascWriteOptions_set_compress(h, if self.compress { 1 } else { 0 });
h
}
}
#[allow(dead_code)]
pub(crate) unsafe fn free_native(h: *mut ffi::whiteout_CascWriteOptions) {
unsafe { ffi::whiteout_casc_CascWriteOptions_delete(h) }
}
}
pub struct Storage {
pub(crate) raw: core::ptr::NonNull<ffi::whiteout_CascStorage>,
}
impl Drop for Storage {
fn drop(&mut self) {
unsafe { ffi::whiteout_casc_CascStorage_delete(self.raw.as_ptr()) }
}
}
impl Storage {
#[allow(dead_code)] pub(crate) unsafe fn from_raw(raw: *mut ffi::whiteout_CascStorage) -> Option<Self> {
core::ptr::NonNull::new(raw).map(|raw| Storage { raw })
}
}
unsafe impl Send for Storage {}
impl core::fmt::Debug for Storage {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
f.debug_struct("Storage").finish_non_exhaustive()
}
}
impl Storage {
pub fn open(path: &str, pool: Option<&crate::interfaces::HostWorkerPool>) -> Option<Storage> {
let path_cstr = std::ffi::CString::new(path).unwrap_or_default();
unsafe {
Storage::from_raw(ffi::whiteout_casc_CascStorage_open(
path_cstr.as_ptr(),
pool.map_or(core::ptr::null_mut(), |v| v.as_ptr()),
))
}
}
pub fn open_path_locale_mask_pool(
path: &str,
locale_mask: u32,
pool: Option<&crate::interfaces::HostWorkerPool>,
) -> Option<Storage> {
let path_cstr = std::ffi::CString::new(path).unwrap_or_default();
unsafe {
Storage::from_raw(ffi::whiteout_casc_CascStorage_open_path_localeMask_pool(
path_cstr.as_ptr(),
locale_mask,
pool.map_or(core::ptr::null_mut(), |v| v.as_ptr()),
))
}
}
pub fn open_path_product_pool(
path: &str,
product: &str,
pool: Option<&crate::interfaces::HostWorkerPool>,
) -> Option<Storage> {
let path_cstr = std::ffi::CString::new(path).unwrap_or_default();
let product_cstr = std::ffi::CString::new(product).unwrap_or_default();
unsafe {
Storage::from_raw(ffi::whiteout_casc_CascStorage_open_path_product_pool(
path_cstr.as_ptr(),
product_cstr.as_ptr(),
pool.map_or(core::ptr::null_mut(), |v| v.as_ptr()),
))
}
}
pub fn close(&mut self) {
unsafe {
ffi::whiteout_casc_CascStorage_close(self.raw.as_ptr());
}
}
pub fn is_local(&self) -> bool {
unsafe { ffi::whiteout_casc_CascStorage_isLocal(self.raw.as_ptr()) != 0 }
}
pub fn is_online(&self) -> bool {
unsafe { ffi::whiteout_casc_CascStorage_isOnline(self.raw.as_ptr()) != 0 }
}
pub fn is_writable(&self) -> bool {
unsafe { ffi::whiteout_casc_CascStorage_isWritable(self.raw.as_ptr()) != 0 }
}
pub fn root_format(&self) -> RootFormat {
unsafe {
RootFormat::try_from(ffi::whiteout_casc_CascStorage_rootFormat(self.raw.as_ptr()))
.expect("unknown enum discriminant from the native library (ABI version skew)")
}
}
pub fn read_file(&self, casc_path: &str) -> Option<Bytes> {
let casc_path_cstr = std::ffi::CString::new(casc_path).unwrap_or_default();
unsafe {
Bytes::from_raw(ffi::whiteout_casc_CascStorage_readFile(
self.raw.as_ptr(),
casc_path_cstr.as_ptr(),
))
}
}
pub fn read_file_casc_path_locale_flags_open_flags(
&self,
casc_path: &str,
locale_flags: u32,
open_flags: u32,
) -> Option<Bytes> {
let casc_path_cstr = std::ffi::CString::new(casc_path).unwrap_or_default();
unsafe {
Bytes::from_raw(
ffi::whiteout_casc_CascStorage_readFile_cascPath_localeFlags_openFlags(
self.raw.as_ptr(),
casc_path_cstr.as_ptr(),
locale_flags,
open_flags,
),
)
}
}
pub fn read_file_file_id_hint(&self, file_id: i32, hint: FileIdHint) -> Option<Bytes> {
unsafe {
Bytes::from_raw(ffi::whiteout_casc_CascStorage_readFile_fileId_hint(
self.raw.as_ptr(),
file_id,
hint as i32,
))
}
}
pub fn read_file_file_id_locale_flags_open_flags_hint(
&self,
file_id: i32,
locale_flags: u32,
open_flags: u32,
hint: FileIdHint,
) -> Option<Bytes> {
unsafe {
Bytes::from_raw(
ffi::whiteout_casc_CascStorage_readFile_fileId_localeFlags_openFlags_hint(
self.raw.as_ptr(),
file_id,
locale_flags,
open_flags,
hint as i32,
),
)
}
}
pub fn file_exists(&self, casc_path: &str) -> bool {
let casc_path_cstr = std::ffi::CString::new(casc_path).unwrap_or_default();
unsafe {
ffi::whiteout_casc_CascStorage_fileExists(self.raw.as_ptr(), casc_path_cstr.as_ptr())
!= 0
}
}
pub fn file_exists_file_id_hint(&self, file_id: i32, hint: FileIdHint) -> bool {
unsafe {
ffi::whiteout_casc_CascStorage_fileExists_fileId_hint(
self.raw.as_ptr(),
file_id,
hint as i32,
) != 0
}
}
pub fn file_size(&self, casc_path: &str) -> Option<u64> {
let casc_path_cstr = std::ffi::CString::new(casc_path).unwrap_or_default();
let mut __v: u64 = 0;
let __has = unsafe {
ffi::whiteout_casc_CascStorage_fileSize(
self.raw.as_ptr(),
casc_path_cstr.as_ptr(),
&mut __v,
)
};
(__has != 0).then_some(__v)
}
pub fn file_size_file_id_hint(&self, file_id: i32, hint: FileIdHint) -> Option<u64> {
let mut __v: u64 = 0;
let __has = unsafe {
ffi::whiteout_casc_CascStorage_fileSize_fileId_hint(
self.raw.as_ptr(),
file_id,
hint as i32,
&mut __v,
)
};
(__has != 0).then_some(__v)
}
pub fn list_files(&self) -> Vec<String> {
unsafe {
let list = ffi::whiteout_casc_CascStorage_listFiles(self.raw.as_ptr());
if list.is_null() {
return Vec::new();
}
let n = ffi::whiteout_casc_StringList_size(list);
let out = (0..n)
.map(|i| crate::support::take_string(ffi::whiteout_casc_StringList_at(list, i)))
.collect();
ffi::whiteout_casc_StringList_delete(list);
out
}
}
pub fn list_entries(&self) -> Vec<FindEntry> {
unsafe {
let snap = ffi::whiteout_casc_CascStorage_listEntries_snapshot(self.raw.as_ptr());
if snap.is_null() {
return Vec::new();
}
let n = ffi::whiteout_casc_CascStorage_listEntries_count(snap);
let mut out = Vec::with_capacity(n);
for i in 0..n {
out.push(FindEntry {
c_key: crate::support::Bytes::from_raw(
ffi::whiteout_casc_CascStorage_listEntries_cKey_at(snap, i),
)
.map(|b| b.to_vec())
.unwrap_or_default(),
file_size: ffi::whiteout_casc_CascStorage_listEntries_fileSize_at(snap, i),
locale_flags: ffi::whiteout_casc_CascStorage_listEntries_localeFlags_at(
snap, i,
),
content_flags: ffi::whiteout_casc_CascStorage_listEntries_contentFlags_at(
snap, i,
),
file_data_id: ffi::whiteout_casc_CascStorage_listEntries_fileDataId_at(snap, i),
path: crate::support::take_string(
ffi::whiteout_casc_CascStorage_listEntries_path_at(snap, i),
),
});
}
ffi::whiteout_casc_CascStorage_listEntries_free(snap);
out
}
}
pub fn total_file_count(&self) -> Option<u32> {
let mut __v: u32 = 0;
let __has =
unsafe { ffi::whiteout_casc_CascStorage_totalFileCount(self.raw.as_ptr(), &mut __v) };
(__has != 0).then_some(__v)
}
pub fn import_keys_from_string(&mut self, key_list: &str) -> bool {
let key_list_cstr = std::ffi::CString::new(key_list).unwrap_or_default();
unsafe {
ffi::whiteout_casc_CascStorage_importKeysFromString(
self.raw.as_ptr(),
key_list_cstr.as_ptr(),
) != 0
}
}
pub fn import_keys_from_file(&mut self, key_file_path: &str) -> bool {
let key_file_path_cstr = std::ffi::CString::new(key_file_path).unwrap_or_default();
unsafe {
ffi::whiteout_casc_CascStorage_importKeysFromFile(
self.raw.as_ptr(),
key_file_path_cstr.as_ptr(),
) != 0
}
}
pub fn find_encryption_key(&self, key_name: u64) -> Option<[u8; 16]> {
let mut __v: [u8; 16] = Default::default();
let __has = unsafe {
ffi::whiteout_casc_CascStorage_findEncryptionKey(
self.raw.as_ptr(),
key_name,
__v.as_mut_ptr(),
)
};
(__has != 0).then_some(__v)
}
pub fn flush_cache(&mut self) {
unsafe {
ffi::whiteout_casc_CascStorage_flushCache(self.raw.as_ptr());
}
}
pub fn prefetch(&mut self) -> bool {
unsafe { ffi::whiteout_casc_CascStorage_prefetch(self.raw.as_ptr()) != 0 }
}
pub fn last_error() -> u32 {
unsafe { ffi::whiteout_casc_CascStorage_lastError() }
}
}
pub struct StorageWritable {
pub(crate) raw: core::ptr::NonNull<ffi::whiteout_CascStorageWritable>,
}
impl Drop for StorageWritable {
fn drop(&mut self) {
unsafe { ffi::whiteout_casc_CascStorageWritable_delete(self.raw.as_ptr()) }
}
}
impl StorageWritable {
#[allow(dead_code)] pub(crate) unsafe fn from_raw(raw: *mut ffi::whiteout_CascStorageWritable) -> Option<Self> {
core::ptr::NonNull::new(raw).map(|raw| StorageWritable { raw })
}
}
unsafe impl Send for StorageWritable {}
impl core::fmt::Debug for StorageWritable {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
f.debug_struct("StorageWritable").finish_non_exhaustive()
}
}
impl StorageWritable {
pub fn create(
opts: &CreateOptions,
pool: Option<&crate::interfaces::HostWorkerPool>,
) -> Option<StorageWritable> {
unsafe {
StorageWritable::from_raw(ffi::whiteout_casc_CascStorageWritable_create(
opts.raw.as_ptr(),
pool.map_or(core::ptr::null_mut(), |v| v.as_ptr()),
))
}
}
pub fn reserve_file_id(&mut self, name: &str) -> Option<u32> {
let name_cstr = std::ffi::CString::new(name).unwrap_or_default();
let mut __v: u32 = 0;
let __has = unsafe {
ffi::whiteout_casc_CascStorageWritable_reserveFileId(
self.raw.as_ptr(),
name_cstr.as_ptr(),
&mut __v,
)
};
(__has != 0).then_some(__v)
}
pub fn write_file(&mut self, path: &str, data: &[u8], opts: &WriteOptions) -> bool {
let path_cstr = std::ffi::CString::new(path).unwrap_or_default();
let opts_native = unsafe { opts.to_native() };
unsafe {
let __r = ffi::whiteout_casc_CascStorageWritable_writeFile(
self.raw.as_ptr(),
path_cstr.as_ptr(),
data.as_ptr(),
data.len(),
opts_native,
) != 0;
WriteOptions::free_native(opts_native);
__r
}
}
pub fn write_file_file_id_data_opts_hint(
&mut self,
file_id: i32,
data: &[u8],
opts: &WriteOptions,
hint: FileIdHint,
) -> bool {
let opts_native = unsafe { opts.to_native() };
unsafe {
let __r = ffi::whiteout_casc_CascStorageWritable_writeFile_fileId_data_opts_hint(
self.raw.as_ptr(),
file_id,
data.as_ptr(),
data.len(),
opts_native,
hint as i32,
) != 0;
WriteOptions::free_native(opts_native);
__r
}
}
pub fn delete_file(&mut self, path: &str) -> bool {
let path_cstr = std::ffi::CString::new(path).unwrap_or_default();
unsafe {
ffi::whiteout_casc_CascStorageWritable_deleteFile(self.raw.as_ptr(), path_cstr.as_ptr())
!= 0
}
}
pub fn delete_file_file_id_hint(&mut self, file_id: i32, hint: FileIdHint) -> bool {
unsafe {
ffi::whiteout_casc_CascStorageWritable_deleteFile_fileId_hint(
self.raw.as_ptr(),
file_id,
hint as i32,
) != 0
}
}
pub fn save(&mut self) -> bool {
unsafe { ffi::whiteout_casc_CascStorageWritable_save(self.raw.as_ptr()) != 0 }
}
pub fn save_path(&mut self, path: &str) -> bool {
let path_cstr = std::ffi::CString::new(path).unwrap_or_default();
unsafe {
ffi::whiteout_casc_CascStorageWritable_save_path(self.raw.as_ptr(), path_cstr.as_ptr())
!= 0
}
}
}
#[doc(hidden)]
pub mod ffi {
#![allow(missing_debug_implementations)]
#[allow(unused_imports)]
use crate::support::{RawBytes, RawCString};
#[repr(C)]
pub struct whiteout_CascCreateOptions {
_private: [u8; 0],
}
#[repr(C)]
pub struct whiteout_CascWriteOptions {
_private: [u8; 0],
}
#[repr(C)]
pub struct whiteout_CascStorage {
_private: [u8; 0],
}
#[repr(C)]
pub struct whiteout_CascStorageWritable {
_private: [u8; 0],
}
#[repr(C)]
pub struct whiteout_StringList {
_private: [u8; 0],
}
extern "C" {
pub fn whiteout_casc_StringList_size(self_: *mut whiteout_StringList) -> usize;
pub fn whiteout_casc_StringList_at(
self_: *mut whiteout_StringList,
index: usize,
) -> RawCString;
pub fn whiteout_casc_StringList_delete(self_: *mut whiteout_StringList);
pub fn whiteout_casc_CascCreateOptions_new() -> *mut whiteout_CascCreateOptions;
pub fn whiteout_casc_CascCreateOptions_delete(self_: *mut whiteout_CascCreateOptions);
pub fn whiteout_casc_CascCreateOptions_get_product(
self_: *mut whiteout_CascCreateOptions,
) -> RawCString;
pub fn whiteout_casc_CascCreateOptions_set_product(
self_: *mut whiteout_CascCreateOptions,
value: *const core::ffi::c_char,
);
pub fn whiteout_casc_CascCreateOptions_get_version(
self_: *mut whiteout_CascCreateOptions,
) -> RawCString;
pub fn whiteout_casc_CascCreateOptions_set_version(
self_: *mut whiteout_CascCreateOptions,
value: *const core::ffi::c_char,
);
pub fn whiteout_casc_CascCreateOptions_get_archiveMaxSize(
self_: *mut whiteout_CascCreateOptions,
) -> u32;
pub fn whiteout_casc_CascCreateOptions_set_archiveMaxSize(
self_: *mut whiteout_CascCreateOptions,
value: u32,
);
pub fn whiteout_casc_CascCreateOptions_get_blteFrameSize(
self_: *mut whiteout_CascCreateOptions,
) -> u32;
pub fn whiteout_casc_CascCreateOptions_set_blteFrameSize(
self_: *mut whiteout_CascCreateOptions,
value: u32,
);
pub fn whiteout_casc_CascCreateOptions_get_rootFormat(
self_: *mut whiteout_CascCreateOptions,
) -> i32;
pub fn whiteout_casc_CascCreateOptions_set_rootFormat(
self_: *mut whiteout_CascCreateOptions,
value: i32,
);
pub fn whiteout_casc_CascWriteOptions_new() -> *mut whiteout_CascWriteOptions;
pub fn whiteout_casc_CascWriteOptions_delete(self_: *mut whiteout_CascWriteOptions);
pub fn whiteout_casc_CascWriteOptions_get_localeFlags(
self_: *mut whiteout_CascWriteOptions,
) -> u32;
pub fn whiteout_casc_CascWriteOptions_set_localeFlags(
self_: *mut whiteout_CascWriteOptions,
value: u32,
);
pub fn whiteout_casc_CascWriteOptions_get_contentFlags(
self_: *mut whiteout_CascWriteOptions,
) -> u32;
pub fn whiteout_casc_CascWriteOptions_set_contentFlags(
self_: *mut whiteout_CascWriteOptions,
value: u32,
);
pub fn whiteout_casc_CascWriteOptions_get_compress(
self_: *mut whiteout_CascWriteOptions,
) -> i32;
pub fn whiteout_casc_CascWriteOptions_set_compress(
self_: *mut whiteout_CascWriteOptions,
value: i32,
);
pub fn whiteout_casc_CascStorage_delete(self_: *mut whiteout_CascStorage);
pub fn whiteout_casc_CascStorage_open(
path: *const core::ffi::c_char,
pool: *mut core::ffi::c_void,
) -> *mut whiteout_CascStorage;
pub fn whiteout_casc_CascStorage_open_path_localeMask_pool(
path: *const core::ffi::c_char,
locale_mask: u32,
pool: *mut core::ffi::c_void,
) -> *mut whiteout_CascStorage;
pub fn whiteout_casc_CascStorage_open_path_product_pool(
path: *const core::ffi::c_char,
product: *const core::ffi::c_char,
pool: *mut core::ffi::c_void,
) -> *mut whiteout_CascStorage;
pub fn whiteout_casc_CascStorage_close(self_: *mut whiteout_CascStorage);
pub fn whiteout_casc_CascStorage_isLocal(self_: *mut whiteout_CascStorage) -> i32;
pub fn whiteout_casc_CascStorage_isOnline(self_: *mut whiteout_CascStorage) -> i32;
pub fn whiteout_casc_CascStorage_isWritable(self_: *mut whiteout_CascStorage) -> i32;
pub fn whiteout_casc_CascStorage_rootFormat(self_: *mut whiteout_CascStorage) -> i32;
pub fn whiteout_casc_CascStorage_readFile(
self_: *mut whiteout_CascStorage,
casc_path: *const core::ffi::c_char,
) -> RawBytes;
pub fn whiteout_casc_CascStorage_readFile_cascPath_localeFlags_openFlags(
self_: *mut whiteout_CascStorage,
casc_path: *const core::ffi::c_char,
locale_flags: u32,
open_flags: u32,
) -> RawBytes;
pub fn whiteout_casc_CascStorage_readFile_fileId_hint(
self_: *mut whiteout_CascStorage,
file_id: i32,
hint: i32,
) -> RawBytes;
pub fn whiteout_casc_CascStorage_readFile_fileId_localeFlags_openFlags_hint(
self_: *mut whiteout_CascStorage,
file_id: i32,
locale_flags: u32,
open_flags: u32,
hint: i32,
) -> RawBytes;
pub fn whiteout_casc_CascStorage_fileExists(
self_: *mut whiteout_CascStorage,
casc_path: *const core::ffi::c_char,
) -> i32;
pub fn whiteout_casc_CascStorage_fileExists_fileId_hint(
self_: *mut whiteout_CascStorage,
file_id: i32,
hint: i32,
) -> i32;
pub fn whiteout_casc_CascStorage_fileSize(
self_: *mut whiteout_CascStorage,
casc_path: *const core::ffi::c_char,
out_value: *mut u64,
) -> i32;
pub fn whiteout_casc_CascStorage_fileSize_fileId_hint(
self_: *mut whiteout_CascStorage,
file_id: i32,
hint: i32,
out_value: *mut u64,
) -> i32;
pub fn whiteout_casc_CascStorage_listFiles(
self_: *mut whiteout_CascStorage,
) -> *mut whiteout_StringList;
pub fn whiteout_casc_CascStorage_listEntries_snapshot(
self_: *mut whiteout_CascStorage,
) -> *mut core::ffi::c_void;
pub fn whiteout_casc_CascStorage_listEntries_count(
snapshot: *mut core::ffi::c_void,
) -> usize;
pub fn whiteout_casc_CascStorage_listEntries_cKey_at(
snapshot: *mut core::ffi::c_void,
index: usize,
) -> RawBytes;
pub fn whiteout_casc_CascStorage_listEntries_fileSize_at(
snapshot: *mut core::ffi::c_void,
index: usize,
) -> u64;
pub fn whiteout_casc_CascStorage_listEntries_localeFlags_at(
snapshot: *mut core::ffi::c_void,
index: usize,
) -> u32;
pub fn whiteout_casc_CascStorage_listEntries_contentFlags_at(
snapshot: *mut core::ffi::c_void,
index: usize,
) -> u32;
pub fn whiteout_casc_CascStorage_listEntries_fileDataId_at(
snapshot: *mut core::ffi::c_void,
index: usize,
) -> i32;
pub fn whiteout_casc_CascStorage_listEntries_path_at(
snapshot: *mut core::ffi::c_void,
index: usize,
) -> RawCString;
pub fn whiteout_casc_CascStorage_listEntries_free(snapshot: *mut core::ffi::c_void);
pub fn whiteout_casc_CascStorage_totalFileCount(
self_: *mut whiteout_CascStorage,
out_value: *mut u32,
) -> i32;
pub fn whiteout_casc_CascStorage_importKeysFromString(
self_: *mut whiteout_CascStorage,
key_list: *const core::ffi::c_char,
) -> i32;
pub fn whiteout_casc_CascStorage_importKeysFromFile(
self_: *mut whiteout_CascStorage,
key_file_path: *const core::ffi::c_char,
) -> i32;
pub fn whiteout_casc_CascStorage_findEncryptionKey(
self_: *mut whiteout_CascStorage,
key_name: u64,
out_value: *mut u8,
) -> i32;
pub fn whiteout_casc_CascStorage_flushCache(self_: *mut whiteout_CascStorage);
pub fn whiteout_casc_CascStorage_prefetch(self_: *mut whiteout_CascStorage) -> i32;
pub fn whiteout_casc_CascStorage_lastError() -> u32;
pub fn whiteout_casc_CascStorageWritable_delete(self_: *mut whiteout_CascStorageWritable);
pub fn whiteout_casc_CascStorageWritable_create(
opts: *mut whiteout_CascCreateOptions,
pool: *mut core::ffi::c_void,
) -> *mut whiteout_CascStorageWritable;
pub fn whiteout_casc_CascStorageWritable_reserveFileId(
self_: *mut whiteout_CascStorageWritable,
name: *const core::ffi::c_char,
out_value: *mut u32,
) -> i32;
pub fn whiteout_casc_CascStorageWritable_writeFile(
self_: *mut whiteout_CascStorageWritable,
path: *const core::ffi::c_char,
data: *const u8,
data_size: usize,
opts: *mut whiteout_CascWriteOptions,
) -> i32;
pub fn whiteout_casc_CascStorageWritable_writeFile_fileId_data_opts_hint(
self_: *mut whiteout_CascStorageWritable,
file_id: i32,
data: *const u8,
data_size: usize,
opts: *mut whiteout_CascWriteOptions,
hint: i32,
) -> i32;
pub fn whiteout_casc_CascStorageWritable_deleteFile(
self_: *mut whiteout_CascStorageWritable,
path: *const core::ffi::c_char,
) -> i32;
pub fn whiteout_casc_CascStorageWritable_deleteFile_fileId_hint(
self_: *mut whiteout_CascStorageWritable,
file_id: i32,
hint: i32,
) -> i32;
pub fn whiteout_casc_CascStorageWritable_save(
self_: *mut whiteout_CascStorageWritable,
) -> i32;
pub fn whiteout_casc_CascStorageWritable_save_path(
self_: *mut whiteout_CascStorageWritable,
path: *const core::ffi::c_char,
) -> i32;
}
}