code wiki / (root) / nx_hex_dump.nx

nx_hex_dump.nx

buildroot/runtime/nx_hex_dump.nx

3967 B133 linesdepth 2pulls 2 transitivereach 2 importersview sourcekind tooltopic hex
docsdependenciesstructsconstsfunctions

about

nx_hex_dump.nx -- bits-up hex+ASCII dump of a byte buffer to an fd. Replaces external tools (xxd, hexdump, hd) with a native NishiLang primitive. Substrate diagnostics MUST use bits-up tools per [[feedback-no-third-party-in-build-path-source-of-truth-is-bits-up]]; if reaching for Wireshark/xxd would diagnose the bug, the substrate needs that capability natively. Output format (16 bytes per line): 00000000 68 74 74 70 73 3a 2f 2f 65 78 61 6d 70 6c 65 2e |https://example.| API: nx_hex_dump_to_fd(fd, label, label_len, bytes, len) -- emit labeled dump on fd (stderr is fd 2). label/label_len may be 0/0 for no label. Returns 0. Per Cardinals 9 (single-responsibility -- one diagnostic primitive), 22 (composition over configuration -- callers choose fd). license_tier: ORIGINAL lineage_id: nishi_hex_dump_q10

dependencies 1 imports · 2 importers

nx_syscalls.nx nx_hex_dump.nx nx_hex_dump_kat_test.nx nx_wire_logger.nx

imports: nx_syscalls.nx

imported by: nx_hex_dump_kat_test.nxnx_wire_logger.nx

structs

none

consts

none

functions

25func _hexnib(v: i64) -> i64
30func _emit_offset(fd: i64, off: i64) -> i64
called by 1: _emit_line calls 3: sys_mmap_hexnibsys_write
47func _emit_line(fd: i64, bytes: *u8, off: i64, total: i64) -> i64
95func nx_hex_dump_to_fd(fd: i64, label: *u8, label_len: i64,
131func main() -> i64