summaryrefslogtreecommitdiff
path: root/src/core/state.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/state.h')
-rw-r--r--src/core/state.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/core/state.h b/src/core/state.h
new file mode 100644
index 0000000..406a79c
--- /dev/null
+++ b/src/core/state.h
@@ -0,0 +1,25 @@
+#ifndef SAND_STATE_H
+#define SAND_STATE_H
+
+// This module defines the evaluator state. This is the "world" in Sand.
+// Multiple evaluator states can coexist as they are totally separate.
+
+#include <stddef.h>
+
+typedef void (* SandPrintHandler)(const char *message, size_t length);
+
+typedef struct {
+ SandPrintHandler print_handler;
+} SandConfig;
+
+// This data structure should be treated as entirely opaque by consuming code.
+typedef struct {
+ SandConfig config;
+} SandState;
+
+
+SandState sand_create_state(SandConfig config);
+
+void sand_destroy_state(SandState *);
+
+#endif