The nomenclature for the functions used for indexing and updating the elements of a darray is modelled on that used in Emacs Lisp.
Returns the address of the indexth element in da. index must be non-negative and no greater than the length of da. The pointer returned is guaranteed to be valid only until the next operation is performed which may change the length of da.
Returns a reference to the last element in da. The pointer returned is guaranteed to be valid only until the next operation is performed which may change the length of da.
Copies the memory referenced by new into the indexth element of da. index must be non-negative and no greater than the length of da.
It is possible to apply a function to every element in a darray. Libretto defines the following type as a pointer to a function which can be applied to each element of a darray.
int (*) (const void *
obj, const void *
args)
The type of a function pointer used to perform arbitrary actions on an object in a darray. The function is passed the address of an object, obj, as well as a user-supplied pointer to parameters, args. The function should return zero on success, or -1 on some error which must terminate the traversal of the array holding obj.