40 lines
797 B
C
40 lines
797 B
C
#pragma once
|
|
#include <stdio.h>
|
|
|
|
#include "list.h"
|
|
#include "vector.h"
|
|
|
|
struct vm;
|
|
struct vm_ref_entry;
|
|
|
|
struct vm_unresolved_ref {
|
|
struct vm_ref_entry *entry;
|
|
struct list_head link;
|
|
char unit_name[64];
|
|
char sym_name[64];
|
|
};
|
|
|
|
struct vm_export_entry {
|
|
int is_native;
|
|
union {
|
|
uintptr_t ex_native;
|
|
size_t ex_index;
|
|
};
|
|
char name[64];
|
|
};
|
|
|
|
struct vm_unit_info {
|
|
size_t index;
|
|
struct vector exports;
|
|
struct vm_unit *unit;
|
|
};
|
|
|
|
int vm_load_unit_file(struct vm *vm,
|
|
struct vm_unit_info *info,
|
|
struct list_head *refs,
|
|
FILE *fp);
|
|
int vm_load_unit(struct vm *vm,
|
|
struct vm_unit_info *info,
|
|
struct list_head *refs,
|
|
const char *name);
|