ptr89/wasm/main.cpp
Kirill Zhumarin e5cc9b0f5d feat!: redesign search results
BREAKING CHANGE: CLI JSON and TypeScript search/xref result structures now expose resolved addresses, source offsets, and bytes separately.
2026-08-29 19:22:54 +03:00

32 lines
916 B
C++

#include <emscripten/bind.h>
#include "Ptr89Wasm.h"
using namespace emscripten;
using namespace Ptr89;
EMSCRIPTEN_BINDINGS(ptr89) {
value_object<Ptr89SearchResult>("Ptr89SearchResult")
.field("address", &Ptr89SearchResult::address)
.field("offset", &Ptr89SearchResult::offset)
.field("bytes", &Ptr89SearchResult::bytes);
value_object<Ptr89XRef>("Ptr89XRef")
.field("type", &Ptr89XRef::type)
.field("xref", &Ptr89XRef::xref)
.field("offset", &Ptr89XRef::offset)
.field("bytes", &Ptr89XRef::bytes);
register_vector<Ptr89SearchResult>("Ptr89SearchResults");
register_vector<Ptr89XRef>("Ptr89XRefs");
class_<Ptr89Wasm>("Ptr89")
.constructor<>()
.function("open", &Ptr89Wasm::open)
.function("close", &Ptr89Wasm::close)
.function("setDebug", &Ptr89Wasm::setDebug)
.function("find", &Ptr89Wasm::find)
.function("findXRefs", &Ptr89Wasm::findXRefs);
function("prettify", &prettify);
}