Clingo
|
Callback interface for custom configuration entries. More...
#include <config.h>
Public Attributes | |
bool(* | get )(size_t const *index, void *data, clingo_string_t *value, bool *has_value) |
Get the value of this entry as a string. | |
bool(* | set )(size_t const *index, char const *value, size_t size, void *data) |
Set the value of this entry from a string. | |
bool(* | size )(void *data, size_t *size, bool *has_size) |
Get the size of this entry if it is an array. | |
void(* | free )(void *data) |
Free the user data associated with this entry. | |
Callback interface for custom configuration entries.
This struct allows users to define custom configuration entries by providing function pointers for querying and manipulating the entry. The data
pointer is passed to each callback and can be used to store user-defined state.
On each configuration path, there can be at most one array entry. If present, the array index is passed to all entries following an array entry in the path. It is up to the entry implementation to interpret an absent index (i.e., when index
is NULL).
All callbacks are optional; if a callback is NULL, the corresponding operation is not supported for this entry.
void(* clingo_config_entry::free) (void *data) |
Free the user data associated with this entry.
[in] | data | user data pointer |
bool(* clingo_config_entry::get) (size_t const *index, void *data, clingo_string_t *value, bool *has_value) |
Get the value of this entry as a string.
[in] | index | an optional array index (can be NULL) |
[in] | data | user data pointer |
[out] | value | output string value |
[out] | has_value | set to true if a value is available, false otherwise |
bool(* clingo_config_entry::set) (size_t const *index, char const *value, size_t size, void *data) |
Set the value of this entry from a string.
[in] | index | an optional array index (can be NULL) |
[in] | value | input string value |
[in] | size | length of the value string |
[in] | data | user data pointer |
bool(* clingo_config_entry::size) (void *data, size_t *size, bool *has_size) |
Get the size of this entry if it is an array.
[in] | data | user data pointer |
[out] | size | number of elements in the array (or zero) |
[out] | has_size | true if the entry is an array, false otherwise |