wasmer/lib/runtime-c-api/wasmer.h

32 lines
951 B
C
Raw Normal View History

2019-02-02 04:10:36 +00:00
#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
2019-02-01 05:51:34 +00:00
2019-02-02 06:26:10 +00:00
typedef enum {
WASMER_CALL_OK = 1,
WASMER_CALL_ERROR = 2,
} wasmer_call_result_t;
2019-02-02 04:10:36 +00:00
typedef enum {
2019-02-01 05:51:34 +00:00
WASMER_COMPILE_OK = 1,
WASMER_COMPILE_ERROR = 2,
2019-02-02 04:10:36 +00:00
} wasmer_compile_result_t;
2019-02-01 05:51:34 +00:00
2019-02-02 04:10:36 +00:00
typedef struct wasmer_import_object_t wasmer_import_object_t;
2019-02-01 05:51:34 +00:00
2019-02-02 04:10:36 +00:00
typedef struct wasmer_instance_t wasmer_instance_t;
2019-02-01 05:51:34 +00:00
void wasmer_import_object_destroy(wasmer_import_object_t *import_object);
2019-02-02 04:10:36 +00:00
wasmer_import_object_t *wasmer_import_object_new(void);
2019-02-01 05:51:34 +00:00
2019-02-02 06:26:10 +00:00
wasmer_call_result_t wasmer_instance_call(wasmer_instance_t *instance, const char *name);
void wasmer_instance_destroy(wasmer_instance_t *instance);
2019-02-01 05:51:34 +00:00
wasmer_compile_result_t wasmer_instantiate(wasmer_instance_t *instance,
2019-02-02 06:26:10 +00:00
uint8_t *wasm_bytes,
uint32_t wasm_bytes_len,
2019-02-01 05:51:34 +00:00
wasmer_import_object_t *import_object);