mod cache;
mod class;
mod file_backed_mapper;
mod individual;
mod linear_ref;
mod magazine;
mod magazine_impl;
mod magazine_stack;
mod map;
mod mapper;
mod mill;
mod press;
mod rack;
#[cfg(any(
all(test, feature = "check_contracts_in_tests"),
feature = "check_contracts"
))]
mod debug_allocation_map;
#[cfg(any(
all(test, feature = "check_contracts_in_tests"),
feature = "check_contracts"
))]
mod debug_arange_map;
#[cfg(any(
all(test, feature = "check_contracts_in_tests"),
feature = "check_contracts"
))]
mod debug_type_map;
use std::os::raw::c_char;
pub use class::Class;
pub use class::ClassConfig;
pub use class::ForeignClassConfig;
pub use file_backed_mapper::set_file_backed_slab_directory;
pub use mapper::register_mapper;
pub use mapper::Mapper;
#[no_mangle]
pub unsafe extern "C" fn slitter_class_register(config_ptr: *const ForeignClassConfig) -> Class {
let config = ClassConfig::from_c(config_ptr).expect("slitter_class_config must be valid");
Class::new(config).expect("slitter class allocation should succeed")
}
#[no_mangle]
pub unsafe extern "C" fn slitter_set_file_backed_slab_directory(path: *const c_char) {
use std::ffi::CStr;
if path.is_null() {
set_file_backed_slab_directory(None);
return;
}
let path_str = CStr::from_ptr(path)
.to_str()
.expect("path must be valid")
.to_owned();
set_file_backed_slab_directory(Some(path_str.into()));
}