summaryrefslogtreecommitdiff
path: root/include/array.h
diff options
context:
space:
mode:
authorLizzy Fleckenstein <lizzy@vlhl.dev>2024-07-13 12:51:05 +0200
committerLizzy Fleckenstein <lizzy@vlhl.dev>2024-07-13 12:51:05 +0200
commit591232eba1809643df1f4a6075ff9581b8bb2f7a (patch)
tree92e2c464158d03ef9c83f153ba5b88c39581d9f8 /include/array.h
parent95283d70eee749d984b2ca07c0b61d39f9bb350d (diff)
downloadsilly_game-591232eba1809643df1f4a6075ff9581b8bb2f7a.tar.xz
move headers to src
Signed-off-by: Lizzy Fleckenstein <lizzy@vlhl.dev>
Diffstat (limited to 'include/array.h')
-rw-r--r--include/array.h21
1 files changed, 0 insertions, 21 deletions
diff --git a/include/array.h b/include/array.h
deleted file mode 100644
index 9affdde..0000000
--- a/include/array.h
+++ /dev/null
@@ -1,21 +0,0 @@
-// SPDX-FileCopyrightText: 2024 Lizzy Fleckenstein <lizzy@vlhl.dev>
-//
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-#ifndef ARRAY_H
-#define ARRAY_H
-
-#include <stddef.h>
-#include <string.h>
-#include <stdlib.h>
-
-#define len(X) (sizeof X / sizeof *X)
-#define array(T) struct { size_t len; T *data; }
-#define arraybuf(T) struct { size_t cap; size_t len; T *data; }
-
-#define ARR_REMOVE(A, P) memmove((P), (P)+1, sizeof *(P) * (--(A).len - ((P) - (A).data)));
-#define ARR_APPEND(A) (((A).cap == (A).len) \
- ? (A).data = realloc((A).data, sizeof *(A).data * ((A).cap = (A).cap ? (A).cap * 2 : 1)) \
- : NULL, &((A).data)[(A).len++])
-
-#endif