From 505a5ac2a4c57d5daa03046366ac38a2e3182b94 Mon Sep 17 00:00:00 2001 From: dx Date: Wed, 20 May 2020 16:17:37 +0100 Subject: +dynamic array implementation Very basic, and only for dynamic content --- Converter/includes/array.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 Converter/includes/array.h (limited to 'Converter/includes') diff --git a/Converter/includes/array.h b/Converter/includes/array.h new file mode 100644 index 0000000..003b1fd --- /dev/null +++ b/Converter/includes/array.h @@ -0,0 +1,17 @@ +#ifndef __ARRAY_H_ +#define __ARRAY_H_ + +#include + +typedef struct +{ + void **data; + size_t sz_allocated; + size_t sz_used; +} array_t; + +void array_init(array_t *arr); +void array_append(array_t *arr, void *item); +void *array_read(array_t *arr, int index); + +#endif // __ARRAY_H_ -- cgit v1.2.3-13-gbd6f