WONKY



LOG | FILES | OVERVIEW


#ifndef WONKY_ARRAY_H
#define WONKY_ARRAY_H WONKY_ARRAY_H
#include <wonky_array.hh>

#include <common.h>
#include <wonky_malloc.h>


/*generic resizable array stuff*/
struct wonky_array_internals
{
	size_t size;
	size_t capacity;
	size_t element_size;
	unsigned char bytes[];
};

void* _wonky_arr wonky_arr_alloc(size_t number_of_elements,size_t element_size);
void* _wonky_arr wonky_arr_expand(void * _wonky_arr arr,size_t expansion_size);
void* _wonky_arr wonky_arr_resize(void * _wonky_arr arr,size_t new_size);
void wonky_arr_delete_elements(void * _wonky_arr arr,size_t start_index,size_t number_of_elements);
void wonky_arr_shrink(void * _wonky_arr arr,size_t shrink_size);
void wonky_arr_delete(void * _wonky_arr arr);
size_t wonky_arr_size(void * _wonky_arr arr);
size_t wonky_arr_last_index(void * _wonky_arr arr);
_Bool wonky_arr_oom(void * _wonky_arr arr);
void _wonky_arr * wonky_arr_copy(void * _wonky_arr arr);
struct wonky_array_internals* wonky_arr_get_internals(void * _wonky_arr arr);

#endif