libwasmedge.pp 76 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148
  1. {$mode objfpc}
  2. {$IFNDEF FPC_DOTTEDUNITS}
  3. unit libwasmedge;
  4. {$ENDIF}
  5. interface
  6. uses
  7. {$IFDEF FPC_DOTTEDUNITS}
  8. System.CTypes;
  9. {$ELSE}
  10. ctypes;
  11. {$ENDIF}
  12. {
  13. Automatically converted by H2Pas 0.99.16 from libwasmedge4.h
  14. The following command line parameters were used:
  15. -l
  16. libwasmedge.so
  17. -o
  18. libwasmedge.pp
  19. -p
  20. -T
  21. -S
  22. -P
  23. -C
  24. -c
  25. libwasmedge4.h
  26. }
  27. const
  28. {$IFDEF UNIX}
  29. {$IFNDEF DARWIN}
  30. LibWasmName = 'libwasmedge.so';
  31. {$ELSE}
  32. LibWasmName = 'libwasmedge.dylib';
  33. {$ENDIF}
  34. {$ELSE}
  35. {$IFDEF WINDOWS}
  36. LibWasmName = 'libwasmedge.dll';
  37. {$ENDIF}
  38. {$ENDIF}
  39. {$IFDEF FPC}
  40. {$PACKRECORDS C}
  41. {$ENDIF}
  42. Type
  43. Puint64_t = ^PQWord;
  44. Puint8_t = ^PByte;
  45. uint128_t = record
  46. Low : QWord;
  47. High : QWord;
  48. end;
  49. tuint128_t = uint128_t;
  50. int128_t = record
  51. low: qword;
  52. high : int64;
  53. end;
  54. tint128_t = int128_t;
  55. tcint = cint;
  56. tuint32_t = uint32;
  57. tint32_t = int32;
  58. tint64_t = int64;
  59. tuint64_t = qword;
  60. tcfloat = single;
  61. tdouble = double;
  62. tbool = cbool;
  63. Ppcchar = ^PAnsichar;
  64. (*
  65. libwasmedge.pp(68,1) Error: Forward type not resolved "Tuint64_t"
  66. libwasmedge.pp(68,1) Error: Forward type not resolved "Tuint8_t"
  67. libwasmedge.pp(68,1) Error: Forward type not resolved "TWasmEdge_ASTModuleContext"
  68. libwasmedge.pp(68,1) Error: Forward type not resolved "TWasmEdge_Async"
  69. libwasmedge.pp(68,1) Error: Forward type not resolved "TWasmEdge_CallingFrameContext"
  70. libwasmedge.pp(68,1) Error: Forward type not resolved "TWasmEdge_CompilerContext"
  71. libwasmedge.pp(68,1) Error: Forward type not resolved "TWasmEdge_CompilerOptimizationLevel"
  72. libwasmedge.pp(68,1) Error: Forward type not resolved "TWasmEdge_CompilerOutputFormat"
  73. libwasmedge.pp(68,1) Error: Forward type not resolved "TWasmEdge_ConfigureContext"
  74. libwasmedge.pp(68,1) Error: Forward type not resolved "TWasmEdge_ErrCategory"
  75. libwasmedge.pp(68,1) Error: Forward type not resolved "TWasmEdge_ErrCode"
  76. libwasmedge.pp(68,1) Error: Forward type not resolved "TWasmEdge_ExecutorContext"
  77. libwasmedge.pp(68,1) Error: Forward type not resolved "TWasmEdge_ExportTypeContext"
  78. libwasmedge.pp(68,1) Error: Forward type not resolved "TWasmEdge_ExternalType"
  79. libwasmedge.pp(68,1) Error: Forward type not resolved "TWasmEdge_FunctionInstanceContext"
  80. libwasmedge.pp(68,1) Error: Forward type not resolved "TWasmEdge_FunctionTypeContext"
  81. libwasmedge.pp(68,1) Error: Forward type not resolved "TWasmEdge_GlobalInstanceContext"
  82. libwasmedge.pp(68,1) Error: Forward type not resolved "TWasmEdge_GlobalTypeContext"
  83. libwasmedge.pp(68,1) Error: Forward type not resolved "TWasmEdge_HostRegistration"
  84. libwasmedge.pp(68,1) Error: Forward type not resolved "TWasmEdge_ImportTypeContext"
  85. libwasmedge.pp(68,1) Error: Forward type not resolved "TWasmEdge_LoaderContext"
  86. libwasmedge.pp(68,1) Error: Forward type not resolved "TWasmEdge_MemoryInstanceContext"
  87. libwasmedge.pp(68,1) Error: Forward type not resolved "TWasmEdge_MemoryTypeContext"
  88. libwasmedge.pp(68,1) Error: Forward type not resolved "TWasmEdge_ModuleInstanceContext"
  89. libwasmedge.pp(68,1) Error: Forward type not resolved "TWasmEdge_Mutability"
  90. libwasmedge.pp(68,1) Error: Forward type not resolved "TWasmEdge_NumType"
  91. libwasmedge.pp(68,1) Error: Forward type not resolved "TWasmEdge_PluginContext"
  92. libwasmedge.pp(68,1) Error: Forward type not resolved "TWasmEdge_Proposal"
  93. libwasmedge.pp(68,1) Error: Forward type not resolved "TWasmEdge_RefType"
  94. libwasmedge.pp(68,1) Error: Forward type not resolved "TWasmEdge_StatisticsContext"
  95. libwasmedge.pp(68,1) Error: Forward type not resolved "TWasmEdge_StoreContext"
  96. libwasmedge.pp(68,1) Error: Forward type not resolved "TWasmEdge_TableInstanceContext"
  97. libwasmedge.pp(68,1) Error: Forward type not resolved "TWasmEdge_TableTypeContext"
  98. libwasmedge.pp(68,1) Error: Forward type not resolved "TWasmEdge_ValidatorContext"
  99. libwasmedge.pp(68,1) Error: Forward type not resolved "TWasmEdge_ValType"
  100. libwasmedge.pp(68,1) Error: Forward type not resolved "TWasmEdge_VMContext
  101. *)
  102. TWasmEdge_ConfigureContext= record end;
  103. TWasmEdge_StatisticsContext= record end;
  104. TWasmEdge_ASTModuleContext= record end;
  105. TWasmEdge_FunctionTypeContext= record end;
  106. TWasmEdge_MemoryTypeContext= record end;
  107. TWasmEdge_TableTypeContext= record end;
  108. TWasmEdge_GlobalTypeContext= record end;
  109. TWasmEdge_ImportTypeContext= record end;
  110. TWasmEdge_ExportTypeContext= record end;
  111. TWasmEdge_CompilerContext= record end;
  112. TWasmEdge_LoaderContext= record end;
  113. TWasmEdge_ValidatorContext= record end;
  114. TWasmEdge_ExecutorContext= record end;
  115. TWasmEdge_StoreContext= record end;
  116. TWasmEdge_ModuleInstanceContext= record end;
  117. TWasmEdge_FunctionInstanceContext = record end;
  118. TWasmEdge_TableInstanceContext= record end;
  119. TWasmEdge_MemoryInstanceContext= record end;
  120. TWasmEdge_GlobalInstanceContext= record end;
  121. TWasmEdge_CallingFrameContext= record end;
  122. TWasmEdge_Async= record end;
  123. TWasmEdge_VMContext= record end;
  124. TWasmEdge_PluginContext= record end;
  125. PWasmEdge_ASTModuleContext = ^TWasmEdge_ASTModuleContext;
  126. PWasmEdge_Async = ^TWasmEdge_Async;
  127. PWasmEdge_CallingFrameContext = ^TWasmEdge_CallingFrameContext;
  128. PWasmEdge_CompilerContext = ^TWasmEdge_CompilerContext;
  129. PWasmEdge_CompilerOptimizationLevel = ^TWasmEdge_CompilerOptimizationLevel;
  130. PWasmEdge_CompilerOutputFormat = ^TWasmEdge_CompilerOutputFormat;
  131. PWasmEdge_ConfigureContext = ^TWasmEdge_ConfigureContext;
  132. PWasmEdge_ErrCategory = ^TWasmEdge_ErrCategory;
  133. PWasmEdge_ErrCode = ^TWasmEdge_ErrCode;
  134. PWasmEdge_ExecutorContext = ^TWasmEdge_ExecutorContext;
  135. PWasmEdge_ExportTypeContext = ^TWasmEdge_ExportTypeContext;
  136. PWasmEdge_ExternalType = ^TWasmEdge_ExternalType;
  137. PWasmEdge_FunctionInstanceContext = ^TWasmEdge_FunctionInstanceContext;
  138. PWasmEdge_FunctionTypeContext = ^TWasmEdge_FunctionTypeContext;
  139. PWasmEdge_GlobalInstanceContext = ^TWasmEdge_GlobalInstanceContext;
  140. PWasmEdge_GlobalTypeContext = ^TWasmEdge_GlobalTypeContext;
  141. PWasmEdge_HostRegistration = ^TWasmEdge_HostRegistration;
  142. PWasmEdge_ImportTypeContext = ^TWasmEdge_ImportTypeContext;
  143. PWasmEdge_LoaderContext = ^TWasmEdge_LoaderContext;
  144. PWasmEdge_MemoryInstanceContext = ^TWasmEdge_MemoryInstanceContext;
  145. PWasmEdge_MemoryTypeContext = ^TWasmEdge_MemoryTypeContext;
  146. PWasmEdge_ModuleInstanceContext = ^TWasmEdge_ModuleInstanceContext;
  147. PWasmEdge_Mutability = ^TWasmEdge_Mutability;
  148. PWasmEdge_NumType = ^TWasmEdge_NumType;
  149. PWasmEdge_PluginContext = ^TWasmEdge_PluginContext;
  150. PWasmEdge_Proposal = ^TWasmEdge_Proposal;
  151. PWasmEdge_RefType = ^TWasmEdge_RefType;
  152. PWasmEdge_StatisticsContext = ^TWasmEdge_StatisticsContext;
  153. PWasmEdge_StoreContext = ^TWasmEdge_StoreContext;
  154. PWasmEdge_TableInstanceContext = ^TWasmEdge_TableInstanceContext;
  155. PWasmEdge_TableTypeContext = ^TWasmEdge_TableTypeContext;
  156. PWasmEdge_ValidatorContext = ^TWasmEdge_ValidatorContext;
  157. PWasmEdge_ValType = ^TWasmEdge_ValType;
  158. PWasmEdge_VMContext = ^TWasmEdge_VMContext;
  159. PPWasmEdge_ImportTypeContext = ^PWasmEdge_ImportTypeContext;
  160. PPWasmEdge_ExportTypeContext = ^PWasmEdge_ExportTypeContext;
  161. PPWasmEdge_ASTModuleContext = ^PWasmEdge_ASTModuleContext;
  162. PPWasmEdge_ModuleInstanceContext = ^PWasmEdge_ModuleInstanceContext ;
  163. PPWasmEdge_FunctionTypeContext = ^PWasmEdge_FunctionTypeContext;
  164. TWasmEdge_Proposal = (WasmEdge_Proposal_ImportExportMutGlobals,
  165. WasmEdge_Proposal_NonTrapFloatToIntConversions,
  166. WasmEdge_Proposal_SignExtensionOperators,
  167. WasmEdge_Proposal_MultiValue,WasmEdge_Proposal_BulkMemoryOperations,
  168. WasmEdge_Proposal_ReferenceTypes,WasmEdge_Proposal_SIMD,
  169. WasmEdge_Proposal_TailCall,WasmEdge_Proposal_MultiMemories,
  170. WasmEdge_Proposal_Annotations,WasmEdge_Proposal_Memory64,
  171. WasmEdge_Proposal_ExceptionHandling,WasmEdge_Proposal_ExtendedConst,
  172. WasmEdge_Proposal_Threads,WasmEdge_Proposal_FunctionReferences
  173. );
  174. TWasmEdge_HostRegistration = (WasmEdge_HostRegistration_Wasi);
  175. TWasmEdge_CompilerOptimizationLevel = (
  176. WasmEdge_CompilerOptimizationLevel_O0 := 0,
  177. WasmEdge_CompilerOptimizationLevel_O1,
  178. WasmEdge_CompilerOptimizationLevel_O2,
  179. WasmEdge_CompilerOptimizationLevel_O3,
  180. WasmEdge_CompilerOptimizationLevel_Os,
  181. WasmEdge_CompilerOptimizationLevel_Oz
  182. );
  183. TWasmEdge_CompilerOutputFormat = (WasmEdge_CompilerOutputFormat_Native := 0,
  184. WasmEdge_CompilerOutputFormat_Wasm);
  185. TWasmEdge_ErrCategory = (WasmEdge_ErrCategory_WASM := $00,WasmEdge_ErrCategory_UserLevelError := $01
  186. );
  187. TWasmEdge_ErrCode = (WasmEdge_ErrCode_Success := $00,WasmEdge_ErrCode_Terminated := $01,
  188. WasmEdge_ErrCode_RuntimeError := $02,WasmEdge_ErrCode_CostLimitExceeded := $03,
  189. WasmEdge_ErrCode_WrongVMWorkflow := $04,
  190. WasmEdge_ErrCode_FuncNotFound := $05,WasmEdge_ErrCode_AOTDisabled := $06,
  191. WasmEdge_ErrCode_Interrupted := $07,WasmEdge_ErrCode_NotValidated := $08,
  192. WasmEdge_ErrCode_UserDefError := $09,WasmEdge_ErrCode_IllegalPath := $20,
  193. WasmEdge_ErrCode_ReadError := $21,WasmEdge_ErrCode_UnexpectedEnd := $22,
  194. WasmEdge_ErrCode_MalformedMagic := $23,
  195. WasmEdge_ErrCode_MalformedVersion := $24,
  196. WasmEdge_ErrCode_MalformedSection := $25,
  197. WasmEdge_ErrCode_SectionSizeMismatch := $26,
  198. WasmEdge_ErrCode_LengthOutOfBounds := $27,
  199. WasmEdge_ErrCode_JunkSection := $28,WasmEdge_ErrCode_IncompatibleFuncCode := $29,
  200. WasmEdge_ErrCode_IncompatibleDataCount := $2A,
  201. WasmEdge_ErrCode_DataCountRequired := $2B,
  202. WasmEdge_ErrCode_MalformedImportKind := $2C,
  203. WasmEdge_ErrCode_MalformedExportKind := $2D,
  204. WasmEdge_ErrCode_ExpectedZeroByte := $2E,
  205. WasmEdge_ErrCode_InvalidMut := $2F,WasmEdge_ErrCode_TooManyLocals := $30,
  206. WasmEdge_ErrCode_MalformedValType := $31,
  207. WasmEdge_ErrCode_MalformedElemType := $32,
  208. WasmEdge_ErrCode_MalformedRefType := $33,
  209. WasmEdge_ErrCode_MalformedUTF8 := $34,WasmEdge_ErrCode_IntegerTooLarge := $35,
  210. WasmEdge_ErrCode_IntegerTooLong := $36,
  211. WasmEdge_ErrCode_IllegalOpCode := $37,WasmEdge_ErrCode_ENDCodeExpected := $38,
  212. WasmEdge_ErrCode_IllegalGrammar := $39,
  213. WasmEdge_ErrCode_SharedMemoryNoMax := $3A,
  214. WasmEdge_ErrCode_IntrinsicsTableNotFound := $3B,
  215. WasmEdge_ErrCode_InvalidAlignment := $40,
  216. WasmEdge_ErrCode_TypeCheckFailed := $41,
  217. WasmEdge_ErrCode_InvalidLabelIdx := $42,
  218. WasmEdge_ErrCode_InvalidLocalIdx := $43,
  219. WasmEdge_ErrCode_InvalidFuncTypeIdx := $44,
  220. WasmEdge_ErrCode_InvalidFuncIdx := $45,
  221. WasmEdge_ErrCode_InvalidTableIdx := $46,
  222. WasmEdge_ErrCode_InvalidMemoryIdx := $47,
  223. WasmEdge_ErrCode_InvalidGlobalIdx := $48,
  224. WasmEdge_ErrCode_InvalidElemIdx := $49,
  225. WasmEdge_ErrCode_InvalidDataIdx := $4A,
  226. WasmEdge_ErrCode_InvalidRefIdx := $4B,WasmEdge_ErrCode_ConstExprRequired := $4C,
  227. WasmEdge_ErrCode_DupExportName := $4D,WasmEdge_ErrCode_ImmutableGlobal := $4E,
  228. WasmEdge_ErrCode_InvalidResultArity := $4F,
  229. WasmEdge_ErrCode_MultiTables := $50,WasmEdge_ErrCode_MultiMemories := $51,
  230. WasmEdge_ErrCode_InvalidLimit := $52,WasmEdge_ErrCode_InvalidMemPages := $53,
  231. WasmEdge_ErrCode_InvalidStartFunc := $54,
  232. WasmEdge_ErrCode_InvalidLaneIdx := $55,
  233. WasmEdge_ErrCode_ModuleNameConflict := $60,
  234. WasmEdge_ErrCode_IncompatibleImportType := $61,
  235. WasmEdge_ErrCode_UnknownImport := $62,WasmEdge_ErrCode_DataSegDoesNotFit := $63,
  236. WasmEdge_ErrCode_ElemSegDoesNotFit := $64,
  237. WasmEdge_ErrCode_WrongInstanceAddress := $80,
  238. WasmEdge_ErrCode_WrongInstanceIndex := $81,
  239. WasmEdge_ErrCode_InstrTypeMismatch := $82,
  240. WasmEdge_ErrCode_FuncSigMismatch := $83,
  241. WasmEdge_ErrCode_DivideByZero := $84,WasmEdge_ErrCode_IntegerOverflow := $85,
  242. WasmEdge_ErrCode_InvalidConvToInt := $86,
  243. WasmEdge_ErrCode_TableOutOfBounds := $87,
  244. WasmEdge_ErrCode_MemoryOutOfBounds := $88,
  245. WasmEdge_ErrCode_Unreachable := $89,WasmEdge_ErrCode_UninitializedElement := $8A,
  246. WasmEdge_ErrCode_UndefinedElement := $8B,
  247. WasmEdge_ErrCode_IndirectCallTypeMismatch := $8C,
  248. WasmEdge_ErrCode_HostFuncError := $8D,WasmEdge_ErrCode_RefTypeMismatch := $8E,
  249. WasmEdge_ErrCode_UnalignedAtomicAccess := $8F,
  250. WasmEdge_ErrCode_ExpectSharedMemory := $90
  251. );
  252. TWasmEdge_ValType = (WasmEdge_ValType_I32 := $7F,WasmEdge_ValType_I64 := $7E,
  253. WasmEdge_ValType_F32 := $7D,WasmEdge_ValType_F64 := $7C,
  254. WasmEdge_ValType_V128 := $7B,WasmEdge_ValType_FuncRef := $70,
  255. WasmEdge_ValType_ExternRef := $6F);
  256. TWasmEdge_NumType = (WasmEdge_NumType_I32 := $7F,WasmEdge_NumType_I64 := $7E,
  257. WasmEdge_NumType_F32 := $7D,WasmEdge_NumType_F64 := $7C,
  258. WasmEdge_NumType_V128 := $7B);
  259. TWasmEdge_RefType = (WasmEdge_RefType_FuncRef := $70,WasmEdge_RefType_ExternRef := $6F
  260. );
  261. TWasmEdge_Mutability = (WasmEdge_Mutability_Const := $00,WasmEdge_Mutability_Var := $01
  262. );
  263. TWasmEdge_ExternalType = (WasmEdge_ExternalType_Function := $00,WasmEdge_ExternalType_Table := $01,
  264. WasmEdge_ExternalType_Memory := $02,WasmEdge_ExternalType_Global := $03
  265. );
  266. PWasmEdge_Value = ^TWasmEdge_Value;
  267. TWasmEdge_Value = record
  268. Value : Tuint128_t;
  269. _Type : TWasmEdge_ValType;
  270. end;
  271. PWasmEdge_String = ^TWasmEdge_String;
  272. TWasmEdge_String = record
  273. Length : Tuint32_t;
  274. Buf : pcchar;
  275. end;
  276. PWasmEdge_Result = ^TWasmEdge_Result;
  277. TWasmEdge_Result = record
  278. Code : Tuint32_t;
  279. end;
  280. PWasmEdge_Limit = ^TWasmEdge_Limit;
  281. TWasmEdge_Limit = record
  282. HasMax : TBool;
  283. Shared : TBool;
  284. Min : Tuint32_t;
  285. Max : Tuint32_t;
  286. end;
  287. PWasmEdge_ProgramOptionType = ^TWasmEdge_ProgramOptionType;
  288. TWasmEdge_ProgramOptionType = (WasmEdge_ProgramOptionType_None,WasmEdge_ProgramOptionType_Toggle,
  289. WasmEdge_ProgramOptionType_Int8,WasmEdge_ProgramOptionType_Int16,
  290. WasmEdge_ProgramOptionType_Int32,WasmEdge_ProgramOptionType_Int64,
  291. WasmEdge_ProgramOptionType_UInt8,WasmEdge_ProgramOptionType_UInt16,
  292. WasmEdge_ProgramOptionType_UInt32,WasmEdge_ProgramOptionType_UInt64,
  293. WasmEdge_ProgramOptionType_Float,WasmEdge_ProgramOptionType_Double,
  294. WasmEdge_ProgramOptionType_String);
  295. PWasmEdge_ProgramOption = ^TWasmEdge_ProgramOption;
  296. TWasmEdge_ProgramOption = record
  297. Name : pcchar;
  298. Description : pcchar;
  299. _Type : TWasmEdge_ProgramOptionType;
  300. Storage : pointer;
  301. DefaultValue : pointer;
  302. end;
  303. PWasmEdge_ModuleDescriptor = ^TWasmEdge_ModuleDescriptor;
  304. TWasmEdge_ModuleDescriptor = record
  305. Name : pcchar;
  306. Description : pcchar;
  307. Create : function (para1:PWasmEdge_ModuleDescriptor):PWasmEdge_ModuleInstanceContext;cdecl;
  308. end;
  309. PWasmEdge_PluginVersionData = ^TWasmEdge_PluginVersionData;
  310. TWasmEdge_PluginVersionData = record
  311. Major : Tuint32_t;
  312. Minor : Tuint32_t;
  313. Patch : Tuint32_t;
  314. Build : Tuint32_t;
  315. end;
  316. PWasmEdge_PluginDescriptor = ^TWasmEdge_PluginDescriptor;
  317. TWasmEdge_PluginDescriptor = record
  318. Name : pcchar;
  319. Description : pcchar;
  320. APIVersion : Tuint32_t;
  321. Version : TWasmEdge_PluginVersionData;
  322. ModuleCount : Tuint32_t;
  323. ProgramOptionCount : Tuint32_t;
  324. ModuleDescriptions : PWasmEdge_ModuleDescriptor;
  325. ProgramOptions : PWasmEdge_ProgramOption;
  326. end;
  327. var
  328. WasmEdge_VersionGet : function:pcchar;cdecl;
  329. WasmEdge_VersionGetMajor : function:Tuint32_t;cdecl;
  330. WasmEdge_VersionGetMinor : function:Tuint32_t;cdecl;
  331. WasmEdge_VersionGetPatch : function:Tuint32_t;cdecl;
  332. WasmEdge_LogSetErrorLevel : procedure;cdecl;
  333. WasmEdge_LogSetDebugLevel : procedure;cdecl;
  334. WasmEdge_LogOff : procedure;cdecl;
  335. WasmEdge_ValueGenI32 : function(Val:Tint32_t):TWasmEdge_Value;cdecl;
  336. WasmEdge_ValueGenI64 : function(Val:Tint64_t):TWasmEdge_Value;cdecl;
  337. WasmEdge_ValueGenF32 : function(Val:Tcfloat):TWasmEdge_Value;cdecl;
  338. WasmEdge_ValueGenF64 : function(Val:Tdouble):TWasmEdge_Value;cdecl;
  339. WasmEdge_ValueGenV128 : function(Val:Tint128_t):TWasmEdge_Value;cdecl;
  340. WasmEdge_ValueGenNullRef : function(T:TWasmEdge_RefType):TWasmEdge_Value;cdecl;
  341. WasmEdge_ValueGenFuncRef : function(Cxt:PWasmEdge_FunctionInstanceContext):TWasmEdge_Value;cdecl;
  342. WasmEdge_ValueGenExternRef : function(Ref:pointer):TWasmEdge_Value;cdecl;
  343. WasmEdge_ValueGetI32 : function(Val:TWasmEdge_Value):Tint32_t;cdecl;
  344. WasmEdge_ValueGetI64 : function(Val:TWasmEdge_Value):Tint64_t;cdecl;
  345. WasmEdge_ValueGetF32 : function(Val:TWasmEdge_Value):Tcfloat;cdecl;
  346. WasmEdge_ValueGetF64 : function(Val:TWasmEdge_Value):Tdouble;cdecl;
  347. WasmEdge_ValueGetV128 : function(Val:TWasmEdge_Value):Tint128_t;cdecl;
  348. WasmEdge_ValueIsNullRef : function(Val:TWasmEdge_Value):TBool;cdecl;
  349. WasmEdge_ValueGetFuncRef : function(Val:TWasmEdge_Value):PWasmEdge_FunctionInstanceContext;cdecl;
  350. WasmEdge_ValueGetExternRef : function(Val:TWasmEdge_Value):pointer;cdecl;
  351. WasmEdge_StringCreateByCString : function(Str:pcchar):TWasmEdge_String;cdecl;
  352. WasmEdge_StringCreateByBuffer : function(Buf:pcchar; Len:Tuint32_t):TWasmEdge_String;cdecl;
  353. WasmEdge_StringWrap : function(Buf:pcchar; Len:Tuint32_t):TWasmEdge_String;cdecl;
  354. WasmEdge_StringIsEqual : function(Str1:TWasmEdge_String; Str2:TWasmEdge_String):TBool;cdecl;
  355. WasmEdge_StringCopy : function(Str:TWasmEdge_String; Buf:pcchar; Len:Tuint32_t):Tuint32_t;cdecl;
  356. WasmEdge_StringDelete : procedure(Str:TWasmEdge_String);cdecl;
  357. WasmEdge_ResultOK : function(Res:TWasmEdge_Result):TBool;cdecl;
  358. WasmEdge_ResultGen : function(Category:TWasmEdge_ErrCategory; Code:Tuint32_t):TWasmEdge_Result;cdecl;
  359. WasmEdge_ResultGetCode : function(Res:TWasmEdge_Result):Tuint32_t;cdecl;
  360. WasmEdge_ResultGetCategory : function(Res:TWasmEdge_Result):TWasmEdge_ErrCategory;cdecl;
  361. WasmEdge_ResultGetMessage : function(Res:TWasmEdge_Result):pcchar;cdecl;
  362. WasmEdge_LimitIsEqual : function(Lim1:TWasmEdge_Limit; Lim2:TWasmEdge_Limit):TBool;cdecl;
  363. WasmEdge_ConfigureCreate : function:PWasmEdge_ConfigureContext;cdecl;
  364. WasmEdge_ConfigureAddProposal : procedure(Cxt:PWasmEdge_ConfigureContext; Prop:TWasmEdge_Proposal);cdecl;
  365. WasmEdge_ConfigureRemoveProposal : procedure(Cxt:PWasmEdge_ConfigureContext; Prop:TWasmEdge_Proposal);cdecl;
  366. WasmEdge_ConfigureHasProposal : function(Cxt:PWasmEdge_ConfigureContext; Prop:TWasmEdge_Proposal):TBool;cdecl;
  367. WasmEdge_ConfigureAddHostRegistration : procedure(Cxt:PWasmEdge_ConfigureContext; Host:TWasmEdge_HostRegistration);cdecl;
  368. WasmEdge_ConfigureRemoveHostRegistration : procedure(Cxt:PWasmEdge_ConfigureContext; Host:TWasmEdge_HostRegistration);cdecl;
  369. WasmEdge_ConfigureHasHostRegistration : function(Cxt:PWasmEdge_ConfigureContext; Host:TWasmEdge_HostRegistration):TBool;cdecl;
  370. WasmEdge_ConfigureSetMaxMemoryPage : procedure(Cxt:PWasmEdge_ConfigureContext; Page:Tuint32_t);cdecl;
  371. WasmEdge_ConfigureGetMaxMemoryPage : function(Cxt:PWasmEdge_ConfigureContext):Tuint32_t;cdecl;
  372. WasmEdge_ConfigureSetForceInterpreter : procedure(Cxt:PWasmEdge_ConfigureContext; IsForceInterpreter:TBool);cdecl;
  373. WasmEdge_ConfigureIsForceInterpreter : function(Cxt:PWasmEdge_ConfigureContext):TBool;cdecl;
  374. WasmEdge_ConfigureSetAllowAFUNIX : procedure(Cxt:PWasmEdge_ConfigureContext; EnableAFUNIX:TBool);cdecl;
  375. WasmEdge_ConfigureIsAllowAFUNIX : function(Cxt:PWasmEdge_ConfigureContext):TBool;cdecl;
  376. WasmEdge_ConfigureCompilerSetOptimizationLevel : procedure(Cxt:PWasmEdge_ConfigureContext; Level:TWasmEdge_CompilerOptimizationLevel);cdecl;
  377. WasmEdge_ConfigureCompilerGetOptimizationLevel : function(Cxt:PWasmEdge_ConfigureContext):TWasmEdge_CompilerOptimizationLevel;cdecl;
  378. WasmEdge_ConfigureCompilerSetOutputFormat : procedure(Cxt:PWasmEdge_ConfigureContext; Format:TWasmEdge_CompilerOutputFormat);cdecl;
  379. WasmEdge_ConfigureCompilerGetOutputFormat : function(Cxt:PWasmEdge_ConfigureContext):TWasmEdge_CompilerOutputFormat;cdecl;
  380. WasmEdge_ConfigureCompilerSetDumpIR : procedure(Cxt:PWasmEdge_ConfigureContext; IsDump:TBool);cdecl;
  381. WasmEdge_ConfigureCompilerIsDumpIR : function(Cxt:PWasmEdge_ConfigureContext):TBool;cdecl;
  382. WasmEdge_ConfigureCompilerSetGenericBinary : procedure(Cxt:PWasmEdge_ConfigureContext; IsGeneric:TBool);cdecl;
  383. WasmEdge_ConfigureCompilerIsGenericBinary : function(Cxt:PWasmEdge_ConfigureContext):TBool;cdecl;
  384. WasmEdge_ConfigureCompilerSetInterruptible : procedure(Cxt:PWasmEdge_ConfigureContext; IsInterruptible:TBool);cdecl;
  385. WasmEdge_ConfigureCompilerIsInterruptible : function(Cxt:PWasmEdge_ConfigureContext):TBool;cdecl;
  386. WasmEdge_ConfigureStatisticsSetInstructionCounting : procedure(Cxt:PWasmEdge_ConfigureContext; IsCount:TBool);cdecl;
  387. WasmEdge_ConfigureStatisticsIsInstructionCounting : function(Cxt:PWasmEdge_ConfigureContext):TBool;cdecl;
  388. WasmEdge_ConfigureStatisticsSetCostMeasuring : procedure(Cxt:PWasmEdge_ConfigureContext; IsMeasure:TBool);cdecl;
  389. WasmEdge_ConfigureStatisticsIsCostMeasuring : function(Cxt:PWasmEdge_ConfigureContext):TBool;cdecl;
  390. WasmEdge_ConfigureStatisticsSetTimeMeasuring : procedure(Cxt:PWasmEdge_ConfigureContext; IsMeasure:TBool);cdecl;
  391. WasmEdge_ConfigureStatisticsIsTimeMeasuring : function(Cxt:PWasmEdge_ConfigureContext):TBool;cdecl;
  392. WasmEdge_ConfigureDelete : procedure(Cxt:PWasmEdge_ConfigureContext);cdecl;
  393. WasmEdge_StatisticsCreate : function:PWasmEdge_StatisticsContext;cdecl;
  394. WasmEdge_StatisticsGetInstrCount : function(Cxt:PWasmEdge_StatisticsContext):Tuint64_t;cdecl;
  395. WasmEdge_StatisticsGetInstrPerSecond : function(Cxt:PWasmEdge_StatisticsContext):Tdouble;cdecl;
  396. WasmEdge_StatisticsGetTotalCost : function(Cxt:PWasmEdge_StatisticsContext):Tuint64_t;cdecl;
  397. WasmEdge_StatisticsSetCostTable : procedure(Cxt:PWasmEdge_StatisticsContext; CostArr:Puint64_t; Len:Tuint32_t);cdecl;
  398. WasmEdge_StatisticsSetCostLimit : procedure(Cxt:PWasmEdge_StatisticsContext; Limit:Tuint64_t);cdecl;
  399. WasmEdge_StatisticsClear : procedure(Cxt:PWasmEdge_StatisticsContext);cdecl;
  400. WasmEdge_StatisticsDelete : procedure(Cxt:PWasmEdge_StatisticsContext);cdecl;
  401. WasmEdge_ASTModuleListImportsLength : function(Cxt:PWasmEdge_ASTModuleContext):Tuint32_t;cdecl;
  402. WasmEdge_ASTModuleListImports : function(Cxt:PWasmEdge_ASTModuleContext; Imports:PPWasmEdge_ImportTypeContext; Len:Tuint32_t):Tuint32_t;cdecl;
  403. WasmEdge_ASTModuleListExportsLength : function(Cxt:PWasmEdge_ASTModuleContext):Tuint32_t;cdecl;
  404. WasmEdge_ASTModuleListExports : function(Cxt:PWasmEdge_ASTModuleContext; Exports_:PPWasmEdge_ExportTypeContext; Len:Tuint32_t):Tuint32_t;cdecl;
  405. WasmEdge_ASTModuleDelete : procedure(Cxt:PWasmEdge_ASTModuleContext);cdecl;
  406. WasmEdge_FunctionTypeCreate : function(ParamList:PWasmEdge_ValType; ParamLen:Tuint32_t; ReturnList:PWasmEdge_ValType; ReturnLen:Tuint32_t):PWasmEdge_FunctionTypeContext;cdecl;
  407. WasmEdge_FunctionTypeGetParametersLength : function(Cxt:PWasmEdge_FunctionTypeContext):Tuint32_t;cdecl;
  408. WasmEdge_FunctionTypeGetParameters : function(Cxt:PWasmEdge_FunctionTypeContext; List:PWasmEdge_ValType; Len:Tuint32_t):Tuint32_t;cdecl;
  409. WasmEdge_FunctionTypeGetReturnsLength : function(Cxt:PWasmEdge_FunctionTypeContext):Tuint32_t;cdecl;
  410. WasmEdge_FunctionTypeGetReturns : function(Cxt:PWasmEdge_FunctionTypeContext; List:PWasmEdge_ValType; Len:Tuint32_t):Tuint32_t;cdecl;
  411. WasmEdge_FunctionTypeDelete : procedure(Cxt:PWasmEdge_FunctionTypeContext);cdecl;
  412. WasmEdge_TableTypeCreate : function(RefType:TWasmEdge_RefType; Limit:TWasmEdge_Limit):PWasmEdge_TableTypeContext;cdecl;
  413. WasmEdge_TableTypeGetRefType : function(Cxt:PWasmEdge_TableTypeContext):TWasmEdge_RefType;cdecl;
  414. WasmEdge_TableTypeGetLimit : function(Cxt:PWasmEdge_TableTypeContext):TWasmEdge_Limit;cdecl;
  415. WasmEdge_TableTypeDelete : procedure(Cxt:PWasmEdge_TableTypeContext);cdecl;
  416. WasmEdge_MemoryTypeCreate : function(Limit:TWasmEdge_Limit):PWasmEdge_MemoryTypeContext;cdecl;
  417. WasmEdge_MemoryTypeGetLimit : function(Cxt:PWasmEdge_MemoryTypeContext):TWasmEdge_Limit;cdecl;
  418. WasmEdge_MemoryTypeDelete : procedure(Cxt:PWasmEdge_MemoryTypeContext);cdecl;
  419. WasmEdge_GlobalTypeCreate : function(ValType:TWasmEdge_ValType; Mut:TWasmEdge_Mutability):PWasmEdge_GlobalTypeContext;cdecl;
  420. WasmEdge_GlobalTypeGetValType : function(Cxt:PWasmEdge_GlobalTypeContext):TWasmEdge_ValType;cdecl;
  421. WasmEdge_GlobalTypeGetMutability : function(Cxt:PWasmEdge_GlobalTypeContext):TWasmEdge_Mutability;cdecl;
  422. WasmEdge_GlobalTypeDelete : procedure(Cxt:PWasmEdge_GlobalTypeContext);cdecl;
  423. WasmEdge_ImportTypeGetExternalType : function(Cxt:PWasmEdge_ImportTypeContext):TWasmEdge_ExternalType;cdecl;
  424. WasmEdge_ImportTypeGetModuleName : function(Cxt:PWasmEdge_ImportTypeContext):TWasmEdge_String;cdecl;
  425. WasmEdge_ImportTypeGetExternalName : function(Cxt:PWasmEdge_ImportTypeContext):TWasmEdge_String;cdecl;
  426. WasmEdge_ImportTypeGetFunctionType : function(ASTCxt:PWasmEdge_ASTModuleContext; Cxt:PWasmEdge_ImportTypeContext):PWasmEdge_FunctionTypeContext;cdecl;
  427. WasmEdge_ImportTypeGetTableType : function(ASTCxt:PWasmEdge_ASTModuleContext; Cxt:PWasmEdge_ImportTypeContext):PWasmEdge_TableTypeContext;cdecl;
  428. WasmEdge_ImportTypeGetMemoryType : function(ASTCxt:PWasmEdge_ASTModuleContext; Cxt:PWasmEdge_ImportTypeContext):PWasmEdge_MemoryTypeContext;cdecl;
  429. WasmEdge_ImportTypeGetGlobalType : function(ASTCxt:PWasmEdge_ASTModuleContext; Cxt:PWasmEdge_ImportTypeContext):PWasmEdge_GlobalTypeContext;cdecl;
  430. WasmEdge_ExportTypeGetExternalType : function(Cxt:PWasmEdge_ExportTypeContext):TWasmEdge_ExternalType;cdecl;
  431. WasmEdge_ExportTypeGetExternalName : function(Cxt:PWasmEdge_ExportTypeContext):TWasmEdge_String;cdecl;
  432. WasmEdge_ExportTypeGetFunctionType : function(ASTCxt:PWasmEdge_ASTModuleContext; Cxt:PWasmEdge_ExportTypeContext):PWasmEdge_FunctionTypeContext;cdecl;
  433. WasmEdge_ExportTypeGetTableType : function(ASTCxt:PWasmEdge_ASTModuleContext; Cxt:PWasmEdge_ExportTypeContext):PWasmEdge_TableTypeContext;cdecl;
  434. WasmEdge_ExportTypeGetMemoryType : function(ASTCxt:PWasmEdge_ASTModuleContext; Cxt:PWasmEdge_ExportTypeContext):PWasmEdge_MemoryTypeContext;cdecl;
  435. WasmEdge_ExportTypeGetGlobalType : function(ASTCxt:PWasmEdge_ASTModuleContext; Cxt:PWasmEdge_ExportTypeContext):PWasmEdge_GlobalTypeContext;cdecl;
  436. WasmEdge_CompilerCreate : function(ConfCxt:PWasmEdge_ConfigureContext):PWasmEdge_CompilerContext;cdecl;
  437. WasmEdge_CompilerCompile : function(Cxt:PWasmEdge_CompilerContext; InPath:pcchar; OutPath:pcchar):TWasmEdge_Result;cdecl;
  438. WasmEdge_CompilerCompileFromBuffer : function(Cxt:PWasmEdge_CompilerContext; InBuffer:Puint8_t; InBufferLen:Tuint64_t; OutPath:pcchar):TWasmEdge_Result;cdecl;
  439. WasmEdge_CompilerDelete : procedure(Cxt:PWasmEdge_CompilerContext);cdecl;
  440. WasmEdge_LoaderCreate : function(ConfCxt:PWasmEdge_ConfigureContext):PWasmEdge_LoaderContext;cdecl;
  441. WasmEdge_LoaderParseFromFile : function(Cxt:PWasmEdge_LoaderContext; Module:PPWasmEdge_ASTModuleContext; Path:pcchar):TWasmEdge_Result;cdecl;
  442. WasmEdge_LoaderParseFromBuffer : function(Cxt:PWasmEdge_LoaderContext; Module:PPWasmEdge_ASTModuleContext; Buf:Puint8_t; BufLen:Tuint32_t):TWasmEdge_Result;cdecl;
  443. WasmEdge_LoaderDelete : procedure(Cxt:PWasmEdge_LoaderContext);cdecl;
  444. WasmEdge_ValidatorCreate : function(ConfCxt:PWasmEdge_ConfigureContext):PWasmEdge_ValidatorContext;cdecl;
  445. WasmEdge_ValidatorValidate : function(Cxt:PWasmEdge_ValidatorContext; ASTCxt:PWasmEdge_ASTModuleContext):TWasmEdge_Result;cdecl;
  446. WasmEdge_ValidatorDelete : procedure(Cxt:PWasmEdge_ValidatorContext);cdecl;
  447. WasmEdge_ExecutorCreate : function(ConfCxt:PWasmEdge_ConfigureContext; StatCxt:PWasmEdge_StatisticsContext):PWasmEdge_ExecutorContext;cdecl;
  448. WasmEdge_ExecutorInstantiate : function(Cxt:PWasmEdge_ExecutorContext; ModuleCxt:PPWasmEdge_ModuleInstanceContext; StoreCxt:PWasmEdge_StoreContext; ASTCxt:PWasmEdge_ASTModuleContext):TWasmEdge_Result;cdecl;
  449. WasmEdge_ExecutorRegister : function(Cxt:PWasmEdge_ExecutorContext; ModuleCxt:PPWasmEdge_ModuleInstanceContext; StoreCxt:PWasmEdge_StoreContext; ASTCxt:PWasmEdge_ASTModuleContext; ModuleName:TWasmEdge_String):TWasmEdge_Result;cdecl;
  450. WasmEdge_ExecutorRegisterImport : function(Cxt:PWasmEdge_ExecutorContext; StoreCxt:PWasmEdge_StoreContext; ImportCxt:PWasmEdge_ModuleInstanceContext):TWasmEdge_Result;cdecl;
  451. WasmEdge_ExecutorInvoke : function(Cxt:PWasmEdge_ExecutorContext; FuncCxt:PWasmEdge_FunctionInstanceContext; Params:PWasmEdge_Value; ParamLen:Tuint32_t; Returns:PWasmEdge_Value;
  452. ReturnLen:Tuint32_t):TWasmEdge_Result;cdecl;
  453. WasmEdge_ExecutorAsyncInvoke : function(Cxt:PWasmEdge_ExecutorContext; FuncCxt:PWasmEdge_FunctionInstanceContext; Params:PWasmEdge_Value; ParamLen:Tuint32_t):PWasmEdge_Async;cdecl;
  454. WasmEdge_ExecutorDelete : procedure(Cxt:PWasmEdge_ExecutorContext);cdecl;
  455. WasmEdge_StoreCreate : function:PWasmEdge_StoreContext;cdecl;
  456. WasmEdge_StoreFindModule : function(Cxt:PWasmEdge_StoreContext; Name:TWasmEdge_String):PWasmEdge_ModuleInstanceContext;cdecl;
  457. WasmEdge_StoreListModuleLength : function(Cxt:PWasmEdge_StoreContext):Tuint32_t;cdecl;
  458. WasmEdge_StoreListModule : function(Cxt:PWasmEdge_StoreContext; Names:PWasmEdge_String; Len:Tuint32_t):Tuint32_t;cdecl;
  459. WasmEdge_StoreDelete : procedure(Cxt:PWasmEdge_StoreContext);cdecl;
  460. WasmEdge_ModuleInstanceCreate : function(ModuleName:TWasmEdge_String):PWasmEdge_ModuleInstanceContext;cdecl;
  461. Type
  462. tfinalizer = procedure (para1:pointer); cdecl;
  463. var
  464. WasmEdge_ModuleInstanceCreateWithData : function(ModuleName:TWasmEdge_String; HostData:pointer; Finalizer: tfinalizer):PWasmEdge_ModuleInstanceContext;cdecl;
  465. WasmEdge_ModuleInstanceCreateWASI : function(Args:Ppcchar; ArgLen:Tuint32_t; Envs:Ppcchar; EnvLen:Tuint32_t; Preopens:Ppcchar;
  466. PreopenLen:Tuint32_t):PWasmEdge_ModuleInstanceContext;cdecl;
  467. WasmEdge_ModuleInstanceInitWASI : procedure(Cxt:PWasmEdge_ModuleInstanceContext; Args:Ppcchar; ArgLen:Tuint32_t; Envs:Ppcchar; EnvLen:Tuint32_t;
  468. Preopens:Ppcchar; PreopenLen:Tuint32_t);cdecl;
  469. WasmEdge_ModuleInstanceWASIGetExitCode : function(Cxt:PWasmEdge_ModuleInstanceContext):Tuint32_t;cdecl;
  470. WasmEdge_ModuleInstanceWASIGetNativeHandler : function(Cxt:PWasmEdge_ModuleInstanceContext; Fd:Tint32_t; NativeHandler:Puint64_t):Tuint32_t;cdecl;
  471. WasmEdge_ModuleInstanceInitWasmEdgeProcess : procedure(AllowedCmds:Ppcchar; CmdsLen:Tuint32_t; AllowAll:TBool);cdecl;
  472. WasmEdge_ModuleInstanceGetModuleName : function(Cxt:PWasmEdge_ModuleInstanceContext):TWasmEdge_String;cdecl;
  473. WasmEdge_ModuleInstanceGetHostData : function(Cxt:PWasmEdge_ModuleInstanceContext):pointer;cdecl;
  474. WasmEdge_ModuleInstanceFindFunction : function(Cxt:PWasmEdge_ModuleInstanceContext; Name:TWasmEdge_String):PWasmEdge_FunctionInstanceContext;cdecl;
  475. WasmEdge_ModuleInstanceFindTable : function(Cxt:PWasmEdge_ModuleInstanceContext; Name:TWasmEdge_String):PWasmEdge_TableInstanceContext;cdecl;
  476. WasmEdge_ModuleInstanceFindMemory : function(Cxt:PWasmEdge_ModuleInstanceContext; Name:TWasmEdge_String):PWasmEdge_MemoryInstanceContext;cdecl;
  477. WasmEdge_ModuleInstanceFindGlobal : function(Cxt:PWasmEdge_ModuleInstanceContext; Name:TWasmEdge_String):PWasmEdge_GlobalInstanceContext;cdecl;
  478. WasmEdge_ModuleInstanceListFunctionLength : function(Cxt:PWasmEdge_ModuleInstanceContext):Tuint32_t;cdecl;
  479. WasmEdge_ModuleInstanceListFunction : function(Cxt:PWasmEdge_ModuleInstanceContext; Names:PWasmEdge_String; Len:Tuint32_t):Tuint32_t;cdecl;
  480. WasmEdge_ModuleInstanceListTableLength : function(Cxt:PWasmEdge_ModuleInstanceContext):Tuint32_t;cdecl;
  481. WasmEdge_ModuleInstanceListTable : function(Cxt:PWasmEdge_ModuleInstanceContext; Names:PWasmEdge_String; Len:Tuint32_t):Tuint32_t;cdecl;
  482. WasmEdge_ModuleInstanceListMemoryLength : function(Cxt:PWasmEdge_ModuleInstanceContext):Tuint32_t;cdecl;
  483. WasmEdge_ModuleInstanceListMemory : function(Cxt:PWasmEdge_ModuleInstanceContext; Names:PWasmEdge_String; Len:Tuint32_t):Tuint32_t;cdecl;
  484. WasmEdge_ModuleInstanceListGlobalLength : function(Cxt:PWasmEdge_ModuleInstanceContext):Tuint32_t;cdecl;
  485. WasmEdge_ModuleInstanceListGlobal : function(Cxt:PWasmEdge_ModuleInstanceContext; Names:PWasmEdge_String; Len:Tuint32_t):Tuint32_t;cdecl;
  486. WasmEdge_ModuleInstanceAddFunction : procedure(Cxt:PWasmEdge_ModuleInstanceContext; Name:TWasmEdge_String; FuncCxt:PWasmEdge_FunctionInstanceContext);cdecl;
  487. WasmEdge_ModuleInstanceAddTable : procedure(Cxt:PWasmEdge_ModuleInstanceContext; Name:TWasmEdge_String; TableCxt:PWasmEdge_TableInstanceContext);cdecl;
  488. WasmEdge_ModuleInstanceAddMemory : procedure(Cxt:PWasmEdge_ModuleInstanceContext; Name:TWasmEdge_String; MemoryCxt:PWasmEdge_MemoryInstanceContext);cdecl;
  489. WasmEdge_ModuleInstanceAddGlobal : procedure(Cxt:PWasmEdge_ModuleInstanceContext; Name:TWasmEdge_String; GlobalCxt:PWasmEdge_GlobalInstanceContext);cdecl;
  490. WasmEdge_ModuleInstanceDelete : procedure(Cxt:PWasmEdge_ModuleInstanceContext);cdecl;
  491. type
  492. TWasmEdge_HostFunc_t = function (Data:pointer; CallFrameCxt:PWasmEdge_CallingFrameContext; Params:PWasmEdge_Value; Returns:PWasmEdge_Value):TWasmEdge_Result;cdecl;
  493. var
  494. WasmEdge_FunctionInstanceCreate : function(_Type:PWasmEdge_FunctionTypeContext; HostFunc:TWasmEdge_HostFunc_t; Data:pointer; Cost:Tuint64_t):PWasmEdge_FunctionInstanceContext;cdecl;
  495. type
  496. TWasmEdge_WrapFunc_t = function (This:pointer; Data:pointer; CallFrameCxt:PWasmEdge_CallingFrameContext; Params:PWasmEdge_Value; ParamLen:Tuint32_t;
  497. Returns:PWasmEdge_Value; ReturnLen:Tuint32_t):TWasmEdge_Result;cdecl;
  498. var
  499. WasmEdge_FunctionInstanceCreateBinding : function(_Type:PWasmEdge_FunctionTypeContext; WrapFunc:TWasmEdge_WrapFunc_t; Binding:pointer; Data:pointer; Cost:Tuint64_t):PWasmEdge_FunctionInstanceContext;cdecl;
  500. WasmEdge_FunctionInstanceGetFunctionType : function(Cxt:PWasmEdge_FunctionInstanceContext):PWasmEdge_FunctionTypeContext;cdecl;
  501. WasmEdge_FunctionInstanceDelete : procedure(Cxt:PWasmEdge_FunctionInstanceContext);cdecl;
  502. WasmEdge_TableInstanceCreate : function(TabType:PWasmEdge_TableTypeContext):PWasmEdge_TableInstanceContext;cdecl;
  503. WasmEdge_TableInstanceGetTableType : function(Cxt:PWasmEdge_TableInstanceContext):PWasmEdge_TableTypeContext;cdecl;
  504. WasmEdge_TableInstanceGetData : function(Cxt:PWasmEdge_TableInstanceContext; Data:PWasmEdge_Value; Offset:Tuint32_t):TWasmEdge_Result;cdecl;
  505. WasmEdge_TableInstanceSetData : function(Cxt:PWasmEdge_TableInstanceContext; Data:TWasmEdge_Value; Offset:Tuint32_t):TWasmEdge_Result;cdecl;
  506. WasmEdge_TableInstanceGetSize : function(Cxt:PWasmEdge_TableInstanceContext):Tuint32_t;cdecl;
  507. WasmEdge_TableInstanceGrow : function(Cxt:PWasmEdge_TableInstanceContext; Size:Tuint32_t):TWasmEdge_Result;cdecl;
  508. WasmEdge_TableInstanceDelete : procedure(Cxt:PWasmEdge_TableInstanceContext);cdecl;
  509. WasmEdge_MemoryInstanceCreate : function(MemType:PWasmEdge_MemoryTypeContext):PWasmEdge_MemoryInstanceContext;cdecl;
  510. WasmEdge_MemoryInstanceGetMemoryType : function(Cxt:PWasmEdge_MemoryInstanceContext):PWasmEdge_MemoryTypeContext;cdecl;
  511. WasmEdge_MemoryInstanceGetData : function(Cxt:PWasmEdge_MemoryInstanceContext; Data:Puint8_t; Offset:Tuint32_t; Length:Tuint32_t):TWasmEdge_Result;cdecl;
  512. WasmEdge_MemoryInstanceSetData : function(Cxt:PWasmEdge_MemoryInstanceContext; Data:Puint8_t; Offset:Tuint32_t; Length:Tuint32_t):TWasmEdge_Result;cdecl;
  513. WasmEdge_MemoryInstanceGetPointer : function(Cxt:PWasmEdge_MemoryInstanceContext; Offset:Tuint32_t; Length:Tuint32_t):Puint8_t;cdecl;
  514. WasmEdge_MemoryInstanceGetPointerConst : function(Cxt:PWasmEdge_MemoryInstanceContext; Offset:Tuint32_t; Length:Tuint32_t):Puint8_t;cdecl;
  515. WasmEdge_MemoryInstanceGetPageSize : function(Cxt:PWasmEdge_MemoryInstanceContext):Tuint32_t;cdecl;
  516. WasmEdge_MemoryInstanceGrowPage : function(Cxt:PWasmEdge_MemoryInstanceContext; Page:Tuint32_t):TWasmEdge_Result;cdecl;
  517. WasmEdge_MemoryInstanceDelete : procedure(Cxt:PWasmEdge_MemoryInstanceContext);cdecl;
  518. WasmEdge_GlobalInstanceCreate : function(GlobType:PWasmEdge_GlobalTypeContext; Value:TWasmEdge_Value):PWasmEdge_GlobalInstanceContext;cdecl;
  519. WasmEdge_GlobalInstanceGetGlobalType : function(Cxt:PWasmEdge_GlobalInstanceContext):PWasmEdge_GlobalTypeContext;cdecl;
  520. WasmEdge_GlobalInstanceGetValue : function(Cxt:PWasmEdge_GlobalInstanceContext):TWasmEdge_Value;cdecl;
  521. WasmEdge_GlobalInstanceSetValue : procedure(Cxt:PWasmEdge_GlobalInstanceContext; Value:TWasmEdge_Value);cdecl;
  522. WasmEdge_GlobalInstanceDelete : procedure(Cxt:PWasmEdge_GlobalInstanceContext);cdecl;
  523. WasmEdge_CallingFrameGetExecutor : function(Cxt:PWasmEdge_CallingFrameContext):PWasmEdge_ExecutorContext;cdecl;
  524. WasmEdge_CallingFrameGetModuleInstance : function(Cxt:PWasmEdge_CallingFrameContext):PWasmEdge_ModuleInstanceContext;cdecl;
  525. WasmEdge_CallingFrameGetMemoryInstance : function(Cxt:PWasmEdge_CallingFrameContext; Idx:Tuint32_t):PWasmEdge_MemoryInstanceContext;cdecl;
  526. WasmEdge_AsyncWait : procedure(Cxt:PWasmEdge_Async);
  527. WasmEdge_AsyncWaitFor : function(Cxt:PWasmEdge_Async; Milliseconds:Tuint64_t):TBool;
  528. WasmEdge_AsyncCancel : procedure(Cxt:PWasmEdge_Async);
  529. WasmEdge_AsyncGetReturnsLength : function(Cxt:PWasmEdge_Async):Tuint32_t;
  530. WasmEdge_AsyncGet : function(Cxt:PWasmEdge_Async; Returns:PWasmEdge_Value; ReturnLen:Tuint32_t):TWasmEdge_Result;
  531. WasmEdge_AsyncDelete : procedure(Cxt:PWasmEdge_Async);
  532. WasmEdge_VMCreate : function(ConfCxt:PWasmEdge_ConfigureContext; StoreCxt:PWasmEdge_StoreContext):PWasmEdge_VMContext;cdecl;
  533. WasmEdge_VMRegisterModuleFromFile : function(Cxt:PWasmEdge_VMContext; ModuleName:TWasmEdge_String; Path:pcchar):TWasmEdge_Result;cdecl;
  534. WasmEdge_VMRegisterModuleFromBuffer : function(Cxt:PWasmEdge_VMContext; ModuleName:TWasmEdge_String; Buf:Puint8_t; BufLen:Tuint32_t):TWasmEdge_Result;cdecl;
  535. WasmEdge_VMRegisterModuleFromASTModule : function(Cxt:PWasmEdge_VMContext; ModuleName:TWasmEdge_String; ASTCxt:PWasmEdge_ASTModuleContext):TWasmEdge_Result;cdecl;
  536. WasmEdge_VMRegisterModuleFromImport : function(Cxt:PWasmEdge_VMContext; ImportCxt:PWasmEdge_ModuleInstanceContext):TWasmEdge_Result;cdecl;
  537. WasmEdge_VMRunWasmFromFile : function(Cxt:PWasmEdge_VMContext; Path:pcchar; FuncName:TWasmEdge_String; Params:PWasmEdge_Value; ParamLen:Tuint32_t;
  538. Returns:PWasmEdge_Value; ReturnLen:Tuint32_t):TWasmEdge_Result;cdecl;
  539. WasmEdge_VMRunWasmFromBuffer : function(Cxt:PWasmEdge_VMContext; Buf:Puint8_t; BufLen:Tuint32_t; FuncName:TWasmEdge_String; Params:PWasmEdge_Value;
  540. ParamLen:Tuint32_t; Returns:PWasmEdge_Value; ReturnLen:Tuint32_t):TWasmEdge_Result;cdecl;
  541. WasmEdge_VMRunWasmFromASTModule : function(Cxt:PWasmEdge_VMContext; ASTCxt:PWasmEdge_ASTModuleContext; FuncName:TWasmEdge_String; Params:PWasmEdge_Value; ParamLen:Tuint32_t;
  542. Returns:PWasmEdge_Value; ReturnLen:Tuint32_t):TWasmEdge_Result;cdecl;
  543. WasmEdge_VMAsyncRunWasmFromFile : function(Cxt:PWasmEdge_VMContext; Path:pcchar; FuncName:TWasmEdge_String; Params:PWasmEdge_Value; ParamLen:Tuint32_t):PWasmEdge_Async;cdecl;
  544. WasmEdge_VMAsyncRunWasmFromBuffer : function(Cxt:PWasmEdge_VMContext; Buf:Puint8_t; BufLen:Tuint32_t; FuncName:TWasmEdge_String; Params:PWasmEdge_Value;
  545. ParamLen:Tuint32_t):PWasmEdge_Async;cdecl;
  546. WasmEdge_VMAsyncRunWasmFromASTModule : function(Cxt:PWasmEdge_VMContext; ASTCxt:PWasmEdge_ASTModuleContext; FuncName:TWasmEdge_String; Params:PWasmEdge_Value; ParamLen:Tuint32_t):PWasmEdge_Async;cdecl;
  547. WasmEdge_VMLoadWasmFromFile : function(Cxt:PWasmEdge_VMContext; Path:pcchar):TWasmEdge_Result;cdecl;
  548. WasmEdge_VMLoadWasmFromBuffer : function(Cxt:PWasmEdge_VMContext; Buf:Puint8_t; BufLen:Tuint32_t):TWasmEdge_Result;cdecl;
  549. WasmEdge_VMLoadWasmFromASTModule : function(Cxt:PWasmEdge_VMContext; ASTCxt:PWasmEdge_ASTModuleContext):TWasmEdge_Result;cdecl;
  550. WasmEdge_VMValidate : function(Cxt:PWasmEdge_VMContext):TWasmEdge_Result;cdecl;
  551. WasmEdge_VMInstantiate : function(Cxt:PWasmEdge_VMContext):TWasmEdge_Result;cdecl;
  552. WasmEdge_VMExecute : function(Cxt:PWasmEdge_VMContext; FuncName:TWasmEdge_String; Params:PWasmEdge_Value; ParamLen:Tuint32_t; Returns:PWasmEdge_Value;
  553. ReturnLen:Tuint32_t):TWasmEdge_Result;cdecl;
  554. WasmEdge_VMExecuteRegistered : function(Cxt:PWasmEdge_VMContext; ModuleName:TWasmEdge_String; FuncName:TWasmEdge_String; Params:PWasmEdge_Value; ParamLen:Tuint32_t;
  555. Returns:PWasmEdge_Value; ReturnLen:Tuint32_t):TWasmEdge_Result;cdecl;
  556. WasmEdge_VMAsyncExecute : function(Cxt:PWasmEdge_VMContext; FuncName:TWasmEdge_String; Params:PWasmEdge_Value; ParamLen:Tuint32_t):PWasmEdge_Async;cdecl;
  557. WasmEdge_VMAsyncExecuteRegistered : function(Cxt:PWasmEdge_VMContext; ModuleName:TWasmEdge_String; FuncName:TWasmEdge_String; Params:PWasmEdge_Value; ParamLen:Tuint32_t):PWasmEdge_Async;cdecl;
  558. WasmEdge_VMGetFunctionType : function(Cxt:PWasmEdge_VMContext; FuncName:TWasmEdge_String):PWasmEdge_FunctionTypeContext;cdecl;
  559. WasmEdge_VMGetFunctionTypeRegistered : function(Cxt:PWasmEdge_VMContext; ModuleName:TWasmEdge_String; FuncName:TWasmEdge_String):PWasmEdge_FunctionTypeContext;cdecl;
  560. WasmEdge_VMCleanup : procedure(Cxt:PWasmEdge_VMContext);cdecl;
  561. WasmEdge_VMGetFunctionListLength : function(Cxt:PWasmEdge_VMContext):Tuint32_t;cdecl;
  562. WasmEdge_VMGetFunctionList : function(Cxt:PWasmEdge_VMContext; Names:PWasmEdge_String; FuncTypes:PPWasmEdge_FunctionTypeContext; Len:Tuint32_t):Tuint32_t;cdecl;
  563. WasmEdge_VMGetImportModuleContext : function(Cxt:PWasmEdge_VMContext; Reg:TWasmEdge_HostRegistration):PWasmEdge_ModuleInstanceContext;cdecl;
  564. WasmEdge_VMGetActiveModule : function(Cxt:PWasmEdge_VMContext):PWasmEdge_ModuleInstanceContext;cdecl;
  565. WasmEdge_VMGetRegisteredModule : function(Cxt:PWasmEdge_VMContext; ModuleName:TWasmEdge_String):PWasmEdge_ModuleInstanceContext;cdecl;
  566. WasmEdge_VMListRegisteredModuleLength : function(Cxt:PWasmEdge_VMContext):Tuint32_t;cdecl;
  567. WasmEdge_VMListRegisteredModule : function(Cxt:PWasmEdge_VMContext; Names:PWasmEdge_String; Len:Tuint32_t):Tuint32_t;cdecl;
  568. WasmEdge_VMGetStoreContext : function(Cxt:PWasmEdge_VMContext):PWasmEdge_StoreContext;cdecl;
  569. WasmEdge_VMGetLoaderContext : function(Cxt:PWasmEdge_VMContext):PWasmEdge_LoaderContext;cdecl;
  570. WasmEdge_VMGetValidatorContext : function(Cxt:PWasmEdge_VMContext):PWasmEdge_ValidatorContext;cdecl;
  571. WasmEdge_VMGetExecutorContext : function(Cxt:PWasmEdge_VMContext):PWasmEdge_ExecutorContext;cdecl;
  572. WasmEdge_VMGetStatisticsContext : function(Cxt:PWasmEdge_VMContext):PWasmEdge_StatisticsContext;cdecl;
  573. WasmEdge_VMDelete : procedure(Cxt:PWasmEdge_VMContext);cdecl;
  574. WasmEdge_Driver_Compiler : function(Argc:Tcint; Argv:Ppcchar):Tcint;cdecl;
  575. WasmEdge_Driver_Tool : function(Argc:Tcint; Argv:Ppcchar):Tcint;cdecl;
  576. WasmEdge_Driver_UniTool : function(Argc:Tcint; Argv:Ppcchar):Tcint;cdecl;
  577. WasmEdge_PluginLoadWithDefaultPaths : procedure;cdecl;
  578. WasmEdge_PluginLoadFromPath : procedure(Path:pcchar);cdecl;
  579. WasmEdge_PluginListPluginsLength : function:Tuint32_t;cdecl;
  580. WasmEdge_PluginListPlugins : function(Names:PWasmEdge_String; Len:Tuint32_t):Tuint32_t;cdecl;
  581. WasmEdge_PluginFind : function(Name:TWasmEdge_String):PWasmEdge_PluginContext;cdecl;
  582. WasmEdge_PluginGetPluginName : function(Cxt:PWasmEdge_PluginContext):TWasmEdge_String;cdecl;
  583. WasmEdge_PluginListModuleLength : function(Cxt:PWasmEdge_PluginContext):Tuint32_t;cdecl;
  584. WasmEdge_PluginListModule : function(Cxt:PWasmEdge_PluginContext; Names:PWasmEdge_String; Len:Tuint32_t):Tuint32_t;cdecl;
  585. WasmEdge_PluginCreateModule : function(Cxt:PWasmEdge_PluginContext; ModuleName:TWasmEdge_String):PWasmEdge_ModuleInstanceContext;cdecl;
  586. WasmEdge_Plugin_GetDescriptor : function:PWasmEdge_PluginDescriptor;cdecl;
  587. WasmEdge_ExecutorExperimentalRegisterPreHostFunction : procedure(Cxt:PWasmEdge_ExecutorContext; Data:pointer; Func:TFinalizer);cdecl;
  588. WasmEdge_ExecutorExperimentalRegisterPostHostFunction : procedure(Cxt:PWasmEdge_ExecutorContext; Data:pointer; Func:TFinalizer);cdecl;
  589. procedure Loadlibwasmedge(const lib : string = LibWasmName);
  590. procedure FreeLibWasmEdge;
  591. implementation
  592. {$IFDEF FPC_DOTTEDUNITS}
  593. uses
  594. System.SysUtils, System.DynLibs;
  595. {$ELSE}
  596. uses
  597. SysUtils, dynlibs;
  598. {$ENDIF}
  599. var
  600. hlib : tlibhandle;
  601. procedure Freelibwasmedge;
  602. begin
  603. if hLib=NilHandle then
  604. exit;
  605. FreeLibrary(hlib);
  606. WasmEdge_VersionGet:=nil;
  607. WasmEdge_VersionGetMajor:=nil;
  608. WasmEdge_VersionGetMinor:=nil;
  609. WasmEdge_VersionGetPatch:=nil;
  610. WasmEdge_LogSetErrorLevel:=nil;
  611. WasmEdge_LogSetDebugLevel:=nil;
  612. WasmEdge_LogOff:=nil;
  613. WasmEdge_ValueGenI32:=nil;
  614. WasmEdge_ValueGenI64:=nil;
  615. WasmEdge_ValueGenF32:=nil;
  616. WasmEdge_ValueGenF64:=nil;
  617. WasmEdge_ValueGenV128:=nil;
  618. WasmEdge_ValueGenNullRef:=nil;
  619. WasmEdge_ValueGenFuncRef:=nil;
  620. WasmEdge_ValueGenExternRef:=nil;
  621. WasmEdge_ValueGetI32:=nil;
  622. WasmEdge_ValueGetI64:=nil;
  623. WasmEdge_ValueGetF32:=nil;
  624. WasmEdge_ValueGetF64:=nil;
  625. WasmEdge_ValueGetV128:=nil;
  626. WasmEdge_ValueIsNullRef:=nil;
  627. WasmEdge_ValueGetFuncRef:=nil;
  628. WasmEdge_ValueGetExternRef:=nil;
  629. WasmEdge_StringCreateByCString:=nil;
  630. WasmEdge_StringCreateByBuffer:=nil;
  631. WasmEdge_StringWrap:=nil;
  632. WasmEdge_StringIsEqual:=nil;
  633. WasmEdge_StringCopy:=nil;
  634. WasmEdge_StringDelete:=nil;
  635. WasmEdge_ResultOK:=nil;
  636. WasmEdge_ResultGen:=nil;
  637. WasmEdge_ResultGetCode:=nil;
  638. WasmEdge_ResultGetCategory:=nil;
  639. WasmEdge_ResultGetMessage:=nil;
  640. WasmEdge_LimitIsEqual:=nil;
  641. WasmEdge_ConfigureCreate:=nil;
  642. WasmEdge_ConfigureAddProposal:=nil;
  643. WasmEdge_ConfigureRemoveProposal:=nil;
  644. WasmEdge_ConfigureHasProposal:=nil;
  645. WasmEdge_ConfigureAddHostRegistration:=nil;
  646. WasmEdge_ConfigureRemoveHostRegistration:=nil;
  647. WasmEdge_ConfigureHasHostRegistration:=nil;
  648. WasmEdge_ConfigureSetMaxMemoryPage:=nil;
  649. WasmEdge_ConfigureGetMaxMemoryPage:=nil;
  650. WasmEdge_ConfigureSetForceInterpreter:=nil;
  651. WasmEdge_ConfigureIsForceInterpreter:=nil;
  652. WasmEdge_ConfigureSetAllowAFUNIX:=nil;
  653. WasmEdge_ConfigureIsAllowAFUNIX:=nil;
  654. WasmEdge_ConfigureCompilerSetOptimizationLevel:=nil;
  655. WasmEdge_ConfigureCompilerGetOptimizationLevel:=nil;
  656. WasmEdge_ConfigureCompilerSetOutputFormat:=nil;
  657. WasmEdge_ConfigureCompilerGetOutputFormat:=nil;
  658. WasmEdge_ConfigureCompilerSetDumpIR:=nil;
  659. WasmEdge_ConfigureCompilerIsDumpIR:=nil;
  660. WasmEdge_ConfigureCompilerSetGenericBinary:=nil;
  661. WasmEdge_ConfigureCompilerIsGenericBinary:=nil;
  662. WasmEdge_ConfigureCompilerSetInterruptible:=nil;
  663. WasmEdge_ConfigureCompilerIsInterruptible:=nil;
  664. WasmEdge_ConfigureStatisticsSetInstructionCounting:=nil;
  665. WasmEdge_ConfigureStatisticsIsInstructionCounting:=nil;
  666. WasmEdge_ConfigureStatisticsSetCostMeasuring:=nil;
  667. WasmEdge_ConfigureStatisticsIsCostMeasuring:=nil;
  668. WasmEdge_ConfigureStatisticsSetTimeMeasuring:=nil;
  669. WasmEdge_ConfigureStatisticsIsTimeMeasuring:=nil;
  670. WasmEdge_ConfigureDelete:=nil;
  671. WasmEdge_StatisticsCreate:=nil;
  672. WasmEdge_StatisticsGetInstrCount:=nil;
  673. WasmEdge_StatisticsGetInstrPerSecond:=nil;
  674. WasmEdge_StatisticsGetTotalCost:=nil;
  675. WasmEdge_StatisticsSetCostTable:=nil;
  676. WasmEdge_StatisticsSetCostLimit:=nil;
  677. WasmEdge_StatisticsClear:=nil;
  678. WasmEdge_StatisticsDelete:=nil;
  679. WasmEdge_ASTModuleListImportsLength:=nil;
  680. WasmEdge_ASTModuleListImports:=nil;
  681. WasmEdge_ASTModuleListExportsLength:=nil;
  682. WasmEdge_ASTModuleListExports:=nil;
  683. WasmEdge_ASTModuleDelete:=nil;
  684. WasmEdge_FunctionTypeCreate:=nil;
  685. WasmEdge_FunctionTypeGetParametersLength:=nil;
  686. WasmEdge_FunctionTypeGetParameters:=nil;
  687. WasmEdge_FunctionTypeGetReturnsLength:=nil;
  688. WasmEdge_FunctionTypeGetReturns:=nil;
  689. WasmEdge_FunctionTypeDelete:=nil;
  690. WasmEdge_TableTypeCreate:=nil;
  691. WasmEdge_TableTypeGetRefType:=nil;
  692. WasmEdge_TableTypeGetLimit:=nil;
  693. WasmEdge_TableTypeDelete:=nil;
  694. WasmEdge_MemoryTypeCreate:=nil;
  695. WasmEdge_MemoryTypeGetLimit:=nil;
  696. WasmEdge_MemoryTypeDelete:=nil;
  697. WasmEdge_GlobalTypeCreate:=nil;
  698. WasmEdge_GlobalTypeGetValType:=nil;
  699. WasmEdge_GlobalTypeGetMutability:=nil;
  700. WasmEdge_GlobalTypeDelete:=nil;
  701. WasmEdge_ImportTypeGetExternalType:=nil;
  702. WasmEdge_ImportTypeGetModuleName:=nil;
  703. WasmEdge_ImportTypeGetExternalName:=nil;
  704. WasmEdge_ImportTypeGetFunctionType:=nil;
  705. WasmEdge_ImportTypeGetTableType:=nil;
  706. WasmEdge_ImportTypeGetMemoryType:=nil;
  707. WasmEdge_ImportTypeGetGlobalType:=nil;
  708. WasmEdge_ExportTypeGetExternalType:=nil;
  709. WasmEdge_ExportTypeGetExternalName:=nil;
  710. WasmEdge_ExportTypeGetFunctionType:=nil;
  711. WasmEdge_ExportTypeGetTableType:=nil;
  712. WasmEdge_ExportTypeGetMemoryType:=nil;
  713. WasmEdge_ExportTypeGetGlobalType:=nil;
  714. WasmEdge_CompilerCreate:=nil;
  715. WasmEdge_CompilerCompile:=nil;
  716. WasmEdge_CompilerCompileFromBuffer:=nil;
  717. WasmEdge_CompilerDelete:=nil;
  718. WasmEdge_LoaderCreate:=nil;
  719. WasmEdge_LoaderParseFromFile:=nil;
  720. WasmEdge_LoaderParseFromBuffer:=nil;
  721. WasmEdge_LoaderDelete:=nil;
  722. WasmEdge_ValidatorCreate:=nil;
  723. WasmEdge_ValidatorValidate:=nil;
  724. WasmEdge_ValidatorDelete:=nil;
  725. WasmEdge_ExecutorCreate:=nil;
  726. WasmEdge_ExecutorInstantiate:=nil;
  727. WasmEdge_ExecutorRegister:=nil;
  728. WasmEdge_ExecutorRegisterImport:=nil;
  729. WasmEdge_ExecutorInvoke:=nil;
  730. WasmEdge_ExecutorAsyncInvoke:=nil;
  731. WasmEdge_ExecutorDelete:=nil;
  732. WasmEdge_StoreCreate:=nil;
  733. WasmEdge_StoreFindModule:=nil;
  734. WasmEdge_StoreListModuleLength:=nil;
  735. WasmEdge_StoreListModule:=nil;
  736. WasmEdge_StoreDelete:=nil;
  737. WasmEdge_ModuleInstanceCreate:=nil;
  738. WasmEdge_ModuleInstanceCreateWithData:=nil;
  739. WasmEdge_ModuleInstanceCreateWASI:=nil;
  740. WasmEdge_ModuleInstanceInitWASI:=nil;
  741. WasmEdge_ModuleInstanceWASIGetExitCode:=nil;
  742. WasmEdge_ModuleInstanceWASIGetNativeHandler:=nil;
  743. WasmEdge_ModuleInstanceInitWasmEdgeProcess:=nil;
  744. WasmEdge_ModuleInstanceGetModuleName:=nil;
  745. WasmEdge_ModuleInstanceGetHostData:=nil;
  746. WasmEdge_ModuleInstanceFindFunction:=nil;
  747. WasmEdge_ModuleInstanceFindTable:=nil;
  748. WasmEdge_ModuleInstanceFindMemory:=nil;
  749. WasmEdge_ModuleInstanceFindGlobal:=nil;
  750. WasmEdge_ModuleInstanceListFunctionLength:=nil;
  751. WasmEdge_ModuleInstanceListFunction:=nil;
  752. WasmEdge_ModuleInstanceListTableLength:=nil;
  753. WasmEdge_ModuleInstanceListTable:=nil;
  754. WasmEdge_ModuleInstanceListMemoryLength:=nil;
  755. WasmEdge_ModuleInstanceListMemory:=nil;
  756. WasmEdge_ModuleInstanceListGlobalLength:=nil;
  757. WasmEdge_ModuleInstanceListGlobal:=nil;
  758. WasmEdge_ModuleInstanceAddFunction:=nil;
  759. WasmEdge_ModuleInstanceAddTable:=nil;
  760. WasmEdge_ModuleInstanceAddMemory:=nil;
  761. WasmEdge_ModuleInstanceAddGlobal:=nil;
  762. WasmEdge_ModuleInstanceDelete:=nil;
  763. WasmEdge_FunctionInstanceCreate:=nil;
  764. WasmEdge_FunctionInstanceCreateBinding:=nil;
  765. WasmEdge_FunctionInstanceGetFunctionType:=nil;
  766. WasmEdge_FunctionInstanceDelete:=nil;
  767. WasmEdge_TableInstanceCreate:=nil;
  768. WasmEdge_TableInstanceGetTableType:=nil;
  769. WasmEdge_TableInstanceGetData:=nil;
  770. WasmEdge_TableInstanceSetData:=nil;
  771. WasmEdge_TableInstanceGetSize:=nil;
  772. WasmEdge_TableInstanceGrow:=nil;
  773. WasmEdge_TableInstanceDelete:=nil;
  774. WasmEdge_MemoryInstanceCreate:=nil;
  775. WasmEdge_MemoryInstanceGetMemoryType:=nil;
  776. WasmEdge_MemoryInstanceGetData:=nil;
  777. WasmEdge_MemoryInstanceSetData:=nil;
  778. WasmEdge_MemoryInstanceGetPointer:=nil;
  779. WasmEdge_MemoryInstanceGetPointerConst:=nil;
  780. WasmEdge_MemoryInstanceGetPageSize:=nil;
  781. WasmEdge_MemoryInstanceGrowPage:=nil;
  782. WasmEdge_MemoryInstanceDelete:=nil;
  783. WasmEdge_GlobalInstanceCreate:=nil;
  784. WasmEdge_GlobalInstanceGetGlobalType:=nil;
  785. WasmEdge_GlobalInstanceGetValue:=nil;
  786. WasmEdge_GlobalInstanceSetValue:=nil;
  787. WasmEdge_GlobalInstanceDelete:=nil;
  788. WasmEdge_CallingFrameGetExecutor:=nil;
  789. WasmEdge_CallingFrameGetModuleInstance:=nil;
  790. WasmEdge_CallingFrameGetMemoryInstance:=nil;
  791. WasmEdge_AsyncWait:=nil;
  792. WasmEdge_AsyncWaitFor:=nil;
  793. WasmEdge_AsyncCancel:=nil;
  794. WasmEdge_AsyncGetReturnsLength:=nil;
  795. WasmEdge_AsyncGet:=nil;
  796. WasmEdge_AsyncDelete:=nil;
  797. WasmEdge_VMCreate:=nil;
  798. WasmEdge_VMRegisterModuleFromFile:=nil;
  799. WasmEdge_VMRegisterModuleFromBuffer:=nil;
  800. WasmEdge_VMRegisterModuleFromASTModule:=nil;
  801. WasmEdge_VMRegisterModuleFromImport:=nil;
  802. WasmEdge_VMRunWasmFromFile:=nil;
  803. WasmEdge_VMRunWasmFromBuffer:=nil;
  804. WasmEdge_VMRunWasmFromASTModule:=nil;
  805. WasmEdge_VMAsyncRunWasmFromFile:=nil;
  806. WasmEdge_VMAsyncRunWasmFromBuffer:=nil;
  807. WasmEdge_VMAsyncRunWasmFromASTModule:=nil;
  808. WasmEdge_VMLoadWasmFromFile:=nil;
  809. WasmEdge_VMLoadWasmFromBuffer:=nil;
  810. WasmEdge_VMLoadWasmFromASTModule:=nil;
  811. WasmEdge_VMValidate:=nil;
  812. WasmEdge_VMInstantiate:=nil;
  813. WasmEdge_VMExecute:=nil;
  814. WasmEdge_VMExecuteRegistered:=nil;
  815. WasmEdge_VMAsyncExecute:=nil;
  816. WasmEdge_VMAsyncExecuteRegistered:=nil;
  817. WasmEdge_VMGetFunctionType:=nil;
  818. WasmEdge_VMGetFunctionTypeRegistered:=nil;
  819. WasmEdge_VMCleanup:=nil;
  820. WasmEdge_VMGetFunctionListLength:=nil;
  821. WasmEdge_VMGetFunctionList:=nil;
  822. WasmEdge_VMGetImportModuleContext:=nil;
  823. WasmEdge_VMGetActiveModule:=nil;
  824. WasmEdge_VMGetRegisteredModule:=nil;
  825. WasmEdge_VMListRegisteredModuleLength:=nil;
  826. WasmEdge_VMListRegisteredModule:=nil;
  827. WasmEdge_VMGetStoreContext:=nil;
  828. WasmEdge_VMGetLoaderContext:=nil;
  829. WasmEdge_VMGetValidatorContext:=nil;
  830. WasmEdge_VMGetExecutorContext:=nil;
  831. WasmEdge_VMGetStatisticsContext:=nil;
  832. WasmEdge_VMDelete:=nil;
  833. WasmEdge_Driver_Compiler:=nil;
  834. WasmEdge_Driver_Tool:=nil;
  835. WasmEdge_Driver_UniTool:=nil;
  836. WasmEdge_PluginLoadWithDefaultPaths:=nil;
  837. WasmEdge_PluginLoadFromPath:=nil;
  838. WasmEdge_PluginListPluginsLength:=nil;
  839. WasmEdge_PluginListPlugins:=nil;
  840. WasmEdge_PluginFind:=nil;
  841. WasmEdge_PluginGetPluginName:=nil;
  842. WasmEdge_PluginListModuleLength:=nil;
  843. WasmEdge_PluginListModule:=nil;
  844. WasmEdge_PluginCreateModule:=nil;
  845. WasmEdge_Plugin_GetDescriptor:=nil;
  846. WasmEdge_ExecutorExperimentalRegisterPreHostFunction:=nil;
  847. WasmEdge_ExecutorExperimentalRegisterPostHostFunction:=nil;
  848. end;
  849. procedure Loadlibwasmedge(const lib : string);
  850. begin
  851. Freelibwasmedge;
  852. hlib:=LoadLibrary(lib);
  853. if (hlib=0) then
  854. raise Exception.Create(format('Could not load library: %s',[lib]));
  855. pointer(WasmEdge_VersionGet):=GetProcAddress(hlib,'WasmEdge_VersionGet');
  856. pointer(WasmEdge_VersionGetMajor):=GetProcAddress(hlib,'WasmEdge_VersionGetMajor');
  857. pointer(WasmEdge_VersionGetMinor):=GetProcAddress(hlib,'WasmEdge_VersionGetMinor');
  858. pointer(WasmEdge_VersionGetPatch):=GetProcAddress(hlib,'WasmEdge_VersionGetPatch');
  859. pointer(WasmEdge_LogSetErrorLevel):=GetProcAddress(hlib,'WasmEdge_LogSetErrorLevel');
  860. pointer(WasmEdge_LogSetDebugLevel):=GetProcAddress(hlib,'WasmEdge_LogSetDebugLevel');
  861. pointer(WasmEdge_LogOff):=GetProcAddress(hlib,'WasmEdge_LogOff');
  862. pointer(WasmEdge_ValueGenI32):=GetProcAddress(hlib,'WasmEdge_ValueGenI32');
  863. pointer(WasmEdge_ValueGenI64):=GetProcAddress(hlib,'WasmEdge_ValueGenI64');
  864. pointer(WasmEdge_ValueGenF32):=GetProcAddress(hlib,'WasmEdge_ValueGenF32');
  865. pointer(WasmEdge_ValueGenF64):=GetProcAddress(hlib,'WasmEdge_ValueGenF64');
  866. pointer(WasmEdge_ValueGenV128):=GetProcAddress(hlib,'WasmEdge_ValueGenV128');
  867. pointer(WasmEdge_ValueGenNullRef):=GetProcAddress(hlib,'WasmEdge_ValueGenNullRef');
  868. pointer(WasmEdge_ValueGenFuncRef):=GetProcAddress(hlib,'WasmEdge_ValueGenFuncRef');
  869. pointer(WasmEdge_ValueGenExternRef):=GetProcAddress(hlib,'WasmEdge_ValueGenExternRef');
  870. pointer(WasmEdge_ValueGetI32):=GetProcAddress(hlib,'WasmEdge_ValueGetI32');
  871. pointer(WasmEdge_ValueGetI64):=GetProcAddress(hlib,'WasmEdge_ValueGetI64');
  872. pointer(WasmEdge_ValueGetF32):=GetProcAddress(hlib,'WasmEdge_ValueGetF32');
  873. pointer(WasmEdge_ValueGetF64):=GetProcAddress(hlib,'WasmEdge_ValueGetF64');
  874. pointer(WasmEdge_ValueGetV128):=GetProcAddress(hlib,'WasmEdge_ValueGetV128');
  875. pointer(WasmEdge_ValueIsNullRef):=GetProcAddress(hlib,'WasmEdge_ValueIsNullRef');
  876. pointer(WasmEdge_ValueGetFuncRef):=GetProcAddress(hlib,'WasmEdge_ValueGetFuncRef');
  877. pointer(WasmEdge_ValueGetExternRef):=GetProcAddress(hlib,'WasmEdge_ValueGetExternRef');
  878. pointer(WasmEdge_StringCreateByCString):=GetProcAddress(hlib,'WasmEdge_StringCreateByCString');
  879. pointer(WasmEdge_StringCreateByBuffer):=GetProcAddress(hlib,'WasmEdge_StringCreateByBuffer');
  880. pointer(WasmEdge_StringWrap):=GetProcAddress(hlib,'WasmEdge_StringWrap');
  881. pointer(WasmEdge_StringIsEqual):=GetProcAddress(hlib,'WasmEdge_StringIsEqual');
  882. pointer(WasmEdge_StringCopy):=GetProcAddress(hlib,'WasmEdge_StringCopy');
  883. pointer(WasmEdge_StringDelete):=GetProcAddress(hlib,'WasmEdge_StringDelete');
  884. pointer(WasmEdge_ResultOK):=GetProcAddress(hlib,'WasmEdge_ResultOK');
  885. pointer(WasmEdge_ResultGen):=GetProcAddress(hlib,'WasmEdge_ResultGen');
  886. pointer(WasmEdge_ResultGetCode):=GetProcAddress(hlib,'WasmEdge_ResultGetCode');
  887. pointer(WasmEdge_ResultGetCategory):=GetProcAddress(hlib,'WasmEdge_ResultGetCategory');
  888. pointer(WasmEdge_ResultGetMessage):=GetProcAddress(hlib,'WasmEdge_ResultGetMessage');
  889. pointer(WasmEdge_LimitIsEqual):=GetProcAddress(hlib,'WasmEdge_LimitIsEqual');
  890. pointer(WasmEdge_ConfigureCreate):=GetProcAddress(hlib,'WasmEdge_ConfigureCreate');
  891. pointer(WasmEdge_ConfigureAddProposal):=GetProcAddress(hlib,'WasmEdge_ConfigureAddProposal');
  892. pointer(WasmEdge_ConfigureRemoveProposal):=GetProcAddress(hlib,'WasmEdge_ConfigureRemoveProposal');
  893. pointer(WasmEdge_ConfigureHasProposal):=GetProcAddress(hlib,'WasmEdge_ConfigureHasProposal');
  894. pointer(WasmEdge_ConfigureAddHostRegistration):=GetProcAddress(hlib,'WasmEdge_ConfigureAddHostRegistration');
  895. pointer(WasmEdge_ConfigureRemoveHostRegistration):=GetProcAddress(hlib,'WasmEdge_ConfigureRemoveHostRegistration');
  896. pointer(WasmEdge_ConfigureHasHostRegistration):=GetProcAddress(hlib,'WasmEdge_ConfigureHasHostRegistration');
  897. pointer(WasmEdge_ConfigureSetMaxMemoryPage):=GetProcAddress(hlib,'WasmEdge_ConfigureSetMaxMemoryPage');
  898. pointer(WasmEdge_ConfigureGetMaxMemoryPage):=GetProcAddress(hlib,'WasmEdge_ConfigureGetMaxMemoryPage');
  899. pointer(WasmEdge_ConfigureSetForceInterpreter):=GetProcAddress(hlib,'WasmEdge_ConfigureSetForceInterpreter');
  900. pointer(WasmEdge_ConfigureIsForceInterpreter):=GetProcAddress(hlib,'WasmEdge_ConfigureIsForceInterpreter');
  901. pointer(WasmEdge_ConfigureSetAllowAFUNIX):=GetProcAddress(hlib,'WasmEdge_ConfigureSetAllowAFUNIX');
  902. pointer(WasmEdge_ConfigureIsAllowAFUNIX):=GetProcAddress(hlib,'WasmEdge_ConfigureIsAllowAFUNIX');
  903. pointer(WasmEdge_ConfigureCompilerSetOptimizationLevel):=GetProcAddress(hlib,'WasmEdge_ConfigureCompilerSetOptimizationLevel');
  904. pointer(WasmEdge_ConfigureCompilerGetOptimizationLevel):=GetProcAddress(hlib,'WasmEdge_ConfigureCompilerGetOptimizationLevel');
  905. pointer(WasmEdge_ConfigureCompilerSetOutputFormat):=GetProcAddress(hlib,'WasmEdge_ConfigureCompilerSetOutputFormat');
  906. pointer(WasmEdge_ConfigureCompilerGetOutputFormat):=GetProcAddress(hlib,'WasmEdge_ConfigureCompilerGetOutputFormat');
  907. pointer(WasmEdge_ConfigureCompilerSetDumpIR):=GetProcAddress(hlib,'WasmEdge_ConfigureCompilerSetDumpIR');
  908. pointer(WasmEdge_ConfigureCompilerIsDumpIR):=GetProcAddress(hlib,'WasmEdge_ConfigureCompilerIsDumpIR');
  909. pointer(WasmEdge_ConfigureCompilerSetGenericBinary):=GetProcAddress(hlib,'WasmEdge_ConfigureCompilerSetGenericBinary');
  910. pointer(WasmEdge_ConfigureCompilerIsGenericBinary):=GetProcAddress(hlib,'WasmEdge_ConfigureCompilerIsGenericBinary');
  911. pointer(WasmEdge_ConfigureCompilerSetInterruptible):=GetProcAddress(hlib,'WasmEdge_ConfigureCompilerSetInterruptible');
  912. pointer(WasmEdge_ConfigureCompilerIsInterruptible):=GetProcAddress(hlib,'WasmEdge_ConfigureCompilerIsInterruptible');
  913. pointer(WasmEdge_ConfigureStatisticsSetInstructionCounting):=GetProcAddress(hlib,'WasmEdge_ConfigureStatisticsSetInstructionCounting');
  914. pointer(WasmEdge_ConfigureStatisticsIsInstructionCounting):=GetProcAddress(hlib,'WasmEdge_ConfigureStatisticsIsInstructionCounting');
  915. pointer(WasmEdge_ConfigureStatisticsSetCostMeasuring):=GetProcAddress(hlib,'WasmEdge_ConfigureStatisticsSetCostMeasuring');
  916. pointer(WasmEdge_ConfigureStatisticsIsCostMeasuring):=GetProcAddress(hlib,'WasmEdge_ConfigureStatisticsIsCostMeasuring');
  917. pointer(WasmEdge_ConfigureStatisticsSetTimeMeasuring):=GetProcAddress(hlib,'WasmEdge_ConfigureStatisticsSetTimeMeasuring');
  918. pointer(WasmEdge_ConfigureStatisticsIsTimeMeasuring):=GetProcAddress(hlib,'WasmEdge_ConfigureStatisticsIsTimeMeasuring');
  919. pointer(WasmEdge_ConfigureDelete):=GetProcAddress(hlib,'WasmEdge_ConfigureDelete');
  920. pointer(WasmEdge_StatisticsCreate):=GetProcAddress(hlib,'WasmEdge_StatisticsCreate');
  921. pointer(WasmEdge_StatisticsGetInstrCount):=GetProcAddress(hlib,'WasmEdge_StatisticsGetInstrCount');
  922. pointer(WasmEdge_StatisticsGetInstrPerSecond):=GetProcAddress(hlib,'WasmEdge_StatisticsGetInstrPerSecond');
  923. pointer(WasmEdge_StatisticsGetTotalCost):=GetProcAddress(hlib,'WasmEdge_StatisticsGetTotalCost');
  924. pointer(WasmEdge_StatisticsSetCostTable):=GetProcAddress(hlib,'WasmEdge_StatisticsSetCostTable');
  925. pointer(WasmEdge_StatisticsSetCostLimit):=GetProcAddress(hlib,'WasmEdge_StatisticsSetCostLimit');
  926. pointer(WasmEdge_StatisticsClear):=GetProcAddress(hlib,'WasmEdge_StatisticsClear');
  927. pointer(WasmEdge_StatisticsDelete):=GetProcAddress(hlib,'WasmEdge_StatisticsDelete');
  928. pointer(WasmEdge_ASTModuleListImportsLength):=GetProcAddress(hlib,'WasmEdge_ASTModuleListImportsLength');
  929. pointer(WasmEdge_ASTModuleListImports):=GetProcAddress(hlib,'WasmEdge_ASTModuleListImports');
  930. pointer(WasmEdge_ASTModuleListExportsLength):=GetProcAddress(hlib,'WasmEdge_ASTModuleListExportsLength');
  931. pointer(WasmEdge_ASTModuleListExports):=GetProcAddress(hlib,'WasmEdge_ASTModuleListExports');
  932. pointer(WasmEdge_ASTModuleDelete):=GetProcAddress(hlib,'WasmEdge_ASTModuleDelete');
  933. pointer(WasmEdge_FunctionTypeCreate):=GetProcAddress(hlib,'WasmEdge_FunctionTypeCreate');
  934. pointer(WasmEdge_FunctionTypeGetParametersLength):=GetProcAddress(hlib,'WasmEdge_FunctionTypeGetParametersLength');
  935. pointer(WasmEdge_FunctionTypeGetParameters):=GetProcAddress(hlib,'WasmEdge_FunctionTypeGetParameters');
  936. pointer(WasmEdge_FunctionTypeGetReturnsLength):=GetProcAddress(hlib,'WasmEdge_FunctionTypeGetReturnsLength');
  937. pointer(WasmEdge_FunctionTypeGetReturns):=GetProcAddress(hlib,'WasmEdge_FunctionTypeGetReturns');
  938. pointer(WasmEdge_FunctionTypeDelete):=GetProcAddress(hlib,'WasmEdge_FunctionTypeDelete');
  939. pointer(WasmEdge_TableTypeCreate):=GetProcAddress(hlib,'WasmEdge_TableTypeCreate');
  940. pointer(WasmEdge_TableTypeGetRefType):=GetProcAddress(hlib,'WasmEdge_TableTypeGetRefType');
  941. pointer(WasmEdge_TableTypeGetLimit):=GetProcAddress(hlib,'WasmEdge_TableTypeGetLimit');
  942. pointer(WasmEdge_TableTypeDelete):=GetProcAddress(hlib,'WasmEdge_TableTypeDelete');
  943. pointer(WasmEdge_MemoryTypeCreate):=GetProcAddress(hlib,'WasmEdge_MemoryTypeCreate');
  944. pointer(WasmEdge_MemoryTypeGetLimit):=GetProcAddress(hlib,'WasmEdge_MemoryTypeGetLimit');
  945. pointer(WasmEdge_MemoryTypeDelete):=GetProcAddress(hlib,'WasmEdge_MemoryTypeDelete');
  946. pointer(WasmEdge_GlobalTypeCreate):=GetProcAddress(hlib,'WasmEdge_GlobalTypeCreate');
  947. pointer(WasmEdge_GlobalTypeGetValType):=GetProcAddress(hlib,'WasmEdge_GlobalTypeGetValType');
  948. pointer(WasmEdge_GlobalTypeGetMutability):=GetProcAddress(hlib,'WasmEdge_GlobalTypeGetMutability');
  949. pointer(WasmEdge_GlobalTypeDelete):=GetProcAddress(hlib,'WasmEdge_GlobalTypeDelete');
  950. pointer(WasmEdge_ImportTypeGetExternalType):=GetProcAddress(hlib,'WasmEdge_ImportTypeGetExternalType');
  951. pointer(WasmEdge_ImportTypeGetModuleName):=GetProcAddress(hlib,'WasmEdge_ImportTypeGetModuleName');
  952. pointer(WasmEdge_ImportTypeGetExternalName):=GetProcAddress(hlib,'WasmEdge_ImportTypeGetExternalName');
  953. pointer(WasmEdge_ImportTypeGetFunctionType):=GetProcAddress(hlib,'WasmEdge_ImportTypeGetFunctionType');
  954. pointer(WasmEdge_ImportTypeGetTableType):=GetProcAddress(hlib,'WasmEdge_ImportTypeGetTableType');
  955. pointer(WasmEdge_ImportTypeGetMemoryType):=GetProcAddress(hlib,'WasmEdge_ImportTypeGetMemoryType');
  956. pointer(WasmEdge_ImportTypeGetGlobalType):=GetProcAddress(hlib,'WasmEdge_ImportTypeGetGlobalType');
  957. pointer(WasmEdge_ExportTypeGetExternalType):=GetProcAddress(hlib,'WasmEdge_ExportTypeGetExternalType');
  958. pointer(WasmEdge_ExportTypeGetExternalName):=GetProcAddress(hlib,'WasmEdge_ExportTypeGetExternalName');
  959. pointer(WasmEdge_ExportTypeGetFunctionType):=GetProcAddress(hlib,'WasmEdge_ExportTypeGetFunctionType');
  960. pointer(WasmEdge_ExportTypeGetTableType):=GetProcAddress(hlib,'WasmEdge_ExportTypeGetTableType');
  961. pointer(WasmEdge_ExportTypeGetMemoryType):=GetProcAddress(hlib,'WasmEdge_ExportTypeGetMemoryType');
  962. pointer(WasmEdge_ExportTypeGetGlobalType):=GetProcAddress(hlib,'WasmEdge_ExportTypeGetGlobalType');
  963. pointer(WasmEdge_CompilerCreate):=GetProcAddress(hlib,'WasmEdge_CompilerCreate');
  964. pointer(WasmEdge_CompilerCompile):=GetProcAddress(hlib,'WasmEdge_CompilerCompile');
  965. pointer(WasmEdge_CompilerCompileFromBuffer):=GetProcAddress(hlib,'WasmEdge_CompilerCompileFromBuffer');
  966. pointer(WasmEdge_CompilerDelete):=GetProcAddress(hlib,'WasmEdge_CompilerDelete');
  967. pointer(WasmEdge_LoaderCreate):=GetProcAddress(hlib,'WasmEdge_LoaderCreate');
  968. pointer(WasmEdge_LoaderParseFromFile):=GetProcAddress(hlib,'WasmEdge_LoaderParseFromFile');
  969. pointer(WasmEdge_LoaderParseFromBuffer):=GetProcAddress(hlib,'WasmEdge_LoaderParseFromBuffer');
  970. pointer(WasmEdge_LoaderDelete):=GetProcAddress(hlib,'WasmEdge_LoaderDelete');
  971. pointer(WasmEdge_ValidatorCreate):=GetProcAddress(hlib,'WasmEdge_ValidatorCreate');
  972. pointer(WasmEdge_ValidatorValidate):=GetProcAddress(hlib,'WasmEdge_ValidatorValidate');
  973. pointer(WasmEdge_ValidatorDelete):=GetProcAddress(hlib,'WasmEdge_ValidatorDelete');
  974. pointer(WasmEdge_ExecutorCreate):=GetProcAddress(hlib,'WasmEdge_ExecutorCreate');
  975. pointer(WasmEdge_ExecutorInstantiate):=GetProcAddress(hlib,'WasmEdge_ExecutorInstantiate');
  976. pointer(WasmEdge_ExecutorRegister):=GetProcAddress(hlib,'WasmEdge_ExecutorRegister');
  977. pointer(WasmEdge_ExecutorRegisterImport):=GetProcAddress(hlib,'WasmEdge_ExecutorRegisterImport');
  978. pointer(WasmEdge_ExecutorInvoke):=GetProcAddress(hlib,'WasmEdge_ExecutorInvoke');
  979. pointer(WasmEdge_ExecutorAsyncInvoke):=GetProcAddress(hlib,'WasmEdge_ExecutorAsyncInvoke');
  980. pointer(WasmEdge_ExecutorDelete):=GetProcAddress(hlib,'WasmEdge_ExecutorDelete');
  981. pointer(WasmEdge_StoreCreate):=GetProcAddress(hlib,'WasmEdge_StoreCreate');
  982. pointer(WasmEdge_StoreFindModule):=GetProcAddress(hlib,'WasmEdge_StoreFindModule');
  983. pointer(WasmEdge_StoreListModuleLength):=GetProcAddress(hlib,'WasmEdge_StoreListModuleLength');
  984. pointer(WasmEdge_StoreListModule):=GetProcAddress(hlib,'WasmEdge_StoreListModule');
  985. pointer(WasmEdge_StoreDelete):=GetProcAddress(hlib,'WasmEdge_StoreDelete');
  986. pointer(WasmEdge_ModuleInstanceCreate):=GetProcAddress(hlib,'WasmEdge_ModuleInstanceCreate');
  987. pointer(WasmEdge_ModuleInstanceCreateWithData):=GetProcAddress(hlib,'WasmEdge_ModuleInstanceCreateWithData');
  988. pointer(WasmEdge_ModuleInstanceCreateWASI):=GetProcAddress(hlib,'WasmEdge_ModuleInstanceCreateWASI');
  989. pointer(WasmEdge_ModuleInstanceInitWASI):=GetProcAddress(hlib,'WasmEdge_ModuleInstanceInitWASI');
  990. pointer(WasmEdge_ModuleInstanceWASIGetExitCode):=GetProcAddress(hlib,'WasmEdge_ModuleInstanceWASIGetExitCode');
  991. pointer(WasmEdge_ModuleInstanceWASIGetNativeHandler):=GetProcAddress(hlib,'WasmEdge_ModuleInstanceWASIGetNativeHandler');
  992. pointer(WasmEdge_ModuleInstanceInitWasmEdgeProcess):=GetProcAddress(hlib,'WasmEdge_ModuleInstanceInitWasmEdgeProcess');
  993. pointer(WasmEdge_ModuleInstanceGetModuleName):=GetProcAddress(hlib,'WasmEdge_ModuleInstanceGetModuleName');
  994. pointer(WasmEdge_ModuleInstanceGetHostData):=GetProcAddress(hlib,'WasmEdge_ModuleInstanceGetHostData');
  995. pointer(WasmEdge_ModuleInstanceFindFunction):=GetProcAddress(hlib,'WasmEdge_ModuleInstanceFindFunction');
  996. pointer(WasmEdge_ModuleInstanceFindTable):=GetProcAddress(hlib,'WasmEdge_ModuleInstanceFindTable');
  997. pointer(WasmEdge_ModuleInstanceFindMemory):=GetProcAddress(hlib,'WasmEdge_ModuleInstanceFindMemory');
  998. pointer(WasmEdge_ModuleInstanceFindGlobal):=GetProcAddress(hlib,'WasmEdge_ModuleInstanceFindGlobal');
  999. pointer(WasmEdge_ModuleInstanceListFunctionLength):=GetProcAddress(hlib,'WasmEdge_ModuleInstanceListFunctionLength');
  1000. pointer(WasmEdge_ModuleInstanceListFunction):=GetProcAddress(hlib,'WasmEdge_ModuleInstanceListFunction');
  1001. pointer(WasmEdge_ModuleInstanceListTableLength):=GetProcAddress(hlib,'WasmEdge_ModuleInstanceListTableLength');
  1002. pointer(WasmEdge_ModuleInstanceListTable):=GetProcAddress(hlib,'WasmEdge_ModuleInstanceListTable');
  1003. pointer(WasmEdge_ModuleInstanceListMemoryLength):=GetProcAddress(hlib,'WasmEdge_ModuleInstanceListMemoryLength');
  1004. pointer(WasmEdge_ModuleInstanceListMemory):=GetProcAddress(hlib,'WasmEdge_ModuleInstanceListMemory');
  1005. pointer(WasmEdge_ModuleInstanceListGlobalLength):=GetProcAddress(hlib,'WasmEdge_ModuleInstanceListGlobalLength');
  1006. pointer(WasmEdge_ModuleInstanceListGlobal):=GetProcAddress(hlib,'WasmEdge_ModuleInstanceListGlobal');
  1007. pointer(WasmEdge_ModuleInstanceAddFunction):=GetProcAddress(hlib,'WasmEdge_ModuleInstanceAddFunction');
  1008. pointer(WasmEdge_ModuleInstanceAddTable):=GetProcAddress(hlib,'WasmEdge_ModuleInstanceAddTable');
  1009. pointer(WasmEdge_ModuleInstanceAddMemory):=GetProcAddress(hlib,'WasmEdge_ModuleInstanceAddMemory');
  1010. pointer(WasmEdge_ModuleInstanceAddGlobal):=GetProcAddress(hlib,'WasmEdge_ModuleInstanceAddGlobal');
  1011. pointer(WasmEdge_ModuleInstanceDelete):=GetProcAddress(hlib,'WasmEdge_ModuleInstanceDelete');
  1012. pointer(WasmEdge_FunctionInstanceCreate):=GetProcAddress(hlib,'WasmEdge_FunctionInstanceCreate');
  1013. pointer(WasmEdge_FunctionInstanceCreateBinding):=GetProcAddress(hlib,'WasmEdge_FunctionInstanceCreateBinding');
  1014. pointer(WasmEdge_FunctionInstanceGetFunctionType):=GetProcAddress(hlib,'WasmEdge_FunctionInstanceGetFunctionType');
  1015. pointer(WasmEdge_FunctionInstanceDelete):=GetProcAddress(hlib,'WasmEdge_FunctionInstanceDelete');
  1016. pointer(WasmEdge_TableInstanceCreate):=GetProcAddress(hlib,'WasmEdge_TableInstanceCreate');
  1017. pointer(WasmEdge_TableInstanceGetTableType):=GetProcAddress(hlib,'WasmEdge_TableInstanceGetTableType');
  1018. pointer(WasmEdge_TableInstanceGetData):=GetProcAddress(hlib,'WasmEdge_TableInstanceGetData');
  1019. pointer(WasmEdge_TableInstanceSetData):=GetProcAddress(hlib,'WasmEdge_TableInstanceSetData');
  1020. pointer(WasmEdge_TableInstanceGetSize):=GetProcAddress(hlib,'WasmEdge_TableInstanceGetSize');
  1021. pointer(WasmEdge_TableInstanceGrow):=GetProcAddress(hlib,'WasmEdge_TableInstanceGrow');
  1022. pointer(WasmEdge_TableInstanceDelete):=GetProcAddress(hlib,'WasmEdge_TableInstanceDelete');
  1023. pointer(WasmEdge_MemoryInstanceCreate):=GetProcAddress(hlib,'WasmEdge_MemoryInstanceCreate');
  1024. pointer(WasmEdge_MemoryInstanceGetMemoryType):=GetProcAddress(hlib,'WasmEdge_MemoryInstanceGetMemoryType');
  1025. pointer(WasmEdge_MemoryInstanceGetData):=GetProcAddress(hlib,'WasmEdge_MemoryInstanceGetData');
  1026. pointer(WasmEdge_MemoryInstanceSetData):=GetProcAddress(hlib,'WasmEdge_MemoryInstanceSetData');
  1027. pointer(WasmEdge_MemoryInstanceGetPointer):=GetProcAddress(hlib,'WasmEdge_MemoryInstanceGetPointer');
  1028. pointer(WasmEdge_MemoryInstanceGetPointerConst):=GetProcAddress(hlib,'WasmEdge_MemoryInstanceGetPointerConst');
  1029. pointer(WasmEdge_MemoryInstanceGetPageSize):=GetProcAddress(hlib,'WasmEdge_MemoryInstanceGetPageSize');
  1030. pointer(WasmEdge_MemoryInstanceGrowPage):=GetProcAddress(hlib,'WasmEdge_MemoryInstanceGrowPage');
  1031. pointer(WasmEdge_MemoryInstanceDelete):=GetProcAddress(hlib,'WasmEdge_MemoryInstanceDelete');
  1032. pointer(WasmEdge_GlobalInstanceCreate):=GetProcAddress(hlib,'WasmEdge_GlobalInstanceCreate');
  1033. pointer(WasmEdge_GlobalInstanceGetGlobalType):=GetProcAddress(hlib,'WasmEdge_GlobalInstanceGetGlobalType');
  1034. pointer(WasmEdge_GlobalInstanceGetValue):=GetProcAddress(hlib,'WasmEdge_GlobalInstanceGetValue');
  1035. pointer(WasmEdge_GlobalInstanceSetValue):=GetProcAddress(hlib,'WasmEdge_GlobalInstanceSetValue');
  1036. pointer(WasmEdge_GlobalInstanceDelete):=GetProcAddress(hlib,'WasmEdge_GlobalInstanceDelete');
  1037. pointer(WasmEdge_CallingFrameGetExecutor):=GetProcAddress(hlib,'WasmEdge_CallingFrameGetExecutor');
  1038. pointer(WasmEdge_CallingFrameGetModuleInstance):=GetProcAddress(hlib,'WasmEdge_CallingFrameGetModuleInstance');
  1039. pointer(WasmEdge_CallingFrameGetMemoryInstance):=GetProcAddress(hlib,'WasmEdge_CallingFrameGetMemoryInstance');
  1040. pointer(WasmEdge_AsyncWait):=GetProcAddress(hlib,'WasmEdge_AsyncWait');
  1041. pointer(WasmEdge_AsyncWaitFor):=GetProcAddress(hlib,'WasmEdge_AsyncWaitFor');
  1042. pointer(WasmEdge_AsyncCancel):=GetProcAddress(hlib,'WasmEdge_AsyncCancel');
  1043. pointer(WasmEdge_AsyncGetReturnsLength):=GetProcAddress(hlib,'WasmEdge_AsyncGetReturnsLength');
  1044. pointer(WasmEdge_AsyncGet):=GetProcAddress(hlib,'WasmEdge_AsyncGet');
  1045. pointer(WasmEdge_AsyncDelete):=GetProcAddress(hlib,'WasmEdge_AsyncDelete');
  1046. pointer(WasmEdge_VMCreate):=GetProcAddress(hlib,'WasmEdge_VMCreate');
  1047. pointer(WasmEdge_VMRegisterModuleFromFile):=GetProcAddress(hlib,'WasmEdge_VMRegisterModuleFromFile');
  1048. pointer(WasmEdge_VMRegisterModuleFromBuffer):=GetProcAddress(hlib,'WasmEdge_VMRegisterModuleFromBuffer');
  1049. pointer(WasmEdge_VMRegisterModuleFromASTModule):=GetProcAddress(hlib,'WasmEdge_VMRegisterModuleFromASTModule');
  1050. pointer(WasmEdge_VMRegisterModuleFromImport):=GetProcAddress(hlib,'WasmEdge_VMRegisterModuleFromImport');
  1051. pointer(WasmEdge_VMRunWasmFromFile):=GetProcAddress(hlib,'WasmEdge_VMRunWasmFromFile');
  1052. pointer(WasmEdge_VMRunWasmFromBuffer):=GetProcAddress(hlib,'WasmEdge_VMRunWasmFromBuffer');
  1053. pointer(WasmEdge_VMRunWasmFromASTModule):=GetProcAddress(hlib,'WasmEdge_VMRunWasmFromASTModule');
  1054. pointer(WasmEdge_VMAsyncRunWasmFromFile):=GetProcAddress(hlib,'WasmEdge_VMAsyncRunWasmFromFile');
  1055. pointer(WasmEdge_VMAsyncRunWasmFromBuffer):=GetProcAddress(hlib,'WasmEdge_VMAsyncRunWasmFromBuffer');
  1056. pointer(WasmEdge_VMAsyncRunWasmFromASTModule):=GetProcAddress(hlib,'WasmEdge_VMAsyncRunWasmFromASTModule');
  1057. pointer(WasmEdge_VMLoadWasmFromFile):=GetProcAddress(hlib,'WasmEdge_VMLoadWasmFromFile');
  1058. pointer(WasmEdge_VMLoadWasmFromBuffer):=GetProcAddress(hlib,'WasmEdge_VMLoadWasmFromBuffer');
  1059. pointer(WasmEdge_VMLoadWasmFromASTModule):=GetProcAddress(hlib,'WasmEdge_VMLoadWasmFromASTModule');
  1060. pointer(WasmEdge_VMValidate):=GetProcAddress(hlib,'WasmEdge_VMValidate');
  1061. pointer(WasmEdge_VMInstantiate):=GetProcAddress(hlib,'WasmEdge_VMInstantiate');
  1062. pointer(WasmEdge_VMExecute):=GetProcAddress(hlib,'WasmEdge_VMExecute');
  1063. pointer(WasmEdge_VMExecuteRegistered):=GetProcAddress(hlib,'WasmEdge_VMExecuteRegistered');
  1064. pointer(WasmEdge_VMAsyncExecute):=GetProcAddress(hlib,'WasmEdge_VMAsyncExecute');
  1065. pointer(WasmEdge_VMAsyncExecuteRegistered):=GetProcAddress(hlib,'WasmEdge_VMAsyncExecuteRegistered');
  1066. pointer(WasmEdge_VMGetFunctionType):=GetProcAddress(hlib,'WasmEdge_VMGetFunctionType');
  1067. pointer(WasmEdge_VMGetFunctionTypeRegistered):=GetProcAddress(hlib,'WasmEdge_VMGetFunctionTypeRegistered');
  1068. pointer(WasmEdge_VMCleanup):=GetProcAddress(hlib,'WasmEdge_VMCleanup');
  1069. pointer(WasmEdge_VMGetFunctionListLength):=GetProcAddress(hlib,'WasmEdge_VMGetFunctionListLength');
  1070. pointer(WasmEdge_VMGetFunctionList):=GetProcAddress(hlib,'WasmEdge_VMGetFunctionList');
  1071. pointer(WasmEdge_VMGetImportModuleContext):=GetProcAddress(hlib,'WasmEdge_VMGetImportModuleContext');
  1072. pointer(WasmEdge_VMGetActiveModule):=GetProcAddress(hlib,'WasmEdge_VMGetActiveModule');
  1073. pointer(WasmEdge_VMGetRegisteredModule):=GetProcAddress(hlib,'WasmEdge_VMGetRegisteredModule');
  1074. pointer(WasmEdge_VMListRegisteredModuleLength):=GetProcAddress(hlib,'WasmEdge_VMListRegisteredModuleLength');
  1075. pointer(WasmEdge_VMListRegisteredModule):=GetProcAddress(hlib,'WasmEdge_VMListRegisteredModule');
  1076. pointer(WasmEdge_VMGetStoreContext):=GetProcAddress(hlib,'WasmEdge_VMGetStoreContext');
  1077. pointer(WasmEdge_VMGetLoaderContext):=GetProcAddress(hlib,'WasmEdge_VMGetLoaderContext');
  1078. pointer(WasmEdge_VMGetValidatorContext):=GetProcAddress(hlib,'WasmEdge_VMGetValidatorContext');
  1079. pointer(WasmEdge_VMGetExecutorContext):=GetProcAddress(hlib,'WasmEdge_VMGetExecutorContext');
  1080. pointer(WasmEdge_VMGetStatisticsContext):=GetProcAddress(hlib,'WasmEdge_VMGetStatisticsContext');
  1081. pointer(WasmEdge_VMDelete):=GetProcAddress(hlib,'WasmEdge_VMDelete');
  1082. pointer(WasmEdge_Driver_Compiler):=GetProcAddress(hlib,'WasmEdge_Driver_Compiler');
  1083. pointer(WasmEdge_Driver_Tool):=GetProcAddress(hlib,'WasmEdge_Driver_Tool');
  1084. pointer(WasmEdge_Driver_UniTool):=GetProcAddress(hlib,'WasmEdge_Driver_UniTool');
  1085. pointer(WasmEdge_PluginLoadWithDefaultPaths):=GetProcAddress(hlib,'WasmEdge_PluginLoadWithDefaultPaths');
  1086. pointer(WasmEdge_PluginLoadFromPath):=GetProcAddress(hlib,'WasmEdge_PluginLoadFromPath');
  1087. pointer(WasmEdge_PluginListPluginsLength):=GetProcAddress(hlib,'WasmEdge_PluginListPluginsLength');
  1088. pointer(WasmEdge_PluginListPlugins):=GetProcAddress(hlib,'WasmEdge_PluginListPlugins');
  1089. pointer(WasmEdge_PluginFind):=GetProcAddress(hlib,'WasmEdge_PluginFind');
  1090. pointer(WasmEdge_PluginGetPluginName):=GetProcAddress(hlib,'WasmEdge_PluginGetPluginName');
  1091. pointer(WasmEdge_PluginListModuleLength):=GetProcAddress(hlib,'WasmEdge_PluginListModuleLength');
  1092. pointer(WasmEdge_PluginListModule):=GetProcAddress(hlib,'WasmEdge_PluginListModule');
  1093. pointer(WasmEdge_PluginCreateModule):=GetProcAddress(hlib,'WasmEdge_PluginCreateModule');
  1094. pointer(WasmEdge_Plugin_GetDescriptor):=GetProcAddress(hlib,'WasmEdge_Plugin_GetDescriptor');
  1095. pointer(WasmEdge_ExecutorExperimentalRegisterPreHostFunction):=GetProcAddress(hlib,'WasmEdge_ExecutorExperimentalRegisterPreHostFunction');
  1096. pointer(WasmEdge_ExecutorExperimentalRegisterPostHostFunction):=GetProcAddress(hlib,'WasmEdge_ExecutorExperimentalRegisterPostHostFunction');
  1097. end;
  1098. finalization
  1099. Freelibwasmedge;
  1100. end.