code wiki / (root) / nx_hex.nx

nx_hex.nx

buildroot/runtime/nx_hex.nx

6079 B185 linesdepth 3pulls 3 transitivereach 3 importersview sourcekind tooltopic hex
docsdependenciesstructsconstsfunctions

about

nx_hex.nx -- hex + binary + byte dump helpers. Every enterprise toolchain has a `hexdump` equivalent: raw byte regions rendered in a stable human-readable format for debugging memory state. This module provides three formats: nx_hex_i64 i64 as 16-char hex (no prefix, no pad-space) nx_hex_bytes byte array as `hh hh hh ...` nx_hex_dump full hexdump-C-style: offset + 16 hex + ASCII All write to stderr (fd 2) by default to avoid collision with program stdout. Deterministic output -- no timestamps, no tool-version headers. F6-compatible. Enterprise grade means: * fixed-width columns (sortable, greppable) * ASCII fallback for unprintable bytes (prints '.') * explicit region length (no overruns on short buffers) * offset prefix shows 8-digit hex (up to 4 GB regions) * no dependency on the filesystem -- pure fd write Paired with nx_log (levels + tags) and nx_metrics (counters), nx_hex closes the "what do I see when I'm lost" gap. Every diagnostic should use ONE of: tagged log, numeric metric, or hex dump. Nothing else.

dependencies 1 imports · 2 importers

syscalls.nx nx_hex.nx nx_optimizer_milestone_attest.nx nx_panic.nx

imports: syscalls.nx

imported by: nx_optimizer_milestone_attest.nxnx_panic.nx

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

main nx_hex_nibble nx_hex_i64 nx_hex_nibble ↻ nx_hex_bytes nx_hex_u8 nx_hex_nibble ↻ nx_hex_dump nx_hex_i64_n nx_hex_nibble ↻ nx_hex_u8 ↻

structs

none

consts

none

functions

37func nx_hex_nibble(n: i64) -> i64
44func nx_hex_i64(fd: i64, v: i64) -> i64
58func nx_hex_i64_n(fd: i64, v: i64, n: i64) -> i64
called by 1: nx_hex_dump calls 1: nx_hex_nibble
74func nx_hex_u8(fd: i64, b: i64) -> i64
84func nx_hex_bytes(fd: i64, buf: *u8, n: i64) -> i64
called by 1: main calls 1: nx_hex_u8
98func nx_hex_dump(fd: i64, buf: *u8, n: i64) -> i64
154func main() -> i64