wasm3x-sys 0.1.0

Raw FFI bindings to the Wasm3 WebAssembly interpreter.
Documentation
//! Raw FFI bindings to the [Wasm3] WebAssembly interpreter.
//!
//! The bindings are generated at build time with `bindgen` from the vendored
//! Wasm3 C sources and expose the public `m3_*` C-API verbatim. Prefer the safe
//! wrapper crate over using these bindings directly.
//!
//! [Wasm3]: https://github.com/wasm3/wasm3
#![allow(non_upper_case_globals)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
#![allow(dead_code)]
#![allow(clippy::all)]

include!(concat!(env!("OUT_DIR"), "/bindings.rs"));

#[cfg(test)]
mod tests {
    use super::*;

    /// Smoke test: create and free an environment and a runtime.
    #[test]
    fn environment_and_runtime_roundtrip() {
        unsafe {
            let env = m3_NewEnvironment();
            assert!(!env.is_null());
            let runtime = m3_NewRuntime(env, 64 * 1024, core::ptr::null_mut());
            assert!(!runtime.is_null());
            m3_FreeRuntime(runtime);
            m3_FreeEnvironment(env);
        }
    }
}