#ifndef WASMTIME_COMPONENT_LINKER_H
#define WASMTIME_COMPONENT_LINKER_H
#include <wasm.h>
#include <wasmtime/component/component.h>
#include <wasmtime/component/instance.h>
#include <wasmtime/component/types/func.h>
#include <wasmtime/conf.h>
#include <wasmtime/error.h>
#include <wasmtime/module.h>
#include <wasmtime/store.h>
#ifdef WASMTIME_FEATURE_COMPONENT_MODEL
#ifdef __cplusplus
extern "C" {
#endif
typedef struct wasmtime_component_linker_t wasmtime_component_linker_t;
typedef struct wasmtime_component_linker_instance_t
wasmtime_component_linker_instance_t;
WASM_API_EXTERN wasmtime_component_linker_t *
wasmtime_component_linker_new(const wasm_engine_t *engine);
WASM_API_EXTERN void
wasmtime_component_linker_allow_shadowing(wasmtime_component_linker_t *linker,
bool allow);
WASM_API_EXTERN wasmtime_component_linker_instance_t *
wasmtime_component_linker_root(wasmtime_component_linker_t *linker);
WASM_API_EXTERN wasmtime_error_t *wasmtime_component_linker_instantiate(
const wasmtime_component_linker_t *linker, wasmtime_context_t *context,
const wasmtime_component_t *component,
wasmtime_component_instance_t *instance_out);
WASM_API_EXTERN wasmtime_error_t *
wasmtime_component_linker_define_unknown_imports_as_traps(
wasmtime_component_linker_t *linker, const wasmtime_component_t *component);
WASM_API_EXTERN void
wasmtime_component_linker_delete(wasmtime_component_linker_t *linker);
WASM_API_EXTERN wasmtime_error_t *
wasmtime_component_linker_instance_add_instance(
wasmtime_component_linker_instance_t *linker_instance, const char *name,
size_t name_len,
wasmtime_component_linker_instance_t **linker_instance_out);
WASM_API_EXTERN wasmtime_error_t *wasmtime_component_linker_instance_add_module(
wasmtime_component_linker_instance_t *linker_instance, const char *name,
size_t name_len, const wasmtime_module_t *module);
typedef wasmtime_error_t *(*wasmtime_component_func_callback_t)(
void *, wasmtime_context_t *, const wasmtime_component_func_type_t *,
wasmtime_component_val_t *, size_t, wasmtime_component_val_t *, size_t);
WASM_API_EXTERN wasmtime_error_t *wasmtime_component_linker_instance_add_func(
wasmtime_component_linker_instance_t *linker_instance, const char *name,
size_t name_len, wasmtime_component_func_callback_t callback, void *data,
void (*finalizer)(void *));
#ifdef WASMTIME_FEATURE_WASI
WASM_API_EXTERN wasmtime_error_t *
wasmtime_component_linker_add_wasip2(wasmtime_component_linker_t *linker);
#endif
#ifdef WASMTIME_FEATURE_WASI_HTTP
WASM_API_EXTERN wasmtime_error_t *
wasmtime_component_linker_add_wasi_http(wasmtime_component_linker_t *linker);
#endif
typedef wasmtime_error_t *(*wasmtime_component_resource_destructor_t)(
void *, wasmtime_context_t *, uint32_t);
WASM_API_EXTERN wasmtime_error_t *
wasmtime_component_linker_instance_add_resource(
wasmtime_component_linker_instance_t *linker_instance, const char *name,
size_t name_len, const wasmtime_component_resource_type_t *resource,
wasmtime_component_resource_destructor_t destructor, void *data,
void (*finalizer)(void *));
WASM_API_EXTERN void wasmtime_component_linker_instance_delete(
wasmtime_component_linker_instance_t *linker_instance);
#ifdef __cplusplus
} #endif
#endif
#endif