root/src/json-lib/arraylist.h

Revision 351020b260749e2e97fda8f50a3bb37dcf1d0e34, 1.0 kB (checked in by Theo Schlossnagle <jesus@omniti.com>, 1 year ago)

namespace these more reasonably (no functional change)

  • Property mode set to 100644
Line 
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 #ifdef __cplusplus
16 extern "C" {
17 #endif
18
19 #define ARRAY_LIST_DEFAULT_SIZE 32
20
21 typedef void (jl_array_list_free_fn) (void *data);
22
23 struct jl_array_list
24 {
25   void **array;
26   int length;
27   int size;
28   jl_array_list_free_fn *free_fn;
29 };
30
31 extern struct jl_array_list*
32 jl_array_list_new(jl_array_list_free_fn *free_fn);
33
34 extern void
35 jl_array_list_free(struct jl_array_list *al);
36
37 extern void*
38 jl_array_list_get_idx(struct jl_array_list *al, int i);
39
40 extern int
41 jl_array_list_put_idx(struct jl_array_list *al, int i, void *data);
42
43 extern int
44 jl_array_list_add(struct jl_array_list *al, void *data);
45
46 extern int
47 jl_array_list_length(struct jl_array_list *al);
48
49 #ifdef __cplusplus
50 }
51 #endif
52
53 #endif
Note: See TracBrowser for help on using the browser.