Configuration of search and enumeration algorithms.
Entries in a configuration are organized hierarchically. Subentries are either accessed by name for map entries or by offset for array entries. Value entries have a string value that can be inspected or modified.
For an example, see configuration.c.
|
bool | clingo_configuration_array_size (clingo_configuration_t *configuration, clingo_id_t key, size_t *size) |
| Get the size of an array entry. More...
|
|
bool | clingo_configuration_array_at (clingo_configuration_t *configuration, clingo_id_t key, size_t offset, clingo_id_t *subkey) |
| Get the subkey at the given offset of an array entry. More...
|
|
bool | clingo_statistics_array_size (clingo_statistics_t *statistics, uint64_t key, size_t *size) |
| Get the size of an array entry. More...
|
|
bool | clingo_statistics_array_at (clingo_statistics_t *statistics, uint64_t key, size_t offset, uint64_t *subkey) |
| Get the subkey at the given offset of an array entry. More...
|
|
|
bool | clingo_configuration_map_size (clingo_configuration_t *configuration, clingo_id_t key, size_t *size) |
| Get the number of subkeys of a map entry. More...
|
|
bool | clingo_configuration_map_subkey_name (clingo_configuration_t *configuration, clingo_id_t key, size_t offset, char const **name) |
| Get the name associated with the offset-th subkey. More...
|
|
bool | clingo_configuration_map_at (clingo_configuration_t *configuration, clingo_id_t key, char const *name, clingo_id_t *subkey) |
| Lookup a subkey under the given name. More...
|
|
bool | clingo_statistics_map_size (clingo_statistics_t *statistics, uint64_t key, size_t *size) |
| Get the number of subkeys of a map entry. More...
|
|
bool | clingo_statistics_map_subkey_name (clingo_statistics_t *statistics, uint64_t key, size_t offset, char const **name) |
| Get the name associated with the offset-th subkey. More...
|
|
bool | clingo_statistics_map_at (clingo_statistics_t *statistics, uint64_t key, char const *name, uint64_t *subkey) |
| Lookup a subkey under the given name. More...
|
|
Enumeration for entries of the configuration.
Enumerator |
---|
clingo_configuration_type_value |
the entry is a (string) value
|
clingo_configuration_type_array |
the entry is an array
|
clingo_configuration_type_map |
the entry is a map
|
Get the subkey at the given offset of an array entry.
- Note
- Some array entries, like fore example the solver configuration, can be accessed past there actual size to add subentries.
- Precondition
- The type of the entry must be clingo_configuration_type_array.
- Parameters
-
[in] | configuration | the target configuration |
[in] | key | the key |
[in] | offset | the offset in the array |
[out] | subkey | the resulting subkey |
- Returns
- whether the call was successful
- Examples:
- configuration.c.
Get the size of an array entry.
- Precondition
- The type of the entry must be clingo_configuration_type_array.
- Parameters
-
[in] | configuration | the target configuration |
[in] | key | the key |
[out] | size | the resulting size |
- Returns
- whether the call was successful
Get the description of an entry.
- Parameters
-
[in] | configuration | the target configuration |
[in] | key | the key |
[out] | description | the description |
- Returns
- whether the call was successful
Lookup a subkey under the given name.
- Precondition
- The type of the entry must be clingo_configuration_type_map.
- Note
- Multiple levels can be looked up by concatenating keys with a period.
- Parameters
-
[in] | configuration | the target configuration |
[in] | key | the key |
[in] | name | the name to lookup the subkey |
[out] | subkey | the resulting subkey |
- Returns
- whether the call was successful
- Examples:
- configuration.c, and statistics.c.
Get the number of subkeys of a map entry.
- Precondition
- The type of the entry must be clingo_configuration_type_map.
- Parameters
-
[in] | configuration | the target configuration |
[in] | key | the key |
[out] | size | the resulting number |
- Returns
- whether the call was successful
Get the name associated with the offset-th subkey.
- Precondition
- The type of the entry must be clingo_configuration_type_map.
- Parameters
-
[in] | configuration | the target configuration |
[in] | key | the key |
[in] | offset | the offset of the name |
[out] | name | the resulting name |
- Returns
- whether the call was successful
Get the root key of the configuration.
- Parameters
-
[in] | configuration | the target configuration |
[out] | key | the root key |
- Returns
- whether the call was successful
- Examples:
- configuration.c, and statistics.c.
Get the type of a key.
- Note
- The type is bitset, an entry can have multiple (but at least one) type.
- Parameters
-
[in] | configuration | the target configuration |
[in] | key | the key |
[out] | type | the resulting type |
- Returns
- whether the call was successful
Get the string value of the given entry.
- Precondition
- The type of the entry must be clingo_configuration_type_value.
-
The given size must be larger or equal to size of the value.
- Parameters
-
[in] | configuration | the target configuration |
[in] | key | the key |
[out] | value | the resulting string value |
[in] | size | the size of the given char array |
- Returns
- whether the call was successful
Get the size of the string value of the given entry.
- Precondition
- The type of the entry must be clingo_configuration_type_value.
- Parameters
-
[in] | configuration | the target configuration |
[in] | key | the key |
[out] | size | the resulting size |
- Returns
- whether the call was successful
Check whether a entry has a value.
- Precondition
- The type of the entry must be clingo_configuration_type_value.
- Parameters
-
[in] | configuration | the target configuration |
[in] | key | the key |
[out] | assigned | whether the entry has a value |
- Returns
- whether the call was successful
bool clingo_statistics_array_at |
( |
clingo_statistics_t * |
statistics, |
|
|
uint64_t |
key, |
|
|
size_t |
offset, |
|
|
uint64_t * |
subkey |
|
) |
| |
Get the subkey at the given offset of an array entry.
- Precondition
- The type of the entry must be clingo_statistics_type_array.
- Parameters
-
[in] | statistics | the target statistics |
[in] | key | the key |
[in] | offset | the offset in the array |
[out] | subkey | the resulting subkey |
- Returns
- whether the call was successful
- Examples:
- statistics.c.
bool clingo_statistics_array_size |
( |
clingo_statistics_t * |
statistics, |
|
|
uint64_t |
key, |
|
|
size_t * |
size |
|
) |
| |
Get the size of an array entry.
- Precondition
- The type of the entry must be clingo_statistics_type_array.
- Parameters
-
[in] | statistics | the target statistics |
[in] | key | the key |
[out] | size | the resulting size |
- Returns
- whether the call was successful
- Examples:
- statistics.c.
bool clingo_statistics_map_at |
( |
clingo_statistics_t * |
statistics, |
|
|
uint64_t |
key, |
|
|
char const * |
name, |
|
|
uint64_t * |
subkey |
|
) |
| |
Lookup a subkey under the given name.
- Precondition
- The type of the entry must be clingo_statistics_type_map.
- Note
- Multiple levels can be looked up by concatenating keys with a period.
- Parameters
-
[in] | statistics | the target statistics |
[in] | key | the key |
[in] | name | the name to lookup the subkey |
[out] | subkey | the resulting subkey |
- Returns
- whether the call was successful
- Examples:
- statistics.c.
bool clingo_statistics_map_size |
( |
clingo_statistics_t * |
statistics, |
|
|
uint64_t |
key, |
|
|
size_t * |
size |
|
) |
| |
Get the number of subkeys of a map entry.
- Precondition
- The type of the entry must be clingo_statistics_type_map.
- Parameters
-
[in] | statistics | the target statistics |
[in] | key | the key |
[out] | size | the resulting number |
- Returns
- whether the call was successful
- Examples:
- statistics.c.
bool clingo_statistics_map_subkey_name |
( |
clingo_statistics_t * |
statistics, |
|
|
uint64_t |
key, |
|
|
size_t |
offset, |
|
|
char const ** |
name |
|
) |
| |
Get the name associated with the offset-th subkey.
- Precondition
- The type of the entry must be clingo_statistics_type_map.
- Parameters
-
[in] | statistics | the target statistics |
[in] | key | the key |
[in] | offset | the offset of the name |
[out] | name | the resulting name |
- Returns
- whether the call was successful
- Examples:
- statistics.c.