code wiki / _hdl_build / _inflate_fixed_authored.nx

_inflate_fixed_authored.nx

buildroot/runtime/_hdl_build/_inflate_fixed_authored.nx

4487 B32 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind tooltopic inflate
docsdependenciesstructsconstsfunctions

about

AUTHORED BY THE NISHI BUILDER (nx_module_author inflate-fixed template) -- DEFLATE stored+fixed, bits-up

dependencies 1 imports · 0 importers

nx_syscalls.nx _inflate_fixed_authored.nx

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

main sys_mmap sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close sys_exit inflate sys_mmap ↻ ibr ihb sys_mmap ↻ ihd ibr ↻

structs

none

consts

none

functions

3func ibr(buf: *u8, len: i64, cur: *i64, n: i64) -> i64 { var v: i64=0; var g: i64=0; while g<n { let bp: i64=cur[0]>>3; if bp>=len { return 0 } let bit: i64=((buf[bp] as i64)>>(cur[0]&7))&1; v=v|(bit<<g); cur[0]=cur[0]+1; g=g+1 } return v }
called by 2: ihdinflate
4func ihb(ln: *i64, n: i64, ct: *i64, sy: *i64) -> i64 { var i: i64=0; while i<=15 { ct[i]=0; i=i+1 } i=0; while i<n { ct[ln[i]]=ct[ln[i]]+1; i=i+1 } let of: *i64=sys_mmap(8*17) as *i64; of[1]=0; var l: i64=1; while l<15 { of[l+1]=of[l]+ct[l]; l=l+1 } i=0; while i<n { if ln[i]!=0 { sy[of[ln[i]]]=i; of[ln[i]]=of[ln[i]]+1 } i=i+1 } return 0 }
called by 1: inflate calls 1: sys_mmap
5func ihd(buf: *u8, len: i64, cur: *i64, ct: *i64, sy: *i64) -> i64 { var code: i64=0; var first: i64=0; var idx: i64=0; var l: i64=1; while l<=15 { code=code|ibr(buf,len,cur,1); let c: i64=ct[l]; if code-first<c { return sy[idx+(code-first)] } idx=idx+c; first=first+c; first=first<<1; code=code<<1; l=l+1 } return 0-1 }
called by 1: inflate calls 1: ibr
6func inflate(src: *u8, srclen: i64, out: *u8) -> i64
called by 1: main calls 4: sys_mmapibrihbihd
24func main() -> i64