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_ERR_IMPORT

Import error.

enumerator COWL_RET_COUNT

Number of enum values.

enumerator COWL_RET_FIRST

First enum value.

cowl_ret cowl_ret_from_ustream(ustream_ret ret)

Converts ustream_ret into cowl_ret.

Parameters:
  • ret – Return code.

Returns:

Return value.

cowl_ret cowl_ret_from_uvec(uvec_ret ret)

Converts uvec_ret into cowl_ret.

Parameters:
  • ret – Return code.

Returns:

Return value.

cowl_ret cowl_ret_from_uhash(uhash_ret ret)

Converts uhash_ret into cowl_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

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_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_DATATYPE

Iterate over datatypes.

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

typedef UBit_N CowlPosition

Position of a component in an OWL construct.

COWL_PS_NONE

No position.

COWL_PS_ANY

Any position.

COWL_PS_LEFT

Left position.

COWL_PS_RIGHT

Right position.

COWL_PS_MIDDLE

Middle position.

COWL_PS_SUBJECT

Subject position.

COWL_PS_PREDICATE

Predicate position.

COWL_PS_OBJECT

Object position.