code wiki / (root) / nx_bspfacts_lib.nx

nx_bspfacts_lib.nx

buildroot/runtime/nx_bspfacts_lib.nx

8745 B188 linesdepth 4pulls 4 transitivereach 2 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_bspfacts_lib.nx -- BODYSLIDE PRESET FACT EXTRACTION CORE (the Bethesda body-preset dialect; /compare/koikatsu card-class lane, admitted 2026-08-30). A BodySlide preset is an XML document: root <SliderPresets>, one or more <Preset name= set=> elements each holding <Group name=/> rows and <SetSlider name= size="big|small" value=/> rows. SCHEMA GROUND TRUTH is the mirrored reference parser (BodySlide GPL-3.0, src/components/SliderPresets.cpp: FloatAttribute("value")/100 on load, value=(int)(v*100) on save) -- read as an ORACLE, no line of it copied; the licence governs the TOOL, each preset file is its own author's work and stays an unpublished local oracle (k-wall as the KK lane). Values are PERMIL of the slider's percent scale: value="57" -> 570; "57.5" -> 575; "-25" -> -250. Extra decimal digits beyond the first are TRUNCATED (declared imprecision: the reference saver emits integers, so anything past tenths is hand-edited noise). Out-of-range values are REPORTED, never clamped -- numbers, not verdicts. Byte-scan primitives are COMPOSED from the sibling dialect lib (kk_find/kk_count/kk_b), never re-typed -- a bug fixed by extraction stays fixed; a 4th hand copy is the duplicate-ruler defect. Slots: [0] is_preset [1] preset_count [2] setslider_count [3] group_count [4] big_count [5] small_count [6] first_name_off [7] first_name_len [8] first_set_off [9] first_set_len license_tier: ORIGINAL No hw writes (Rule 26).

dependencies 2 imports · 2 importers

nx_syscalls.nx nx_kkfacts_lib.nx nx_bspfacts_lib.nx nx_bspfacts.nx nx_bspfacts_gate.nx

imports: nx_syscalls.nxnx_kkfacts_lib.nx

imported by: nx_bspfacts.nxnx_bspfacts_gate.nx

structs

none

consts

21const BSP_N_SLOTS: i64 = 10
22const BSP_HEAD_SCAN: i64 = 512 // the root element must appear in the first 512 bytes (xml decl + BOM headroom)
23const BSP_PERMIL_PER_PCT: i64 = 10 // 1 percent = 10 permil
24const BSP_QUOTE: i64 = 34 // '"' -- constructed, the lexer never sees a quote inside a needle
25const BSP_CH_BIG: i64 = 98 // 'b' -- first byte of size="big"
26const BSP_CH_SMALL: i64 = 115 // 's' -- first byte of size="small"
27const BSP_CH_MINUS: i64 = 45
28const BSP_CH_DOT: i64 = 46
29const BSP_CH_0: i64 = 48
30const BSP_CH_9: i64 = 57
31const BSP_VAL_BAD: i64 = 0 - 1000000 // impossible slider value (-100000 percent); decode stops on it

functions

35func bsp_attr(buf: *u8, at: i64, end: i64, key: *u8, lenout: *i64) -> i64
called by 2: bsp_probebsp_decode calls 2: kk_findkk_b
55func bsp_count_size(buf: *u8, start: i64, end: i64, ch: i64) -> i64
called by 1: bsp_probe calls 2: kk_findkk_b
71func bsp_val_permil(buf: *u8, off: i64, len: i64) -> i64
called by 1: bsp_decode calls 1: kk_b
104func bsp_probe(buf: *u8, n: i64, file_size: i64, facts: *i64) -> i64
138func bsp_decode(buf: *u8, n: i64, sizesel: i64, name_offs: *i64, name_lens: *i64, vals: *i64, outcap: i64, meta: *i64) -> i64