Clingo
Loading...
Searching...
No Matches
clingo_script Struct Reference

Custom scripting language to run functions during grounding. More...

#include <script.h>

Public Attributes

bool(* execute )(char const *code, size_t size, void *data)
 Evaluate the given source code.
 
bool(* call )(clingo_lib_t *lib, clingo_location_t const *loc, char const *name, size_t name_size, clingo_symbol_t const *arguments, size_t arguments_size, clingo_symbol_callback_t symbol_callback, void *symbol_callback_data, void *data)
 Call the function with the given name and arguments.
 
bool(* callable )(char const *name, size_t size, size_t arguments, bool *result, void *data)
 Check if the given function is callable.
 
bool(* main )(clingo_lib_t *lib, clingo_control_t *control, void *data)
 Run the main function.
 
void(* name )(void *data, clingo_string_t *name)
 Get the name of the script.
 
void(* version )(void *data, clingo_string_t *version)
 Get the version of the script.
 
void(* free )(void *data)
 This function is called once when the script is deleted.
 

Detailed Description

Custom scripting language to run functions during grounding.

Member Data Documentation

◆ call

bool(* clingo_script::call) (clingo_lib_t *lib, clingo_location_t const *loc, char const *name, size_t name_size, clingo_symbol_t const *arguments, size_t arguments_size, clingo_symbol_callback_t symbol_callback, void *symbol_callback_data, void *data)

Call the function with the given name and arguments.

Parameters
[in]liblibrary object
[in]namethe name of the function
[in]argumentsthe arguments to the function
[in]arguments_sizethe number of arguments
[in]symbol_callbackcallback to return a pool of symbols
[in]symbol_callback_datauser data for the symbol callback
[in]datauser data as given when registering the script
Returns
whether the function call was successful

◆ callable

bool(* clingo_script::callable) (char const *name, size_t size, size_t arguments, bool *result, void *data)

Check if the given function is callable.

Parameters
[in]namethe name of the function
[in]argumentsthe number of arguments
[out]resultwhether the function is callable
[in]datauser data as given when registering the script
Returns
whether the function call was successful

◆ execute

bool(* clingo_script::execute) (char const *code, size_t size, void *data)

Evaluate the given source code.

Parameters
[in]codethe code to evaluate
[in]datauser data as given when registering the script
Returns
whether the function call was successful

◆ free

void(* clingo_script::free) (void *data)

This function is called once when the script is deleted.

Parameters
[in]datauser data as given when registering the script

◆ main

bool(* clingo_script::main) (clingo_lib_t *lib, clingo_control_t *control, void *data)

Run the main function.

Parameters
[in]controlthe control object to pass to the main function
[in]datauser data as given when registering the script
Returns
whether the function call was successful

◆ name

void(* clingo_script::name) (void *data, clingo_string_t *name)

Get the name of the script.

Returns
the name of the script.

◆ version

void(* clingo_script::version) (void *data, clingo_string_t *version)

Get the version of the script.

Returns
the version of the script.

The documentation for this struct was generated from the following file: