reoxide 0.7.0

Rust-bindings for the ReOxide decompiler extension framework
Documentation
use crate::cpp::StdString;

opaque!(ReOxideInterface);

impl ReOxideInterface {
    pub fn send_string(&mut self, s: &str) {
        let std_str = StdString::from_str(s);
        unsafe { ReOxideInterface_send_string(self, std_str.as_ref()) };
    }
}

/// Throws a LowlevelError on the Ghidra C++ side, which will then
/// propagate back to C++ code through C-unwind
pub fn ghidra_throw(explain: &str) -> ! {
    unsafe { ghidra_panic(explain.as_ptr(), explain.len()) }
}


#[link(name = "reoxide")]
unsafe extern "C-unwind" {
    fn ReOxideInterface_send_string(this: *mut ReOxideInterface, s: *const StdString);
    fn ghidra_panic(s: *const u8, len: usize) -> !;
}