code wiki / (root) / nx_manga_rating.nx

nx_manga_rating.nx

buildroot/runtime/nx_manga_rating.nx

8020 B185 linesdepth 4pulls 6 transitivereach 0 importersview sourcekind tooltopic manga
docsdependenciesstructsconstsfunctions

about

nx_manga_rating.nx -- THE CONTENT RATING PLANE for the manga lane (mangagen MG24 mr_rate_row, MG32 mr_adult_invariant). A rating is DATA CARRIED ON THE ASSET -- never a property of the account, and never which folder somebody remembered to drop the file in. COMPOSES THE INCUMBENTS AND RE-IMPLEMENTS NEITHER: nx_torrent_access nx_taccess_allow(viewer_level, area) -- the fail-closed VIEWER-LEVEL decision from the operator directive of 2026-06-20. Levels OWNER 3 / FAMILY 1 / ANON 0; areas SFW 0 requires FAMILY, NSFW 1 requires OWNER. This organ NEVER re-decides access; it only says which AREA an asset belongs in, and hands that to the incumbent ruler. nx_wardrobe_state WS_ADULT_AGE -- the adult threshold that already fails closed at construction in the character lane. IMPORTED rather than redeclared: the same constant written twice is two constants to every scanner, and an age threshold that can drift between two organs is a defect generator. THE LOAD-BEARING PROPERTY, and the whole point of the organ: AN UNRATED ASSET IS TREATED AS GATED, NEVER AS SAFE. An absent rating is not evidence of innocence. Every mapping below fails toward the MORE restrictive area, so the failure mode of a missing row is the family viewer cannot see it, never the child can.

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_torrent_access.nx nx_wardrobe_state.nx nx_manga_rating.nx

imports: nx_syscalls.nxnx_torrent_access.nxnx_wardrobe_state.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main mr_puts sys_write mr_slen sys_mmap nxa_die sys_write ↻ sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ mr_rate_row mr_rating_valid mr_slen ↻ mr_apps mr_num sys_mmap ↻ mr_atoi mr_putn sys_mmap ↻ mr_num ↻ sys_write ↻ mr_may_serve mr_rating_valid ↻ mr_area_for_rating nx_taccess_allow nx_taccess_required_level mr_area_for_rating ↻ mr_adult_invariant mr_rating_valid ↻

structs

none

consts

26const MR_RATE_UNRATED: i64 = 0-1
27const MR_RATE_ALLAGES: i64 = 0
28const MR_RATE_TEEN: i64 = 1
29const MR_RATE_MATURE: i64 = 2
30const MR_RATE_ADULT: i64 = 3
31const MR_RATE_MAX: i64 = 3
34const MR_OK: i64 = 0
35const MR_E_MINOR: i64 = 0-1
36const MR_E_RATING: i64 = 0-2
37const MR_E_ROW: i64 = 0-3
39const MR_ROWCAP: i64 = 512
40const MR_PIPE: i64 = 124

functions

42func mr_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 2: mr_rate_rowmr_puts
44func mr_apps(dst: *u8, o: i64, s: *u8) -> i64
called by 1: mr_rate_row
50func mr_num(dst: *u8, o: i64, v: i64) -> i64
called by 2: mr_rate_rowmr_putn calls 1: sys_mmap
64func mr_rating_valid(r: i64) -> i64
73func mr_area_for_rating(r: i64) -> i64
called by 2: mr_may_servemain
81func mr_may_serve(viewer_level: i64, r: i64) -> i64
90func mr_adult_invariant(subject_age: i64, r: i64) -> i64
called by 1: main calls 1: mr_rating_valid
100func mr_rate_row(cid: *u8, r: i64, src: *u8, epoch: i64, out: *u8, cap: i64) -> i64
118func mr_puts(s: *u8) -> i64 { sys_write(1, s, mr_slen(s)); return 0 }
called by 1: main calls 2: sys_writemr_slen
119func mr_putn(v: i64) -> i64 { let b: *u8 = sys_mmap(64); let n: i64 = mr_num(b, 0, v); sys_write(1, b, n); return 0 }
called by 1: main calls 3: sys_mmapmr_numsys_write
121func mr_atoi(s: *u8) -> i64
called by 1: main
137func main(argc: i64, argv: *i64) -> i64