code wiki / (root) / nx_rowparse_lib.nx

nx_rowparse_lib.nx

buildroot/runtime/nx_rowparse_lib.nx

5287 B141 linesdepth 2pulls 2 transitivereach 4 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_rowparse_lib.nx -- THE ONE ROW PARSER for delimited estate records, extracted 2026-09-04 because the DRY law fires at THREE and the third copy had just been written. nx_debt_triple parsed TAB-delimited debt rows, nx_aliascensus parsed TAB-delimited allowlist rows, and nx_refdrift parsed PIPE-delimited refs rows, each with its own private slen, line-end, column, span-compare and number-emit -- the same arithmetic written three times with three prefixes. Each copy was CORRECT; that is precisely why the duplication was invisible, and why the estate's rule is a COUNT rather than a judgement about whether it feels duplicated. THE SEPARATOR IS A PARAMETER, WHICH IS THE WHOLE REASON ONE LIB CAN SERVE ALL THREE. The three organs differed on exactly one axis: TAB for the store planes, PIPE for the compare records. A lib that hardcoded either would have forced the third organ to keep its private copy, which is how a shared lib acquires a duplicate sibling and the count goes from three to four. ⚠A NOTE ON WHAT IS NOT HERE. Nothing in this file reads a file, forks, or decides anything. It is pure span arithmetic over a caller-owned buffer, so a consumer's gate can exercise it with a hand-built fixture and no I/O -- which is the property that made the three consumers gateable in the first place. license_tier: ORIGINAL. No syscalls except the emit helpers' scratch allocation. No hw writes (Rule 26).

dependencies 1 imports · 4 importers

nx_syscalls.nx nx_rowparse_lib.nx nx_aliascensus.nx nx_board_idref_gate.nx nx_debt_triple.nx nx_refdrift.nx

imports: nx_syscalls.nx

imported by: nx_aliascensus.nxnx_board_idref_gate.nxnx_debt_triple.nxnx_refdrift.nx

structs

none

consts

19const RP_NL: i64 = 10
20const RP_TAB: i64 = 9
21const RP_PIPE: i64 = 124
22const RP_ZERO: i64 = 48
23const RP_NINE: i64 = 57
24const RP_MINUS: i64 = 45
25const RP_SCRATCH: i64 = 32
26const RP_TEN: i64 = 10

functions

28func rp_slen(s: *u8) -> i64
35func rp_le(b: *u8, i: i64, n: i64) -> i64
46func rp_col(b: *u8, s: i64, e: i64, col: i64, sep: i64, out: *i64) -> i64
63func rp_col_tab(b: *u8, s: i64, e: i64, col: i64, out: *i64) -> i64
called by 2: mainmain calls 1: rp_col
66func rp_col_pipe(b: *u8, s: i64, e: i64, col: i64, out: *i64) -> i64
called by 2: mainrd_recite_row calls 1: rp_col
69func rp_span_eq(b: *u8, s: i64, l: i64, b2: *u8, s2: i64, l2: i64) -> i64
called by 1: main
78func rp_lit_eq(b: *u8, s: i64, l: i64, lit: *u8) -> i64
89func rp_num(b: *u8, s: i64, l: i64) -> i64
called by 2: mainmain
103func rp_same(a: *u8, an: i64, b: *u8, bn: i64) -> i64
called by 1: rd_same
112func rp_put(out: *u8, o: i64, s: *u8) -> i64
118func rp_putn(out: *u8, o: i64, v: i64) -> i64
called by 5: mainmainmainrd_put2rd_ymd calls 1: sys_mmap
131func rp_putspan(out: *u8, o: i64, b: *u8, s: i64, l: i64) -> i64
136func rp_cstr(dst: *u8, b: *u8, s: i64, l: i64) -> i64
called by 1: main