use std::io::Error;
use self::parser::Parser;
use crate::MachineType;
mod parser;
#[derive(Debug, Clone, Default)]
pub struct ModuleDef {
pub exports: Vec<ShortExport>,
pub import_name: String,
pub image_base: u64,
pub stack_reserve: u64,
pub stack_commit: u64,
pub heap_reserve: u64,
pub heap_commit: u64,
pub major_image_version: u32,
pub minor_image_version: u32,
pub major_os_version: u32,
pub minor_os_version: u32,
}
impl ModuleDef {
pub fn parse(def: &str, machine: MachineType) -> Result<ModuleDef, Error> {
Parser::new(def, machine).parse()
}
}
#[derive(Debug, Clone, Default)]
pub struct ShortExport {
pub name: String,
pub ext_name: Option<String>,
pub symbol_name: String,
pub alias_target: String,
pub ordinal: u16,
pub no_name: bool,
pub data: bool,
pub private: bool,
pub constant: bool,
}