Numeric types

Return codes

enum cowl_ret_builtin

Builtin return codes.

Values:

enumerator COWL_OK

The operation succeeded.

enumerator COWL_NO

The operation did not succeed.

Note

This code is returned when an operation does not succeed as part of its normal execution. It does not signal an error condition.

Note

This code is also returned when an operation is stopped by e.g. returning COWL_NO from an iterator function.

enumerator COWL_ERR

The operation failed due to an unspecified error.

enumerator COWL_ERR_MEM

The operation failed due to a memory allocation error.

enumerator COWL_ERR_BOUNDS

Buffer bounds exceeded, or value over/underflowed its type.

enumerator COWL_ERR_IO

The operation failed due to an IO error.

Note

When this happens, errno is sometimes set to a more meaningful value.

enumerator COWL_ERR_SYNTAX

Syntax error.

typedef ulib_ret cowl_ret

Return code type.

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_ret_should_stop(cowl_ret ret)

Checks if a return code indicates that an operation should be stopped.

Parameters:
  • ret – Return code.

Returns:

True if the return code indicates that an operation should be stopped, 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.

bool cowl_should_stop(cowl_ret ret)

Checks if a return code indicates that an operation should be stopped.

Note

Hints the compiler that the condition is unlikely to be true.

Parameters:
  • ret – Return code.

Returns:

True if the return code indicates that an operation should be stopped, false otherwise.

cowl_ret cowl_ret_from_ulib(ulib_ret ret)

Converts ulib_ret into cowl_ret.

Parameters:
  • ret – Return code.

Returns:

Return value.

UString cowl_ret_to_string(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.

COWL_CONTINUE

Alias for COWL_OK, used to indicate that an operation should continue.

COWL_STOP

Alias for COWL_NO, used to indicate that an operation should be stopped.

Flags

These types represent groups of boolean options.

Iteration over primitives

typedef UBit_N CowlPrimitiveFlags

Flags to control 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.

COWL_PF_IND

Iterate over individuals.

COWL_PF_PROP

Iterate over properties.

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.

CowlPrimitiveFlags cowl_primitive_flags_add_type(CowlPrimitiveFlags flags, CowlPrimitiveType type)

Adds the specified type to the flags.

Parameters:
  • flags – Primitive flags.

  • type – Primitive type.

Returns:

Updated flags.

CowlPrimitiveFlags cowl_primitive_flags_remove_type(CowlPrimitiveFlags flags, CowlPrimitiveType type)

Removes the specified type from the flags.

Parameters:
  • flags – Primitive flags.

  • type – Primitive type.

Returns:

Updated 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

typedef UBit_N CowlPosition

Position of a component in an OWL construct.

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.