]> git.evergreen-ils.org Git - working/Evergreen.git/blob - OpenSRF/src/libjson/arraylist.h
sort groups by name for consistancy
[working/Evergreen.git] / OpenSRF / src / libjson / arraylist.h
1 /*
2  * $Id$
3  *
4  * Copyright Metaparadigm Pte. Ltd. 2004.
5  * Michael Clark <michael@metaparadigm.com>
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public (LGPL)
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * Lesser General Public License for more details: http://www.gnu.org/
16  *
17  */
18
19 #ifndef _arraylist_h_
20 #define _arraylist_h_
21
22 #define ARRAY_LIST_DEFAULT_SIZE 32
23
24 typedef void (array_list_free_fn) (void *data);
25
26 struct array_list
27 {
28   void **array;
29   int length;
30   int size;
31   array_list_free_fn *free_fn;
32 };
33
34 extern struct array_list*
35 array_list_new(array_list_free_fn *free_fn);
36
37 extern void
38 array_list_free(struct array_list *this);
39
40 extern void*
41 array_list_get_idx(struct array_list *this, int i);
42
43 extern int
44 array_list_put_idx(struct array_list *this, int i, void *data);
45
46 extern int
47 array_list_add(struct array_list *this, void *data);
48
49 extern int
50 array_list_length(struct array_list *this);
51
52 #endif