prim__setbits8 : AnyPtr -> Integer -> Bits8 -> PrimIO ()prim__getbits8 : AnyPtr -> Integer -> Bits8record CIArray8 : Nat -> Type- Totality: total
Visibility: export
Constructor: IA : AnyPtr -> CIArray8 n
Projection: .ptr : CIArray8 n -> AnyPtr
at : CIArray8 n -> Fin n -> Bits8- Totality: total
Visibility: export ix : CIArray8 n -> (0 m : Nat) -> Ix (S m) n => Bits8- Totality: total
Visibility: export atNat : CIArray8 n -> (m : Nat) -> {auto 0 _ : LT m n} -> Bits8- Totality: total
Visibility: export toVect : CIArray8 n -> Vect n Bits8 Reads the values from a C pointer into a vector.
Totality: total
Visibility: exportfoldrKV : (Fin n -> Bits8 -> b -> b) -> b -> CIArray8 n -> b Right fold over the values of an array plus their indices.
Totality: total
Visibility: exportfoldr : (Bits8 -> b -> b) -> b -> CIArray8 n -> b Right fold over the values of an array
Totality: total
Visibility: exportfoldlKV : (Fin n -> b -> Bits8 -> b) -> b -> CIArray8 n -> b Left fold over the values of an array plus their indices.
Totality: total
Visibility: exportfoldl : (b -> Bits8 -> b) -> b -> CIArray8 n -> b Left fold over the values of an array
Totality: total
Visibility: exportrecord PrimCArray8 : Type -> Bool -> Nat -> Type A wrapped pointer to a C-array holding `n` unsigned 8-bit
values (C-primitive).
Reading from and writing to such an array is O(1) and runs in `IO`.
See `CArray8` for a pure version of mutable C arrays using linear types.
See `CArray8S` for a pure versoin of mutable C arrays using linear types (overwritting/scrubbing before freeing).
See `CArray8IO` for a version of mutable C arrays usable in IO.
See `CArray8IOS` for a version of the mutable C arrays usuable in IO (overwritting/scrubbing before freeing)
Note : In typical use cases, the memory allocated for a C array must
be manually released with a call to `free` unless it is part
of a larger structure `Struct` or managed by an external library.
Totality: total
Visibility: export
Constructor: PCA8 : AnyPtr -> PrimCArray8 s b n
Projection: .ptr : PrimCArray8 s b n -> AnyPtr
0 CArray8 : Type -> Nat -> Type Convenience alias for `PrimCArray8 s False n a`
Totality: total
Visibility: public export0 CArray8S : Type -> Nat -> Type Convenience alias for `PrimCArray8 s True n a`
Totality: total
Visibility: public export0 CArray8IO : Nat -> Type Convenience alias for `PrimCArray8 World False n a`
Totality: total
Visibility: public export0 CArray8IOS : Nat -> Type Convenience alias for `PrimCArray8 World True n a`
Totality: total
Visibility: public exportunsafeUnwrap : CArray8 s n -> AnyPtr- Totality: total
Visibility: export unsafeWrap : AnyPtr -> CArray8 s n- Totality: total
Visibility: export malloc1 : (n : Nat) -> F1 s (PrimCArray8 s b n) Allocates a new C-pointer of `sizeof a * n` bytes.
Totality: total
Visibility: exportcalloc1 : (n : Nat) -> F1 s (PrimCArray8 s b n) Like `malloc1` but resets all allocated bytes to zero.
Totality: total
Visibility: exportfree1 : CArray8 s n -> F1' s Frees the memory allocated for a C array without
overwriting its contents.
Totality: total
Visibility: exportfrees1 : CArray8S s n -> F1' s Overwrites the contents of a C array before freeing
the underlying memory.
Totality: total
Visibility: exportget : PrimCArray8 s b n -> Fin n -> F1 s Bits8 Reads a value from a C-pointer at the given position.
Totality: total
Visibility: exportgetIx : PrimCArray8 s b n -> (0 m : Nat) -> Ix (S m) n => F1 s Bits8 Reads a value from a C-pointer at the given position.
Totality: total
Visibility: exportgetNat : PrimCArray8 s b n -> (m : Nat) -> {auto 0 _ : LT m n} -> F1 s Bits8 Reads a value from a C-pointer at the given position.
Totality: total
Visibility: exportset : PrimCArray8 s b n -> Fin n -> Bits8 -> F1' s Writes a value to a C pointer at the given position.
Totality: total
Visibility: exportsetIx : PrimCArray8 s b n -> (0 m : Nat) -> Ix (S m) n => Bits8 -> F1' s Writes a value to a C pointer at the given position.
Totality: total
Visibility: exportsetNat : PrimCArray8 s b n -> (m : Nat) -> {auto 0 _ : LT m n} -> Bits8 -> F1' s Writes a value to a C pointer at the given position.
Totality: total
Visibility: exportwriteVect : PrimCArray8 s b n -> Vect n Bits8 -> F1' s Writes the values from a vector to a C pointer
Totality: total
Visibility: exportwithIArray : PrimCArray8 s b n -> (CIArray8 n -> c) -> F1 s c Temporarily wraps the mutable array in an immutable wrapper and
run a computation with that.
This is safe, because the pure function cannot possibly share the
immutable array by storing it in a mutable reference. It is
referentially transparent, because we call it from a linear context.
Totality: total
Visibility: exportwriteList : (as : List Bits8) -> PrimCArray8 s b (length as) -> F1' s Writes the values from a list to a C pointer
Totality: total
Visibility: exportwithPrimCArray8 : (n : Nat) -> (PrimCArray8 s b n -> F1' s) -> (PrimCArray8 s b n -> F1 s c) -> c Allocates a C array, runs a computation, and releases
the array using the supplied cleanup operation.
The Boolean index is erased because cleanup behavior
is supplied explicitly rather than selected by inspecting b.
Totality: total
Visibility: exportwithCArray : (n : Nat) -> (CArray8 s n -> F1 s b) -> b Allocates a C array, runs a computation, and frees
the underlying memory afterward.
Totality: total
Visibility: exportwithCArrayS : (n : Nat) -> (CArray8S s n -> F1 s b) -> b Allocates a C array, runs a computation, and securely
scrubs the underlying memory before freeing it.
Totality: total
Visibility: exportmalloc : Lift1 s f => (n : Nat) -> f (PrimCArray8 s b n) Allocates a new C-pointer of `sizeof a * n` bytes.
Totality: total
Visibility: exportcalloc : Lift1 s f => (n : Nat) -> f (PrimCArray8 s b n) Like `malloc` but resets all allocated bytes to zero.
Totality: total
Visibility: exportfree : Lift1 s f => CArray8 s n -> f () Frees a C array without scrubbing its contents.
Note: Only call this if the C array is no longer used and has been
allocated via a call to `malloc` or `alloc` (either in C land
or in Idris). Afterwards, it is no longer safe to use the array
for reading or writing, nor is it safe to call `free` on it again.
For safe resource management, use the linear version of
C arrays if possible. Otherwise, consider using a safer monad
than `IO` if possible.
Totality: total
Visibility: exportfrees : Lift1 s f => CArray8S s n -> f () Scrubs and frees a C array.
Note: Only call this if the C array is no longer used and has been
allocated via a call to `malloc` or `alloc` (either in C land
or in Idris). Afterwards, it is no longer safe to use the array
for reading or writing, nor is it safe to call `free` on it again.
For safe resource management, use the linear version of
C arrays if possible. Otherwise, consider using a safer monad
than `IO` if possible.
Totality: total
Visibility: exportfromList : Lift1 s f => (as : List Bits8) -> f (PrimCArray8 s b (length as))- Totality: total
Visibility: export