|
|
@ -11,6 +11,7 @@
|
|
|
|
#define wasm3_ext_h
|
|
|
|
#define wasm3_ext_h
|
|
|
|
|
|
|
|
|
|
|
|
#include "wasm3.h"
|
|
|
|
#include "wasm3.h"
|
|
|
|
|
|
|
|
//#include "m3_exec_defs.h"
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include <stdbool.h>
|
|
|
|
|
|
|
|
|
|
|
|
#if defined(__cplusplus)
|
|
|
|
#if defined(__cplusplus)
|
|
|
@ -29,8 +30,9 @@ extern "C" {
|
|
|
|
// To append a new function, set io_functionIndex to negative. On return, the new function index will be set.
|
|
|
|
// To append a new function, set io_functionIndex to negative. On return, the new function index will be set.
|
|
|
|
// To overwrite an existing function, set io_functionIndex to the desired element. i_signature must match the existing
|
|
|
|
// To overwrite an existing function, set io_functionIndex to the desired element. i_signature must match the existing
|
|
|
|
// function signature.
|
|
|
|
// function signature.
|
|
|
|
// ** InjectFunction invalidates any existing IM3Function pointers
|
|
|
|
|
|
|
|
M3Result m3_InjectFunction (IM3Module io_module,
|
|
|
|
// ** InjectFunction invalidates any outstanding IM3Function pointers
|
|
|
|
|
|
|
|
M3Result m3_InjectFunction (IM3Module i_module,
|
|
|
|
int32_t * io_functionIndex,
|
|
|
|
int32_t * io_functionIndex,
|
|
|
|
// const char * const i_name,
|
|
|
|
// const char * const i_name,
|
|
|
|
const char * const i_signature,
|
|
|
|
const char * const i_signature,
|
|
|
@ -39,7 +41,7 @@ extern "C" {
|
|
|
|
|
|
|
|
|
|
|
|
M3Result m3_AddFunctionToTable (IM3Function i_function,
|
|
|
|
M3Result m3_AddFunctionToTable (IM3Function i_function,
|
|
|
|
uint32_t * o_elementIndex,
|
|
|
|
uint32_t * o_elementIndex,
|
|
|
|
uint32_t i_tableIndex); // must be zero
|
|
|
|
uint32_t i_tableIndex); // i_tableIndex must be zero
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
IM3Function m3_GetFunctionByIndex (IM3Module i_module,
|
|
|
|
IM3Function m3_GetFunctionByIndex (IM3Module i_module,
|
|
|
@ -51,7 +53,14 @@ extern "C" {
|
|
|
|
M3Result m3_GetDataSegmentOffset (IM3Module i_module,
|
|
|
|
M3Result m3_GetDataSegmentOffset (IM3Module i_module,
|
|
|
|
uint32_t i_index);
|
|
|
|
uint32_t i_index);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//-------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if 0
|
|
|
|
|
|
|
|
M3Result m3_RegisterCustomOpcode (IM3Module i_module,
|
|
|
|
|
|
|
|
uint16_t i_opcode,
|
|
|
|
|
|
|
|
uint8_t i_numImmediates,
|
|
|
|
|
|
|
|
IM3Operation i_operation);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
#if 0
|
|
|
|
#if 0
|
|
|
|
M3Result m3_SetStackGlobalIndex (IM3Module io_module,
|
|
|
|
M3Result m3_SetStackGlobalIndex (IM3Module io_module,
|
|
|
|
uint32_t i_index);
|
|
|
|
uint32_t i_index);
|
|
|
|