#![allow(non_snake_case, non_camel_case_types, non_upper_case_globals)]
use std::ffi::c_void;
use std::os::raw::{c_char, c_double, c_int};
use crate::plugin2::EDIT_SECTION;
#[repr(i32)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub enum PARAM_TYPE {
NONE = -1,
NIL = 0,
BOOLEAN = 1,
LIGHTUSERDATA = 2,
NUMBER = 3,
STRING = 4,
TABLE = 5,
FUNCTION = 6,
USERDATA = 7,
THREAD = 8,
}
#[repr(C)]
#[derive(Debug, Clone, Copy)]
pub struct SCRIPT_MODULE_PARAM {
pub get_param_num: unsafe extern "C" fn() -> c_int,
pub get_param_int: unsafe extern "C" fn(index: c_int) -> c_int,
pub get_param_double: unsafe extern "C" fn(index: c_int) -> c_double,
pub get_param_string: unsafe extern "C" fn(index: c_int) -> *const c_char,
pub get_param_data: unsafe extern "C" fn(index: c_int) -> *mut c_void,
pub get_param_table_int: unsafe extern "C" fn(index: c_int, key: *const c_char) -> c_int,
pub get_param_table_double: unsafe extern "C" fn(index: c_int, key: *const c_char) -> c_double,
pub get_param_table_string:
unsafe extern "C" fn(index: c_int, key: *const c_char) -> *const c_char,
pub get_param_array_num: unsafe extern "C" fn(index: c_int) -> c_int,
pub get_param_array_int: unsafe extern "C" fn(index: c_int, key: c_int) -> c_int,
pub get_param_array_double: unsafe extern "C" fn(index: c_int, key: c_int) -> c_double,
pub get_param_array_string: unsafe extern "C" fn(index: c_int, key: c_int) -> *const c_char,
pub push_result_int: unsafe extern "C" fn(value: c_int),
pub push_result_double: unsafe extern "C" fn(value: c_double),
pub push_result_string: unsafe extern "C" fn(value: *const c_char),
pub push_result_data: unsafe extern "C" fn(value: *const c_void),
pub push_result_table_int:
unsafe extern "C" fn(key: *const *const c_char, value: *const c_int, num: c_int),
pub push_result_table_double:
unsafe extern "C" fn(key: *const *const c_char, value: *const c_double, num: c_int),
pub push_result_table_string:
unsafe extern "C" fn(key: *const *const c_char, value: *const *const c_char, num: c_int),
pub push_result_array_int: unsafe extern "C" fn(value: *const c_int, num: c_int),
pub push_result_array_double: unsafe extern "C" fn(value: *const c_double, num: c_int),
pub push_result_array_string: unsafe extern "C" fn(value: *const *const c_char, num: c_int),
pub set_error: unsafe extern "C" fn(message: *const c_char),
pub get_param_boolean: unsafe extern "C" fn(index: c_int) -> bool,
pub push_result_boolean: unsafe extern "C" fn(value: bool),
pub get_param_table_boolean: unsafe extern "C" fn(index: c_int, key: *const c_char) -> bool,
pub push_result_array_boolean: unsafe extern "C" fn(value: *const bool, num: c_int),
pub push_result_table_boolean:
unsafe extern "C" fn(key: *const *const c_char, value: *const bool, num: c_int),
pub edit: *mut EDIT_SECTION,
pub push_result_function: unsafe extern "C" fn(
func: unsafe extern "C" fn(smp: *mut SCRIPT_MODULE_PARAM),
userdata: *mut c_void,
),
pub deprecated_push_result_meta_table: unsafe extern "C" fn(
func_getter: unsafe extern "C" fn(smp: *mut SCRIPT_MODULE_PARAM),
func_setter: unsafe extern "C" fn(smp: *mut SCRIPT_MODULE_PARAM),
userdata: *mut c_void,
),
pub userdata: *mut c_void,
pub push_result_meta_table: unsafe extern "C" fn(
meta_method_functions: *const META_METHOD_FUNCTION,
userdata: *mut c_void,
),
pub get_param_meta_table: unsafe extern "C" fn(
index: c_int,
meta_method_functions: *mut META_METHOD_FUNCTION,
) -> *mut c_void,
pub get_param_type: unsafe extern "C" fn(index: c_int) -> PARAM_TYPE,
}
#[repr(C)]
#[derive(Debug, Clone, Copy)]
pub struct META_METHOD_FUNCTION {
pub method: *const c_char,
pub func: unsafe extern "C" fn(smp: *mut SCRIPT_MODULE_PARAM),
}
#[repr(C)]
#[derive(Debug, Clone, Copy)]
pub struct SCRIPT_MODULE_FUNCTION {
pub name: *const u16,
pub func: unsafe extern "C" fn(smp: *mut SCRIPT_MODULE_PARAM),
}
#[repr(C)]
#[derive(Debug, Clone, Copy)]
pub struct SCRIPT_MODULE_TABLE {
pub information: *const u16,
pub functions: *const SCRIPT_MODULE_FUNCTION,
}