Automate g_sys structure handling for web.

This commit is contained in:
Brad Nelson
2022-07-10 21:25:22 -07:00
parent ffdbec63e5
commit 4cc02ffc96
9 changed files with 69 additions and 77 deletions

View File

@ -16,3 +16,23 @@
#define SMUDGE 2
#define BUILTIN_FORK 4
#define BUILTIN_MARK 8
typedef struct {
cell_t *heap, **current, ***context;
cell_t *latestxt, notfound;
cell_t *heap_start;
cell_t heap_size, stack_cells;
const char *boot;
cell_t boot_size;
const char *tib;
cell_t ntib, tin, state, base;
int argc;
char **argv;
cell_t *(*runner)(cell_t *rp); // pointer to forth_run
// Layout not used by Forth.
cell_t *rp; // spot to park main thread
cell_t DOLIT_XT, DOFLIT_XT, DOEXIT_XT, YIELD_XT;
void *DOCREATE_OP;
const BUILTIN_WORD *builtins;
} G_SYS;

View File

@ -43,25 +43,6 @@ enum {
#undef V
};
typedef struct {
cell_t *heap, **current, ***context;
cell_t *latestxt, notfound;
cell_t *heap_start;
cell_t heap_size, stack_cells;
const char *boot;
cell_t boot_size;
const char *tib;
cell_t ntib, tin, state, base;
int argc;
char **argv;
cell_t *(*runner)(cell_t *rp); // pointer to forth_run
// Layout not used by Forth.
cell_t *rp; // spot to park main thread
cell_t DOLIT_XT, DOFLIT_XT, DOEXIT_XT, YIELD_XT;
void *DOCREATE_OP;
const BUILTIN_WORD *builtins;
} G_SYS;
static G_SYS *g_sys = 0;
static cell_t convert(const char *pos, cell_t n, cell_t base, cell_t *ret) {