ERKALE
ERKALE - DFT from Hel
 All Classes Functions Variables Friends Pages
ArrayList.h
1  /***************************************************************************
2  ArrayList.h - header file for ArrayList: a simple searchable and extendable
3  list type
4 
5  Copyright (C) 2006-2008 by Scientific Computing and Modelling NV.
6  For support, contact Alexei Yakovlev (yakovlev at scm . com)
7 
8  This file is part of the ADF software
9  For more information, see <http://www.scm.com>
10 
11  This program is free software; you can redistribute it and/or modify
12  it under the terms of the GNU Lesser General Public License as published by
13  the Free Software Foundation version 3 of the License.
14 
15  This program is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  GNU General Public License for more details.
19 
20  SCM owns the intellectual property right for this file and reserves the
21  right to distrbute it under a license other than LGPL
22  ****************************************************************************/
23 
24 #ifndef _ARRAY_LIST_H_
25 #define _ARRAY_LIST_H_
26 
27 typedef struct _ArrayList {
28  void **data;
29  int allocatedSize;
30  int length;
31 } ArrayList;
32 
33 
34 void addArrayListElement (ArrayList *array, void *elem);
35 void insertArrayListElement (ArrayList *array, void *elem, int position);
36 void *getArrayListElement (const ArrayList *array, int index);
37 void *removeArrayListElement (ArrayList *array, int index);
38 void clearArrayList(ArrayList *array);
39 void *findArrayListElement(const ArrayList *array, const void *searchItem, \
40  int (*comparator)(const void *searchItem, const void *arrayItem));
41 int findIndexOfArrayListElement(const ArrayList *array, const void *searchItem, \
42  int (*comparator)(const void *searchItem, const void *arrayItem));
43 
44 #endif
45 
Definition: ArrayList.h:27