Numeric types
Return codes
-
enum cowl_ret
Return codes for API calls that can fail.
Note
Error codes are guaranteed to evaluate to true in boolean expressions.
Values:
-
enumerator COWL_OK
Success.
-
enumerator COWL_ERR
Failure with unspecified error.
-
enumerator COWL_ERR_IO
Input/output error, usually returned when a file or stream operation fails.
Note
When this happens,
errno
is sometimes set to a more meaningful value.
-
enumerator COWL_ERR_MEM
Memory error, usually caused by failed allocations.
-
enumerator COWL_ERR_SYNTAX
Syntax error.
-
enumerator COWL_OK
-
bool cowl_ret_is_err(cowl_ret ret)
Checks if a return code indicates an error.
- Parameters:
ret – Return code.
- Returns:
True if the return code indicates an error, false otherwise.
-
bool cowl_ret_is_ok(cowl_ret ret)
Checks if a return code does not indicate an error.
- Parameters:
ret – Return code.
- Returns:
True if the return code does not indicate an error, false otherwise.
-
bool cowl_is_err(cowl_ret ret)
Checks if a return code indicates an error.
Note
Hints the compiler that the condition is unlikely to be true.
- Parameters:
ret – Return code.
- Returns:
True if the return code indicates an error, false otherwise.
-
bool cowl_is_ok(cowl_ret ret)
Checks if a return code does not indicate an error.
Note
Hints the compiler that the condition is likely to be true.
- Parameters:
ret – Return code.
- Returns:
True if the return code does not indicate an error, false otherwise.
-
cowl_ret cowl_ret_from_ulib(ulib_ret ret)
Converts
ulib_ret
intocowl_ret
.- Parameters:
ret – Return code.
- Returns:
Return value.
-
UString cowl_ret_to_ustring(cowl_ret ret)
Returns a human-readable string representation of the specified return value.
Note
You must not modify or free the returned string.
- Parameters:
ret – Return value.
- Returns:
String representation, or NULL on error.
-
CowlString *cowl_ret_to_string(cowl_ret ret)
Returns a human-readable string representation of the specified return value.
Note
You must release the returned object via
cowl_release()
.- Parameters:
ret – Return value.
- Returns:
String representation, or NULL on error.
Flags
These types represent groups of boolean options.
Iteration over primitives
-
COWL_PF_NONE
Iterate over no primitives.
-
COWL_PF_ALL
Iterate over all primitives.
-
COWL_PF_CLASS
Iterate over classes.
-
COWL_PF_DATATYPE
Iterate over datatypes.
-
COWL_PF_OBJ_PROP
Iterate over object properties.
-
COWL_PF_DATA_PROP
Iterate over data properties.
-
COWL_PF_ANNOT_PROP
Iterate over annotation properties.
-
COWL_PF_NAMED_IND
Iterate over named individuals.
-
COWL_PF_ANON_IND
Iterate over anonymous individuals.
-
COWL_PF_IRI
Iterate over IRIs.
-
COWL_PF_ENTITY
Iterate over entities.
-
CowlPrimitiveFlags cowl_primitive_flags_from_type(CowlPrimitiveType type)
Returns a bitmask with a bit set for the specified primitive type.
- Parameters:
type – Primitive type.
- Returns:
Flags.
-
bool cowl_primitive_flags_has_type(CowlPrimitiveFlags flags, CowlPrimitiveType type)
Checks whether the specified type is included in the flags.
- Parameters:
flags – Primitive flags.
type – Primitive type.
- Returns:
True if the type is included in the flags, false otherwise.
Construct position
-
COWL_PS_NONE
No position.
-
COWL_PS_LEFT
Left position.
-
COWL_PS_RIGHT
Right position.
-
COWL_PS_MIDDLE
Middle position.
-
COWL_PS_ANY
Any position.
-
COWL_PS_SUBJECT
Subject position in assertion axioms.
-
COWL_PS_PREDICATE
Predicate position in assertion axioms.
-
COWL_PS_OBJECT
Object position in assertion axioms.