Struct clingo_sys::clingo_script
source · #[repr(C)]pub struct clingo_script {
pub execute: Option<unsafe extern "C" fn(location: *const clingo_location_t, code: *const c_char, data: *mut c_void) -> bool>,
pub call: Option<unsafe extern "C" fn(location: *const clingo_location_t, name: *const c_char, arguments: *const clingo_symbol_t, arguments_size: usize, symbol_callback: clingo_symbol_callback_t, symbol_callback_data: *mut c_void, data: *mut c_void) -> bool>,
pub callable: Option<unsafe extern "C" fn(name: *const c_char, result: *mut bool, data: *mut c_void) -> bool>,
pub main: Option<unsafe extern "C" fn(control: *mut clingo_control_t, data: *mut c_void) -> bool>,
pub free: Option<unsafe extern "C" fn(data: *mut c_void)>,
pub version: *const c_char,
}
Expand description
! Custom scripting language to run functions during grounding.
Fields§
§execute: Option<unsafe extern "C" fn(location: *const clingo_location_t, code: *const c_char, data: *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(location: *const clingo_location_t, name: *const c_char, arguments: *const clingo_symbol_t, arguments_size: usize, symbol_callback: clingo_symbol_callback_t, symbol_callback_data: *mut c_void, data: *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(name: *const c_char, result: *mut bool, data: *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(control: *mut clingo_control_t, data: *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(data: *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 c_char
Trait Implementations§
source§impl Clone for clingo_script
impl Clone for clingo_script
source§fn clone(&self) -> clingo_script
fn clone(&self) -> clingo_script
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more