#![allow(unsafe_code)]
use super::report::{report_bool, report_i32};
use crate::panic_guard::FfiBoundary;
use crate::runtime::EngineContext;
#[doc(hidden)]
#[unsafe(no_mangle)]
pub unsafe extern "C" fn rust__handler__low_byte_first(
ctx: *mut EngineContext,
out: *mut bool,
) -> bool {
FfiBoundary::run_default(false, || {
report_bool(out, unsafe { &mut *ctx }.engine_mut().low_byte_first())
})
}
#[doc(hidden)]
#[unsafe(no_mangle)]
pub unsafe extern "C" fn rust__handler__checksum(ctx: *mut EngineContext, out: *mut u32) -> bool {
FfiBoundary::run_default(false, || {
match unsafe { &mut *ctx }.engine_mut().checksum() {
Some(v) => {
if !out.is_null() {
unsafe { *out = v };
}
true
}
None => false,
}
})
}
#[doc(hidden)]
#[unsafe(no_mangle)]
pub unsafe extern "C" fn rust__handler__is_crashed(
ctx: *mut EngineContext,
out: *mut bool,
) -> bool {
FfiBoundary::run_default(false, || {
report_bool(out, unsafe { &mut *ctx }.engine_mut().is_crashed())
})
}
#[doc(hidden)]
#[unsafe(no_mangle)]
pub unsafe extern "C" fn rust__handler__auto_repair(
ctx: *mut EngineContext,
out: *mut bool,
) -> bool {
FfiBoundary::run_default(false, || {
report_bool(out, unsafe { &mut *ctx }.engine_mut().auto_repair())
})
}
#[doc(hidden)]
#[unsafe(no_mangle)]
pub unsafe extern "C" fn rust__handler__primary_key_is_clustered(
ctx: *mut EngineContext,
out: *mut bool,
) -> bool {
FfiBoundary::run_default(false, || {
report_bool(
out,
unsafe { &mut *ctx }.engine_mut().primary_key_is_clustered(),
)
})
}
#[doc(hidden)]
#[unsafe(no_mangle)]
pub unsafe extern "C" fn rust__handler__indexes_are_disabled(
ctx: *mut EngineContext,
out: *mut i32,
) -> bool {
FfiBoundary::run_default(false, || {
report_i32(
out,
unsafe { &mut *ctx }.engine_mut().indexes_are_disabled(),
)
})
}