robin/laufey

git clone https://git.robinwobin.dev/robin/laufey

dundargocrefactor: remove redundant struct names735aa4c4c8

master
707 B17 linesraw
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 {
9  int ga_len;                       // current number of items used
10  int ga_maxlen;                    // maximum number of items possible
11  int ga_itemsize;                  // sizeof(item)
12  int ga_growsize;                  // number of items to grow each time
13  void *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 }