diff options
| author | eunhhu <[email protected]> | 2026-10-19 04:42:05 +0100 |
|---|---|---|
| committer | eunhhu <[email protected]> | 2026-10-19 04:42:05 +0100 |
| commit | 6596533b0d5fe10f3cab028d7fa69a40e5416ecd (patch) | |
| tree | 9c5a64858ac749d892e673b7aab04928cd3bbe60 /core/module.h | |
| parent | 5a2292a389989b71b99ea582cf306cf1719d8aae (diff) | |
| download | pure-6596533b0d5fe10f3cab028d7fa69a40e5416ecd.tar.gz pure-6596533b0d5fe10f3cab028d7fa69a40e5416ecd.zip | |
028's bytes alone as a state, made: module state type 6 read as a text state flagged PURE_TEXT_BYTES in state_flags (so serve's same_states compares it for queries and replaces), its TEXT_LOAD giving bytes and its TEXT_SET taking them, a cursor's ops on it refused (anchor in bytes) and an anchor in it refused at load; one store file text-NAME, the values record marking each bytes state (kind 7, its name, 8 zero bytes), a text state's file that is no UTF-8 its initial value when marked and store_error when not (as before); a replace carrying bytes to a text only when its draft is UTF-8, else opening the store's draft anew; pure-run shows a bytes state's hex; unit test bytes_states (seven starts from a store: 0xff and 0x00 kept, bytes to text to bytes to text with no UTF-8 and with it; three replaces; four refused); counts: b47 against b46 BFS with batches +0.12%, the rest within 0.001%; the bank's queries (s45 and s47 in turns, six each, bytes compared among them) in_credit -0.31%, per_branch -0.18%, ranks -0.11%, the rest within 0.01%, the seven answers the same bytes; Pure, Vega and aup checks green; 008, 028
Diffstat (limited to 'core/module.h')
| -rw-r--r-- | core/module.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/core/module.h b/core/module.h index 6fad0ec..43d9ccb 100644 --- a/core/module.h +++ b/core/module.h @@ -259,8 +259,11 @@ typedef enum { PURE_STATE_NUM = 0, PURE_STATE_TEXT = 1, PURE_STATE_CURSOR = 2, PURE_STATE_LIST = 3, PURE_STATE_INDEX = 4, PURE_STATE_BOOL = 5, PURE_STATE_I64 = 6 } PureStateType; -/* A state's type in a module: a number, a text, an anchor, a list, a bool or an i64. */ -enum { PURE_MODULE_NUM, PURE_MODULE_TEXT, PURE_MODULE_ANCHOR, PURE_MODULE_LIST, PURE_MODULE_BOOL, PURE_MODULE_I64 }; +/* A state's type in a module: a number, a text, an anchor, a list, a bool, an i64 or bytes (028: held as a text is, its + * flag PURE_TEXT_BYTES, UTF-8 asked of none of it). */ +enum { PURE_MODULE_NUM, PURE_MODULE_TEXT, PURE_MODULE_ANCHOR, PURE_MODULE_LIST, PURE_MODULE_BOOL, PURE_MODULE_I64, + PURE_MODULE_BYTES }; +#define PURE_TEXT_BYTES 1u /* a text state's flag (state_flags): its type is bytes (028) */ /* A number's, a bool's or an i64's state as a list cell's kind (PURE_CELL_..., * for pure_cell_as), or 0xFF for any other state. */ static inline uint8_t pure_value_kind(uint8_t state_type) { |
