#include "gi_buffer.h"
Go to the source code of this file.
Classes | |
| struct | GiArray |
Defines | |
| #define | GI_ARRAY_HEAD(array) gi_buffer_head(&((array)->buf)) |
| #define | gi_array_head(array) GI_ARRAY_HEAD(array) |
| #define | gi_array_length(array) ((array)->nmemb) |
| #define | GI_ARRAY_FOREACH(foreachfn) ((GiArrayForeachFn)(foreachfn)) |
Typedefs | |
| typedef void(* | GiArrayForeachFn )(void *data, void *udata) |
Functions | |
| EXTERN_C_BEGIN LIBGIFT_EXPORT void | gi_array_init (GiArray *array, size_t elemsize) |
| LIBGIFT_EXPORT void | gi_array_finish (GiArray *array) |
| LIBGIFT_EXPORT GiArray * | gi_array_new (size_t elemsize) |
| LIBGIFT_EXPORT void | gi_array_free (GiArray *array) |
| LIBGIFT_EXPORT GiArray * | gi_array_copy (GiArray *array) |
| LIBGIFT_EXPORT bool | gi_array_index (GiArray *array, void *buf, size_t index) |
| LIBGIFT_EXPORT bool | gi_array_push (GiArray *array, const void *buf) |
| LIBGIFT_EXPORT bool | gi_array_pop (GiArray *array, void *buf) |
| LIBGIFT_EXPORT bool | gi_array_unshift (GiArray *array, const void *buf) |
| LIBGIFT_EXPORT bool | gi_array_shift (GiArray *array, void *buf) |
| LIBGIFT_EXPORT bool | gi_array_splice (GiArray *array, void *removed, size_t offset, size_t length, const void *inserted, size_t nmemb) |
| LIBGIFT_EXPORT void | gi_array_foreach (GiArray *array, GiArrayForeachFn foreachfn, const void *udata) |
|
|
Accessor macro to simplify receiving a pointer to the first element in the array. |
|
|
Deepy copy the input array. Produces a new dynamically allocated array object with the same element structure. |
|
|
Destroy any internally allocated array data. |
|
|
Free dynamically allocated array storage (as with gi_array_new) and clean up internal array data (as with gi_array_finish). |
|
||||||||||||||||
|
Access an individual array element.
|
|
||||||||||||
|
Initialize a new array object. |
|
|
Dynamically allocate storage for a new array object and implicitly initialize. |
|
||||||||||||
|
Remove a single element from the end of the array and store it at `buf'. |
|
||||||||||||
|
Push a single element to the end of the array. The storage provided by `buf' will be copied into the array object. |
|
||||||||||||
|
Remove a single element from the beginning of the array. See gi_array_pop for exact semantics of the removal operation. |
|
||||||||||||||||||||||||||||
|
Splice the array. Simply put, the splice operation will remove `length' elements from the position beginning at `offset', storing them in `removed', and insert the `nmemb' elements stored at `inserted' in their place. It's probably best to lookup `perldoc -f splice' if you wish to see the inspiration for this insane interface.
|
|
||||||||||||
|
Add a single element to the beginning of the array. See gi_array_push for exact semantics of the insert operation. |
1.3.7