wip: working on extern in VM
- Feat: add writer externs writing fns - Feat: add VM reader functions
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <vm/internals/reader.h>
|
||||
|
||||
// Reader sizes section
|
||||
bool vm_rd_sections_sz(fzl_vm_reader_t *reader, FILE *fd)
|
||||
{
|
||||
if (!reader || !fd)
|
||||
return false;
|
||||
|
||||
bool ok = vm_rd_u16(fd, 1, (uint16_t *)&reader->consts_count);
|
||||
if (!ok)
|
||||
return false;
|
||||
|
||||
ok = vm_rd_u16(fd, 1, &reader->extern_libs_count);
|
||||
if (!ok)
|
||||
return false;
|
||||
|
||||
ok = vm_rd_u16(fd, 1, &reader->extern_types_count);
|
||||
if (!ok)
|
||||
return false;
|
||||
|
||||
ok = vm_rd_u16(fd, 1, &reader->extern_fns_count);
|
||||
if (!ok)
|
||||
return false;
|
||||
|
||||
ok = vm_rd_word(fd, 1, &reader->ops_count);
|
||||
return ok;
|
||||
}
|
||||
Reference in New Issue
Block a user