code wiki / (root) / nx_galx_vidoff_nas.nx

nx_galx_vidoff_nas.nx

buildroot/runtime/nx_galx_vidoff_nas.nx

2445 B36 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind tooltopic galx
docsdependenciesstructsconstsfunctions

about

nx_galx_vidoff_nas.nx -- NAS-native rebuild of galx_vid_off.bin (the id->byte-offset index) so the gallery serve does O(1) /vid lookups instead of a full-file scan per request (60 video tiles/page). Runs ON the NAS via nx_nas_run after a catalog reindex. Mirrors gs_vidoff_build in nx_gallery_serve. Header (big-endian): tsv_size(8) n(8) then n*offset(8). tsv_size = the serve's freshness check. No sh. license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_itoa_lib.nx nx_galx_vidoff_nas.nx

imports: nx_syscalls.nxnx_itoa_lib.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 vo_p sys_write sys_exit vo_wb64 sys_openat_wr sys_write ↻ sys_close ↻ vo_n nxi_out nxi_fd sys_mmap ↻ ccz_cat_num sys_write ↻ sys_munmap

structs

none

consts

9const TSV: *u8 = "/volume1/ai/galx/knowledge/status/galx_vid_paths.tsv"
10const OFF: *u8 = "/volume1/ai/galx/knowledge/status/galx_vid_off.bin"

functions

12func vo_p(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
called by 1: main calls 1: sys_write
17func vo_n(v: i64) -> i64 { nxi_out(v); return 0 }
called by 1: main calls 1: nxi_out
18func vo_wb64(b: *u8, o: i64, v: i64) -> i64 { b[o]=((v>>56)&0xff) as u8; b[o+1]=((v>>48)&0xff) as u8; b[o+2]=((v>>40)&0xff) as u8; b[o+3]=((v>>32)&0xff) as u8; b[o+4]=((v>>24)&0xff) as u8; b[o+5]=((v>>16)&0xff) as u8; b[o+6]=((v>>8)&0xff) as u8; b[o+7]=(v&0xff) as u8; return o+8 }
called by 1: main
20func main() -> i64