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_weighted_literal |
A Literal with an associated weight. More... | |
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 5 |
Minor version number. | |
#define | CLINGO_VERSION_REVISION 1 |
Revision number. | |
#define | CLINGO_VERSION "5.5.1" |
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 struct clingo_weighted_literal | clingo_weighted_literal_t |
A Literal with an associated weight. | |
typedef int | clingo_error_t |
Corresponding type to clingo_error_e. | |
typedef int | clingo_warning_t |
Corresponding type to clingo_warning_e. | |
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_e. | |
typedef struct clingo_location | clingo_location_t |
Represents a source code location marking its beginnig and end. More... | |
Enumerations | |
enum | clingo_error_e { 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_e { 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_e { clingo_truth_value_free = 0, clingo_truth_value_true = 1, clingo_truth_value_false = 2 } |
Represents three-valued truth values. More... | |
Functions | |
CLINGO_VISIBILITY_DEFAULT char const * | clingo_error_string (clingo_error_t code) |
Convert error code into string. | |
CLINGO_VISIBILITY_DEFAULT clingo_error_t | clingo_error_code () |
Get the last error code set by a clingo API call. More... | |
CLINGO_VISIBILITY_DEFAULT char const * | clingo_error_message () |
Get the last error message set if an API call fails. More... | |
CLINGO_VISIBILITY_DEFAULT void | clingo_set_error (clingo_error_t code, char const *message) |
Set a custom error code and message in the active thread. More... | |
CLINGO_VISIBILITY_DEFAULT char const * | clingo_warning_string (clingo_warning_t code) |
Convert warning code into string. | |
CLINGO_VISIBILITY_DEFAULT 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_e |
Enumeration of error codes.
enum clingo_truth_value_e |
enum clingo_warning_e |
Enumeration of warning codes.
CLINGO_VISIBILITY_DEFAULT clingo_error_t clingo_error_code | ( | ) |
Get the last error code set by a clingo API call.
CLINGO_VISIBILITY_DEFAULT char const* clingo_error_message | ( | ) |
Get the last error message set if an API call fails.
CLINGO_VISIBILITY_DEFAULT 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 |
CLINGO_VISIBILITY_DEFAULT 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 |