code wiki / _hdl_build / nx_galx_manga.nx
nx_galx_manga.nx
buildroot/runtime/_hdl_build/nx_galx_manga.nx
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
imports: nx_syscalls.nx
imported by: nobody (leaf or entry point)
structs
| none |
consts
| 10 | const MG_INDEX: *u8 = "knowledge/status/galx_manga_index.txt" |
| 11 | const MG_READER: *u8 = "knowledge/staging/media/reader/" |
functions
| 13 | func mg_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 14 | func 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 } |
| 15 | func mg_utoa(dst: *u8, o: i64, v: i64) -> i64 |
| 26 | func mg_name_ok(s: *u8, n: i64) -> i64 |
| 47 | func mg_read(path: *u8, buf: *u8, cap: i64) -> i64 |
| 62 | func mg_index_add(slug: *u8) -> i64 |
| 91 | func mg_list_json(out: *u8, cap: i64) -> i64 |
| 124 | func mg_pages_json(slug: *u8, out: *u8, cap: i64) -> i64 |
| 139 | func mg_page_path(slug: *u8, file: *u8, out: *u8) -> i64 |