14 toInt = prim__zextB8_Int
17 fromInt = prim__truncInt_B8
25-- This needn't be precise; it just needs to be enough to be safe.
31allocate : Int -> IO ByteArray
33 ptr <- foreign FFI_C "array_alloc" (Int -> IO CData) sz
37reallocate : Int -> ByteArray -> IO ()
38reallocate newSz (BA ptr sz)
39 = foreign FFI_C "array_realloc" (Int -> CData -> IO ()) sz ptr
42peek : Int -> ByteArray -> IO Byte
44 = if (ofs < 0 || ofs >= sz)
46 else foreign FFI_C "array_peek" (Int -> CData -> IO Byte) ofs ptr
49peekInt : Int -> ByteArray -> IO Int
50peekInt ofs (BA ptr sz)
51 = if (ofs < 0 || ofs+bytesPerInt > sz)
53 else foreign FFI_C "array_peek_int" (Int -> CData -> IO Int) ofs ptr
56poke : Int -> Byte -> ByteArray -> IO ()
58 = if (ofs < 0 || ofs >= sz)
60 else foreign FFI_C "array_poke" (Int -> Byte -> CData -> IO ()) ofs b ptr
63pokeInt : Int -> Int -> ByteArray -> IO ()
64pokeInt ofs i (BA ptr sz)
65 = if (ofs < 0 || ofs+bytesPerInt > sz)
67 else foreign FFI_C "array_poke_int" (Int -> Int -> CData -> IO ()) ofs i ptr
70copy : (ByteArray, Int) -> (ByteArray, Int) -> Int -> IO ()
71copy (BA srcPtr srcSz, srcIx) (BA dstPtr dstSz, dstIx) count
72 = if (srcIx < 0 || dstIx < 0 || (srcIx+count) > srcSz || (dstIx+count) > dstSz)
74 else foreign FFI_C "array_copy" (CData -> Int -> CData -> Int -> Int -> IO ()) srcPtr srcIx dstPtr dstIx count
77fill : Int -> Int -> Byte -> ByteArray -> IO ()
78fill ofs count b (BA ptr sz)
79 = if (ofs < 0 || ofs+count > sz)
81 else foreign FFI_C "array_fill" (Int -> Int -> Byte -> CData -> IO ()) ofs count b ptr
84size : ByteArray -> Int
88compare : (ByteArray, Int) -> (ByteArray, Int) -> Int -> IO Int
89compare (BA ptrL szL, ofsL) (BA ptrR szR, ofsR) count
90 = if (ofsL < 0 || ofsL+count > szL || ofsR < 0 || ofsR+count > szR)
92 else foreign FFI_C "array_compare" (CData -> Int -> CData -> Int -> Int -> IO Int) ptrL ofsL ptrR ofsR count
95find : Byte -> ByteArray -> Int -> Int -> IO (Maybe Int)
96find b (BA ptr sz) ofs end = do
97 ofs <- foreign FFI_C "array_find" (Byte -> CData -> Int -> Int -> IO Int) b ptr ofs end
100 else return $ Just ofs
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list