MMgr v1.0.0
Zero-heap memory manager in C11. One borrowed buffer, carved by asserted offset.
Loading...
Searching...
No Matches
mmgr_cspan Struct Reference

A buffer being read: its bytes, how far the reader has gone, and whether it ran out. More...

#include <spatium.h>

Data Fields

const uint8_t * buf
size_t len
size_t pos
embed_bool err

Detailed Description

A buffer being read: its bytes, how far the reader has gone, and whether it ran out.

Note
The read-only counterpart of mmgr_span. buf is const here. A span handed out for reading cannot be written through it.
err is sticky, for the same reason overflow is.
Warning
buf points at storage that must outlive every use of the span [BORROWS].

Definition at line 62 of file spatium.h.

Field Documentation

◆ buf

const uint8_t* mmgr_cspan::buf

First byte, or NULL when there is nothing to read [BORROWS].

Definition at line 64 of file spatium.h.

◆ len

size_t mmgr_cspan::len

Readable bytes at buf.

Definition at line 65 of file spatium.h.

◆ pos

size_t mmgr_cspan::pos

Bytes read so far.

Definition at line 66 of file spatium.h.

◆ err

embed_bool mmgr_cspan::err

Set once a read has run past len, and never cleared after.

Definition at line 67 of file spatium.h.


The documentation for this struct was generated from the following file: