code wiki / _hdl_build / nx_sovjson_lib.nx

nx_sovjson_lib.nx

buildroot/runtime/_hdl_build/nx_sovjson_lib.nx

5072 B102 linesdepth 2pulls 2 transitivereach 41 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_sovjson_lib.nx -- SHARED sovereign-JSON emitter + seg-store span helpers. OO BASE COMPONENT for the token-efficiency subsystem: nx_clawf_route composes it now; nx_seat (st_*) and the TS03 dispatcher migrate onto it next (filed). Consolidates the ~10 helpers each organ was re-implementing INLINE (DRY, rule-15) -- one canonical copy the atlas can see as a hub. Functionality preserved BY CONSTRUCTION: byte-identical helper semantics, proven by each consumer's gate. license_tier: ORIGINAL No hw writes (Rule 26).

dependencies 1 imports · 41 importers

nx_syscalls.nx nx_sovjson_lib.nx nx_accesswall_research.nx nx_account_admin_census.nx nx_acct_admin_handoff.nx nx_actlog.nx nx_bootmine.nx nx_claude_harvest.nx nx_clawf_route.nx nx_ctxcost.nx nx_debt_hygiene.nx nx_debtmine.nx

diagram shows first 10 each side; +0 more imports, +31 more importers in the complete lists below.

imports: nx_syscalls.nx

imported by: nx_accesswall_research.nxnx_account_admin_census.nxnx_acct_admin_handoff.nxnx_actlog.nxnx_bootmine.nxnx_claude_harvest.nxnx_clawf_route.nxnx_ctxcost.nxnx_debt_hygiene.nxnx_debtmine.nxnx_dedup_candidates.nxnx_dedup_migrate.nxnx_eco_scorecard.nxnx_favela_census.nxnx_featuremine.nxnx_fwdconst_scan.nxnx_harnessmine.nxnx_hw_envelope.nxnx_kaprobe.nxnx_lawsearch.nxnx_leasemine.nxnx_libprobe.nxnx_lsdir.nxnx_maturity_board.nxnx_minecov.nxnx_minerhub.nxnx_mmap_probe.nxnx_netobs.nxnx_ns_probe.nxnx_promptpack.nxnx_pub_desk.nxnx_registrymine.nxnx_res_census.nxnx_seat.nxnx_swapguard_beat.nxnx_tlsprobe.nxnx_tokroi.nxnx_trajscan.nxnx_trajscan_beat.nxnx_treediverge_beat.nxnx_workflowmine.nx

structs

none

consts

62const SJ_ALLOW_BUF: i64 = 131072

functions

9func sj_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
called by 24: aw_putsg_wg_wmainmaindh_puts+18 calls 1: sys_write
10func sj_werr(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(2, s, n); return 0 }
called by 8: mainmainmainmainmainpd_werr+2 calls 1: sys_write
11func sj_vlen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
12func sj_cat(d: *u8, o: i64, s: *u8) -> i64 { var i: i64 = 0; while s[i] != (0 as u8) { d[o] = s[i]; o = o + 1; i = i + 1 } return o }
13func sj_catn(d: *u8, o: i64, v: i64) -> i64 { let t: *u8 = sys_mmap(28); var m: i64 = v; if m < 0 { d[o] = 45 as u8; o = o + 1; m = 0 - m } var k: i64 = 0; if m == 0 { t[0] = 48 as u8; k = 1 } while m > 0 { t[k] = (48 + (m % 10)) as u8; m = m / 10; k = k + 1 } var i: i64 = 0; while i < k { d[o] = t[k-1-i]; o = o + 1; i = i + 1 } return o }
14func sj_cat_esc(d: *u8, o: i64, q: *u8, s: i64, e: i64, maxn: i64) -> i64
31func sj_le(q: *u8, i: i64, n: i64) -> i64 { var e: i64 = i; var s: i64 = 1; while s == 1 { if e >= n { s = 0 } else { if q[e] == (10 as u8) { s = 0 } else { e = e + 1 } } } return e }
32func sj_col(q: *u8, ls: i64, le: i64, c: i64, out: *i64) -> i64
48func sj_lit_eq(q: *u8, s: i64, e: i64, lit: *u8) -> i64
54func sj_atoi_span(q: *u8, s: i64, e: i64) -> i64 { var v: i64 = 0; var i: i64 = s; while i < e { let c: i64 = q[i] as i64; if c >= 48 { if c <= 57 { v = v * 10 + (c - 48) } } i = i + 1 } return v }
55func sj_atoi_z(s: *u8) -> i64 { var v: i64 = 0; var i: i64 = 0; while s[i] != (0 as u8) { let c: i64 = s[i] as i64; if c >= 48 { if c <= 57 { v = v * 10 + (c - 48) } } i = i + 1 } return v }
63func sj_allow_path(name: *u8, outp: *u8) -> i64
90func sj_span_has(q: *u8, s: i64, e: i64, lit: *u8) -> i64