wip: begin writer impl for externs

This commit is contained in:
samsonium
2026-11-05 04:01:23 +03:00
parent 66f31ab865
commit de0e88f2e9
3 changed files with 10 additions and 15 deletions
+5
View File
@@ -39,6 +39,9 @@ int fzl_write(fzl_writer_t *writer, fzl_gen_t *gen)
const char hdr[5] = {'F', 'Z', 'L', 0x0, 0x1};
fwrite(hdr, sizeof(char), 5, fp);
fwrite(&gen->consts->size, sizeof(size_t), 1, fp);
fwrite(&gen->extern_libs_count, sizeof(size_t), 1, fp);
fwrite(&gen->extern_types_count, sizeof(size_t), 1, fp);
fwrite(&gen->extern_fns_count, sizeof(size_t), 1, fp);
fwrite(&gen->ops_count, sizeof(size_t), 1, fp);
for (size_t i = 0; i < gen->consts->size; i++)
@@ -54,6 +57,8 @@ int fzl_write(fzl_writer_t *writer, fzl_gen_t *gen)
}
}
// TODO: write libs, types and functions
if (gen->ops_count > 0)
fwrite(gen->ops, sizeof(uint64_t), gen->ops_count, fp);