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 |
| Most needle offsets the search sieve tests per candidate word. | |
| #define | MMGR_FIND_CHAIN_MAX |
| Longest haystack a one or two byte needle is settled over by a mask chain and not by building a sieve. | |
Functions | |
| CatenaFinitaCfg | mmgr_cellul_init (const CatenaFinitaCfg *args) |
| Returns a copy of the argument struct. | |
| size_t | mmgr_cellul_len (const CatenaFinitaCfg *args) |
| Returns the bytes in src before its terminator, starting at args->at. | |
| size_t | mmgr_cellul_diff (const CatenaFinitaCfg *args) |
| Returns the offset of the first byte where src and other differ. | |
| embed_bool | mmgr_cellul_eq (const CatenaFinitaCfg *args) |
| Reports whether src and other hold the same terminated string. | |
| embed_bool | mmgr_cellul_starts (const CatenaFinitaCfg *args) |
| Reports whether src begins with other. | |
| const char * | mmgr_cellul_find (const CatenaFinitaCfg *args) |
| Finds the first occurrence of other within src. | |
| embed_bool | mmgr_cellul_has (const CatenaFinitaCfg *args) |
| Reports whether other occurs within src. | |
| const char * | mmgr_cellul_chr (const CatenaFinitaCfg *args) |
| Finds the first occurrence of args->byte in src, before the terminator. | |
| size_t | mmgr_cellul_copy (const CatenaFinitaCfg *args) |
| Copies src into dst, writing at most cap bytes including the terminator. | |
| embed_bool | mmgr_cellul_ws (const CatenaFinitaCfg *args) |
| Tests src[at] for whitespace. | |
| embed_bool | mmgr_cellul_digit (const CatenaFinitaCfg *args) |
| Tests src[at] for a decimal digit. | |
| embed_iword | mmgr_cellul_step_word (const VerboProgrediorCfg *args) |
| Compares one word pair and reports whether a walk should continue. | |
| embed_iword | mmgr_cellul_step_byte (const VerboProgrediorCfg *args) |
| Compares one byte pair and reports whether a walk should continue. | |
| embed_iword | mmgr_cellul_to_long (const TransfiguroCfg *args) |
| Reads a signed decimal integer from args->src. | |
| embed_word | mmgr_cellul_to_ulong (const TransfiguroCfg *args) |
| Reads an unsigned decimal integer from args->src. | |
| double | mmgr_cellul_to_double (const TransfiguroCfg *args) |
| Reads a decimal floating point number from args->src. | |
| float | mmgr_cellul_to_float (const TransfiguroCfg *args) |
| Reads a decimal floating point number from args->src and narrows it to float. | |
Variables | |
| static const CellularumLaboroNs | cellul |
| Dispatch table instance named cellul, with each member set to its mmgr_cellul_ function. | |
Bounded string work: the three argument types, the calls, and the cellul dispatch table.
Definition in file cellularum_laboro.h.
| #define MMGR_SIEVE_ROWS |
Most needle offsets the search sieve tests per candidate word.
Definition at line 49 of file cellularum_laboro.h.
| #define MMGR_FIND_CHAIN_MAX |
Longest haystack a one or two byte needle is settled over by a mask chain and not by building a sieve.
n 8 64 2048 Xtensa chain 124 489 13391 Xtensa sieve 187 607 15494 RISC-V chain 124 488 13393 RISC-V sieve 219 680 17059
The chain wins at every length on both parts, and so the default is no limit. The knob is kept because that is a measurement instead of a proof, and a part or a workload that disagrees should be able to say so without editing the walk.
Definition at line 80 of file cellularum_laboro.h.
| CatenaFinitaCfg mmgr_cellul_init | ( | const CatenaFinitaCfg * | args | ) |
Returns a copy of the argument struct.
| [in] | args | Struct to copy [BORROWS]. |
References mmgr_cellul_init().
Referenced by mmgr_cellul_init().
| size_t mmgr_cellul_len | ( | const CatenaFinitaCfg * | args | ) |
Returns the bytes in src before its terminator, starting at args->at.
| [in] | args | Bytes src, the extent cap, and the start offset at [BORROWS]. |
References mmgr_cellul_len().
Referenced by mmgr_cellul_len().
| size_t mmgr_cellul_diff | ( | const CatenaFinitaCfg * | args | ) |
Returns the offset of the first byte where src and other differ.
| [in] | args | Bytes src and other, the extent cap, and ci [BORROWS]. |
References mmgr_cellul_diff().
Referenced by mmgr_cellul_diff().
| embed_bool mmgr_cellul_eq | ( | const CatenaFinitaCfg * | args | ) |
Reports whether src and other hold the same terminated string.
| [in] | args | Bytes src and other, the extent cap, and ci [BORROWS]. |
References mmgr_cellul_eq().
Referenced by mmgr_cellul_eq().
| embed_bool mmgr_cellul_starts | ( | const CatenaFinitaCfg * | args | ) |
Reports whether src begins with other.
| [in] | args | Bytes src and other, the extent cap, and ci [BORROWS]. |
References mmgr_cellul_starts().
Referenced by mmgr_cellul_starts().
| const char * mmgr_cellul_find | ( | const CatenaFinitaCfg * | args | ) |
Finds the first occurrence of other within src.
| [in] | args | Haystack src with cap, needle other with other_cap, and ci [BORROWS]. |
References mmgr_cellul_find().
Referenced by mmgr_cellul_find().
| embed_bool mmgr_cellul_has | ( | const CatenaFinitaCfg * | args | ) |
Reports whether other occurs within src.
| [in] | args | Haystack src with cap, needle other with other_cap, and ci [BORROWS]. |
References mmgr_cellul_has().
Referenced by mmgr_cellul_has().
| const char * mmgr_cellul_chr | ( | const CatenaFinitaCfg * | args | ) |
Finds the first occurrence of args->byte in src, before the terminator.
| [in] | args | Bytes src, the extent cap, and the byte sought [BORROWS]. |
References mmgr_cellul_chr().
Referenced by mmgr_cellul_chr().
| size_t mmgr_cellul_copy | ( | const CatenaFinitaCfg * | args | ) |
Copies src into dst, writing at most cap bytes including the terminator.
| [in,out] | args | Source src, destination dst, and the destination extent cap [BORROWS]. |
References mmgr_cellul_copy().
Referenced by mmgr_cellul_copy().
| embed_bool mmgr_cellul_ws | ( | const CatenaFinitaCfg * | args | ) |
Tests src[at] for whitespace.
| [in] | args | Bytes src and the offset at [BORROWS]. |
References mmgr_cellul_ws().
Referenced by mmgr_cellul_ws().
| embed_bool mmgr_cellul_digit | ( | const CatenaFinitaCfg * | args | ) |
Tests src[at] for a decimal digit.
| [in] | args | Bytes src and the offset at [BORROWS]. |
References mmgr_cellul_digit().
Referenced by mmgr_cellul_digit().
| embed_iword mmgr_cellul_step_word | ( | const VerboProgrediorCfg * | args | ) |
Compares one word pair and reports whether a walk should continue.
| [in] | args | Words word_left and word_right, with ci and end_wins [BORROWS]. |
References mmgr_cellul_step_word().
Referenced by mmgr_cellul_step_word().
| embed_iword mmgr_cellul_step_byte | ( | const VerboProgrediorCfg * | args | ) |
Compares one byte pair and reports whether a walk should continue.
| [in] | args | Bytes byte_left and byte_right, with ci and end_wins [BORROWS]. |
References mmgr_cellul_step_byte().
Referenced by mmgr_cellul_step_byte().
| embed_iword mmgr_cellul_to_long | ( | const TransfiguroCfg * | args | ) |
Reads a signed decimal integer from args->src.
| [in,out] | args | Text src and the optional end target [BORROWS]. |
References mmgr_cellul_to_long().
Referenced by mmgr_cellul_to_long().
| embed_word mmgr_cellul_to_ulong | ( | const TransfiguroCfg * | args | ) |
Reads an unsigned decimal integer from args->src.
| [in,out] | args | Text src and the optional end target [BORROWS]. |
References mmgr_cellul_to_ulong().
Referenced by mmgr_cellul_to_ulong().
| double mmgr_cellul_to_double | ( | const TransfiguroCfg * | args | ) |
Reads a decimal floating point number from args->src.
| [in,out] | args | Text src and the optional end target [BORROWS]. |
References mmgr_cellul_to_double().
Referenced by mmgr_cellul_to_double().
| float mmgr_cellul_to_float | ( | const TransfiguroCfg * | args | ) |
Reads a decimal floating point number from args->src and narrows it to float.
| [in,out] | args | Text src and the optional end target [BORROWS]. |
References mmgr_cellul_to_float().
Referenced by mmgr_cellul_to_float().
|
static |
Dispatch table instance named cellul, with each member set to its mmgr_cellul_ function.
Definition at line 341 of file cellularum_laboro.h.