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

The returned string is retained, so you are responsible for releasing it.

Parameters

ret – Return value.

Returns

String representation, or NULL on error.