CBuild wiki
Generic API for any spans. It works with any structures containing
specific fields - data and size (example
below). Currently two CBuild datatypes follow this convention - dynamic
arrays and string views.
License: GPL-3.0-or-later. Set element in span using its
index.
const cbuild_span_t*
span Span.size_t idx Element index.*typeof(span->data)
elem New element’s value.bool False on
overflow.
Get element from span using its index.
const cbuild_span_t*
span Span.size_t idx Element index.typeof(span->data)
Pointer to an element or NULL if index
out of bounds.
Get first element from span.
const cbuild_span_t*
span Span.typeof(span->data)
Pointer to an element.
Get last element from span.
const cbuild_span_t*
span Span.typeof(span->data)
Pointer to an element.
Foreach implementation for spans. Same semantics as ‘for’ loop.
cbuild_span_t*
span Span.name iter Name if variable that will be used as
iterator. Will have type typeof(span->data).