pub type clingo_script_t = clingo_script;Expand description
! Custom scripting language to run functions during grounding.
Aliased Type§
#[repr(C)]pub struct clingo_script_t {
pub execute: Option<unsafe extern "C" fn(*const clingo_location, *const i8, *mut c_void) -> bool>,
pub call: Option<unsafe extern "C" fn(*const clingo_location, *const i8, *const u64, usize, Option<unsafe extern "C" fn(*const u64, usize, *mut c_void) -> bool>, *mut c_void, *mut c_void) -> bool>,
pub callable: Option<unsafe extern "C" fn(*const i8, *mut bool, *mut c_void) -> bool>,
pub main: Option<unsafe extern "C" fn(*mut clingo_control, *mut c_void) -> bool>,
pub free: Option<unsafe extern "C" fn(*mut c_void)>,
pub version: *const i8,
}Fields§
§execute: Option<unsafe extern "C" fn(*const clingo_location, *const i8, *mut c_void) -> bool>! Evaluate the given source code. ! @param[in] location the location in the logic program of the source code ! @param[in] code the code to evaluate ! @param[in] data user data as given when registering the script ! @return whether the function call was successful
call: Option<unsafe extern "C" fn(*const clingo_location, *const i8, *const u64, usize, Option<unsafe extern "C" fn(*const u64, usize, *mut c_void) -> bool>, *mut c_void, *mut c_void) -> bool>! Call the function with the given name and arguments. ! @param[in] location the location in the logic program of the function call ! @param[in] name the name of the function ! @param[in] arguments the arguments to the function ! @param[in] arguments_size the number of arguments ! @param[in] symbol_callback callback to return a pool of symbols ! @param[in] symbol_callback_data user data for the symbol callback ! @param[in] data user data as given when registering the script ! @return whether the function call was successful
callable: Option<unsafe extern "C" fn(*const i8, *mut bool, *mut c_void) -> bool>! Check if the given function is callable. ! @param[in] name the name of the function ! @param[out] result whether the function is callable ! @param[in] data user data as given when registering the script ! @return whether the function call was successful
main: Option<unsafe extern "C" fn(*mut clingo_control, *mut c_void) -> bool>! Run the main function. ! @param[in] control the control object to pass to the main function ! @param[in] data user data as given when registering the script ! @return whether the function call was successful
free: Option<unsafe extern "C" fn(*mut c_void)>! This function is called once when the script is deleted. ! @param[in] data user data as given when registering the script
version: *const i8