#ifndef WASMTIME_STORE_H
#define WASMTIME_STORE_H
#include <wasi.h>
#include <wasm.h>
#include <wasmtime/conf.h>
#include <wasmtime/error.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct wasmtime_store wasmtime_store_t;
typedef struct wasmtime_context wasmtime_context_t;
WASM_API_EXTERN wasmtime_store_t *wasmtime_store_new(wasm_engine_t *engine,
void *data,
void (*finalizer)(void *));
WASM_API_EXTERN wasmtime_context_t *
wasmtime_store_context(wasmtime_store_t *store);
WASM_API_EXTERN void wasmtime_store_limiter(wasmtime_store_t *store,
int64_t memory_size,
int64_t table_elements,
int64_t instances, int64_t tables,
int64_t memories);
WASM_API_EXTERN void wasmtime_store_delete(wasmtime_store_t *store);
WASM_API_EXTERN void *
wasmtime_context_get_data(const wasmtime_context_t *context);
WASM_API_EXTERN void wasmtime_context_set_data(wasmtime_context_t *context,
void *data);
WASM_API_EXTERN wasmtime_error_t *
wasmtime_context_gc(wasmtime_context_t *context);
WASM_API_EXTERN wasmtime_error_t *
wasmtime_context_set_fuel(wasmtime_context_t *store, uint64_t fuel);
WASM_API_EXTERN wasmtime_error_t *
wasmtime_context_get_fuel(const wasmtime_context_t *context, uint64_t *fuel);
#ifdef WASMTIME_FEATURE_WASI
WASM_API_EXTERN wasmtime_error_t *
wasmtime_context_set_wasi(wasmtime_context_t *context, wasi_config_t *wasi);
#endif
#ifdef WASMTIME_FEATURE_WASI_HTTP
WASM_API_EXTERN void
wasmtime_context_set_wasi_http(wasmtime_context_t *context);
#endif
WASM_API_EXTERN void
wasmtime_context_set_epoch_deadline(wasmtime_context_t *context,
uint64_t ticks_beyond_current);
typedef uint8_t wasmtime_update_deadline_kind_t;
#define WASMTIME_UPDATE_DEADLINE_CONTINUE 0
#define WASMTIME_UPDATE_DEADLINE_YIELD 1
WASM_API_EXTERN void wasmtime_store_epoch_deadline_callback(
wasmtime_store_t *store,
wasmtime_error_t *(*func)(wasmtime_context_t *context, void *data,
uint64_t *epoch_deadline_delta,
wasmtime_update_deadline_kind_t *update_kind),
void *data, void (*finalizer)(void *));
#ifdef __cplusplus
} #endif
#endif