code wiki / _hdl_build / nx_doc_view.nx
nx_doc_view.nx
buildroot/runtime/_hdl_build/nx_doc_view.nx
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
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
structs
| none |
consts
| 7 | const REG_MAGIC_65536: i64 = 65536 |
| 8 | const REG_MAGIC_65535: i64 = 65535 |
| 10 | const REG_PATH: *u8 = "knowledge/doc_viewers.conf\x00" |
functions
| 12 | func dv_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8) { n=n+1 } return n } |
| 13 | func dv_puts(s: *u8) -> i64 { sys_write(1, s, dv_slen(s)); return 0 } |
| 15 | func dv_readfile(path: *u8, buf: *u8, cap: i64) -> i64 |
| 22 | func dv_low(c: i64) -> i64 { if c>=65 { if c<=90 { return c+32 } } return c } called by 1: dv_ext |
| 25 | func dv_ext(path: *u8, ext: *u8) -> i64 |
| 36 | func dv_streq(a: *u8, an: i64, b: *u8, bn: i64) -> i64 called by 1: dv_lookup |
| 43 | func dv_lookup(reg: *u8, rlen: i64, ext: *u8, extn: i64, elf: *u8, label: *u8) -> i64 |
| 72 | func dv_run(elf: *u8, inp: *u8, outp: *u8, dlurl: *u8) -> i64 |
| 90 | func main(argc: i64, argv: *i64) -> i64 |