code wiki / _hdl_build / nx_library_shelf.nx
nx_library_shelf.nx
buildroot/runtime/_hdl_build/nx_library_shelf.nx
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
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
| 8 | const K_MAGIC_1024: i64 = 1024 |
| 9 | const K_MAGIC_65536: i64 = 65536 |
functions
| 11 | func slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } |
| 12 | func w(fd: i64, s: *u8) -> i64 { sys_write(fd, s, slen(s)); return 0 } |
| 13 | func 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 } |
| 14 | func p(s: *u8) -> i64 { w(1, s); return 0 } |
| 15 | func wesc(fd: i64, s: *u8) -> i64 |
| 24 | func sh_find(hay: *u8, hl: i64, needle: *u8) -> i64 |
| 31 | func sh_valstr(hay: *u8, hl: i64, key: *u8, out: *u8, cap: i64) -> i64 |
| 43 | func ensure_dir(path: *u8) -> i64 { __syscall(258, 0-100, path, 0x1ed, 0, 0, 0); return 0 } called by 1: main |
| 46 | func load_book(slug: *u8, title: *u8, author: *u8, cover: *u8) -> i64 |
| 63 | func emit_card(fd: i64, slug: *u8, title: *u8, author: *u8, cover: *u8) -> i64 |
| 76 | func load_audio(slug: *u8, title: *u8, narrator: *u8) -> i64 |
| 92 | func emit_audio_card(fd: i64, slug: *u8, title: *u8, narrator: *u8) -> i64 |
| 100 | func 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 |
| 102 | func in_list(nm: *u8, list: *u8, listn: i64) -> i64 called by 1: main |
| 115 | func main(argc: i64, argv: *i64) -> i64 |