aboutsummaryrefslogtreecommitdiff
path: root/src/context.c
diff options
context:
space:
mode:
authorMarvin Borner2021-07-27 21:10:34 +0200
committerMarvin Borner2021-07-27 21:10:34 +0200
commitbfdc8d2d843c08bd01517256a63518d03da236f6 (patch)
tree399cfdb73a1716b8d8f6efb1447990f917a9242a /src/context.c
parent56c2a240f379ca3d12b1bb5a9950c1663ba33763 (diff)
Started treeify
Diffstat (limited to 'src/context.c')
-rw-r--r--src/context.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/context.c b/src/context.c
index c0898d8..ff0291a 100644
--- a/src/context.c
+++ b/src/context.c
@@ -1,6 +1,10 @@
+#include <assert.h>
+#include <stdio.h>
+#include <stdlib.h>
+
#include <context.h>
-#include <lib.h>
#include <tokenize.h>
+#include <treeify.h>
struct ctx *context_create(const char *path)
{
@@ -24,6 +28,9 @@ struct ctx *context_create(const char *path)
ctx->raw[ctx->size] = 0;
+ ctx->tree.head = tree_create();
+ ctx->tree.current = NULL;
+
return ctx;
}
@@ -41,6 +48,9 @@ void context_destroy(struct ctx *ctx)
if (ctx->tokens)
free(ctx->tokens);
+ if (ctx->tree.head)
+ tree_destroy(ctx->tree.head);
+
free(ctx);
}