From 52c18e60929b64285d4bb333f87482d954c9b2e0 Mon Sep 17 00:00:00 2001 From: Xavier Del Campo Romero Date: Sun, 26 Nov 2023 22:43:30 +0100 Subject: First commit --- private_include/interp.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 private_include/interp.h (limited to 'private_include/interp.h') 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 +#include +#include +#include + +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 -- cgit v1.2.3