aboutsummaryrefslogtreecommitdiff
path: root/src/term.c
diff options
context:
space:
mode:
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;
+}