code wiki / _hdl_build / nx_library_shelf.nx

nx_library_shelf.nx

buildroot/runtime/_hdl_build/nx_library_shelf.nx

13570 B210 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind tooltopic library
docsdependenciesstructsconstsfunctions

about

nx_library_shelf.nx -- SOVEREIGN, ZERO-JAVASCRIPT library shelf (operator: "no js, nishi everywhere"). Enumerates the rendered books under knowledge/staging/media/reader/<slug>/ (getdents64), reads each book.json for title/author/cover, and emits a static HTML+CSS card grid (knowledge/staging/media/library_shelf.html) -- covers shown on the cards (the artwork ingestion now visible), each card a plain <a> to reader_static_<slug>.html. 0 <script>: grid via CSS grid, theme via radio/:checked, no client code. Logic lives in this Nishi organ. expect_exit: 0 license_tier: ORIGINAL

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_library_shelf.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 ensure_dir sh_streq sys_openat_wr p w sys_write slen sys_exit w ↻ sys_mmap sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close in_list load_book sys_mmap ↻ sys_read_file ↻ sh_valstr sh_find slen ↻ slen ↻ emit_card w ↻ wesc w ↻ sys_write ↻ load_audio sys_mmap ↻ sys_read_file ↻ sh_valstr ↻ emit_audio_card w ↻ wesc ↻ sys_close ↻ wn sys_write ↻

structs

none

consts

8const K_MAGIC_1024: i64 = 1024
9const K_MAGIC_65536: i64 = 65536

functions

11func slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
called by 3: wsh_findsh_valstr
12func w(fd: i64, s: *u8) -> i64 { sys_write(fd, s, slen(s)); return 0 }
13func wn(fd: i64, v0: i64) -> i64 { var v: i64=v0; if v<0 { sys_write(fd,"-" as *u8,1); v=0-v } let b: *u8=sys_mmap(24); var k: i64=0; if v==0 {b[0]=48 as u8;k=1} while v>0 {b[k]=(48+(v%10)) as u8; v=v/10; k=k+1} let o: *u8=sys_mmap(24); var j: i64=0; while j<k {o[j]=b[k-1-j];j=j+1} sys_write(fd,o,k); return 0 }
called by 1: main calls 2: sys_writesys_mmap
14func p(s: *u8) -> i64 { w(1, s); return 0 }
called by 1: main calls 1: w
15func wesc(fd: i64, s: *u8) -> i64
called by 2: emit_cardemit_audio_card calls 2: wsys_write
24func sh_find(hay: *u8, hl: i64, needle: *u8) -> i64
called by 1: sh_valstr calls 1: slen
31func sh_valstr(hay: *u8, hl: i64, key: *u8, out: *u8, cap: i64) -> i64
called by 2: load_bookload_audio calls 2: sh_findslen
43func ensure_dir(path: *u8) -> i64 { __syscall(258, 0-100, path, 0x1ed, 0, 0, 0); return 0 }
called by 1: main
46func load_book(slug: *u8, title: *u8, author: *u8, cover: *u8) -> i64
called by 1: main calls 3: sys_mmapsys_read_filesh_valstr
63func emit_card(fd: i64, slug: *u8, title: *u8, author: *u8, cover: *u8) -> i64
called by 1: main calls 2: wwesc
76func load_audio(slug: *u8, title: *u8, narrator: *u8) -> i64
called by 1: main calls 3: sys_mmapsys_read_filesh_valstr
92func emit_audio_card(fd: i64, slug: *u8, title: *u8, narrator: *u8) -> i64
called by 1: main calls 2: wwesc
100func sh_streq(a: *u8, b: *u8) -> i64 { var i: i64=0; while a[i]!=(0 as u8){ if a[i]!=b[i]{return 0} i=i+1 } if b[i]!=(0 as u8){return 0} return 1 }
called by 1: main
102func in_list(nm: *u8, list: *u8, listn: i64) -> i64
called by 1: main
115func main(argc: i64, argv: *i64) -> i64