MMgr v2.3.0
Zero-heap memory manager in C11. One borrowed buffer, carved by asserted offset.
Loading...
Searching...
No Matches
verba_scribo.h File Reference

Text and number writes, the limits, and one table per type of thing written. More...

#include "mmgr.h"

Go to the source code of this file.

Data Structures

struct  VerbaTextusCfg
 Arguments for the entries that write text into a buffer. More...
struct  VerbaScriboTextusNs
 Type of the verba_textus dispatch table. More...
struct  VerbaLitteraCfg
 Arguments for the entries that write one character. More...
struct  VerbaScriboLitteraNs
 Type of the verba_littera dispatch table. More...
struct  VerbaNumerusCfg
 Arguments for the entries that write an integer. More...
struct  VerbaScriboNumerusNs
 Type of the verba_numerus dispatch table. More...
struct  VerbaFractioCfg
 Arguments for the entries that write a double. More...
struct  VerbaScriboFractioNs
 Type of the verba_fractio dispatch table. More...
struct  VerbaFinisCfg
 Arguments for the entries that write the buffer itself, with no value to place in it. More...
struct  VerbaScriboFinisNs
 Type of the verba_finis dispatch table. More...

Macros

#define MMGR_G_MAX_SIG
 Expands to 18u, the most significant digits mmgr_verba_g will retain.
#define MMGR_FIXED_MAX_DECIMALS
 Expands to 18u, the max digits after the point mmgr_verba_fixed will write.

Functions

EMBED_HOST_DEVICE size_t mmgr_verba_put_n (const VerbaTextusCfg *args)
 Writes a counted run of text.
EMBED_HOST_DEVICE size_t mmgr_verba_put (const VerbaTextusCfg *args)
 Writes a terminated string, with a measure of it first.
EMBED_HOST_DEVICE size_t mmgr_verba_put_clip (const VerbaTextusCfg *args)
 Writes as much of a string as fits.
EMBED_HOST_DEVICE size_t mmgr_verba_xml (const VerbaTextusCfg *args)
 Writes text with the four XML entities substituted.
EMBED_HOST_DEVICE size_t mmgr_verba_json (const VerbaTextusCfg *args)
 Writes text as a quoted JSON string.
EMBED_HOST_DEVICE size_t mmgr_verba_ch (const VerbaLitteraCfg *args)
 Writes one character.
EMBED_HOST_DEVICE size_t mmgr_verba_u64_clip (const VerbaNumerusCfg *args)
 Writes a value right aligned, padded with spaces.
EMBED_HOST_DEVICE size_t mmgr_verba_uint (const VerbaNumerusCfg *args)
 Writes a value in the base the caller gives.
EMBED_HOST_DEVICE size_t mmgr_verba_u32w (const VerbaNumerusCfg *args)
 Writes a value in base ten, padded to min digits.
EMBED_HOST_DEVICE size_t mmgr_verba_hex (const VerbaNumerusCfg *args)
 Writes a value in lower case base sixteen.
EMBED_HOST_DEVICE size_t mmgr_verba_u32 (const VerbaNumerusCfg *args)
 Writes a value in base ten, unpadded.
EMBED_HOST_DEVICE size_t mmgr_verba_u64 (const VerbaNumerusCfg *args)
 Writes a value in base ten, unpadded.
EMBED_HOST_DEVICE size_t mmgr_verba_i64 (const VerbaNumerusCfg *args)
 Writes a signed value in base ten.
EMBED_HOST_DEVICE size_t mmgr_verba_g (const VerbaFractioCfg *args)
 Writes a double to a significant digit count.
EMBED_HOST_DEVICE size_t mmgr_verba_fixed (const VerbaFractioCfg *args)
 Writes a double to a decimal count.
EMBED_HOST_DEVICE embed_bool mmgr_verba_sign_bit (const VerbaFractioCfg *args)
 Reports a double's sign bit.
EMBED_HOST_DEVICE embed_bool mmgr_verba_is_inf (const VerbaFractioCfg *args)
 Reports whether a double is an infinity.
EMBED_HOST_DEVICE embed_bool mmgr_verba_is_nan (const VerbaFractioCfg *args)
 Reports whether a double is a NaN.
EMBED_HOST_DEVICE size_t mmgr_verba_finish (const VerbaFinisCfg *args)
 Stores the terminator and reports the length.
EMBED_HOST_DEVICE embed_bool mmgr_verba_ok (const VerbaFinisCfg *args)
 Reports whether there is still room.

Variables

static const VerbaScriboTextusNs verba_textus
 Dispatch table instance named verba_textus, with each member set to its mmgr_verba_ function.
static const VerbaScriboLitteraNs verba_littera
 Dispatch table instance named verba_littera, whose one member holds mmgr_verba_ch.
static const VerbaScriboNumerusNs verba_numerus
 Dispatch table instance named verba_numerus, with each member set to its mmgr_verba_ function.
static const VerbaScriboFractioNs verba_fractio
 Dispatch table instance named verba_fractio, with each member set to its mmgr_verba_ function.
static const VerbaScriboFinisNs verba_finis
 Dispatch table instance named verba_finis, with each member set to its mmgr_verba_ function.

Detailed Description

Text and number writes, the limits, and one table per type of thing written.

Author
dstroy0 (Douglas Quigg) dquig.nosp@m.g123.nosp@m.@gmai.nosp@m.l.co.nosp@m.m
Date
2026-08-29
Note
Five tables and not one, each with the arguments its own entries read. A call carries the destination and the value it places, alone. A character write does not pass a double, a base and a column count it will never look at.
Every write entry takes the offset to write at and returns the offset past what it wrote, and so calls chain.
An entry that will not fit returns args->cap, which every later entry then reads as no room left.
finish stores the terminator and reports the length. Nothing before it terminates the buffer.

Definition in file verba_scribo.h.