MMgr v2.3.0
Zero-heap memory manager in C11. One borrowed buffer, carved by asserted offset.
Loading...
Searching...
No Matches
verba_scribo.h
Go to the documentation of this file.
1/* MMgr - Copyright (C) 2026 Douglas Quigg (dstroy0) <dquigg123@gmail.com>
2 * SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Commercial OR LicenseRef-Educational
3 *
4 * Every use falls under AGPL-3.0-or-later unless you hold explicit permission, which is either a
5 * negotiated commercial licensing contract or an educator's license issued to you personally.
6 */
7/**
8 * @file verba_scribo.h
9 * @brief Text and number writes, the limits, and one table per type of thing written.
10 * @author dstroy0 (Douglas Quigg) <dquigg123@gmail.com>
11 * @date 2026-08-29
12 *
13 * @note Five tables and not one, each with the arguments its own entries read. A call carries the
14 * destination and the value it places, alone. A character write does not pass
15 * a double, a base and a column count it will never look at.
16 * @note Every write entry takes the offset to write at and returns the offset past what it wrote, and so calls chain.
17 * @note An entry that will not fit returns args->cap, which every later entry then reads as no room left.
18 * @note finish stores the terminator and reports the length. Nothing before it terminates the buffer.
19 */
20#ifndef MMGR_VERBA_SCRIBO_H
21#define MMGR_VERBA_SCRIBO_H
22
23/** @addtogroup mod_verba
24 * @{ */
25
26#include "mmgr.h"
27
28EMBED_BEGIN_DECLS
29
30/**
31 * @brief Expands to 18u, the most significant digits mmgr_verba_g will retain.
32 *
33 * @note A larger args->sig stops here. An args->sig of 0 counts as 1.
34 */
35#define MMGR_G_MAX_SIG 18u
36
37/**
38 * @brief Expands to 18u, the max digits after the point mmgr_verba_fixed will write.
39 *
40 * @note A larger args->decimals stops here. An args->decimals of 0 writes no point at all.
41 */
42#define MMGR_FIXED_MAX_DECIMALS 18u
43
44/**
45 * @brief Arguments for the entries that write text into a buffer.
46 *
47 * @note put_n writes text_len bytes. put measures the text when text_len is 0 and takes it as given
48 * otherwise. put_clip, xml and json read text and leave text_len alone.
49 * @warning out must be writable for cap bytes. A byte is always reserved for the terminator finish
50 * stores.
51 */
52typedef struct
53{
54 char *const out; /**< Destination buffer [BORROWS]. */
55 const size_t cap; /**< Bytes available in out. */
56 const size_t at; /**< Offset to write at. */
57 const char *const text; /**< Text to write [BORROWS]. */
58 const size_t text_len; /**< Bytes of text put_n writes, and the length put takes when non-zero. */
60
61/**
62 * @brief Type of the verba_textus dispatch table.
63 *
64 * @note EMBED_TABLE_LAYOUT asserts the five members sit at consecutive EMBED_FUNCTION_POINTER_BYTES offsets, with
65 * nothing else.
66 */
67typedef struct
68{
69 size_t (*put_n)(const VerbaTextusCfg *args); /**< Writes a counted run of text. */
70 size_t (*put)(const VerbaTextusCfg *args); /**< Writes a terminated string, with a measure of it first. */
71 size_t (*put_clip)(const VerbaTextusCfg *args); /**< Writes as much of a string as fits. */
72 size_t (*xml)(const VerbaTextusCfg *args); /**< Writes text with the four XML entities substituted. */
73 size_t (*json)(const VerbaTextusCfg *args); /**< Writes text as a quoted JSON string. */
75EMBED_TABLE_LAYOUT(VerbaScriboTextusNs, put_n, put, put_clip, xml, json);
76
77/**
78 * @brief Arguments for the entries that write one character.
79 *
80 * @note Only mmgr_verba_ch reads these, and it writes one byte at the offset in at.
81 * @warning out must be writable for cap bytes. A byte is always reserved for the terminator finish
82 * stores.
83 */
84typedef struct
85{
86 char *const out; /**< Destination buffer [BORROWS]. */
87 const size_t cap; /**< Bytes available in out. */
88 const size_t at; /**< Offset to write at. */
89 const char ch; /**< Character to write. */
91
92/**
93 * @brief Type of the verba_littera dispatch table.
94 *
95 * @note EMBED_TABLE_LAYOUT asserts the ch member is at offset 0 and that the struct holds nothing else.
96 */
97typedef struct
98{
99 size_t (*ch)(const VerbaLitteraCfg *args); /**< Writes one character. */
101EMBED_TABLE_LAYOUT(VerbaScriboLitteraNs, ch);
102
103/**
104 * @brief Arguments for the entries that write an integer.
105 *
106 * @note i64 reads sval and every other entry reads val. uint is the only one that reads base, and
107 * u64_clip the only one that reads columns.
108 * @note uint, u32w and hex read min. u32, u64 and i64 fix it at one in the backend instead.
109 * @warning out must be writable for cap bytes. A byte is always reserved for the terminator finish
110 * stores.
111 */
112typedef struct
113{
114 char *const out; /**< Destination buffer [BORROWS]. */
115 const size_t cap; /**< Bytes available in out. */
116 const size_t at; /**< Offset to write at. */
117 const uint64_t val; /**< Unsigned value the unsigned entries write. */
118 const int64_t sval; /**< Signed value i64 writes. */
119 const uint8_t base; /**< Numeric base uint writes in: 8, 16, or anything else for ten. */
120 const uint8_t min; /**< Fewest digits to write, padded on the left with zeros. */
121 const uint8_t columns; /**< Fewest columns u64_clip fills, padded on the left with spaces. */
123
124/**
125 * @brief Type of the verba_numerus dispatch table.
126 *
127 * @note EMBED_TABLE_LAYOUT asserts the seven members sit at consecutive EMBED_FUNCTION_POINTER_BYTES offsets, with
128 * nothing else.
129 */
130typedef struct
131{
132 size_t (*u64_clip)(const VerbaNumerusCfg *args); /**< Writes a value right aligned, padded with spaces. */
133 size_t (*uint)(const VerbaNumerusCfg *args); /**< Writes a value in the base the caller gives. */
134 size_t (*u32w)(const VerbaNumerusCfg *args); /**< Writes a value in base ten, padded to min digits. */
135 size_t (*hex)(const VerbaNumerusCfg *args); /**< Writes a value in lower case base sixteen. */
136 size_t (*u32)(const VerbaNumerusCfg *args); /**< Writes a value in base ten, unpadded. */
137 size_t (*u64)(const VerbaNumerusCfg *args); /**< The same walk as u32, named for the width meant. */
138 size_t (*i64)(const VerbaNumerusCfg *args); /**< Writes a signed value in base ten. */
140EMBED_TABLE_LAYOUT(VerbaScriboNumerusNs, u64_clip, uint, u32w, hex, u32, u64, i64);
141
142/**
143 * @brief Arguments for the entries that write a double.
144 *
145 * @note g reads sig and fixed reads decimals. Neither reads the other's. The three predicates read
146 * real on its own and write nothing, and so out and cap may stay unset for them.
147 * @warning g and fixed need out writable for cap bytes. A byte is always reserved for the terminator
148 * finish stores.
149 */
150typedef struct
151{
152 char *const out; /**< Destination buffer [BORROWS]. The three predicates leave it unset. */
153 const size_t cap; /**< Bytes available in out. */
154 const size_t at; /**< Offset to write at. */
155 const double real; /**< The value to write or classify. */
156 const uint8_t sig; /**< Significant digits g retains, clamped at MMGR_G_MAX_SIG. */
157 const uint8_t decimals; /**< Digits after the point fixed writes, clamped at MMGR_FIXED_MAX_DECIMALS. */
159
160/**
161 * @brief Type of the verba_fractio dispatch table.
162 *
163 * @note EMBED_TABLE_LAYOUT asserts the five members sit at consecutive EMBED_FUNCTION_POINTER_BYTES offsets, with
164 * nothing else.
165 */
166typedef struct
167{
168 size_t (*g)(const VerbaFractioCfg *args); /**< Writes a double to a significant digit count. */
169 size_t (*fixed)(const VerbaFractioCfg *args); /**< Writes a double to a decimal count. */
170 embed_bool (*sign_bit)(const VerbaFractioCfg *args); /**< Reports a double's sign bit. */
171 embed_bool (*is_inf)(const VerbaFractioCfg *args); /**< Reports whether a double is an infinity. */
172 embed_bool (*is_nan)(const VerbaFractioCfg *args); /**< Reports whether a double is a NaN. */
174EMBED_TABLE_LAYOUT(VerbaScriboFractioNs, g, fixed, sign_bit, is_inf, is_nan);
175
176/**
177 * @brief Arguments for the entries that write the buffer itself, with no value to place in it.
178 *
179 * @note finish stores a byte at at, and so it needs out. The ok entry compares at against cap and
180 * reads neither the buffer nor a value. So out may stay unset for it.
181 */
182typedef struct
183{
184 char *const out; /**< Destination buffer [BORROWS]. ok leaves it unset. */
185 const size_t cap; /**< Bytes available in out. */
186 const size_t at; /**< Offset reached. */
188
189/**
190 * @brief Type of the verba_finis dispatch table.
191 *
192 * @note EMBED_TABLE_LAYOUT asserts the two members sit at consecutive EMBED_FUNCTION_POINTER_BYTES offsets, with
193 * nothing else.
194 */
195typedef struct
196{
197 size_t (*finish)(const VerbaFinisCfg *args); /**< Stores the terminator and reports the length. */
198 embed_bool (*ok)(const VerbaFinisCfg *args); /**< Reports whether there is still room. */
200EMBED_TABLE_LAYOUT(VerbaScriboFinisNs, finish, ok);
201
202/**
203 * @brief Writes a counted run of text.
204 *
205 * @param[in] args Buffer, capacity, offset, text and its length [BORROWS].
206 * @return The offset past the text, or args->cap when it did not fit.
207 * @note Writes nothing at all when it does not fit, and does not write what it can.
208 * @warning args->text must be readable for args->text_len bytes. It looks for no terminator.
209 */
210EMBED_HOST_DEVICE size_t mmgr_verba_put_n(const VerbaTextusCfg *args);
211
212/**
213 * @brief Writes a terminated string, with a measure of it first.
214 *
215 * @param[in] args Buffer, capacity, offset and the text [BORROWS].
216 * @return The offset past the text, or args->cap when it did not fit.
217 * @note Takes args->text_len as the length when it is non-zero, and only otherwise measures.
218 * @warning args->text must not be NULL here, unlike put_clip, xml and json.
219 */
220EMBED_HOST_DEVICE size_t mmgr_verba_put(const VerbaTextusCfg *args);
221
222/**
223 * @brief Writes as much of a string as fits.
224 *
225 * @param[in] args Buffer, capacity, offset and the text [BORROWS].
226 * @return The offset past the write, which is args->at when nothing was.
227 * @note Returns args->at and not args->cap when it writes nothing. A later call can still write.
228 * @note Bounds the measure by the room left, and so the length measured is already the length that fits.
229 * @warning A NULL args->text writes nothing and does not fault, unlike put.
230 */
231EMBED_HOST_DEVICE size_t mmgr_verba_put_clip(const VerbaTextusCfg *args);
232
233/**
234 * @brief Writes text with the four XML entities substituted.
235 *
236 * @param[in] args Buffer, capacity, offset and the text [BORROWS].
237 * @return The offset past the write, which is args->at for a NULL args->text.
238 * @note Replaces the ampersand, the two angle brackets and the double quote. The apostrophe is
239 * goes out as it is, and so this suits element text and double quoted attributes.
240 * @warning Walks to the terminator. Its own terminator bounds args->text, and not args->cap.
241 */
242EMBED_HOST_DEVICE size_t mmgr_verba_xml(const VerbaTextusCfg *args);
243
244/**
245 * @brief Writes text as a quoted JSON string.
246 *
247 * @param[in] args Buffer, capacity, offset and the text [BORROWS].
248 * @return The offset past the close quote, or args->cap once something did not fit.
249 * @note Writes the open and close quotes itself, and so the result is a complete JSON string. A
250 * NULL args->text writes an empty pair of quotes where xml writes nothing at all.
251 * @warning Walks to the terminator. Its own terminator bounds args->text, and not args->cap.
252 */
253EMBED_HOST_DEVICE size_t mmgr_verba_json(const VerbaTextusCfg *args);
254
255/**
256 * @brief Writes one character.
257 *
258 * @param[in] args Buffer, capacity, offset and the character [BORROWS].
259 * @return args->at plus one, or args->cap when there is no room.
260 * @note The base step the escape and digit entries write through, one character at a time.
261 * @warning args->out must be writable for args->cap bytes. A byte is always reserved for the
262 * terminator finish stores.
263 */
264EMBED_HOST_DEVICE size_t mmgr_verba_ch(const VerbaLitteraCfg *args);
265
266/**
267 * @brief Writes a value right aligned, padded with spaces.
268 *
269 * @param[in] args Buffer, capacity, offset, the value and the column count [BORROWS].
270 * @return The offset past the write, which is args->at when there was no room.
271 * @note Takes args->columns as a floor. A value that needs more digits than that widens the field.
272 * @note Pads on the left with spaces, where uint pads with leading zeros.
273 * @warning args->out must be writable for args->cap bytes, and one byte stays reserved for the terminator.
274 */
275EMBED_HOST_DEVICE size_t mmgr_verba_u64_clip(const VerbaNumerusCfg *args);
276
277/**
278 * @brief Writes a value in the base the caller gives.
279 *
280 * @param[in] args Buffer, capacity, offset, the value, the base and the least digit count [BORROWS].
281 * @return The offset past the digits, or args->cap when they do not fit.
282 * @note The digit count raised to args->min before the room test is what pads with leading zeros.
283 * @warning Any args->base other than 8 or 16 comes out in base ten, whatever value it holds.
284 */
285EMBED_HOST_DEVICE size_t mmgr_verba_uint(const VerbaNumerusCfg *args);
286
287/**
288 * @brief Writes a value in base ten, padded to min digits.
289 *
290 * @param[in] args Buffer, capacity, offset, the value and the least digit count [BORROWS].
291 * @return The offset past the digits, or args->cap when they do not fit.
292 * @note Fixes the base at ten and forwards args->min, as separates it from u32.
293 * @warning args->base takes no part here, whatever the caller put in it.
294 */
295EMBED_HOST_DEVICE size_t mmgr_verba_u32w(const VerbaNumerusCfg *args);
296
297/**
298 * @brief Writes a value in lower case base sixteen.
299 *
300 * @param[in] args Buffer, capacity, offset, the value and the least digit count [BORROWS].
301 * @return The offset past the digits, or args->cap when they do not fit.
302 * @note Fixes the base at sixteen, and so the digits come out lower case. Forwards args->min so the
303 * result can carry leading zeros to a fixed width.
304 * @warning args->base takes no part here, whatever the caller put in it.
305 */
306EMBED_HOST_DEVICE size_t mmgr_verba_hex(const VerbaNumerusCfg *args);
307
308/**
309 * @brief Writes a value in base ten, unpadded.
310 *
311 * @param[in] args Buffer, capacity, offset and the value [BORROWS].
312 * @return The offset past the digits, or args->cap when they do not fit.
313 * @note Fixes both the base at ten and the least digit count at one.
314 * @warning Neither args->base nor args->min takes any part here. Reach for u32w to pad.
315 */
316EMBED_HOST_DEVICE size_t mmgr_verba_u32(const VerbaNumerusCfg *args);
317
318/**
319 * @brief Writes a value in base ten, unpadded.
320 *
321 * @param[in] args Buffer, capacity, offset and the value [BORROWS].
322 * @return The offset past the digits, or args->cap when they do not fit.
323 * @note The same walk as u32, since args->val is 64 bits either way. Both names exist to let a caller
324 * read the width it means at the call.
325 * @warning Neither args->base nor args->min takes any part here. Reach for u32w to pad.
326 */
327EMBED_HOST_DEVICE size_t mmgr_verba_u64(const VerbaNumerusCfg *args);
328
329/**
330 * @brief Writes a signed value in base ten.
331 *
332 * @param[in] args Buffer, capacity, offset and the signed value in sval [BORROWS].
333 * @return The offset past the digits, or args->cap when they do not fit.
334 * @note Writes the sign through ch, then passes the magnitude to uint at base ten.
335 * @note The magnitude is -(sval + 1) plus one, which stays in range for the max negative value.
336 * @warning Reads args->sval and not args->val. A caller that fills the unsigned member writes a zero.
337 */
338EMBED_HOST_DEVICE size_t mmgr_verba_i64(const VerbaNumerusCfg *args);
339
340/**
341 * @brief Writes a double to a significant digit count.
342 *
343 * @param[in] args Buffer, capacity, offset, the value and the significant digit count [BORROWS].
344 * @return The offset past the write, or args->cap once something did not fit.
345 * @note An args->sig of 0 counts as 1, and anything above MMGR_G_MAX_SIG stops there.
346 * @note Picks the shorter of a plain and an exponential form, and drops trailing zeros before it chooses.
347 * @warning An infinity writes inf and a NaN writes nan, lower case and unquoted, and so neither is valid
348 * JSON on its own.
349 */
350EMBED_HOST_DEVICE size_t mmgr_verba_g(const VerbaFractioCfg *args);
351
352/**
353 * @brief Writes a double to a decimal count.
354 *
355 * @param[in] args Buffer, capacity, offset, the value and the decimal count [BORROWS].
356 * @return The offset past the write, or args->cap once something did not fit.
357 * @note args->decimals stops at MMGR_FIXED_MAX_DECIMALS, and a value of 0 writes no point at all.
358 * @note A half rounds up, and a fraction that carries raises the integer part. The sign goes out
359 * ahead of the magnitude. A negative half rounds away from zero.
360 * @warning A magnitude too large for 64 bits of integer part falls back to g at ten significant
361 * digits. So the result is not always in the fixed form the caller asked for.
362 */
363EMBED_HOST_DEVICE size_t mmgr_verba_fixed(const VerbaFractioCfg *args);
364
365/**
366 * @brief Reports a double's sign bit.
367 *
368 * @param[in] args The value to test, as args->real [BORROWS].
369 * @return EMBED_TRUE when the sign bit holds, with nothing written.
370 * @note Reads the bit and does not compare against zero. A negative zero returns EMBED_TRUE.
371 * @note Reads no member but args->real. args->out may stay unset.
372 */
373EMBED_HOST_DEVICE embed_bool mmgr_verba_sign_bit(const VerbaFractioCfg *args);
374
375/**
376 * @brief Reports whether a double is an infinity.
377 *
378 * @param[in] args The value to test, as args->real [BORROWS].
379 * @return EMBED_TRUE for either infinity, with nothing written.
380 * @note Wants the exponent field all ones and the mantissa zero, where is_nan wants it non-zero.
381 * @note The sign takes no part. A negative infinity returns EMBED_TRUE too.
382 */
383EMBED_HOST_DEVICE embed_bool mmgr_verba_is_inf(const VerbaFractioCfg *args);
384
385/**
386 * @brief Reports whether a double is a NaN.
387 *
388 * @param[in] args The value to test, as args->real [BORROWS].
389 * @return EMBED_TRUE for any NaN, with nothing written.
390 * @note Wants the exponent field all ones and the mantissa non-zero, where is_inf wants it zero.
391 * @note Quiet and signaling NaNs answer alike, since the test covers only a non-zero mantissa.
392 */
393EMBED_HOST_DEVICE embed_bool mmgr_verba_is_nan(const VerbaFractioCfg *args);
394
395/**
396 * @brief Stores the terminator and reports the length.
397 *
398 * @param[in] args Buffer, capacity and the offset reached [BORROWS].
399 * @return args->at, or 0 when args->at already reached args->cap.
400 * @note A return of 0 covers both an empty result and one that ran out of room. ok tells them apart.
401 * @warning The only entry that writes a terminator. A buffer is not a string until this runs.
402 */
403EMBED_HOST_DEVICE size_t mmgr_verba_finish(const VerbaFinisCfg *args);
404
405/**
406 * @brief Reports whether there is still room.
407 *
408 * @param[in] args Capacity and the offset reached [BORROWS].
409 * @return EMBED_TRUE while there is still room, EMBED_FALSE once an entry returned args->cap.
410 * @note Reads neither args->out nor any value member, and so it touches no memory and args->out may be NULL.
411 */
412EMBED_HOST_DEVICE embed_bool mmgr_verba_ok(const VerbaFinisCfg *args);
413
414/**
415 * @brief Dispatch table instance named verba_textus, with each member set to its mmgr_verba_ function.
416 */
417EMBED_TABLE_STORAGE VerbaScriboTextusNs verba_textus EMBED_UNUSED = {
418 .put_n = mmgr_verba_put_n,
419 .put = mmgr_verba_put,
420 .put_clip = mmgr_verba_put_clip,
421 .xml = mmgr_verba_xml,
422 .json = mmgr_verba_json,
423};
424
425/**
426 * @brief Dispatch table instance named verba_littera, whose one member holds mmgr_verba_ch.
427 */
428EMBED_TABLE_STORAGE VerbaScriboLitteraNs verba_littera EMBED_UNUSED = {
429 .ch = mmgr_verba_ch,
430};
431
432/**
433 * @brief Dispatch table instance named verba_numerus, with each member set to its mmgr_verba_ function.
434 */
435EMBED_TABLE_STORAGE VerbaScriboNumerusNs verba_numerus EMBED_UNUSED = {
436 .u64_clip = mmgr_verba_u64_clip,
437 .uint = mmgr_verba_uint,
438 .u32w = mmgr_verba_u32w,
439 .hex = mmgr_verba_hex,
440 .u32 = mmgr_verba_u32,
441 .u64 = mmgr_verba_u64,
442 .i64 = mmgr_verba_i64,
443};
444
445/**
446 * @brief Dispatch table instance named verba_fractio, with each member set to its mmgr_verba_ function.
447 */
448EMBED_TABLE_STORAGE VerbaScriboFractioNs verba_fractio EMBED_UNUSED = {
449 .g = mmgr_verba_g,
450 .fixed = mmgr_verba_fixed,
451 .sign_bit = mmgr_verba_sign_bit,
452 .is_inf = mmgr_verba_is_inf,
453 .is_nan = mmgr_verba_is_nan,
454};
455
456/**
457 * @brief Dispatch table instance named verba_finis, with each member set to its mmgr_verba_ function.
458 */
459EMBED_TABLE_STORAGE VerbaScriboFinisNs verba_finis EMBED_UNUSED = {
460 .finish = mmgr_verba_finish,
461 .ok = mmgr_verba_ok,
462};
463
464EMBED_END_DECLS
465
466/** @} */
467
468#endif
static const VerbaScriboLitteraNs verba_littera
Dispatch table instance named verba_littera, whose one member holds mmgr_verba_ch.
EMBED_HOST_DEVICE embed_bool mmgr_verba_is_nan(const VerbaFractioCfg *args)
Reports whether a double is a NaN.
static const VerbaScriboFinisNs verba_finis
Dispatch table instance named verba_finis, with each member set to its mmgr_verba_ function.
EMBED_HOST_DEVICE size_t mmgr_verba_ch(const VerbaLitteraCfg *args)
Writes one character.
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_put(const VerbaTextusCfg *args)
Writes a terminated string, with a measure of it first.
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_json(const VerbaTextusCfg *args)
Writes text as a quoted JSON string.
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_g(const VerbaFractioCfg *args)
Writes a double to a significant digit count.
EMBED_HOST_DEVICE size_t mmgr_verba_put_n(const VerbaTextusCfg *args)
Writes a counted run of text.
static const VerbaScriboTextusNs verba_textus
Dispatch table instance named verba_textus, with each member set to its mmgr_verba_ function.
EMBED_HOST_DEVICE embed_bool mmgr_verba_sign_bit(const VerbaFractioCfg *args)
Reports a double's sign bit.
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_i64(const VerbaNumerusCfg *args)
Writes a signed value in base ten.
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_finish(const VerbaFinisCfg *args)
Stores the terminator and reports the length.
EMBED_HOST_DEVICE size_t mmgr_verba_u64_clip(const VerbaNumerusCfg *args)
Writes a value right aligned, padded with spaces.
static const VerbaScriboFractioNs verba_fractio
Dispatch table instance named verba_fractio, with each member set to its mmgr_verba_ function.
EMBED_HOST_DEVICE embed_bool mmgr_verba_is_inf(const VerbaFractioCfg *args)
Reports whether a double is an infinity.
static const VerbaScriboNumerusNs verba_numerus
Dispatch table instance named verba_numerus, with each member set to its mmgr_verba_ function.
EMBED_HOST_DEVICE size_t mmgr_verba_fixed(const VerbaFractioCfg *args)
Writes a double to a decimal count.
EMBED_HOST_DEVICE size_t mmgr_verba_put_clip(const VerbaTextusCfg *args)
Writes as much of a string as fits.
EMBED_HOST_DEVICE embed_bool mmgr_verba_ok(const VerbaFinisCfg *args)
Reports whether there is still room.
EMBED_HOST_DEVICE size_t mmgr_verba_hex(const VerbaNumerusCfg *args)
Writes a value in lower case base sixteen.
The embedded_types headers every module builds on.
Arguments for the entries that write the buffer itself, with no value to place in it.
const size_t at
char *const out
const size_t cap
Arguments for the entries that write a double.
char *const out
const double real
const size_t at
const size_t cap
const uint8_t decimals
const uint8_t sig
Arguments for the entries that write one character.
char *const out
const char ch
const size_t cap
const size_t at
Arguments for the entries that write an integer.
const uint64_t val
const size_t cap
char *const out
const uint8_t base
const int64_t sval
const uint8_t min
const uint8_t columns
const size_t at
Type of the verba_finis dispatch table.
embed_bool(*) ok(const VerbaFinisCfg *args)
size_t(*) finish(const VerbaFinisCfg *args)
Type of the verba_fractio dispatch table.
embed_bool(*) is_inf(const VerbaFractioCfg *args)
embed_bool(*) sign_bit(const VerbaFractioCfg *args)
size_t(*) g(const VerbaFractioCfg *args)
embed_bool(*) is_nan(const VerbaFractioCfg *args)
size_t(*) fixed(const VerbaFractioCfg *args)
Type of the verba_littera dispatch table.
size_t(*) ch(const VerbaLitteraCfg *args)
Type of the verba_numerus dispatch table.
size_t(*) u32w(const VerbaNumerusCfg *args)
size_t(*) u64(const VerbaNumerusCfg *args)
size_t(*) u64_clip(const VerbaNumerusCfg *args)
size_t(*) i64(const VerbaNumerusCfg *args)
size_t(*) u32(const VerbaNumerusCfg *args)
size_t(*) hex(const VerbaNumerusCfg *args)
size_t(*) uint(const VerbaNumerusCfg *args)
Type of the verba_textus dispatch table.
size_t(*) put_clip(const VerbaTextusCfg *args)
size_t(*) put(const VerbaTextusCfg *args)
size_t(*) put_n(const VerbaTextusCfg *args)
size_t(*) xml(const VerbaTextusCfg *args)
size_t(*) json(const VerbaTextusCfg *args)
Arguments for the entries that write text into a buffer.
const size_t cap
const char *const text
const size_t text_len
char *const out
const size_t at