first commit

This commit is contained in:
Ole Algoritme
2022-09-05 21:52:22 +02:00
commit 698a8f7487
198 changed files with 951446 additions and 0 deletions

19
include/nva/util.h Normal file
View File

@@ -0,0 +1,19 @@
#ifndef UTIL_H
#define UTIL_H
#define ARRAY_SIZE(a) (sizeof (a) / sizeof *(a))
#define ADDARRAY(a, e) \
do { \
if ((a ## num) >= (a ## max)) { \
if (!(a ## max)) \
(a ## max) = 16; \
else \
(a ## max) *= 2; \
(a) = realloc((a), (a ## max)*sizeof(*(a))); \
} \
(a)[(a ## num)++] = (e); \
} while(0)
#endif