Libical API Documentation 3.0

icalarray.h
Go to the documentation of this file.
1/*======================================================================
2 FILE: icalarray.h
3 CREATOR: Damon Chaplin 07 March 2001
4
5 (C) COPYRIGHT 2001, Ximian, Inc.
6
7 This library is free software; you can redistribute it and/or modify
8 it under the terms of either:
9
10 The LGPL as published by the Free Software Foundation, version
11 2.1, available at: https://www.gnu.org/licenses/lgpl-2.1.html
12
13 Or:
14
15 The Mozilla Public License Version 2.0. You may obtain a copy of
16 the License at https://www.mozilla.org/MPL/
17======================================================================*/
18
25#ifndef ICALARRAY_H
26#define ICALARRAY_H
27
28#include "libical_ical_export.h"
29
34 typedef struct _icalarray icalarray;
35 struct _icalarray
36{
37 size_t element_size;
38 size_t increment_size;
39 size_t num_elements;
40 size_t space_allocated;
41 void **chunks;
42};
43
81LIBICAL_ICAL_EXPORT icalarray *icalarray_new(size_t element_size, size_t increment_size);
82
119LIBICAL_ICAL_EXPORT icalarray *icalarray_copy(icalarray *array);
120
134LIBICAL_ICAL_EXPORT void icalarray_free(icalarray *array);
135
165LIBICAL_ICAL_EXPORT void icalarray_append(icalarray *array, const void *element);
166
213LIBICAL_ICAL_EXPORT void icalarray_remove_element_at(icalarray *array, size_t position);
214
255LIBICAL_ICAL_EXPORT void *icalarray_element_at(icalarray *array, size_t position);
256
294LIBICAL_ICAL_EXPORT void icalarray_sort(icalarray *array,
295 int (*compare) (const void *, const void *));
296
297#endif /* ICALARRAY_H */
icalarray_element_at
void * icalarray_element_at(icalarray *array, size_t position)
Access an array element.
Definition: icalarray.c:117
icalarray_copy
icalarray * icalarray_copy(icalarray *array)
Copies an existing icalarray and its elements, creating a new one.
Definition: icalarray.c:60
icalarray_free
void icalarray_free(icalarray *array)
Frees an array object and everything that it contains.
Definition: icalarray.c:90
icalarray_sort
void icalarray_sort(icalarray *array, int(*compare)(const void *, const void *))
Sorts the elements of an icalarray using the given comparison function.
Definition: icalarray.c:136
icalarray_append
void icalarray_append(icalarray *array, const void *element)
Appends an element to an array.
Definition: icalarray.c:105
icalarray_new
icalarray * icalarray_new(size_t element_size, size_t increment_size)
Creates a new icalarray object.
Definition: icalarray.c:31
icalarray_remove_element_at
void icalarray_remove_element_at(icalarray *array, size_t position)
Removes a given element from an array.
Definition: icalarray.c:125
_icalarray
Definition: icalarray.h:36