nx_sitesweep_lib.nx
buildroot/runtime/nx_sitesweep_lib.nx
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
imports: nx_syscalls.nxnx_pageref_lib.nx
imported by: nx_sitesweep.nxnx_sitesweep_gate.nx
structs
| none |
consts
| 25 | const SS_C_UNCHECKED: i64 = 0 |
| 26 | const SS_C_NOREFS: i64 = 1 |
| 27 | const SS_C_GREEN: i64 = 2 |
| 28 | const SS_C_PARTIAL: i64 = 3 |
| 29 | const SS_C_BROKEN: i64 = 4 |
| 30 | const SS_C_PAGERED: i64 = 5 |
| 31 | const SS_C_UNOBSERVABLE: i64 = 6 |
| 32 | const SS_C_UNMEASURED: i64 = 7 |
| 33 | const SS_C_UNREADABLE: i64 = 8 |
| 34 | const SS_C_N: i64 = 9 |
| 37 | const SS_CH_NL: i64 = 10 |
| 38 | const SS_CH_CR: i64 = 13 |
| 39 | const SS_CH_SP: i64 = 32 |
| 40 | const SS_CH_MINUS: i64 = 45 |
| 41 | const SS_CH_DOT: i64 = 46 |
| 42 | const SS_CH_SLASH: i64 = 47 |
| 43 | const SS_CH_ZERO: i64 = 48 |
| 44 | const SS_CH_NINE: i64 = 57 |
| 45 | const SS_DEC: i64 = 10 |
| 46 | const SS_WORD: i64 = 8 |
| 47 | const SS_SCRATCH: i64 = 32 |
| 48 | const SS_MODE_644: i64 = 420 |
| 49 | const SS_HTML_SUF: i64 = 5 |
| 50 | const SS_INDEX_SUF: i64 = 6 |
| 54 | const SS_T_VERDICT: i64 = 8 // "VERDICT=" |
| 55 | const SS_T_BROKEN: i64 = 8 // " broken=" |
| 56 | const SS_T_CHECKED: i64 = 8 // "checked=" |
| 57 | const SS_T_SKIPPED: i64 = 9 // " skipped=" |
| 58 | const SS_T_LAW: i64 = 15 // "law-violations=" |
| 61 | const SS_V_CLASS: i64 = 0 |
| 62 | const SS_V_BROKEN: i64 = 1 |
| 63 | const SS_V_CHECKED: i64 = 2 |
| 64 | const SS_V_LAW: i64 = 3 |
| 65 | const SS_V_MS: i64 = 4 |
| 66 | const SS_V_SKIPPED: i64 = 5 |
| 74 | const SS_V_A11Y: i64 = 6 |
| 75 | const SS_V_COVGAP: i64 = 7 |
| 76 | const SS_V_N: i64 = 8 |
functions
| 81 | func ss_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 82 | func 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 } |
| 83 | func ss_catn(d: *u8, o: i64, v: i64) -> i64 |
| 96 | func ss_at(buf: *u8, n: i64, off: i64, lit: *u8) -> i64 |
| 105 | func ss_contains(buf: *u8, n: i64, lit: *u8) -> i64 |
| 115 | func ss_last(buf: *u8, n: i64, lit: *u8) -> i64 |
| 123 | func ss_int_at(buf: *u8, n: i64, off: i64) -> i64 |
| 139 | func ss_pfx(a: *u8, pfx: *u8) -> i64 |
| 144 | func ss_ends_html(s: *u8) -> i64 |
| 156 | func ss_field(buf: *u8, ls: i64, le: i64, key: *u8) -> i64 |
| 163 | func ss_tok_eq(buf: *u8, le: i64, off: i64, want: *u8) -> i64 |
| 179 | func ss_write_all(path: *u8, buf: *u8, n: i64) -> i64 |
| 195 | func ss_class_name(c: i64) -> *u8 |
| 209 | func ss_class_of_name(s: *u8) -> i64 |
| 239 | func ss_may_have_refs(buf: *u8, n: i64) -> i64 |
| 254 | func ss_url_of(origin: *u8, docroot_len: i64, path: *u8, out: *u8) -> i64 |
| 277 | func ss_parse_ruler(buf: *u8, n: i64, cut: i64, outv: *i64) -> i64 |