code wiki / (root) / nx_underbuilt_lib.nx

nx_underbuilt_lib.nx

buildroot/runtime/nx_underbuilt_lib.nx

8365 B249 linesdepth 2pulls 2 transitivereach 2 importersview sourcekind librarytopic underbuilt
docsdependenciesstructsconstsfunctions

about

nx_underbuilt_lib.nx -- R6 parse/tally core for the NHTSA underbuilt-part signal (LIB, no main; imported by nx_underbuilt_board + nx_underbuilt_gate). Context-byte JSON key matching (quote-key-quote-colon) so no quote characters appear in nx string literals; component values split on commas and tallied in a ctx-table arena. ctx t: *i64 slots: 0=name-arena ptr, 1=arena-used, 2=off[] ptr, 3=len[] ptr, 4=count[] ptr, 5=ndistinct, 6=records (key occurrences), 7=tokens (sum of counts), 8=arena cap. Board persistence to seg_store = a later rung; v0 board is printed + gated. license_tier: ORIGINAL

dependencies 1 imports · 2 importers

nx_syscalls.nx nx_underbuilt_lib.nx nx_underbuilt_board.nx nx_underbuilt_gate.nx

imports: nx_syscalls.nx

imported by: nx_underbuilt_board.nxnx_underbuilt_gate.nx

structs

none

consts

none

functions

9func ubl_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
10func ubl_putn(v: i64) -> i64
25func ubl_read(path: *u8, buf: *u8, cap: i64) -> i64
43func ubl_match(buf: *u8, n: i64, key: *u8, klen: i64, at: i64) -> i64
called by 1: ubl_next
58func ubl_next(buf: *u8, n: i64, key: *u8, klen: i64, from: i64) -> i64
73func ubl_key_int(buf: *u8, n: i64, key: *u8, klen: i64) -> i64
97func ubl_count_true(buf: *u8, n: i64, key: *u8, klen: i64) -> i64
called by 1: ubb_vehicle calls 1: ubl_next
112func ubl_reset(t: *i64) -> i64 { t[1] = 0; t[5] = 0; t[6] = 0; t[7] = 0; return 0 }
115func ubl_tok_add(t: *i64, buf: *u8, at: i64, len: i64) -> i64
called by 1: ubl_tally
156func ubl_tally(t: *i64, buf: *u8, n: i64, key: *u8, klen: i64) -> i64
203func ubl_top(t: *i64, rank: *i64, kmax: i64) -> i64
called by 2: ubb_vehiclemain
226func ubl_name_out(t: *i64, idx: i64) -> i64
called by 1: ubb_vehicle calls 1: sys_write
235func ubl_name_is(t: *i64, idx: i64, s: *u8) -> i64
called by 1: main