Spans over a caller's buffer, the two span types, and the spat dispatch table. More...
#include "mmgr.h"Go to the source code of this file.
Data Structures | |
| struct | mmgr_span |
| A buffer being filled: its bytes, how far the writer has gone, and whether it ran out. More... | |
| struct | mmgr_cspan |
| A buffer being read: its bytes, how far the reader has gone, and whether it ran out. More... | |
| struct | SpatiumCfg |
| Arguments for every spat call, where each call reads only the members it needs. More... | |
| struct | SpatiumNs |
| Type of the spat dispatch table. More... | |
Functions | |
| mmgr_span | mmgr_spat_from (const SpatiumCfg *args) |
| Builds a fill span over args->buf, with pos at 0 and overflow clear. | |
| mmgr_cspan | mmgr_spat_cfrom (const SpatiumCfg *args) |
| Builds a read span over args->cbuf, with pos at 0 and err clear. | |
| embed_bool | mmgr_spat_ok (const SpatiumCfg *args) |
| Returns whether args->span has storage and has not overflowed. | |
| embed_bool | mmgr_spat_cok (const SpatiumCfg *args) |
| Returns whether args->cspan has storage and has recorded no error. | |
| embed_bool | mmgr_spat_has_storage (const SpatiumCfg *args) |
| Returns whether args->span covers any bytes at all. | |
| void | mmgr_spat_reset (const SpatiumCfg *args) |
| Returns the span at args->at to its start and clears its overflow. | |
| mmgr_span | mmgr_spat_after (const SpatiumCfg *args) |
| Returns the span beginning args->count bytes into args->span. | |
| mmgr_span | mmgr_spat_first (const SpatiumCfg *args) |
| Returns the span covering only the first args->count bytes of args->span. | |
| mmgr_cspan | mmgr_spat_produced (const SpatiumCfg *args) |
| Returns a read span over everything written into args->span. | |
| mmgr_cspan | mmgr_spat_read (const SpatiumCfg *args) |
| Returns a read span over the first args->count bytes written into args->span. | |
Variables | |
| static const SpatiumNs | spat |
| Dispatch table instance named spat, with each member set to its mmgr_spat_ function. | |
Spans over a caller's buffer, the two span types, and the spat dispatch table.
Definition in file spatium.h.
| mmgr_span mmgr_spat_from | ( | const SpatiumCfg * | args | ) |
Builds a fill span over args->buf, with pos at 0 and overflow clear.
| [in] | args | Buffer buf and its extent cap [BORROWS]. |
References mmgr_spat_from().
Referenced by mmgr_spat_from().
| mmgr_cspan mmgr_spat_cfrom | ( | const SpatiumCfg * | args | ) |
Builds a read span over args->cbuf, with pos at 0 and err clear.
| [in] | args | Buffer cbuf and its extent cap [BORROWS]. |
References mmgr_spat_cfrom().
Referenced by mmgr_spat_cfrom().
| embed_bool mmgr_spat_ok | ( | const SpatiumCfg * | args | ) |
Returns whether args->span has storage and has not overflowed.
| [in] | args | Span to test, as args->span [BORROWS]. |
References mmgr_spat_ok().
Referenced by mmgr_spat_ok().
| embed_bool mmgr_spat_cok | ( | const SpatiumCfg * | args | ) |
Returns whether args->cspan has storage and has recorded no error.
| [in] | args | Read span to test, as args->cspan [BORROWS]. |
References mmgr_spat_cok().
Referenced by mmgr_spat_cok().
| embed_bool mmgr_spat_has_storage | ( | const SpatiumCfg * | args | ) |
Returns whether args->span covers any bytes at all.
| [in] | args | Span to test, as args->span [BORROWS]. |
References mmgr_spat_has_storage().
Referenced by mmgr_spat_has_storage().
| void mmgr_spat_reset | ( | const SpatiumCfg * | args | ) |
Returns the span at args->at to its start and clears its overflow.
| [in,out] | args | Span to rewind, as args->at [BORROWS]. |
References mmgr_spat_reset().
Referenced by mmgr_spat_reset().
| mmgr_span mmgr_spat_after | ( | const SpatiumCfg * | args | ) |
Returns the span beginning args->count bytes into args->span.
| [in] | args | Span to walk, as args->span, and the bytes to skip as args->count [BORROWS]. |
References mmgr_spat_after().
Referenced by mmgr_spat_after().
| mmgr_span mmgr_spat_first | ( | const SpatiumCfg * | args | ) |
Returns the span covering only the first args->count bytes of args->span.
| [in] | args | Span to narrow, as args->span, and the bytes to keep as args->count [BORROWS]. |
References mmgr_spat_first().
Referenced by mmgr_spat_first().
| mmgr_cspan mmgr_spat_produced | ( | const SpatiumCfg * | args | ) |
Returns a read span over everything written into args->span.
| [in] | args | Span to read back, as args->span [BORROWS]. |
References mmgr_spat_produced().
Referenced by mmgr_spat_produced().
| mmgr_cspan mmgr_spat_read | ( | const SpatiumCfg * | args | ) |
Returns a read span over the first args->count bytes written into args->span.
| [in] | args | Span to read back, as args->span, and the bytes to cover as args->count [BORROWS]. |
References mmgr_spat_read().
Referenced by mmgr_spat_read().