12#if defined _WIN32 || defined __CYGWIN__
15#ifdef CLINGO_NO_VISIBILITY
16#define CLINGO_VISIBILITY_DEFAULT
17#define CLINGO_VISIBILITY_PRIVATE
20#ifdef CLINGO_BUILD_LIBRARY
21#define CLINGO_VISIBILITY_DEFAULT __declspec(dllexport)
23#define CLINGO_VISIBILITY_DEFAULT __declspec(dllimport)
25#define CLINGO_VISIBILITY_PRIVATE
28#define CLINGO_VISIBILITY_DEFAULT __attribute__((visibility("default")))
29#define CLINGO_VISIBILITY_PRIVATE __attribute__((visibility("hidden")))
32#define CLINGO_VISIBILITY_DEFAULT
34#define CLINGO_VISIBILITY_PRIVATE
40#define CLINGO_DEPRECATED __attribute__((deprecated))
42#define CLINGO_DEPRECATED __declspec(deprecated)
45#define CLINGO_DEPRECATED
67#define CLINGO_VERSION_MAJOR 6
69#define CLINGO_VERSION_MINOR 0
71#define CLINGO_VERSION_REVISION 0
73#define CLINGO_VERSION "6.0.0"
75#define CLINGO_EXECUTABLE "clingo"
192CLINGO_VISIBILITY_DEFAULT
void clingo_version(
int *major,
int *minor,
int *revision);
CLINGO_VISIBILITY_DEFAULT void clingo_position_file(clingo_position_t const *pos, clingo_string_t *value)
Get the file name of the position.
CLINGO_VISIBILITY_DEFAULT clingo_position_t const * clingo_location_end(clingo_location_t const *loc)
Get the end of the location.
CLINGO_VISIBILITY_DEFAULT void clingo_lib_release(clingo_lib_t *lib)
Release a library object created with clingo_lib_new().
CLINGO_VISIBILITY_DEFAULT int clingo_position_compare(clingo_position_t const *a, clingo_position_t const *b)
Compare two positions.
CLINGO_VISIBILITY_DEFAULT bool clingo_position_new(clingo_lib_t *lib, char const *file, size_t size, size_t line, size_t column, clingo_position_t const **pos)
Create a new source position object.
struct clingo_string clingo_string_t
Struct to capture strings that are not null-terminated.
CLINGO_VISIBILITY_DEFAULT void clingo_string_builder_free(clingo_string_builder_t const *bld)
Free the string builder.
CLINGO_VISIBILITY_DEFAULT void clingo_version(int *major, int *minor, int *revision)
Obtain the clingo version.
CLINGO_VISIBILITY_DEFAULT bool clingo_set_error(clingo_result_t code, char const *message, size_t size)
Set an error in the current thread.
struct clingo_weighted_literal clingo_weighted_literal_t
A literal with an associated weight.
CLINGO_VISIBILITY_DEFAULT void clingo_lib_report(clingo_lib_t *lib, clingo_message_t code, char const *message, size_t size)
Report a message via the libraries logger.
CLINGO_VISIBILITY_DEFAULT bool clingo_location_new(clingo_position_t const *begin, clingo_position_t const *end, clingo_location_t const **loc)
Create a new source location object.
CLINGO_VISIBILITY_DEFAULT bool clingo_position_to_string(clingo_position_t const *pos, clingo_string_builder_t *str)
Convert the given position into a string.
CLINGO_VISIBILITY_DEFAULT size_t clingo_position_column(clingo_position_t const *pos)
Get the column number of the position.
CLINGO_VISIBILITY_DEFAULT void clingo_string_builder_clear(clingo_string_builder_t *bld)
Clear the string in the builder.
CLINGO_VISIBILITY_DEFAULT bool clingo_lib_new(clingo_lib_flags_t flags, clingo_log_level_t level, clingo_logger_t const *logger, void *data, size_t limit, clingo_lib_t **lib)
Create a library object.
int clingo_log_level_t
Corresponding type to clingo_log_level_e.
Definition core.h:154
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
CLINGO_VISIBILITY_DEFAULT void clingo_get_error(clingo_result_t *code, clingo_string_t *message)
Get the error set in the current thread.
CLINGO_VISIBILITY_DEFAULT bool clingo_string_builder_copy(clingo_string_builder_t const *src, clingo_string_builder_t **dst)
Copy the string builder.
uint32_t clingo_atom_t
Unsigned integer type used for aspif atoms.
Definition core.h:80
CLINGO_VISIBILITY_DEFAULT int clingo_location_compare(clingo_location_t const *a, clingo_location_t const *b)
Compare two locations.
struct clingo_string_builder clingo_string_builder_t
A builder for strings.
Definition core.h:257
CLINGO_VISIBILITY_DEFAULT void clingo_clear_error(void)
Clear the current error.
CLINGO_VISIBILITY_DEFAULT bool clingo_string_builder_string(clingo_string_builder_t const *bld, clingo_string_t *value)
Get the (zero-terminated) string in the builder.
CLINGO_VISIBILITY_DEFAULT void clingo_result_string(clingo_result_t code, clingo_string_t *value)
Convert the given result code into a string.
CLINGO_VISIBILITY_DEFAULT size_t clingo_position_line(clingo_position_t const *pos)
Get the line number of the position.
CLINGO_VISIBILITY_DEFAULT bool clingo_position_equal(clingo_position_t const *a, clingo_position_t const *b)
Check if two positions are equal.
CLINGO_VISIBILITY_DEFAULT bool clingo_location_to_string(clingo_location_t const *loc, clingo_string_builder_t *str)
Convert the given location into a string.
clingo_message_e
Enumeration of message codes.
Definition core.h:131
struct clingo_logger clingo_logger_t
The clingo logger.
clingo_log_level_e
Enumeration of log levels.
Definition core.h:146
CLINGO_VISIBILITY_DEFAULT size_t clingo_position_hash(clingo_position_t const *pos)
Compute a hash of the position.
int32_t clingo_literal_t
Signed integer type used for aspif and solver literals.
Definition core.h:78
CLINGO_VISIBILITY_DEFAULT clingo_position_t const * clingo_location_begin(clingo_location_t const *loc)
Get the beginning of the location.
CLINGO_VISIBILITY_DEFAULT void clingo_position_free(clingo_position_t const *pos)
Free the given position.
clingo_result_e
Enumeration of error codes.
Definition core.h:102
int clingo_message_t
Corresponding type to clingo_message_e.
Definition core.h:143
uint32_t clingo_id_t
Unsigned integer type used in various places.
Definition core.h:82
int clingo_result_t
Corresponding type to clingo_result_e.
Definition core.h:111
uint32_t clingo_lib_flags_t
Bitset of clingo_lib_flags_e.
Definition core.h:185
CLINGO_VISIBILITY_DEFAULT void clingo_location_free(clingo_location_t const *loc)
Free the given location.
struct clingo_position clingo_position_t
Represents a cursor position in source code.
Definition core.h:291
clingo_lib_flags_e
Flags to create library objects.
Definition core.h:179
CLINGO_VISIBILITY_DEFAULT bool clingo_string_builder_new(clingo_string_builder_t **bld)
Create a new string builder.
CLINGO_VISIBILITY_DEFAULT bool clingo_position_copy(clingo_position_t const *src, clingo_position_t const **dst)
Copy the given position.
CLINGO_VISIBILITY_DEFAULT bool clingo_location_equal(clingo_location_t const *a, clingo_location_t const *b)
Check if two locations are equal.
int32_t clingo_weight_t
Signed integer type for weights in sum aggregates and minimize constraints.
Definition core.h:84
CLINGO_VISIBILITY_DEFAULT void clingo_message_string(clingo_message_t code, clingo_string_t *value)
Convert the giving message code into a string.
CLINGO_VISIBILITY_DEFAULT bool clingo_location_copy(clingo_location_t const *src, clingo_location_t const **dst)
Copy the given location.
CLINGO_VISIBILITY_DEFAULT size_t clingo_location_hash(clingo_location_t const *loc)
Compute a hash of the location.
CLINGO_VISIBILITY_DEFAULT void clingo_lib_acquire(clingo_lib_t *lib)
Increment the reference count of the given library.
@ clingo_message_file_included
same file included multiple times
Definition core.h:137
@ clingo_message_error
to report multiple errors; a corresponding runtime error is raised later
Definition core.h:140
@ clingo_message_info
an info message
Definition core.h:134
@ clingo_message_atom_undefined
undefined atom in program
Definition core.h:136
@ clingo_message_global_variable
global variable in tuple of aggregate element
Definition core.h:138
@ clingo_message_operation_undefined
undefined operation in program
Definition core.h:135
@ clingo_message_trace
a trace message
Definition core.h:132
@ clingo_message_debug
a debug message
Definition core.h:133
@ clingo_message_warn
a warning message
Definition core.h:139
@ clingo_log_level_warn
the warning level
Definition core.h:150
@ clingo_log_level_debug
the debug level
Definition core.h:148
@ clingo_log_level_info
the info level
Definition core.h:149
@ clingo_log_level_error
the error level (least verbose)
Definition core.h:151
@ clingo_log_level_trace
the trace level (most verbose)
Definition core.h:147
@ clingo_result_range
result out of range
Definition core.h:108
@ clingo_result_runtime
errors only detectable at runtime like invalid input
Definition core.h:104
@ clingo_result_success
successful API calls
Definition core.h:103
@ clingo_result_invalid
invalid arguments passed to function
Definition core.h:107
@ clingo_result_bad_alloc
memory could not be allocated
Definition core.h:106
@ clingo_result_logic
wrong usage of the clingo API
Definition core.h:105
@ clingo_lib_flags_shared
create symbols in a thread-safe manner
Definition core.h:181
@ clingo_lib_flags_slotted
use custom allocator for storing symbols
Definition core.h:180
@ clingo_lib_flags_fast_release
whether to enable fast release of libraries
Definition core.h:182
The clingo logger.
Definition core.h:157
void(* free)(void *data)
Free the logger.
Definition core.h:172
void(* log)(clingo_message_t code, char const *message, size_t size, void *data)
Callback to intercept messages.
Definition core.h:166
Struct to capture strings that are not null-terminated.
Definition core.h:91
size_t size
the length of the string
Definition core.h:93
char const * data
pointer to the beginning of the string
Definition core.h:92
A literal with an associated weight.
Definition core.h:86
clingo_weight_t weight
the weight
Definition core.h:88
clingo_literal_t literal
the literal
Definition core.h:87