code wiki / _hdl_build / nx_estr.nx
nx_estr.nx
buildroot/runtime/_hdl_build/nx_estr.nx
about
nx_estr.nx -- the shared EMIT/CONVERT base class: the 4 primitives that ~1900 organs each reimplement
locally (measured 2026-07-21 via the atlas eco-scorecard's SonarQube line-dup gap: 1159 local puts,
578 local putn/itoa, 589 local cat, across 6183 _hdl_build organs, with NO shared base to import).
Import this instead of hand-rolling a digit loop -- the OO consolidation target for the duplication GAP.
Built on sys_write only (no float, no hw writes -- Rule 26). license_tier: ORIGINAL
dependencies 1 imports · 15 importers
diagram shows first 10 each side; +0 more imports, +5 more importers in the complete lists below.
imports: nx_syscalls.nx
imported by: lmprobe_lm001.nxlmprobe_lm002.nxlmprobe_lm004.nxlmprobe_lm008.nxnx_board.nxnx_debtconfirm.nxnx_elseif_desync_probe.nxnx_estr_gate.nxnx_gate_anchor_edit.nxnx_gatedry.nxnx_landmine_probe.nxnx_magicratchet.nxnx_modtest.nxnx_presubmit_lib.nxnx_wiredclaim.nx
structs
| none |
consts
| none |
functions
| 8 | func es_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 9 | func es_puts(s: *u8) -> i64 { sys_write(1, s, es_len(s)); return 0 } |
| 10 | func es_putn(v: i64) -> i64 |
| 20 | func es_catn(buf: *u8, o: i64, v: i64) -> i64 |
| 31 | func es_cat(buf: *u8, o: i64, s: *u8) -> i64 { var p: i64 = o; var i: i64 = 0; while s[i] != (0 as u8) { buf[p] = s[i]; p = p + 1; i = i + 1 } return p } |
| 33 | func es_atoi(s: *u8) -> i64 { var v: i64 = 0; var i: i64 = 0; var go: i64 = 1; while go == 1 { let c: i64 = s[i] as i64; if c < 48 { go = 0 } else { if c > 57 { go = 0 } else { v = v * 10 + (c - 48); i = i + 1 } } } return v } |