Update
This commit is contained in:
parent
bd9b51be9a
commit
115dc530e1
6 changed files with 153 additions and 64 deletions
11
src/main.c
11
src/main.c
|
@ -1,9 +1,6 @@
|
|||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#define UNW_LOCAL_ONLY
|
||||
#include <libunwind.h>
|
||||
#include <malloc.h>
|
||||
|
||||
#include "hydroforth/hydroforth.h"
|
||||
|
||||
|
@ -60,7 +57,7 @@ int main(int argc, char *argv[])
|
|||
fputs("No source file specified!\n", stderr);
|
||||
return 1;
|
||||
}
|
||||
FILE *fp = fopen(argv[1], "rb");
|
||||
FILE *fp = fopen(argv[1], "r");
|
||||
if (fp == NULL)
|
||||
{
|
||||
fputs("Error opening file!\n", stderr);
|
||||
|
@ -75,11 +72,11 @@ int main(int argc, char *argv[])
|
|||
.pos = 0,
|
||||
.single_char_word_keys_len = 0,
|
||||
.word_keys_len = 0,
|
||||
.word_keys_max_len = 0,
|
||||
.word_definitions_len = 0,
|
||||
};
|
||||
HYDROFORTH__RESULT result = {.error = OK, .backtrace_len = 0};
|
||||
hydroforth.run(&result, &interpreter);
|
||||
free(res.src);
|
||||
free(interpreter.src);
|
||||
if (result.error)
|
||||
{
|
||||
hydroforth__add_func_backtrace(&result);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue