code wiki / (root) / nx_manga_rating_lib.nx

nx_manga_rating_lib.nx

buildroot/runtime/nx_manga_rating_lib.nx

6530 B145 linesdepth 4pulls 6 transitivereach 1 importersview sourcekind librarytopic manga
docsdependenciesstructsconstsfunctions

about

nx_manga_rating_lib.nx -- THE CONTENT RATING DECISION as a shared lib (mangagen MG24 mr_rate_row, MG32 mr_adult_invariant). SINGLE RESPONSIBILITY: this file DECIDES, nx_manga_rating is a thin CLI over it, and nx_manga_rating_gate tests it IN-PROCESS. One decision, one home -- so the CLI and the gate cannot drift into two different answers, which is the whole reason for the split. 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. OWNER 3 / FAMILY 1 / ANON 0; areas SFW 0 requires FAMILY, NSFW 1 requires OWNER. This lib NEVER re-decides access: it says which AREA an asset belongs in and hands that to the incumbent. nx_wardrobe_state WS_ADULT_AGE -- the adult threshold already failing closed at construction in the character lane. IMPORTED, never 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 rather than a policy. THE LOAD-BEARING PROPERTY: AN UNRATED ASSET IS TREATED AS GATED, NEVER AS SAFE. An absent rating is not evidence of innocence. Every mapping fails toward the MORE restrictive area, so a missing row costs a family viewer a page it could have seen -- never the reverse.

dependencies 3 imports · 1 importers

nx_syscalls.nx nx_torrent_access.nx nx_wardrobe_state.nx nx_manga_rating_lib.nx nx_manga_rating_gate.nx

imports: nx_syscalls.nxnx_torrent_access.nxnx_wardrobe_state.nx

imported by: nx_manga_rating_gate.nx

structs

none

consts

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

functions

45func mr_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 1: mr_rate_row
47func mr_apps(dst: *u8, o: i64, s: *u8) -> i64
called by 1: mr_rate_row
53func mr_num(dst: *u8, o: i64, v: i64) -> i64
called by 1: mr_rate_row calls 1: sys_mmap
65func mr_atoi(s: *u8) -> i64
83func mr_rating_valid(r: i64) -> i64
91func mr_area_for_rating(r: i64) -> i64
called by 2: mainmr_may_serve
99func mr_may_serve(viewer_level: i64, r: i64) -> i64
129func mr_rate_row(cid: *u8, r: i64, src: *u8, epoch: i64, out: *u8, cap: i64) -> i64