|
| Foreign.Marshal.Array | | Portability | portable | | Stability | provisional | | Maintainer | ffi@haskell.org |
|
|
|
|
|
| Description |
| Marshalling support: routines allocating, storing, and retrieving Haskell
lists that are represented as arrays in the foreign language
|
|
| Synopsis |
|
|
|
|
| Marshalling arrays
|
|
| Allocation
|
|
|
| Allocate storage for the given number of elements of a storable type
(like malloc, but for multiple elements).
|
|
|
| Like mallocArray, but add an extra position to hold a special
termination element.
|
|
|
| Temporarily allocate space for the given number of elements
(like alloca, but for multiple elements).
|
|
|
| Like allocaArray, but add an extra position to hold a special
termination element.
|
|
|
| Adjust the size of an array
|
|
|
| Adjust the size of an array including an extra position for the end marker.
|
|
| Marshalling
|
|
|
| Convert an array of given length into a Haskell list. This version
traverses the array backwards using an accumulating parameter,
which uses constant stack space. The previous version using mapM
needed linear stack space.
|
|
|
| Convert an array terminated by the given end marker into a Haskell list
|
|
|
| Write the list elements consecutive into memory
|
|
|
| Write the list elements consecutive into memory and terminate them with the
given marker element
|
|
| Combined allocation and marshalling
|
|
|
| Write a list of storable elements into a newly allocated, consecutive
sequence of storable values
(like new, but for multiple elements).
|
|
|
| Write a list of storable elements into a newly allocated, consecutive
sequence of storable values, where the end is fixed by the given end marker
|
|
|
| Temporarily store a list of storable values in memory
(like with, but for multiple elements).
|
|
|
| Like withArray, but a terminator indicates where the array ends
|
|
|
| Like withArray, but the action gets the number of values
as an additional parameter
|
|
|
| Like withArrayLen, but a terminator indicates where the array ends
|
|
| Copying
|
|
| (argument order: destination, source)
|
|
|
| Copy the given number of elements from the second array (source) into the
first array (destination); the copied areas may not overlap
|
|
|
| Copy the given number of elements from the second array (source) into the
first array (destination); the copied areas may overlap
|
|
| Finding the length
|
|
|
| Return the number of elements in an array, excluding the terminator
|
|
| Indexing
|
|
|
| Advance a pointer into an array by the given number of elements
|
|
| Produced by Haddock version 0.8 |