code wiki / _hdl_build / nx_doc_view.nx

nx_doc_view.nx

buildroot/runtime/_hdl_build/nx_doc_view.nx

5061 B119 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind tooltopic doc
docsdependenciesstructsconstsfunctions

about

nx_doc_view.nx -- the Nishi browser's DOCUMENT-VIEWER DISPATCH. Makes the browser an omnitool WITHOUT bloat: a data-driven registry (knowledge/doc_viewers.conf: "<ext>\t<renderer_elf>\t<label>") maps a file extension to a focused sovereign renderer organ, which nx_doc_view fork-execs to turn the document into a 0-JS HTML page the browser shows INLINE. Adding a format = ONE registry row + a renderer organ; this dispatcher never changes. Renderers share one interface: "<elf> html <in> <out.html> [download_url]". license_tier: ORIGINAL

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_doc_view.nx

imports: nx_syscalls.nx

imported by: nobody (leaf or entry point)

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

main dv_puts sys_write dv_slen sys_exit sys_mmap dv_ext dv_slen ↻ dv_low dv_readfile sys_openat_rd sys_read sys_close dv_lookup dv_streq dv_run sys_fork sys_mmap ↻ sys_execve sys_exit ↻ sys_wait4

structs

none

consts

7const REG_MAGIC_65536: i64 = 65536
8const REG_MAGIC_65535: i64 = 65535
10const REG_PATH: *u8 = "knowledge/doc_viewers.conf\x00"

functions

12func dv_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8) { n=n+1 } return n }
called by 2: dv_putsdv_ext
13func dv_puts(s: *u8) -> i64 { sys_write(1, s, dv_slen(s)); return 0 }
called by 1: main calls 2: sys_writedv_slen
15func dv_readfile(path: *u8, buf: *u8, cap: i64) -> i64
called by 1: main calls 3: sys_openat_rdsys_readsys_close
22func dv_low(c: i64) -> i64 { if c>=65 { if c<=90 { return c+32 } } return c }
called by 1: dv_ext
25func dv_ext(path: *u8, ext: *u8) -> i64
called by 1: main calls 2: dv_slendv_low
36func dv_streq(a: *u8, an: i64, b: *u8, bn: i64) -> i64
called by 1: dv_lookup
43func dv_lookup(reg: *u8, rlen: i64, ext: *u8, extn: i64, elf: *u8, label: *u8) -> i64
called by 1: main calls 1: dv_streq
72func dv_run(elf: *u8, inp: *u8, outp: *u8, dlurl: *u8) -> i64
90func main(argc: i64, argv: *i64) -> i64