|
Libical API Documentation 4.0 UNRELEASED Go to the stable 3.0 documentation
|
An array of arbitrarily-sized elements which grows dynamically as elements are added. More...
Go to the source code of this file.
Data Structures | |
| struct | _icalarray |
Typedefs | |
| typedef struct _icalarray | icalarray |
| A struct representing an icalarray object. | |
Functions | |
| void | icalarray_append (icalarray *array, const void *element) |
| Appends an element to an array. | |
| icalarray * | icalarray_copy (const icalarray *array) |
| Copies an existing icalarray and its elements, creating a new one. | |
| void * | icalarray_element_at (icalarray *array, size_t position) |
| Access an array element. | |
| void | icalarray_free (icalarray *array) |
| Frees an array object and everything that it contains. | |
| icalarray * | icalarray_new (size_t element_size, size_t increment_size) |
| Creates a new icalarray object. | |
| void | icalarray_remove_element_at (icalarray *array, size_t position) |
| Removes a given element from an array. | |
| void | icalarray_set_element_at (icalarray *array, const void *element, size_t position) |
| Overwrites an existing element in an array with a new value. | |
| void | icalarray_sort (icalarray *array, int(*compare)(const void *, const void *)) |
| Sorts the elements of an icalarray using the given comparison function. | |
An array of arbitrarily-sized elements which grows dynamically as elements are added.
| void icalarray_append | ( | icalarray * | array, |
| const void * | element ) |
Appends an element to an array.
| array | The array to append the element to |
| element | The element to append |
Appends the given element to the array, reallocating and expanding the array as needed.
Copies an existing icalarray and its elements, creating a new one.
| array | The array to copy |
Creates a new icalarray object, copying all the existing elements from array as well as its properties (such as element_size and increment_size) over.
| void * icalarray_element_at | ( | icalarray * | array, |
| size_t | position ) |
Access an array element.
| array | The array object in which the element is stored |
| position | The position of the element to access in the array |
Accesses an array element by returning a pointer to it, given an array and a valid element position.
| void icalarray_free | ( | icalarray * | array | ) |
Frees an array object and everything that it contains.
| array | The array to release |
| icalarray * icalarray_new | ( | size_t | element_size, |
| size_t | increment_size ) |
Creates a new icalarray object.
| element_size | The size of the elements to be held by the array |
| increment_size | How many extra elements worth of space to allocate on expansion |
Creates a new icalarray object. The parameter element_size determines the size of the elements that the array will hold (in bytes). The parameter increment_size determines how many extra elements to be allocated when expanding the array for performance reasons (expansions are expensive, since it involves copying all existing elements). If increment_size is zero, then the default increment size specified during libical build time is chosen.
| void icalarray_remove_element_at | ( | icalarray * | array, |
| size_t | position ) |
Removes a given element from an array.
| array | The array from which to remove the element |
| position | The position of the element to remove |
Removes the element at the given position from the array.
| void icalarray_set_element_at | ( | icalarray * | array, |
| const void * | element, | ||
| size_t | position ) |
Overwrites an existing element in an array with a new value.
| array | The array to overwrite the element in |
| element | The element to set as the new value |
| position | The position of the element to overwrite |
Sets the given element at the position in the array, overwriting the current element at that position.
| void icalarray_sort | ( | icalarray * | array, |
| int(* | compare )(const void *, const void *) ) |
Sorts the elements of an icalarray using the given comparison function.
| array | The array to sort |
| compare | The comparison function to use |