Diffstat (limited to 'libical/src/libical/icalarray.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libical/src/libical/icalarray.h | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/libical/src/libical/icalarray.h b/libical/src/libical/icalarray.h new file mode 100644 index 0000000..e265167 --- a/dev/null +++ b/libical/src/libical/icalarray.h | |||
@@ -0,0 +1,63 @@ | |||
1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */ | ||
2 | /*====================================================================== | ||
3 | FILE: icalarray.h | ||
4 | CREATOR: Damon Chaplin 07 March 2001 | ||
5 | |||
6 | |||
7 | $Id$ | ||
8 | $Locker$ | ||
9 | |||
10 | (C) COPYRIGHT 2001, Ximian, Inc. | ||
11 | |||
12 | This program is free software; you can redistribute it and/or modify | ||
13 | it under the terms of either: | ||
14 | |||
15 | The LGPL as published by the Free Software Foundation, version | ||
16 | 2.1, available at: http://www.fsf.org/copyleft/lesser.html | ||
17 | |||
18 | Or: | ||
19 | |||
20 | The Mozilla Public License Version 1.0. You may obtain a copy of | ||
21 | the License at http://www.mozilla.org/MPL/ | ||
22 | |||
23 | |||
24 | ======================================================================*/ | ||
25 | |||
26 | |||
27 | #ifndef ICALARRAY_H | ||
28 | #define ICALARRAY_H | ||
29 | |||
30 | /** @file icalarray.h | ||
31 | * | ||
32 | * @brief An array of arbitrarily-sized elements which grows | ||
33 | * dynamically as elements are added. | ||
34 | */ | ||
35 | |||
36 | typedef struct _icalarray icalarray; | ||
37 | struct _icalarray { | ||
38 | unsigned int element_size; | ||
39 | unsigned int increment_size; | ||
40 | unsigned int num_elements; | ||
41 | unsigned int space_allocated; | ||
42 | void *data; | ||
43 | }; | ||
44 | |||
45 | |||
46 | |||
47 | icalarray *icalarray_new (int element_size, | ||
48 | int increment_size); | ||
49 | void icalarray_free (icalarray*array); | ||
50 | |||
51 | void icalarray_append (icalarray*array, | ||
52 | void *element); | ||
53 | void icalarray_remove_element_at (icalarray*array, | ||
54 | int position); | ||
55 | |||
56 | void *icalarray_element_at (icalarray*array, | ||
57 | int position); | ||
58 | |||
59 | void icalarray_sort (icalarray*array, | ||
60 | int (*compare) (const void *, const void *)); | ||
61 | |||
62 | |||
63 | #endif /* ICALARRAY_H */ | ||