extensions
Steven Massey 3 years ago
parent a26615cf99
commit 92c220407e

@ -11,6 +11,7 @@
#define wasm3_ext_h
#include "wasm3.h"
//#include "m3_exec_defs.h"
#include <stdbool.h>
#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 overwrite an existing function, set io_functionIndex to the desired element. i_signature must match the existing
// 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,
// const char * const i_name,
const char * const i_signature,
@ -39,7 +41,7 @@ extern "C" {
M3Result m3_AddFunctionToTable (IM3Function i_function,
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,
@ -51,7 +53,14 @@ extern "C" {
M3Result m3_GetDataSegmentOffset (IM3Module i_module,
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
M3Result m3_SetStackGlobalIndex (IM3Module io_module,
uint32_t i_index);

@ -61,8 +61,8 @@ typedef struct M3Function
#if defined (DEBUG)
u32 hits;
u32 index;
#endif
u32 index;
u16 maxStackSlots;

Loading…
Cancel
Save