code wiki / _hdl_build / nx_wiki_page_lib.nx

nx_wiki_page_lib.nx

buildroot/runtime/_hdl_build/nx_wiki_page_lib.nx

9359 B165 linesdepth 3pulls 3 transitivereach 1 importersview sourcekind librarytopic wiki
docsdependenciesstructsconstsfunctions

about

nx_wiki_page_lib.nx -- the reusable page emitter for the autonomous wiki. wp_emit_page() turns ONE workstream record (a memory project-*.md = our real work) into an S-class anatomy page (Lead -> Infobox -> Body[md render w/ [[wikilinks]]] -> See also -> Category) on the shared skin, per the Wikipedia MoS/Layout the Nishi researcher fetched. Used by nx_wiki_workstream_page (one page) AND nx_wiki_build (all of them). Sovereign: nx_syscalls + nx_wiki_skin_lib. license_tier: ORIGINAL

dependencies 2 imports · 1 importers

nx_syscalls.nx nx_wiki_skin_lib.nx nx_wiki_page_lib.nx nx_wiki_build.nx

imports: nx_syscalls.nxnx_wiki_skin_lib.nx

imported by: nx_wiki_build.nx

structs

none

consts

8const K_MAGIC_2048: i64 = 2048

functions

10func wp_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
11func wp_slurp(path: *u8, buf: *u8, cap: i64) -> i64
called by 1: main calls 3: sys_openat_rdsys_readsys_close
20func wp_find_from(buf: *u8, len: i64, from: i64, pat: *u8) -> i64
27func wp_line_end(buf: *u8, len: i64, s: i64) -> i64 { var e: i64 = s; while e < len { if buf[e] == (10 as u8) { return e } e = e + 1 } return len }
called by 1: wp_body
28func wp_fm_field(buf: *u8, len: i64, key: *u8, out: *u8, cap: i64) -> i64
called by 1: wp_emit_page calls 1: wp_find_from
46func wp_esc1(dst: *u8, o: i64, c: i64) -> i64
called by 2: wp_escwp_inline calls 1: sk_cat
52func wp_esc(dst: *u8, o: i64, buf: *u8, a: i64, b: i64) -> i64 { var oo: i64 = o; var i: i64 = a; while i < b { oo = wp_esc1(dst, oo, buf[i] as i64); i = i + 1 } return oo }
53func wp_find2(buf: *u8, i: i64, end: i64, a: u8, b: u8) -> i64 { var k: i64 = i; while k + 1 < end { if buf[k] == a { if buf[k + 1] == b { return k } } k = k + 1 } return end }
called by 2: wp_inlinewp_seealso
54func wp_find1(buf: *u8, i: i64, end: i64, a: u8) -> i64 { var k: i64 = i; while k < end { if buf[k] == a { return k } k = k + 1 } return end }
called by 1: wp_inline
55func wp_inline(dst: *u8, off: i64, buf: *u8, a: i64, b: i64) -> i64
82func wp_body(dst: *u8, off: i64, buf: *u8, start: i64, len: i64) -> i64
119func wp_seealso(dst: *u8, off: i64, buf: *u8, start: i64, len: i64) -> i64
called by 1: wp_emit_page calls 3: sk_catwp_find2wp_esc
139func wp_emit_page(out: *u8, rec: *u8, slen: i64) -> i64