9#ifndef NEXUS_IO_STREAM_H
10#define NEXUS_IO_STREAM_H
18#define NX_STREAM_BOUNDARY_IDLE 1U
19#define NX_STREAM_BOUNDARY_TRIGGER 2U
20#define NX_STREAM_BOUNDARY_LOSS 4U
21#define NX_STREAM_BOUNDARY_ERROR 8U
175 size_t length, uint32_t flags);
225 bool memory_quiesced);
293 bool memory_quiesced);
Small vendor-independent result vocabulary.
nx_result_t
Operation result; success at submission means admission only.
nx_result_t nx_stream_acquire(nx_stream_t *stream, nx_stream_block_t *block)
Acquire the next ready block for one serialized consumer.
@ NX_STREAM_SLOT_BORROWED
nx_result_t nx_stream_release(nx_stream_t *stream, const nx_stream_block_t *block)
Release only the matching consumer incarnation after final use.
nx_result_t nx_stream_publish(nx_stream_t *stream, const nx_stream_fill_t *fill, size_t length, uint32_t flags)
Publish a complete block after all hardware writes detached.
nx_result_t nx_stream_abort(nx_stream_t *stream, const nx_stream_fill_t *fill, bool memory_quiesced)
Abort a producer loan only after memory write sources detach.
nx_result_t nx_stream_post_abort(nx_stream_producer_t *producer, const nx_stream_fill_t *fill, bool memory_quiesced)
Cancel the newest pending fill after proof of memory drain.
nx_result_t nx_stream_post_initialize(nx_stream_producer_t *producer, nx_stream_t *stream)
Bind a posted producer to a quiescent initialized stream.
nx_result_t nx_stream_post_publish(nx_stream_producer_t *producer, const nx_stream_fill_t *fill, size_t length, uint32_t flags)
Publish only the oldest pending detached producer loan.
nx_result_t nx_stream_post_reserve(nx_stream_producer_t *producer, nx_stream_fill_t *fill)
Reserve a future fill without making earlier blocks ready.
nx_result_t nx_stream_reserve(nx_stream_t *stream, nx_stream_fill_t *fill)
Reserve the next free block for one serialized producer.
void nx_stream_note_loss(nx_stream_t *stream, uint32_t count)
Latch explicitly observed dropped producer boundaries.
bool nx_stream_post_can_reserve(const nx_stream_producer_t *producer)
Query the next preposted slot without a loan or guessed loss.
nx_result_t nx_stream_initialize(nx_stream_t *stream, nx_stream_slot_t *slots, size_t count)
Initialize an unborrowed stream and exact supplied block array.
nx_result_t nx_stream_stop(nx_stream_t *stream)
Close producer admission while retaining every outstanding loan.
bool nx_stream_can_reserve(const nx_stream_t *stream)
Query the next physical slot without creating a loan or loss.
Immutable consumer loan, valid until matching release succeeds.
Mutable producer loan; hardware must stop before abort or publish.
Optional caller-owned preposted producer; no default cost.
Caller-owned block metadata; initialize data and capacity only.
nx_stream_slot_state_t state
Caller-owned stream control, initialized before publication.