/+junk/c_sdl_joypad

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/%2Bjunk/c_sdl_joypad

« back to all changes in this revision

Viewing changes to src/DynamicArray.h

  • Committer: Gustav Hartvigsson
  • Date: 2014-01-12 00:26:29 UTC
  • Revision ID: gustav.hartvigsson@gmail.com-20140112002629-jsoprtfhefs89utd
* made the code compile.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef __H_DYNAMIC_ARRAY__
 
2
#define __H_DYNAMIC_ARRAY__
1
3
#include <stdlib.h>
2
4
 
3
5
/*
26
28
#define ARRAY_PADDING 8
27
29
 
28
30
/**
 
31
 * an opaque data structure that represents the dynamic array.
 
32
 */
 
33
typedef struct _DynamicArray DynamicArray;
 
34
 
 
35
/**
29
36
 * Represents a for each function.
30
37
 * 
31
38
 * @param self the dynamic array.
33
40
 * @returns data to be put in a new DynamicArray, if used with
34
41
 * dynamic_array_for_each_with_return.
35
42
 */
36
 
typedef void * (* ForEachFunc)(DynamicArray * self, void * data);
 
43
typedef void * (* ForEachFunc)(DynamicArray * self, void * item, void * data);
37
44
 
38
 
/**
39
 
 * an opaque data structure that represents the dynamic array.
40
 
 */
41
 
typedef struct _DynamicArray DynamicArray;
42
45
 
43
46
/**
44
47
 * Create a new dynamic array.
46
49
 * @param len The length of the initial array.
47
50
 * @param item_size The size of the items to be stored.
48
51
 */
49
 
DymamicArray * dynamic_array_new (size_t len);
 
52
DynamicArray * dynamic_array_new (size_t len);
50
53
 
51
54
/**
52
55
 * Frees the dynamic array.
59
62
/**
60
63
 * Get an item from the array.
61
64
 */
62
 
void * dynamic_array_get (DynamicArray * self, int index);
 
65
void * dynamic_array_get (DynamicArray * self, size_t index);
63
66
 
64
67
/**
65
68
 * Get the length of the array.
95
98
                                                   ForEachFunc func,
96
99
                                                   void * data);
97
100
 
 
101
#endif /* #define __H_DYNAMIC_ARRAY__ */