nx_learnmine_lib.nx
buildroot/runtime/nx_learnmine_lib.nx
about
nx_learnmine_lib.nx -- LEARNING MINING: third-party how-to material as SUPPORTING GUIDES for the /compare rungs (operator
2026-09-06: farm archive.org, YouTube, Vimeo, DeviantArt and the rest for videos, transcripts and text that power the
development rungs, so the boards carry third-party feedback and reference frames, not only the seat's own judgement).
The evidence law is the operator's: a workflow video is a LIAR-KILLER (it proves the field can do the thing and shows
how) or a REFERENCE FRAME (what the result looks like in that month); it is NEVER an oracle, and its month is its bar.
This lib is the FIRST rung of the lane: the archive.org advancedsearch listing (output=json) of one creator or query,
parsed from its own bytes into item rows and a census (media types, years, subjects) so a seat reads a 200-row digest
instead of a quarter-megabyte of JSON. Every later rung (item files, subtitle mirrors through nx_srt and nx_webvtt,
the YouTube caption track, the guide rows on <dom>.guides) composes this table; nothing here fetches -- the bytes come
from nx_research_fetch under provenance, and the organ only reads what was mirrored.
license_tier: ORIGINAL No hw writes (Rule 26).
dependencies 1 imports · 2 importers
imports: nx_syscalls.nx
imported by: nx_learnmine.nxnx_learnmine_gate.nx
structs
| none |
consts
| 14 | const LM_QUOTE: i64 = 34 |
| 15 | const LM_BACKSLASH: i64 = 92 |
| 16 | const LM_LBRACE: i64 = 123 |
| 17 | const LM_RBRACE: i64 = 125 |
| 18 | const LM_LBRACKET: i64 = 91 |
| 19 | const LM_RBRACKET: i64 = 93 |
| 20 | const LM_COLON: i64 = 58 |
| 21 | const LM_COMMA: i64 = 44 |
| 22 | const LM_SPACE: i64 = 32 |
| 23 | const LM_NL: i64 = 10 |
| 24 | const LM_TAB: i64 = 9 |
| 25 | const LM_CR: i64 = 13 |
| 26 | const LM_PIPE: i64 = 124 |
| 27 | const LM_SLASH: i64 = 47 |
| 28 | const LM_SEMI: i64 = 59 |
| 29 | const LM_QMARK: i64 = 63 |
| 30 | const LM_UTF8_1: i64 = 128 |
| 31 | const LM_UTF8_2: i64 = 2048 |
| 32 | const LM_SURROGATE_LO: i64 = 55296 |
| 33 | const LM_SURROGATE_HI: i64 = 57344 |
| 34 | const LM_DATE_LEN: i64 = 10 |
| 35 | const LM_DESC_HEAD: i64 = 240 |
| 36 | const LM_FIELD_CAP: i64 = 65536 |
| 37 | const LM_SUBJ_CAP: i64 = 4096 |
| 38 | const LM_KEY_DOCS: *u8 = "\"docs\":" |
| 39 | const LM_KEY_NUMFOUND: *u8 = "\"numFound\":" |
| 40 | const LM_KEY_ID: *u8 = "\"identifier\":" |
| 41 | const LM_KEY_TYPE: *u8 = "\"mediatype\":" |
| 42 | const LM_KEY_DATE: *u8 = "\"date\":" |
| 43 | const LM_KEY_TITLE: *u8 = "\"title\":" |
| 44 | const LM_KEY_DESC: *u8 = "\"description\":" |
| 45 | const LM_KEY_SUBJECT: *u8 = "\"subject\":" |
| 46 | const LM_KEY_DOWNLOADS: *u8 = "\"downloads\":" |
| 47 | const LM_TYPE_MOVIES: *u8 = "movies" |
| 48 | const LM_TYPE_TEXTS: *u8 = "texts" |
| 49 | const LM_TYPE_AUDIO: *u8 = "audio" |
| 50 | const LM_TYPE_IMAGE: *u8 = "image" |
| 51 | const LM_DASH: *u8 = "-" |
| 53 | const LM_I_ID: i64 = 0 |
| 54 | const LM_I_TYPE: i64 = 1 |
| 55 | const LM_I_DATE: i64 = 2 |
| 56 | const LM_I_TITLE: i64 = 3 |
| 57 | const LM_I_DOWNLOADS: i64 = 4 |
| 58 | const LM_I_SUBJECTS: i64 = 5 |
| 59 | const LM_I_DESC: i64 = 6 |
| 60 | const LM_I_DESC_LEN: i64 = 7 |
| 61 | const LM_I_SLOTS: i64 = 8 |
| 63 | const LM_L_ITEMS: i64 = 0 |
| 64 | const LM_L_NUMFOUND: i64 = 1 |
| 65 | const LM_L_MOVIES: i64 = 2 |
| 66 | const LM_L_TEXTS: i64 = 3 |
| 67 | const LM_L_AUDIO: i64 = 4 |
| 68 | const LM_L_IMAGE: i64 = 5 |
| 69 | const LM_L_OTHER: i64 = 6 |
| 70 | const LM_L_NEWEST: i64 = 7 |
| 71 | const LM_L_OLDEST: i64 = 8 |
| 72 | const LM_L_TRUNCATED_DESCS: i64 = 9 |
| 73 | const LM_L_DOWNLOADS: i64 = 10 |
| 74 | const LM_L_SLOTS: i64 = 12 |
| 76 | const LM_OK: i64 = 0 |
| 77 | const LM_ERR_UNREADABLE: i64 = 0 - 1 |
| 78 | const LM_ERR_NO_DOCS: i64 = 0 - 2 |
| 79 | const LM_ERR_MALFORMED: i64 = 0 - 3 |
| 80 | const LM_ERR_CAPACITY: i64 = 0 - 4 |
functions
| 82 | func lm_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 83 | func lm_streq(a: *u8, b: *u8) -> i64 { var i: i64 = 0; while a[i] != (0 as u8) { if a[i] != b[i] { return 0 } i = i + 1 } if b[i] != (0 as u8) { return 0 } return 1 } |
| 84 | func lm_cat(d: *u8, o: i64, s: *u8) -> i64 { var i: i64 = 0; while s[i] != (0 as u8) { d[o + i] = s[i]; i = i + 1 } return o + i } |
| 85 | func lm_dup(s: *u8, n: i64) -> *u8 { let d: *u8 = sys_mmap(n + 1); var i: i64 = 0; while i < n { d[i] = s[i]; i = i + 1 } d[n] = 0 as u8; return d } |
| 86 | func lm_putd(d: *u8, o: i64, v: i64) -> i64 |
| 97 | func lm_err_name(e: i64) -> *u8 called by 1: main |
| 106 | func lm_find(b: *u8, from: i64, end: i64, key: *u8) -> i64 |
| 117 | func lm_skip_ws(b: *u8, p: i64, end: i64) -> i64 |
| 131 | func lm_hexval(c: i64) -> i64 called by 1: lm_str |
| 138 | func lm_put_cp(out: *u8, o: i64, cp: i64) -> i64 called by 1: lm_str |
| 148 | func lm_row_byte(c: i64) -> i64 called by 1: lm_str |
| 158 | func lm_str(b: *u8, p: i64, end: i64, out: *u8, cap: i64, outlen: *i64) -> i64 |
| 206 | func lm_value(b: *u8, s: i64, e: i64, key: *u8, out: *u8, cap: i64, sep: i64) -> i64 |
| 260 | func lm_atoi(s: *u8) -> i64 |
| 271 | func lm_obj_end(b: *u8, s: i64, end: i64) -> i64 called by 1: lm_parse_listing |
| 290 | func lm_date_cmp(a: *u8, c: *u8) -> i64 called by 1: lm_parse_listing |
| 302 | func lm_parse_listing(b: *u8, n: i64, items: *i64, cap: i64, lst: *i64) -> i64 |
| 384 | func lm_subjects(items: *i64, n: i64, subj: *i64, counts: *i64, cap: i64, full: *i64) -> i64 |