code wiki / (root) / nx_toner_track.nx

nx_toner_track.nx

buildroot/runtime/nx_toner_track.nx

3388 B74 linesdepth 3pulls 6 transitivereach 0 importersview sourcekind tooltopic toner
docsdependenciesstructsconstsfunctions

about

nx_toner_track.nx -- REAL toner reading from the page we actually printed. Decodes the URF artifact back to its bitmap, measures true ink coverage, records it in the persistent ledger, and reports real toner remaining -- the printer's lying gauge ignored entirely. READ+record only (a data file) -> never-brick. license_tier: ORIGINAL ; genealogy_id: project-printer-management-ipp-sclass-2026-06-20

dependencies 5 imports · 0 importers

nx_syscalls.nx nx_pwg_rle.nx nx_toner_meter.nx nx_toner_ledger.nx nx_toner_store.nx nx_toner_track.nx

imports: nx_syscalls.nxnx_pwg_rle.nxnx_toner_meter.nxnx_toner_ledger.nxnx_toner_store.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main sys_mmap sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close p sys_write sys_exit be32 pn sys_write ↻ sys_mmap ↻ nx_rle_decode nx_toner_coverage_ppm p2 pn ↻ p ↻ nx_tstore_load sys_mmap ↻ sys_read_file ↻ nx_tstore_rd_le64 nx_ledger_add nx_tstore_save sys_mmap ↻ nx_tstore_wr_le64 sys_openat_wr sys_write ↻ sys_close ↻ nx_ledger_remaining_bp nx_ledger_capacity nx_ledger_remaining_pages nx_ledger_capacity ↻ nx_ledger_used_pages

structs

none

consts

11const K_MAGIC_10000: i64 = 10000

functions

13func p(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 2: p2main calls 1: sys_write
14func pn(v: i64) -> i64
called by 2: p2main calls 2: sys_writesys_mmap
24func p2(whole: i64, frac2: i64) -> i64
called by 1: main calls 2: pnp
29func be32(d: *u8, o: i64) -> i64
called by 1: main
33func main() -> i64