Type Alias clingo_sys::clingo_script_t
source · pub type clingo_script_t = clingo_script;
Expand description
! Custom scripting language to run functions during grounding.
Aliased Type§
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