robin/laufey
git clone https://git.robinwobin.dev/robin/laufey
735aa4c4c8
master
1#pragma once 2 3#include <stddef.h> 4 5/// Structure used for growing arrays. 6/// This is used to store information that only grows, is deleted all at 7/// once, and needs to be accessed by index. See ga_clear() and ga_grow(). 8typedef struct { 9int ga_len ;// current number of items used 10int ga_maxlen ;// maximum number of items possible 11int ga_itemsize ;// sizeof(item) 12int ga_growsize ;// number of items to grow each time 13void * ga_data ;// pointer to the first item 14}garray_T ; 15 16#define GA_EMPTY_INIT_VALUE { 0, 0, 0, 1, NULL } 17#define GA_INIT (itemsize ,growsize ) { 0, 0, (itemsize), (growsize), NULL }