Add experimental wasm bindings

Published to npm as objdiff-wasm
This commit is contained in:
2024-08-20 21:40:32 -06:00
parent 8250d26b77
commit 0fccae1049
40 changed files with 4732 additions and 311 deletions

View File

@@ -1,6 +1,7 @@
use std::collections::HashSet;
use anyhow::Result;
use wasm_bindgen::prelude::wasm_bindgen;
use crate::{
diff::{
@@ -17,6 +18,7 @@ pub mod code;
pub mod data;
pub mod display;
#[wasm_bindgen]
#[derive(
Debug,
Copy,
@@ -41,6 +43,7 @@ pub enum X86Formatter {
Masm,
}
#[wasm_bindgen]
#[derive(
Debug,
Copy,
@@ -65,6 +68,7 @@ pub enum MipsAbi {
N64,
}
#[wasm_bindgen]
#[derive(
Debug,
Copy,
@@ -93,6 +97,7 @@ pub enum MipsInstrCategory {
R5900,
}
#[wasm_bindgen]
#[derive(
Debug,
Copy,
@@ -117,6 +122,7 @@ pub enum ArmArchVersion {
V6K,
}
#[wasm_bindgen]
#[derive(
Debug,
Copy,
@@ -148,6 +154,7 @@ pub enum ArmR9Usage {
#[inline]
const fn default_true() -> bool { true }
#[wasm_bindgen]
#[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(default)]
pub struct DiffObjConfig {
@@ -200,6 +207,9 @@ impl DiffObjConfig {
}
}
#[wasm_bindgen]
pub fn default_diff_obj_config() -> DiffObjConfig { Default::default() }
#[derive(Debug, Clone)]
pub struct ObjSectionDiff {
pub symbols: Vec<ObjSymbolDiff>,