code wiki / (root) / nx_sitesweep_lib.nx

nx_sitesweep_lib.nx

buildroot/runtime/nx_sitesweep_lib.nx

17176 B324 linesdepth 2pulls 3 transitivereach 2 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_sitesweep_lib.nx -- the shared half of the site-wide broken-asset sweep: the classes, the prefilter, the path->URL map, and THE RULER-OUTPUT PARSER. One owner, imported by BOTH the sweep (nx_sitesweep) and its gate (nx_sitesweep_gate). WHY A LIB AND NOT A PRIVATE HELPER. The sweep's own judgement is exactly two things: which pages can be proven ref-free without a fetch, and how nx_page_verify's verdict text is read. Everything else is nx_page_verify's judgement. If the gate re-implemented either of those to test them, the gate would be testing a SECOND ruler and could agree with itself while disagreeing with what ships. There is one copy, so the tested thing and the shipped thing cannot differ. It also makes the gate FAST: these functions need no fork and no network, so the roster can run real teeth in milliseconds instead of a gate that must always be skipped for cost. license_tier: ORIGINAL

dependencies 2 imports · 2 importers

nx_syscalls.nx nx_pageref_lib.nx nx_sitesweep_lib.nx nx_sitesweep.nx nx_sitesweep_gate.nx

imports: nx_syscalls.nxnx_pageref_lib.nx

imported by: nx_sitesweep.nxnx_sitesweep_gate.nx

structs

none

consts

25const SS_C_UNCHECKED: i64 = 0
26const SS_C_NOREFS: i64 = 1
27const SS_C_GREEN: i64 = 2
28const SS_C_PARTIAL: i64 = 3
29const SS_C_BROKEN: i64 = 4
30const SS_C_PAGERED: i64 = 5
31const SS_C_UNOBSERVABLE: i64 = 6
32const SS_C_UNMEASURED: i64 = 7
33const SS_C_UNREADABLE: i64 = 8
34const SS_C_N: i64 = 9
37const SS_CH_NL: i64 = 10
38const SS_CH_CR: i64 = 13
39const SS_CH_SP: i64 = 32
40const SS_CH_MINUS: i64 = 45
41const SS_CH_DOT: i64 = 46
42const SS_CH_SLASH: i64 = 47
43const SS_CH_ZERO: i64 = 48
44const SS_CH_NINE: i64 = 57
45const SS_DEC: i64 = 10
46const SS_WORD: i64 = 8
47const SS_SCRATCH: i64 = 32
48const SS_MODE_644: i64 = 420
49const SS_HTML_SUF: i64 = 5
50const SS_INDEX_SUF: i64 = 6
54const SS_T_VERDICT: i64 = 8 // "VERDICT="
55const SS_T_BROKEN: i64 = 8 // " broken="
56const SS_T_CHECKED: i64 = 8 // "checked="
57const SS_T_SKIPPED: i64 = 9 // " skipped="
58const SS_T_LAW: i64 = 15 // "law-violations="
61const SS_V_CLASS: i64 = 0
62const SS_V_BROKEN: i64 = 1
63const SS_V_CHECKED: i64 = 2
64const SS_V_LAW: i64 = 3
65const SS_V_MS: i64 = 4
66const SS_V_SKIPPED: i64 = 5
74const SS_V_A11Y: i64 = 6
75const SS_V_COVGAP: i64 = 7
76const SS_V_N: i64 = 8

functions

81func ss_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
82func ss_cat(d: *u8, o: i64, s: *u8) -> i64 { var i: i64 = 0; var p: i64 = o; while s[i] != (0 as u8) { d[p] = s[i]; p = p + 1; i = i + 1 } return p }
83func ss_catn(d: *u8, o: i64, v: i64) -> i64
96func ss_at(buf: *u8, n: i64, off: i64, lit: *u8) -> i64
105func ss_contains(buf: *u8, n: i64, lit: *u8) -> i64
115func ss_last(buf: *u8, n: i64, lit: *u8) -> i64
called by 1: ss_parse_ruler calls 2: ss_lenss_at
123func ss_int_at(buf: *u8, n: i64, off: i64) -> i64
called by 2: mainss_parse_ruler
139func ss_pfx(a: *u8, pfx: *u8) -> i64
144func ss_ends_html(s: *u8) -> i64
called by 1: ss_walk calls 1: ss_len
156func ss_field(buf: *u8, ls: i64, le: i64, key: *u8) -> i64
calls 2: ss_lenss_at
163func ss_tok_eq(buf: *u8, le: i64, off: i64, want: *u8) -> i64
179func ss_write_all(path: *u8, buf: *u8, n: i64) -> i64
195func ss_class_name(c: i64) -> *u8
209func ss_class_of_name(s: *u8) -> i64
called by 1: ss_parse_ruler calls 1: ss_pfx
239func ss_may_have_refs(buf: *u8, n: i64) -> i64
254func ss_url_of(origin: *u8, docroot_len: i64, path: *u8, out: *u8) -> i64
277func ss_parse_ruler(buf: *u8, n: i64, cut: i64, outv: *i64) -> i64