28 return array->num_elements;
50 }
else if (a->
val > b->
val) {
64 if (!array || !needle) {
70 for (i = 0; i < array->num_elements; i++) {
72 if (!enumcmp(e, needle)) {
82 if (!array || !elem) {
95 if (!array || !elem) {
119 if (!array || !del) {
125 for (
size_t i = 0; i < array->num_elements; i++) {
127 if (enumcmp(elem, del)) {
134 array->num_elements = j;
157 icalarray_sort(array, (
int (*)(
const void *,
const void *))&enumcmp);
169 for (i = 0; i < array->num_elements; i++) {
void * icalarray_element_at(icalarray *array, size_t position)
Access an array element.
void icalarray_free(icalarray *array)
void icalarray_sort(icalarray *array, int(*compare)(const void *, const void *))
Sorts the elements of an icalarray using the given comparison function.
void icalarray_append(icalarray *array, const void *element)
Appends an element to 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_remove_element_at(icalarray *array, size_t position)
Removes a given element from an array.
void icalenumarray_free(icalenumarray *array)
Frees this array's memory and all its elements.
void icalenumarray_remove(icalenumarray *array, const icalenumarray_element *del)
Removes all occurrences of an element.
size_t icalenumarray_find(icalenumarray *array, const icalenumarray_element *needle)
Finds an element in the array.
void icalenumarray_sort(icalenumarray *array)
Sorts the elements in the array in ascending order.
void icalenumarray_append(icalenumarray *array, const icalenumarray_element *elem)
Appends an element to the array.
size_t icalenumarray_size(const icalenumarray *array)
Indicates the count of elements stored in the array.
icalenumarray * icalenumarray_clone(icalenumarray *array)
Clones the array and all its elements.
void icalenumarray_remove_element_at(icalenumarray *array, size_t position)
Removes the element at an array position.
const icalenumarray_element * icalenumarray_element_at(icalenumarray *array, size_t position)
Accesses an element stored in the array.
void icalenumarray_add(icalenumarray *array, const icalenumarray_element *elem)
Appends an element to the array, omitting duplicates.
Defines the data structure for handling arrays of enums.
#define icalenumarray_new(increment_size)
void icalmemory_free_buffer(void *buf)
Releases a buffer.
char * icalmemory_strdup(const char *s)
Creates a duplicate of a string.
Common memory management routines.