49
45
#define my_init_dynamic_array(A,B,C,D) init_dynamic_array2(A,B,NULL,C,D)
50
46
#define my_init_dynamic_array_ci(A,B,C,D) init_dynamic_array2(A,B,NULL,C,D)
52
extern bool init_dynamic_array2(DYNAMIC_ARRAY *array,uint32_t element_size,
48
bool init_dynamic_array2(DYNAMIC_ARRAY *array,uint32_t element_size,
53
49
void *init_buffer, uint32_t init_alloc,
54
50
uint32_t alloc_increment);
55
51
/* init_dynamic_array() function is deprecated */
56
extern bool init_dynamic_array(DYNAMIC_ARRAY *array,uint32_t element_size,
52
bool init_dynamic_array(DYNAMIC_ARRAY *array,uint32_t element_size,
57
53
uint32_t init_alloc,uint32_t alloc_increment);
58
extern bool insert_dynamic(DYNAMIC_ARRAY *array,unsigned char * element);
59
extern unsigned char *alloc_dynamic(DYNAMIC_ARRAY *array);
60
extern unsigned char *pop_dynamic(DYNAMIC_ARRAY*);
61
extern bool set_dynamic(DYNAMIC_ARRAY *array,unsigned char * element,uint32_t array_index);
62
extern void get_dynamic(DYNAMIC_ARRAY *array,unsigned char * element,uint32_t array_index);
63
extern void delete_dynamic(DYNAMIC_ARRAY *array);
64
extern void delete_dynamic_element(DYNAMIC_ARRAY *array, uint32_t array_index);
65
extern void freeze_size(DYNAMIC_ARRAY *array);
66
extern int get_index_dynamic(DYNAMIC_ARRAY *array, unsigned char * element);
54
bool insert_dynamic(DYNAMIC_ARRAY *array,unsigned char * element);
55
unsigned char *alloc_dynamic(DYNAMIC_ARRAY *array);
56
unsigned char *pop_dynamic(DYNAMIC_ARRAY*);
57
bool set_dynamic(DYNAMIC_ARRAY *array,unsigned char * element,uint32_t array_index);
58
void get_dynamic(DYNAMIC_ARRAY *array,unsigned char * element,uint32_t array_index);
59
void delete_dynamic(DYNAMIC_ARRAY *array);
60
void delete_dynamic_element(DYNAMIC_ARRAY *array, uint32_t array_index);
61
void freeze_size(DYNAMIC_ARRAY *array);
62
int get_index_dynamic(DYNAMIC_ARRAY *array, unsigned char * element);
67
63
#define dynamic_element(array,array_index,type) ((type)((array)->buffer) +(array_index))
68
64
#define push_dynamic(A,B) insert_dynamic((A),(B))
69
65
#define reset_dynamic(array) ((array)->elements= 0)