aboutsummaryrefslogtreecommitdiff
path: root/src/term.c
diff options
context:
space:
mode:
authorMarvin Borner2023-04-11 20:56:14 +0200
committerMarvin Borner2023-04-11 20:56:14 +0200
commit5c8f9487ec11035cbd1accfb67f1a4943a2b8db1 (patch)
tree8a294e7efe801986b6e7f9e19a5ed962aa816c4f /src/term.c
parent4b40b490d3948a2ccf736bcf94b95abf44955a38 (diff)
Bootstrapping
Diffstat (limited to 'src/term.c')
-rw-r--r--src/term.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/term.c b/src/term.c
new file mode 100644
index 0000000..7ab1a79
--- /dev/null
+++ b/src/term.c
@@ -0,0 +1,19 @@
+// Copyright (c) 2023, Marvin Borner <dev@marvinborner.de>
+// SPDX-License-Identifier: MIT
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <term.h>
+
+struct term *new_term(term_type type)
+{
+ struct term *term = malloc(sizeof(*term));
+ if (!term) {
+ fprintf(stderr, "Out of memory!\n");
+ abort();
+ }
+ term->type = type;
+ return term;
+}