1 /*
2 Copyright (C) 2003 Cedric Cellier, Dominique Lavault
3 
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License
6 as published by the Free Software Foundation; either version 2
7 of the License, or (at your option) any later version.
8 
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 GNU General Public License for more details.
13 
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
17 */
18 /*
19  * Functions to create and manipulate a list of void*.
20  */
21 
22 #ifndef _GLTV_LIST_
23 #define _GLTV_LIST_
24 
25 //struct s_gltv_list;
26 typedef struct s_gltv_list* GLTV_LIST;
27 
28 /* to get a new empty list */
29 /* size is the total estimated max size of the list.
30  * if resizeable, the list will expand as necessary */
31 extern GLTV_LIST gltv_list_new(unsigned, int);
32 /* to delete a list */
33 extern void gltv_list_del(GLTV_LIST);
34 /* to push a value - return 1 on succes */
35 extern int gltv_list_push(GLTV_LIST, void *);
36 /* to pop a value */
37 extern void *gltv_list_pop(GLTV_LIST);
38 /* to empty the list (the list keeps its current size, even if resized) */
39 extern void gltv_list_clear(GLTV_LIST);
40 /* tells the list size */
41 extern unsigned gltv_list_size(GLTV_LIST);
42 /* returns value n (optimised if last accessed value was not far from n) */
43 extern void *gltv_list_get(GLTV_LIST, unsigned);
44 /* reset value at position n (same condition) */
45 extern void gltv_list_set(GLTV_LIST, unsigned, void *);
46 /* insert value at position n (same condition) */
47 extern void gltv_list_insert(GLTV_LIST, unsigned, void *);
48 /* remove value at position n (same condition) */
49 extern void *gltv_list_remove(GLTV_LIST, unsigned);
50 
51 #endif
52