code wiki / _hdl_build / _sqlite_read_authored.nx
_sqlite_read_authored.nx
buildroot/runtime/_hdl_build/_sqlite_read_authored.nx
about
AUTHORED BY THE NISHI BUILDER (nx_module_author_data sqlite-read template) -- ELDERMIG E1 rung 1.
Sovereign READ-ONLY SQLite reader: header check, table-btree walk (leaf 0x0D / interior 0x05),
sqlite_master record decode (type/name/rootpage), per-table row counts. Additive law: read-only.
HONEST LIMIT (raised hand for rung 2): local payload only -- overflow pages not followed yet;
fine for sqlite_master scans of Elder DBs; full row/column reads = rung 2.
dependencies 1 imports · 0 importers
imports: nx_syscalls.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| none |
functions
| 7 | func _sq_w(fd: i64, s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(fd,s,n); return 0 } |
| 8 | func _sq_wn(fd: i64, v: i64) -> i64 { let bb: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m}; let t: *u8=sys_mmap(28); var k: i64=0; if m==0{t[0]=48;k=1}; while m>0{t[k]=48+(m%10);m=m/10;k=k+1}; var i: i64=0; while i<k{bb[i]=t[k-1-i];i=i+1}; sys_write(fd,bb,k); return 0 } |
| 9 | func _sq_be16(p: *u8, off: i64) -> i64 { let a: i64=p[off]; let b: i64=p[off+1]; return (a<<8)|b } |
| 10 | func _sq_be32(p: *u8, off: i64) -> i64 { let a: i64=p[off]; let b: i64=p[off+1]; let c: i64=p[off+2]; let d: i64=p[off+3]; return (((((a<<8)|b)<<8)|c)<<8)|d } |
| 11 | func _sq_varint(p: *u8, off: i64, lenout: *i64) -> i64 called by 1: _sq_master |
| 25 | func _sq_stsize(st: i64) -> i64 called by 1: _sq_master |
| 32 | func _sq_page(db: *u8, ps: i64, pgno: i64) -> *u8 { let base: i64 = db as i64; return (base + (pgno-1)*ps) as *u8 } |
| 33 | func _sq_rowcount(db: *u8, ps: i64, pgno: i64) -> i64 |
| 53 | func _sq_master(db: *u8, ps: i64, pgno: i64, names: *u8, npos: *i64, noff: *i64, roots: *i64, cnt: *i64) -> i64 |
| 119 | func main(argc: i64, argv: *i64) -> i64 |