use std::ffi::CStr;
use crate::base::conddef;
unsafe impl Sync for conddef {}
unsafe impl Send for conddef {}
impl conddef {
pub const fn new(
name: &'static CStr,
handler: super::types::CondHandlerInner,
min: i32,
max: i32,
id: i32,
) -> Self {
Self {
next: std::ptr::null_mut(),
name: name.as_ptr() as _,
flags: 0,
handler: Some(handler),
min,
max,
condid: id,
module: std::ptr::null_mut(),
}
}
pub const fn new_infix(
name: &'static CStr,
handler: super::types::CondHandlerInner,
id: i32,
) -> Self {
Self {
next: std::ptr::null_mut(),
name: name.as_ptr() as _,
flags: crate::base::CONDF_INFIX as _,
handler: Some(handler),
min: 0,
max: 0,
condid: id,
module: std::ptr::null_mut(),
}
}
}