summaryrefslogtreecommitdiff
path: root/private_include/interp.h
blob: beafbb17b19fd99a76ac67ab8dfa5df96d70155c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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