summaryrefslogtreecommitdiff
path: root/private_include/interp.h
diff options
context:
space:
mode:
authorXavier Del Campo Romero <xavi.dcr@tutanota.com>2023-11-26 22:43:30 +0100
committerXavier Del Campo Romero <xavi.dcr@tutanota.com>2023-12-29 23:36:21 +0100
commit52c18e60929b64285d4bb333f87482d954c9b2e0 (patch)
tree836ab3a01d160f45cda4f5a28522fc0bf471011c /private_include/interp.h
First commitfirst-step
Diffstat (limited to 'private_include/interp.h')
-rw-r--r--private_include/interp.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/private_include/interp.h b/private_include/interp.h
new file mode 100644
index 0000000..beafbb1
--- /dev/null
+++ b/private_include/interp.h
@@ -0,0 +1,29 @@
+#ifndef INTERP_H
+#define INTERP_H
+
+#include <opcodes.h>
+#include <stddef.h>
+#include <stdint.h>
+#include <stdio.h>
+
+struct interp_cfg
+{
+ FILE *f;
+};
+
+struct interp_set
+{
+ const enum opcode *opcodes;
+ size_t n;
+};
+
+extern const struct interp_set interp_initexpr_set;
+
+struct interp *interp_alloc(const struct interp_cfg *cfg);
+int interp_run(struct interp *i);
+int interp_run_limited(struct interp *i, const struct interp_set *ops);
+const char *interp_get_exception(const struct interp *i);
+void interp_free(struct interp *i);
+int interp_check_opcode(uint8_t op, FILE *f);
+
+#endif