#ifndef INTERFACE_H
#define INTERFACE_H 1
#include <stddef.h>
#include "consts.h"
struct gearlance_compile_input {
const char* data; size_t length;
};
struct gearlance_compiled_program;
struct gearlance_compile_result {
bool error_encountered;
const char* err_msg; struct gearlance_compiled_program *program; };
struct gearlance_execute_input {
struct gearlance_compiled_program *program_left; struct gearlance_compiled_program *program_right; bool track_stats;
};
enum gearlance_end_type {
gearlance_end_time,
gearlance_end_flag,
gearlance_end_tape,
gearlance_end_unknown, };
struct gearlance_execute_result {
int scores[2][MAXTAPE+1];
enum gearlance_end_type end_type[2][MAXTAPE+1];
unsigned long long cycles;
unsigned char tape_max[2][MAXTAPE];
unsigned heat_position[2][MAXTAPE];
};
extern struct gearlance_compile_result gearlance_compile(struct gearlance_compile_input input);
extern void gearlance_execute(struct gearlance_execute_input input, struct gearlance_execute_result* output);
extern void gearlance_free_program(struct gearlance_compiled_program *program);
#endif