Golem  v0.1.1
Generic Operating system Libraries for Embedded Multitasking
 All Data Structures Files Functions Variables Pages
glm_vector.h
Go to the documentation of this file.
1 
24 #ifndef _GLM_VECTOR_H_
25 #define _GLM_VECTOR_H_
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
31 
32 /* INCLUDES *******************************************************************/
33 #include "../glm_heap.h"
34 #include <stdlib.h>
35 
36 /* DEFINES ********************************************************************/
37 
38 
39 /* TYPES **********************************************************************/
40 
45 typedef struct
46 {
47  void * *objects;
48  size_t objectsize;
49  size_t length;
50 } vector_t;
51 
52 
56 extern vector_t * vector_create( heap_id_t a_heap_id, uint_base_t a_length,
57  size_t a_objectsize );
58 
59 
61 extern void vector_destroy( heap_id_t a_heap_id, vector_t * a_vector );
62 
63 
65 extern void vector_clear( heap_id_t a_heap_id, vector_t * a_vector );
66 
67 
70 extern uint_base_t vector_add( heap_id_t a_heap_id, vector_t * a_vector,
71  void * a_object );
72 
73 
75 extern uint_base_t vector_get_length( vector_t * a_vector );
76 
77 
80 extern void * vector_get_object( vector_t * a_vector, uint_base_t a_index );
81 
82 
83 #ifdef __cplusplus
84 }
85 #endif
86 
87 #endif /* _GLM_VECTOR_H_ */
88