Clingo C API
C API for clingo providing high level functions to control grounding and solving.
|
Data types and functions used throughout all modules and version information.
For an example, see version.c.
Classes | |
struct | clingo_location |
Represents a source code location marking its beginnig and end. More... | |
Macros | |
#define | CLINGO_VERSION_MAJOR 5 |
Major version number. | |
#define | CLINGO_VERSION_MINOR 0 |
Minor version number. | |
#define | CLINGO_VERSION_REVISION 0 |
Revision number. | |
#define | CLINGO_VERSION #CLINGO_VERSION_MAJOR "." #CLINGO_VERSION_MINOR "." #CLINGO_VERSION_REVISION |
String representation of version. | |
Typedefs | |
typedef int32_t | clingo_literal_t |
Signed integer type used for aspif and solver literals. | |
typedef uint32_t | clingo_atom_t |
Unsigned integer type used for aspif atoms. | |
typedef uint32_t | clingo_id_t |
Unsigned integer type used in various places. | |
typedef int32_t | clingo_weight_t |
Signed integer type for weights in sum aggregates and minimize constraints. | |
typedef int | clingo_error_t |
Corresponding type to clingo_error. | |
typedef int | clingo_warning_t |
Corresponding type to clingo_warning. | |
typedef void | clingo_logger_t(clingo_warning_t code, char const *message, void *data) |
Callback to intercept warning messages. More... | |
typedef int | clingo_truth_value_t |
Corresponding type to clingo_truth_value. | |
typedef struct clingo_location | clingo_location_t |
Represents a source code location marking its beginnig and end. More... | |
Enumerations | |
enum | clingo_error { clingo_error_success = 0, clingo_error_runtime = 1, clingo_error_logic = 2, clingo_error_bad_alloc = 3, clingo_error_unknown = 4 } |
Enumeration of error codes. More... | |
enum | clingo_warning { clingo_warning_operation_undefined = 0, clingo_warning_runtime_error = 1, clingo_warning_atom_undefined = 2, clingo_warning_file_included = 3, clingo_warning_variable_unbounded = 4, clingo_warning_global_variable = 5, clingo_warning_other = 6 } |
Enumeration of warning codes. More... | |
enum | clingo_truth_value { clingo_truth_value_free = 0, clingo_truth_value_true = 1, clingo_truth_value_false = 2 } |
Represents three-valued truth values. More... | |
Functions | |
char const * | clingo_error_string (clingo_error_t code) |
Convert error code into string. | |
clingo_error_t | clingo_error_code () |
Get the last error code set by a clingo API call. More... | |
char const * | clingo_error_message () |
Get the last error message set if an API call fails. More... | |
void | clingo_set_error (clingo_error_t code, char const *message) |
Set a custom error code and message in the active thread. More... | |
char const * | clingo_warning_string (clingo_warning_t code) |
Convert warning code into string. | |
void | clingo_version (int *major, int *minor, int *revision) |
Obtain the clingo version. More... | |
typedef struct clingo_location clingo_location_t |
Represents a source code location marking its beginnig and end.
typedef void clingo_logger_t(clingo_warning_t code, char const *message, void *data) |
Callback to intercept warning messages.
[in] | code | associated warning code |
[in] | message | warning message |
[in] | data | user data for callback |
enum clingo_error |
Enumeration of error codes.
enum clingo_truth_value |
enum clingo_warning |
Enumeration of warning codes.
clingo_error_t clingo_error_code | ( | ) |
Get the last error code set by a clingo API call.
char const* clingo_error_message | ( | ) |
Get the last error message set if an API call fails.
void clingo_set_error | ( | clingo_error_t | code, |
char const * | message | ||
) |
Set a custom error code and message in the active thread.
[in] | code | the error code |
[in] | message | the error message |
void clingo_version | ( | int * | major, |
int * | minor, | ||
int * | revision | ||
) |
Obtain the clingo version.
[out] | major | major version number |
[out] | minor | minor version number |
[out] | revision | revision number |