398
390
void my_store_ptr(unsigned char *buff, size_t pack_length, my_off_t pos);
399
391
my_off_t my_get_ptr(unsigned char *ptr, size_t pack_length);
400
392
File create_temp_file(char *to, const char *dir, const char *pfx, myf MyFlags);
401
#define my_init_dynamic_array(A,B,C,D) init_dynamic_array2(A,B,NULL,C,D)
402
#define my_init_dynamic_array_ci(A,B,C,D) init_dynamic_array2(A,B,NULL,C,D)
403
#define my_init_dynamic_array2(A,B,C,D,E) init_dynamic_array2(A,B,C,D,E)
404
#define my_init_dynamic_array2_ci(A,B,C,D,E) init_dynamic_array2(A,B,C,D,E)
405
extern bool init_dynamic_array2(DYNAMIC_ARRAY *array,uint32_t element_size,
406
void *init_buffer, uint32_t init_alloc,
407
uint32_t alloc_increment);
408
/* init_dynamic_array() function is deprecated */
409
extern bool init_dynamic_array(DYNAMIC_ARRAY *array,uint32_t element_size,
410
uint32_t init_alloc,uint32_t alloc_increment);
411
extern bool insert_dynamic(DYNAMIC_ARRAY *array,unsigned char * element);
412
extern unsigned char *alloc_dynamic(DYNAMIC_ARRAY *array);
413
extern unsigned char *pop_dynamic(DYNAMIC_ARRAY*);
414
extern bool set_dynamic(DYNAMIC_ARRAY *array,unsigned char * element,uint32_t array_index);
415
extern bool allocate_dynamic(DYNAMIC_ARRAY *array, uint32_t max_elements);
416
extern void get_dynamic(DYNAMIC_ARRAY *array,unsigned char * element,uint32_t array_index);
417
extern void delete_dynamic(DYNAMIC_ARRAY *array);
418
extern void delete_dynamic_element(DYNAMIC_ARRAY *array, uint32_t array_index);
419
extern void freeze_size(DYNAMIC_ARRAY *array);
420
extern int get_index_dynamic(DYNAMIC_ARRAY *array, unsigned char * element);
421
#define dynamic_array_ptr(array,array_index) ((array)->buffer+(array_index)*(array)->size_of_element)
422
#define dynamic_element(array,array_index,type) ((type)((array)->buffer) +(array_index))
423
#define push_dynamic(A,B) insert_dynamic((A),(B))
424
#define reset_dynamic(array) ((array)->elements= 0)
425
#define sort_dynamic(A,cmp) my_qsort((A)->buffer, (A)->elements, (A)->size_of_element, (cmp))
394
#include <mysys/dynamic_array.h>
427
396
#define alloc_root_inited(A) ((A)->min_malloc != 0)
428
397
#define ALLOC_ROOT_MIN_BLOCK_SIZE (MALLOC_OVERHEAD + sizeof(USED_MEM) + 8)