module CArray:sig..end
type'at ='a Ctypes.carray
val get : 'a t -> int -> 'aget a n returns the nth element of the zero-indexed array a. The
semantics for non-scalar types are non-copying, as for Ctypes.(!@).
If you rebind the CArray module to Array then you can also use the
syntax a.(n) instead of Array.get a n.
Raise Invalid_argument "index out of bounds" if n is outside of the
range 0 to (CArray.length a - 1).
val set : 'a t -> int -> 'a -> unitset a n v overwrites the nth element of the zero-indexed array a
with v.
If you rebind the CArray module to Array then you can also use the
a.(n) <- v syntax instead of Array.set a n v.
Raise Invalid_argument "index out of bounds" if n is outside of the
range 0 to (CArray.length a - 1).
val unsafe_get : 'a t -> int -> 'aunsafe_get a n behaves like get a n except that the check that n
between 0 and (CArray.length a - 1) is not performed.val unsafe_set : 'a t -> int -> 'a -> unitunsafe_set a n v behaves like set a n v except that the check that
n between 0 and (CArray.length a - 1) is not performed.val of_list : 'a typ -> 'a list -> 'a tof_list t l builds an array of type t of the same length as l, and
writes the elements of l to the corresponding elements of the array.val to_list : 'a t -> 'a listto_list a builds a list of the same length as a such that each
element of the list is the result of reading the corresponding element of
a.val iter : ('a -> unit) -> 'a t -> unititer f a is analogous to Array.iter f a: it applies f in turn to
all the elements of a.val map : 'b typ -> ('a -> 'b) -> 'a t -> 'b tmap t f a is analogous to Array.map f a: it creates a new array with
element type t whose elements are obtained by applying f to the
elements of a.val mapi : 'b typ -> (int -> 'a -> 'b) -> 'a t -> 'b tmapi behaves like Array.mapi, except that it also passes the
index of each element as the first argument to f and the element
itself as the second argument.val fold_left : ('a -> 'b -> 'a) -> 'a -> 'b t -> 'aCArray.fold_left (@) x a computes
(((x @ a.(0)) @ a.(1)) ...) @ a.(n-1)
where n is the length of the array a.val fold_right : ('b -> 'a -> 'a) -> 'b t -> 'a -> 'aCArray.fold_right f a x computes
a.(0) @ (a.(1) @ ( ... (a.(n-1) @ x) ...))
where n is the length of the array a.val length : 'a t -> intval start : 'a t -> 'a Ctypes.ptrval from_ptr : 'a Ctypes.ptr -> int -> 'a tfrom_ptr p n creates an n-length array reference to the memory at
address p.val make : ?finalise:('a t -> unit) ->
'a typ -> ?initial:'a -> int -> 'a tmake t n creates an n-length array of type t. If the optional
argument ?initial is supplied, it indicates a value that should be
used to initialise every element of the array. The argument ?finalise,
if present, will be called just before the memory is freed.val copy : 'a t -> 'a tcopy a creates a fresh array with the same elements as a.val sub : 'a t -> pos:int -> length:int -> 'a tsub a ~pos ~length creates a fresh array of length length containing
the elements a.(pos) to a.(pos + length - 1) of a.
Raise Invalid_argument "CArray.sub" if pos and length do not
designate a valid subarray of a.
val element_type : 'a t -> 'a typ