code wiki / _hdl_build / nx_galx_manga.nx

nx_galx_manga.nx

buildroot/runtime/_hdl_build/nx_galx_manga.nx

6131 B148 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind orphan librarytopic galx
docsdependenciesstructsconstsfunctions

about

nx_galx_manga.nx -- MANGA collection + reader lib for the gallery (media-manager -> gallery migration). A manga = an ordered set of page images extracted by nx_cbx_pages into knowledge/staging/media/reader/<slug>/ (cbx.json manifest + page000.<ext> ...). This lib is the SOVEREIGN, pure-IO backend the gallery daemon wires three thin routes onto, so it is gate-testable in isolation (no daemon/socket) -- exactly the nx_mgmt_upload lib+gate split. Single responsibility: list staged manga / return a manga's page manifest / resolve+guard a page-file path (path-traversal fail-closed) / idempotently register a slug in the manga index. NO fork here (the daemon owns extraction). Sovereign: nx_syscalls only. license_tier: ORIGINAL

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_galx_manga.nx

imports: nx_syscalls.nx

imported by: nobody (leaf or entry point)

structs

none

consts

10const MG_INDEX: *u8 = "knowledge/status/galx_manga_index.txt"
11const MG_READER: *u8 = "knowledge/staging/media/reader/"

functions

13func mg_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
14func mg_cat(dst: *u8, o: i64, s: *u8) -> i64 { var i: i64 = 0; while s[i] != (0 as u8) { dst[o + i] = s[i]; i = i + 1 } return o + i }
15func mg_utoa(dst: *u8, o: i64, v: i64) -> i64
called by 1: mg_list_json calls 1: sys_mmap
26func mg_name_ok(s: *u8, n: i64) -> i64
47func mg_read(path: *u8, buf: *u8, cap: i64) -> i64
62func mg_index_add(slug: *u8) -> i64
91func mg_list_json(out: *u8, cap: i64) -> i64
124func mg_pages_json(slug: *u8, out: *u8, cap: i64) -> i64
139func mg_page_path(slug: *u8, file: *u8, out: *u8) -> i64