code wiki / _hdl_build / nx_ag_lib.nx

nx_ag_lib.nx

buildroot/runtime/_hdl_build/nx_ag_lib.nx

1806 B17 linesdepth 3pulls 3 transitivereach 2 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_ag_lib.nx -- shared gate helpers (atoi / itoa / strlen / single-read) extracted from nx_gated_edit_gate + nx_consol_apply_gate, which carried byte-identical copies (rule 15: pattern in 2+ -> shared/). Bodies are VERBATIM -> behaviour-preserving by construction; proven by re-running the consumer gate GREEN after delegation. license_tier: ORIGINAL No hw writes (Rule 26). Consumers: nx_gated_edit_gate (+ nx_consol_apply_gate pending NAS sync).

dependencies 2 imports · 2 importers

nx_syscalls.nx nx_itoa_lib.nx nx_ag_lib.nx nx_gated_edit_gate.nx nx_gated_edit_multi_gate.nx

imports: nx_syscalls.nxnx_itoa_lib.nx

imported by: nx_gated_edit_gate.nxnx_gated_edit_multi_gate.nx

structs

none

consts

none

functions

7func ag_atoi(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 }
called by 2: mainmain
15func ag_itoa(dst: *u8, v: i64) -> i64 { return ccz_cat_num(dst, 0, v) }
called by 2: mainmain calls 1: ccz_cat_num
16func ag_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 2: mainmain
17func ag_read(path: *u8, buf: *u8, cap: i64) -> i64 { let fd: i64 = sys_openat_rd(path); if fd < 0 { return 0 - 1 } let n: i64 = sys_read(fd, buf, cap - 1); sys_close(fd); return n }