wip: working on extern in VM

- Feat: add writer externs writing fns
- Feat: add VM reader functions
This commit is contained in:
samsonium
2026-11-05 21:48:40 +03:00
parent 84572edb0d
commit 1db42c1e8e
17 changed files with 608 additions and 16 deletions
+4 -4
View File
@@ -40,10 +40,10 @@ int fzl_write(fzl_writer_t *writer, fzl_gen_t *gen)
const char hdr[5] = {'F', 'Z', 'L', 0x0, 0x2};
fwrite(hdr, sizeof(char), 5, fd);
fwrite(&gen->consts->size, sizeof(size_t), 1, fd);
fwrite(&gen->extern_libs_count, sizeof(size_t), 1, fd);
fwrite(&gen->extern_types_count, sizeof(size_t), 1, fd);
fwrite(&gen->extern_fns_count, sizeof(size_t), 1, fd);
fwrite(&gen->consts->size, sizeof(uint16_t), 1, fd);
fwrite(&gen->extern_libs_count, sizeof(uint16_t), 1, fd);
fwrite(&gen->extern_types_count, sizeof(uint16_t), 1, fd);
fwrite(&gen->extern_fns_count, sizeof(uint16_t), 1, fd);
fwrite(&gen->ops_count, sizeof(size_t), 1, fd);
bool result = wr_consts(fd, gen->consts);