8#include <clingo/control.h>
9#include <clingo/core.h>
10#include <clingo/symbol.h>
23 bool (*
execute)(
char const *code,
size_t size,
void *data);
35 void *symbol_callback_data,
void *data);
42 bool (*
callable)(
char const *
name,
size_t size,
size_t arguments,
bool *result,
void *data);
struct clingo_lib clingo_lib_t
A library object storing global information.
Definition core.h:176
struct clingo_location clingo_location_t
Represents a source code location marking its beginning and end.
Definition core.h:359
struct clingo_script clingo_script_t
Custom scripting language to run functions during grounding.
CLINGO_VISIBILITY_DEFAULT bool clingo_script_register(clingo_lib_t *lib, clingo_script_t const *script, void *data)
Add a custom scripting language to a control object.
bool(* clingo_symbol_callback_t)(clingo_symbol_t const *symbols, size_t symbols_size, void *data)
Callback function to inject symbols.
Definition symbol.h:60
uint64_t clingo_symbol_t
Type to represent a symbol.
Definition symbol.h:51
Custom scripting language to run functions during grounding.
Definition script.h:18
void(* name)(void *data, clingo_string_t *name)
Get the name of the script.
Definition script.h:50
bool(* callable)(char const *name, size_t size, size_t arguments, bool *result, void *data)
Check if the given function is callable.
Definition script.h:42
void(* version)(void *data, clingo_string_t *version)
Get the version of the script.
Definition script.h:53
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.
Definition script.h:33
bool(* execute)(char const *code, size_t size, void *data)
Evaluate the given source code.
Definition script.h:23
void(* free)(void *data)
This function is called once when the script is deleted.
Definition script.h:56
bool(* main)(clingo_lib_t *lib, clingo_control_t *control, void *data)
Run the main function.
Definition script.h:47
Struct to capture strings that are not null-terminated.
Definition core.h:91