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

Bounded string work: the three argument types, the calls, and the cellul dispatch table. More...

Go to the source code of this file.

Data Structures

struct  CatenaFinitaCfg
 Arguments for the string calls, where each call reads only the members it needs. More...
struct  VerboProgrediorCfg
 Arguments for the single-step compares used to drive a walk. More...
struct  TransfiguroCfg
 Arguments for the conversions from text to number. More...
struct  CellularumLaboroNs
 Type of the cellul dispatch table. More...

Macros

#define MMGR_SIEVE_ROWS
 Max needle offsets the search sieve tests per candidate word.
#define MMGR_FIND_CHAIN_MAX
 Longest haystack over which a mask chain, and not a sieve, settles a one or two byte needle.

Functions

EMBED_HOST_DEVICE CatenaFinitaCfg mmgr_cellul_init (const CatenaFinitaCfg *args)
 Returns a copy of the argument struct.
EMBED_HOST_DEVICE size_t mmgr_cellul_len (const CatenaFinitaCfg *args)
 Returns the bytes in src before its terminator, from args->at on.
EMBED_HOST_DEVICE size_t mmgr_cellul_diff (const CatenaFinitaCfg *args)
 Returns the offset of the first byte where src and other differ.
EMBED_HOST_DEVICE embed_bool mmgr_cellul_eq (const CatenaFinitaCfg *args)
 Reports whether src and other hold the same terminated string.
EMBED_HOST_DEVICE embed_bool mmgr_cellul_starts (const CatenaFinitaCfg *args)
 Reports whether src begins with other.
EMBED_HOST_DEVICE const char * mmgr_cellul_find (const CatenaFinitaCfg *args)
 Finds the first occurrence of other within src.
EMBED_HOST_DEVICE embed_bool mmgr_cellul_has (const CatenaFinitaCfg *args)
 Reports whether other occurs within src.
EMBED_HOST_DEVICE const char * mmgr_cellul_chr (const CatenaFinitaCfg *args)
 Finds the first occurrence of args->byte in src, before the terminator.
EMBED_HOST_DEVICE size_t mmgr_cellul_copy (const CatenaFinitaCfg *args)
 Copies src into dst, and writes at max cap bytes, the terminator among them.
EMBED_HOST_DEVICE embed_bool mmgr_cellul_ws (const CatenaFinitaCfg *args)
 Tests src[at] for whitespace.
EMBED_HOST_DEVICE embed_bool mmgr_cellul_digit (const CatenaFinitaCfg *args)
 Tests src[at] for a decimal digit.
EMBED_HOST_DEVICE embed_iword mmgr_cellul_step_word (const VerboProgrediorCfg *args)
 Compares one word pair and reports whether a walk should continue.
EMBED_HOST_DEVICE embed_iword mmgr_cellul_step_byte (const VerboProgrediorCfg *args)
 Compares one byte pair and reports whether a walk should continue.
EMBED_HOST_DEVICE embed_iword mmgr_cellul_to_long (const TransfiguroCfg *args)
 Reads a signed decimal integer from args->src.
EMBED_HOST_DEVICE embed_word mmgr_cellul_to_ulong (const TransfiguroCfg *args)
 Reads an unsigned decimal integer from args->src.
EMBED_HOST_DEVICE double mmgr_cellul_to_double (const TransfiguroCfg *args)
 Reads a decimal floating point number from args->src.
EMBED_HOST_DEVICE float mmgr_cellul_to_float (const TransfiguroCfg *args)
 Reads a decimal floating point number from args->src and narrows it to float.
EMBED_HOST_DEVICE embed_word mmgr_cellul_to_ulong_in (const TransfiguroCfg *args)
 Reads an unsigned integer in base args->base from args->src.
EMBED_HOST_DEVICE size_t mmgr_cellul_span (const CatenaFinitaCfg *args)
 Counts the bytes at the start of src that the set other holds.
EMBED_HOST_DEVICE size_t mmgr_cellul_span_not (const CatenaFinitaCfg *args)
 Counts the bytes at the start of src that the set other does not hold.
EMBED_HOST_DEVICE const char * mmgr_cellul_chr_last (const CatenaFinitaCfg *args)
 Finds the last occurrence of args->byte in src, before the terminator.
EMBED_HOST_DEVICE size_t mmgr_cellul_span_last (const CatenaFinitaCfg *args)
 Counts the bytes at the end of src's cap bytes that the set other holds.
EMBED_HOST_DEVICE size_t mmgr_cellul_span_not_last (const CatenaFinitaCfg *args)
 Counts the bytes at the end of src's cap bytes that the set other does not hold.

Variables

static const CellularumLaboroNs cellul
 Dispatch table instance named cellul, with each member set to its mmgr_cellul_ function.

Detailed Description

Bounded string work: the three argument types, the calls, and the cellul dispatch table.

Author
dstroy0 (Douglas Quigg) dquig.nosp@m.g123.nosp@m.@gmai.nosp@m.l.co.nosp@m.m
Date
2026-08-29
Note
A cap the caller states bounds the calls that take CatenaFinitaCfg. So no walk runs past it even where the bytes carry no terminator. That bound makes these usable where a libc string call is not. An absent terminator stops a walk and does not run it off the end.
ws and digit are the exception. Each reads the single byte at args->at and never consults cap, because a one byte test has nothing to run past.
The TransfiguroCfg conversions carry no bound at all. Each reads until the first byte that is not part of the number, and so the caller owes them such a byte inside readable storage. A terminator is the usual one.
The VerboProgrediorCfg pair take their operands by value and read no memory, and so neither carries a bound.
Warning
Nothing here allocates or passes back ownership. Every pointer in and out is the caller's, and the addresses find and chr return point into the src they received.

Definition in file cellularum_laboro.h.