arraylist.h
Go to the documentation of this file.
1 /*
2  * $Id: arraylist.h,v 1.4 2006/01/26 02:16:28 mclark Exp $
3  *
4  * Copyright (c) 2004, 2005 Metaparadigm Pte. Ltd.
5  * Michael Clark <michael@metaparadigm.com>
6  *
7  * This library is free software; you can redistribute it and/or modify
8  * it under the terms of the MIT license. See COPYING for details.
9  *
10  */
11 
12 #ifndef _arraylist_h_
13 #define _arraylist_h_
14 
15 #define ARRAY_LIST_DEFAULT_SIZE 32
16 
17 typedef void (array_list_free_fn) (void *data);
18 
19 struct array_list
20 {
21  void **array;
22  int length;
23  int size;
25 };
26 
27 extern struct array_list*
29 
30 extern void
31 array_list_free(struct array_list *al);
32 
33 extern void*
34 array_list_get_idx(struct array_list *al, int i);
35 
36 extern int
37 array_list_put_idx(struct array_list *al, int i, void *data);
38 
39 extern int
40 array_list_add(struct array_list *al, void *data);
41 
42 extern int
43 array_list_length(struct array_list *al);
44 
45 #endif
void( array_list_free_fn)(void *data)
Definition: arraylist.h:17
struct array_list * array_list_new(array_list_free_fn *free_fn)
Definition: arraylist.c:27
int size
Definition: arraylist.h:23
array_list_free_fn * free_fn
Definition: arraylist.h:24
void ** array
Definition: arraylist.h:21
void array_list_free(struct array_list *al)
Definition: arraylist.c:43
int array_list_add(struct array_list *al, void *data)
Definition: arraylist.c:84
int array_list_length(struct array_list *al)
Definition: arraylist.c:90
void * array_list_get_idx(struct array_list *al, int i)
Definition: arraylist.c:53
int array_list_put_idx(struct array_list *al, int i, void *data)
Definition: arraylist.c:74
int length
Definition: arraylist.h:22


csm
Author(s): Andrea Censi
autogenerated on Tue May 11 2021 02:18:23