summaryrefslogtreecommitdiff
path: root/std/arr.c
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2020-01-16 20:34:41 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2020-01-16 20:34:41 -0500
commitdd3c2aa388026afcbcb987d9944c6f7207fb2d2c (patch)
tree5c9eb31e80917879cbb95a2a0c40d8060dd21614 /std/arr.c
parent2ca96f5c91395771a37ad6707b2b28c60e6a8873 (diff)
better packages. also started std/io pkg (wrote hello world in toc!)
Diffstat (limited to 'std/arr.c')
-rw-r--r--std/arr.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/std/arr.c b/std/arr.c
new file mode 100644
index 0000000..2d2c03a
--- /dev/null
+++ b/std/arr.c
@@ -0,0 +1,23 @@
+#include <stdint.h>
+#include <stdio.h>
+typedef int8_t i8;
+typedef int16_t i16;
+typedef int32_t i32;
+typedef int64_t i64;
+typedef uint8_t u8;
+typedef uint16_t u16;
+typedef uint32_t u32;
+typedef uint64_t u64;
+typedef float f32;
+typedef double f64;
+typedef u8 bool;
+typedef struct { void *data; i64 n; } slice_;
+#define false ((bool)0)
+#define true ((bool)1)
+static slice_ mkslice_(void *data, i64 n) { slice_ ret; ret.data = data; ret.n = n; return ret; }
+static void free_(void *data) { extern void free(void *data); free(data); }
+static void *e__calloc(size_t n, size_t sz) { extern void *calloc(size_t n, size_t size); extern void abort(void); void *ret = calloc(n, sz); if (n && sz && !ret) { fprintf(stderr, "Out of memory.\n"); abort(); } return ret; }
+
+
+/* declarations */
+/* code */