~/bend-docscommunity

raw.bend source

raw.bend on the hub · documented module

# bend-raw-cells: raw little-endian 32-bit cells between files and Bend arrays (Array<U32>), in place, as foreign effects.# Native builds only (C); the JS stubs throw. Nothing here is proved.##   import bend-raw-cells@<version>/raw.bend as Rimport Base# Raw.read fills the first `cells`# cells from the file (which must hold exactly cells * 4 bytes), Raw.write writes them. Foreign code.def Raw.read(path: String, a: Array<U32>, cells: U32) -> IO(Array<U32>):  import "./effs/raw_read.c"  import "./effs/raw_read.js"def Raw.write(path: String, a: Array<U32>, cells: U32) -> IO(Array<U32>):  import "./effs/raw_write.c"  import "./effs/raw_write.js"# Raw.read_at: `cells` cells from byte offset off_hi * 2^32 + off_lo of the file into the array from cell dst on.def Raw.read_at(path: String, off_hi: U32, off_lo: U32, a: Array<U32>, dst: U32, cells: U32) -> IO(Array<U32>):  import "./effs/raw_read_at.c"  import "./effs/raw_read_at.js"