use core::ffi::c_void;
pub const PATCH_MAGIC: u32 = 0x4843_5450;
pub const PATCH_ABI_VERSION: u16 = 0x000B;
pub const PATCH_HEADER_SIZE: usize = 136;
#[repr(C)]
pub struct PatchEnv {
pub abi_version: u32,
pub user_ctx: *mut c_void,
}
#[repr(C)]
pub struct PatchHeader {
pub magic: u32,
pub abi_version: u16,
pub flags: u16,
pub init: usize,
pub agent_update_buffers: Option<unsafe extern "C" fn(*const PatchEnv, *mut f32, *mut f32, i32) -> f32>,
pub agent_set_buffer: Option<unsafe extern "C" fn(*const PatchEnv, *mut f32)>,
pub agent_get_buffer_size: Option<unsafe extern "C" fn(*const PatchEnv) -> i32>,
pub agent_get_param_min: Option<unsafe extern "C" fn(*const PatchEnv, i32) -> f32>,
pub agent_get_param_max: Option<unsafe extern "C" fn(*const PatchEnv, i32) -> f32>,
pub agent_get_param_default: Option<unsafe extern "C" fn(*const PatchEnv, i32) -> f32>,
pub agent_is_param_enabled: Option<unsafe extern "C" fn(*const PatchEnv, i32, i32) -> u8>,
pub agent_get_param_name: Option<unsafe extern "C" fn(*const PatchEnv, i32, *mut u8, usize)>,
pub agent_get_param_unit: Option<unsafe extern "C" fn(*const PatchEnv, i32, *mut u8, usize)>,
pub agent_set_param: Option<unsafe extern "C" fn(*const PatchEnv, i32, f32)>,
pub agent_special_action: Option<unsafe extern "C" fn(*const PatchEnv, i32)>,
pub agent_get_state_idx: Option<unsafe extern "C" fn(*const PatchEnv) -> i32>,
pub image_size: u32,
pub bss_begin: usize,
pub bss_size: u32,
pub reserved: [u32; 16],
}
#[cfg(target_pointer_width = "32")]
const _: () = {
assert!(core::mem::size_of::<PatchHeader>() == PATCH_HEADER_SIZE);
assert!(core::mem::size_of::<PatchEnv>() == 8);
};