Wasmtime bindings for Zig
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
1.1 KiB

// https://github.com/bytecodealliance/wasmtime/blob/main/crates/c-api/include/wasmtime/config.h
/// Global engine configuration
///
/// This structure represents global configuration used when constructing an
/// `Engine`. Configuration is safe to share between threads. Typically you'll
/// create a config object and immediately pass it into
/// `Engine.initWithConfig`, however.
///
/// For more information about configuration see the Rust documentation as
/// well at https://bytecodealliance.github.io/wasmtime/api/wasmtime/struct.Config.html.
pub const Config = opaque {
/// Creates a new empty configuration object.
///
/// The object returned is owned by the caller and will need to be deleted
/// with `deinit`. May return `error.ConfigInit` if a configuration object
/// could not be allocated.
pub fn init() !*Config {
return wasm_config_new() orelse error.ConfigInit;
}
pub fn deinit(self: *Config) void {
wasm_config_delete(self);
}
// TODO: More bindings!
extern "c" fn wasm_config_new() ?*Config;
extern "c" fn wasm_config_delete(*Config) void;
};