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

ASCII class membership: mask type, class list, and the ascii dispatch table. More...

#include "mmgr.h"

Go to the source code of this file.

Data Structures

struct  MmgrAsciiMask
 Sixteen bytes with one bit for each of the code points 0 to 127. More...
struct  AsciiCfg
 Arguments to mmgr_ascii_in: the class and the byte to test. More...
struct  AsciiPersonaBitorumNs
 Type of the ascii dispatch table. More...

Enumerations

enum  MmgrAsciiClass {
  MMGR_ASCII_NUM ,
  MMGR_ASCII_ALPHA ,
  MMGR_ASCII_ALNUM ,
  MMGR_ASCII_UPPER ,
  MMGR_ASCII_LOWER ,
  MMGR_ASCII_HEX ,
  MMGR_ASCII_PUNCT ,
  MMGR_ASCII_SPACE ,
  MMGR_ASCII_CTRL ,
  MMGR_ASCII_PRINT ,
  MMGR_ASCII_CLASSES
}
 Asserts an MmgrAsciiMask is exactly sixteen bytes. More...

Functions

EMBED_HOST_DEVICE embed_bool mmgr_ascii_in (const AsciiCfg *args)
 Returns whether args->byte has its bit set in the type bitmap.
EMBED_HOST_DEVICE uint8_t mmgr_ascii_lower (const AsciiCfg *args)
 Returns args->byte with an upper case letter folded to its lower case, as tolower folds it.
EMBED_HOST_DEVICE uint8_t mmgr_ascii_upper (const AsciiCfg *args)
 Returns args->byte with a lower case letter folded to its upper case, as toupper folds it.

Variables

static const AsciiPersonaBitorumNs ascii
 Dispatch table instance named ascii, with each member set to its mmgr_ascii_ function.

Detailed Description

ASCII class membership: mask type, class list, and the ascii 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
Class membership as a bitmap lookup and not a chain of range compares. One shift, one mask and one test answer any class, and the cost does not grow with how many ranges the class covers.
Covers code points 0 to 127 only. A byte of 0x80 or above is in no class here, and that retains the table sixteen bytes and not thirty-two.

Definition in file ascii_persona_bitorum.h.