Skip to main content

Module status

Module status 

Source
Expand description

Status codes and error mapping for the Hurray C ABI.

All exported extern "C" functions return a HurrayStatus integer. Zero indicates success; negative values indicate a specific error condition. Callers MUST check the return value of every function before using output pointer arguments.

One positive value exists: HURRAY_END_OF_STREAM. It is not an error, which is why it is not negative, and why status < 0 remains the error test.

Constants§

HURRAY_END_OF_STREAM
Input ended cleanly at a tensor boundary: there is no next tensor.
HURRAY_ERR_BUFFER_TOO_SMALL
An output buffer is too small to hold the result.
HURRAY_ERR_CORE_UNUSABLE
A transport moved bytes whose count was lost, so the handle’s position no longer matches the transport’s and nothing can recover it (ADR-041 § 6).
HURRAY_ERR_FIELD_NOT_APPLICABLE
The requested field does not belong to this descriptor’s layout.
HURRAY_ERR_FIELD_NOT_PRESENT
The requested field is valid for this layout but absent from this descriptor.
HURRAY_ERR_INDEX_OUT_OF_BOUNDS
An index argument is outside the valid range for the collection.
HURRAY_ERR_INTERNAL
An unclassified internal error occurred.
HURRAY_ERR_INTERNAL_PANIC
The function panicked internally; the handle MUST NOT be reused.
HURRAY_ERR_INVALID_FILE
The file is not a valid HRRYFILE container, or the file being written would not be one.
HURRAY_ERR_INVALID_LAYOUT
A layout descriptor field or tag is invalid.
HURRAY_ERR_INVALID_MAGIC
The descriptor magic bytes were not "HRRY" (0x48 0x52 0x52 0x59).
HURRAY_ERR_INVALID_STREAM
The byte stream is not a valid Hurray stream, or a stream that already failed was used again.
HURRAY_ERR_INVALID_SYNC_MODE
The sync mode byte is not a recognized value.
HURRAY_ERR_INVALID_TYPE
A type tag, device tag, or memory class is invalid.
HURRAY_ERR_LIMIT_EXCEEDED
A descriptor, buffer, or nesting depth exceeded a configured limit.
HURRAY_ERR_NOT_COMPOSITE
A composite was asked for where there is none, or offered where one is required.
HURRAY_ERR_NOT_FOUND
No tensor of that name is in the file’s footer index.
HURRAY_ERR_NULL_POINTER
A required pointer argument is null.
HURRAY_ERR_SINK_CLOSED
The sink accepted zero bytes while an item was in flight.
HURRAY_ERR_SYNC_MODE_MISMATCH
A sync-mode handoff payload does not match the buffer’s declared sync mode.
HURRAY_ERR_TRANSPORT
A caller-supplied transport callback reported failure.
HURRAY_ERR_UNEXPECTED_EOF
Input ended in the middle of a descriptor or a buffer.
HURRAY_ERR_VERSION_MISMATCH
The descriptor version is not supported by this implementation.
HURRAY_OK
Operation completed successfully.

Type Aliases§

HurrayStatus
Integer status code returned by every Hurray C ABI function.