1
2
3
/* automatically generated by rust-bindgen 0.61.0 */

pub const true_ : u32 = 1 ; pub const false_ : u32 = 0 ; pub const __bool_true_false_are_defined : u32 = 1 ; pub const _STDINT_H : u32 = 1 ; pub const _FEATURES_H : u32 = 1 ; pub const _DEFAULT_SOURCE : u32 = 1 ; pub const __GLIBC_USE_ISOC2X : u32 = 0 ; pub const __USE_ISOC11 : u32 = 1 ; pub const __USE_ISOC99 : u32 = 1 ; pub const __USE_ISOC95 : u32 = 1 ; pub const __USE_POSIX_IMPLICITLY : u32 = 1 ; pub const _POSIX_SOURCE : u32 = 1 ; pub const _POSIX_C_SOURCE : u32 = 200809 ; pub const __USE_POSIX : u32 = 1 ; pub const __USE_POSIX2 : u32 = 1 ; pub const __USE_POSIX199309 : u32 = 1 ; pub const __USE_POSIX199506 : u32 = 1 ; pub const __USE_XOPEN2K : u32 = 1 ; pub const __USE_XOPEN2K8 : u32 = 1 ; pub const _ATFILE_SOURCE : u32 = 1 ; pub const __USE_MISC : u32 = 1 ; pub const __USE_ATFILE : u32 = 1 ; pub const __USE_FORTIFY_LEVEL : u32 = 0 ; pub const __GLIBC_USE_DEPRECATED_GETS : u32 = 0 ; pub const __GLIBC_USE_DEPRECATED_SCANF : u32 = 0 ; pub const _STDC_PREDEF_H : u32 = 1 ; pub const __STDC_IEC_559__ : u32 = 1 ; pub const __STDC_IEC_559_COMPLEX__ : u32 = 1 ; pub const __STDC_ISO_10646__ : u32 = 201706 ; pub const __GNU_LIBRARY__ : u32 = 6 ; pub const __GLIBC__ : u32 = 2 ; pub const __GLIBC_MINOR__ : u32 = 31 ; pub const _SYS_CDEFS_H : u32 = 1 ; pub const __glibc_c99_flexarr_available : u32 = 1 ; pub const __WORDSIZE : u32 = 64 ; pub const __WORDSIZE_TIME64_COMPAT32 : u32 = 1 ; pub const __SYSCALL_WORDSIZE : u32 = 64 ; pub const __LONG_DOUBLE_USES_FLOAT128 : u32 = 0 ; pub const __HAVE_GENERIC_SELECTION : u32 = 1 ; pub const __GLIBC_USE_LIB_EXT2 : u32 = 0 ; pub const __GLIBC_USE_IEC_60559_BFP_EXT : u32 = 0 ; pub const __GLIBC_USE_IEC_60559_BFP_EXT_C2X : u32 = 0 ; pub const __GLIBC_USE_IEC_60559_FUNCS_EXT : u32 = 0 ; pub const __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X : u32 = 0 ; pub const __GLIBC_USE_IEC_60559_TYPES_EXT : u32 = 0 ; pub const _BITS_TYPES_H : u32 = 1 ; pub const __TIMESIZE : u32 = 64 ; pub const _BITS_TYPESIZES_H : u32 = 1 ; pub const __OFF_T_MATCHES_OFF64_T : u32 = 1 ; pub const __INO_T_MATCHES_INO64_T : u32 = 1 ; pub const __RLIM_T_MATCHES_RLIM64_T : u32 = 1 ; pub const __STATFS_MATCHES_STATFS64 : u32 = 1 ; pub const __FD_SETSIZE : u32 = 1024 ; pub const _BITS_TIME64_H : u32 = 1 ; pub const _BITS_WCHAR_H : u32 = 1 ; pub const _BITS_STDINT_INTN_H : u32 = 1 ; pub const _BITS_STDINT_UINTN_H : u32 = 1 ; pub const INT8_MIN : i32 = - 128 ; pub const INT16_MIN : i32 = - 32768 ; pub const INT32_MIN : i32 = - 2147483648 ; pub const INT8_MAX : u32 = 127 ; pub const INT16_MAX : u32 = 32767 ; pub const INT32_MAX : u32 = 2147483647 ; pub const UINT8_MAX : u32 = 255 ; pub const UINT16_MAX : u32 = 65535 ; pub const UINT32_MAX : u32 = 4294967295 ; pub const INT_LEAST8_MIN : i32 = - 128 ; pub const INT_LEAST16_MIN : i32 = - 32768 ; pub const INT_LEAST32_MIN : i32 = - 2147483648 ; pub const INT_LEAST8_MAX : u32 = 127 ; pub const INT_LEAST16_MAX : u32 = 32767 ; pub const INT_LEAST32_MAX : u32 = 2147483647 ; pub const UINT_LEAST8_MAX : u32 = 255 ; pub const UINT_LEAST16_MAX : u32 = 65535 ; pub const UINT_LEAST32_MAX : u32 = 4294967295 ; pub const INT_FAST8_MIN : i32 = - 128 ; pub const INT_FAST16_MIN : i64 = - 9223372036854775808 ; pub const INT_FAST32_MIN : i64 = - 9223372036854775808 ; pub const INT_FAST8_MAX : u32 = 127 ; pub const INT_FAST16_MAX : u64 = 9223372036854775807 ; pub const INT_FAST32_MAX : u64 = 9223372036854775807 ; pub const UINT_FAST8_MAX : u32 = 255 ; pub const UINT_FAST16_MAX : i32 = - 1 ; pub const UINT_FAST32_MAX : i32 = - 1 ; pub const INTPTR_MIN : i64 = - 9223372036854775808 ; pub const INTPTR_MAX : u64 = 9223372036854775807 ; pub const UINTPTR_MAX : i32 = - 1 ; pub const PTRDIFF_MIN : i64 = - 9223372036854775808 ; pub const PTRDIFF_MAX : u64 = 9223372036854775807 ; pub const SIG_ATOMIC_MIN : i32 = - 2147483648 ; pub const SIG_ATOMIC_MAX : u32 = 2147483647 ; pub const SIZE_MAX : i32 = - 1 ; pub const WINT_MIN : u32 = 0 ; pub const WINT_MAX : u32 = 4294967295 ; pub const WASMEDGE_VERSION : & [u8 ; 17usize] = b"0.0.0-unreleased\0" ; pub const WASMEDGE_VERSION_MAJOR : u32 = 0 ; pub const WASMEDGE_VERSION_MINOR : u32 = 0 ; pub const WASMEDGE_VERSION_PATCH : u32 = 0 ; pub const WasmEdge_Plugin_CurrentAPIVersion : u32 = 2 ; pub type __u_char = :: std :: os :: raw :: c_uchar ; pub type __u_short = :: std :: os :: raw :: c_ushort ; pub type __u_int = :: std :: os :: raw :: c_uint ; pub type __u_long = :: std :: os :: raw :: c_ulong ; pub type __int8_t = :: std :: os :: raw :: c_schar ; pub type __uint8_t = :: std :: os :: raw :: c_uchar ; pub type __int16_t = :: std :: os :: raw :: c_short ; pub type __uint16_t = :: std :: os :: raw :: c_ushort ; pub type __int32_t = :: std :: os :: raw :: c_int ; pub type __uint32_t = :: std :: os :: raw :: c_uint ; pub type __int64_t = :: std :: os :: raw :: c_long ; pub type __uint64_t = :: std :: os :: raw :: c_ulong ; pub type __int_least8_t = __int8_t ; pub type __uint_least8_t = __uint8_t ; pub type __int_least16_t = __int16_t ; pub type __uint_least16_t = __uint16_t ; pub type __int_least32_t = __int32_t ; pub type __uint_least32_t = __uint32_t ; pub type __int_least64_t = __int64_t ; pub type __uint_least64_t = __uint64_t ; pub type __quad_t = :: std :: os :: raw :: c_long ; pub type __u_quad_t = :: std :: os :: raw :: c_ulong ; pub type __intmax_t = :: std :: os :: raw :: c_long ; pub type __uintmax_t = :: std :: os :: raw :: c_ulong ; pub type __dev_t = :: std :: os :: raw :: c_ulong ; pub type __uid_t = :: std :: os :: raw :: c_uint ; pub type __gid_t = :: std :: os :: raw :: c_uint ; pub type __ino_t = :: std :: os :: raw :: c_ulong ; pub type __ino64_t = :: std :: os :: raw :: c_ulong ; pub type __mode_t = :: std :: os :: raw :: c_uint ; pub type __nlink_t = :: std :: os :: raw :: c_ulong ; pub type __off_t = :: std :: os :: raw :: c_long ; pub type __off64_t = :: std :: os :: raw :: c_long ; pub type __pid_t = :: std :: os :: raw :: c_int ; # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct __fsid_t { pub __val : [:: std :: os :: raw :: c_int ; 2usize] , } # [test] fn bindgen_test_layout___fsid_t () { const UNINIT : :: std :: mem :: MaybeUninit < __fsid_t > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < __fsid_t > () , 8usize , concat ! ("Size of: " , stringify ! (__fsid_t))) ; assert_eq ! (:: std :: mem :: align_of :: < __fsid_t > () , 4usize , concat ! ("Alignment of " , stringify ! (__fsid_t))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . __val) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (__fsid_t) , "::" , stringify ! (__val))) ; } pub type __clock_t = :: std :: os :: raw :: c_long ; pub type __rlim_t = :: std :: os :: raw :: c_ulong ; pub type __rlim64_t = :: std :: os :: raw :: c_ulong ; pub type __id_t = :: std :: os :: raw :: c_uint ; pub type __time_t = :: std :: os :: raw :: c_long ; pub type __useconds_t = :: std :: os :: raw :: c_uint ; pub type __suseconds_t = :: std :: os :: raw :: c_long ; pub type __daddr_t = :: std :: os :: raw :: c_int ; pub type __key_t = :: std :: os :: raw :: c_int ; pub type __clockid_t = :: std :: os :: raw :: c_int ; pub type __timer_t = * mut :: std :: os :: raw :: c_void ; pub type __blksize_t = :: std :: os :: raw :: c_long ; pub type __blkcnt_t = :: std :: os :: raw :: c_long ; pub type __blkcnt64_t = :: std :: os :: raw :: c_long ; pub type __fsblkcnt_t = :: std :: os :: raw :: c_ulong ; pub type __fsblkcnt64_t = :: std :: os :: raw :: c_ulong ; pub type __fsfilcnt_t = :: std :: os :: raw :: c_ulong ; pub type __fsfilcnt64_t = :: std :: os :: raw :: c_ulong ; pub type __fsword_t = :: std :: os :: raw :: c_long ; pub type __ssize_t = :: std :: os :: raw :: c_long ; pub type __syscall_slong_t = :: std :: os :: raw :: c_long ; pub type __syscall_ulong_t = :: std :: os :: raw :: c_ulong ; pub type __loff_t = __off64_t ; pub type __caddr_t = * mut :: std :: os :: raw :: c_char ; pub type __intptr_t = :: std :: os :: raw :: c_long ; pub type __socklen_t = :: std :: os :: raw :: c_uint ; pub type __sig_atomic_t = :: std :: os :: raw :: c_int ; pub type int_least8_t = __int_least8_t ; pub type int_least16_t = __int_least16_t ; pub type int_least32_t = __int_least32_t ; pub type int_least64_t = __int_least64_t ; pub type uint_least8_t = __uint_least8_t ; pub type uint_least16_t = __uint_least16_t ; pub type uint_least32_t = __uint_least32_t ; pub type uint_least64_t = __uint_least64_t ; pub type int_fast8_t = :: std :: os :: raw :: c_schar ; pub type int_fast16_t = :: std :: os :: raw :: c_long ; pub type int_fast32_t = :: std :: os :: raw :: c_long ; pub type int_fast64_t = :: std :: os :: raw :: c_long ; pub type uint_fast8_t = :: std :: os :: raw :: c_uchar ; pub type uint_fast16_t = :: std :: os :: raw :: c_ulong ; pub type uint_fast32_t = :: std :: os :: raw :: c_ulong ; pub type uint_fast64_t = :: std :: os :: raw :: c_ulong ; pub type intmax_t = __intmax_t ; pub type uintmax_t = __uintmax_t ; pub const WasmEdge_Proposal_ImportExportMutGlobals : WasmEdge_Proposal = 0 ; pub const WasmEdge_Proposal_NonTrapFloatToIntConversions : WasmEdge_Proposal = 1 ; pub const WasmEdge_Proposal_SignExtensionOperators : WasmEdge_Proposal = 2 ; pub const WasmEdge_Proposal_MultiValue : WasmEdge_Proposal = 3 ; pub const WasmEdge_Proposal_BulkMemoryOperations : WasmEdge_Proposal = 4 ; pub const WasmEdge_Proposal_ReferenceTypes : WasmEdge_Proposal = 5 ; pub const WasmEdge_Proposal_SIMD : WasmEdge_Proposal = 6 ; pub const WasmEdge_Proposal_TailCall : WasmEdge_Proposal = 7 ; pub const WasmEdge_Proposal_MultiMemories : WasmEdge_Proposal = 8 ; pub const WasmEdge_Proposal_Annotations : WasmEdge_Proposal = 9 ; pub const WasmEdge_Proposal_Memory64 : WasmEdge_Proposal = 10 ; pub const WasmEdge_Proposal_ExceptionHandling : WasmEdge_Proposal = 11 ; pub const WasmEdge_Proposal_ExtendedConst : WasmEdge_Proposal = 12 ; pub const WasmEdge_Proposal_Threads : WasmEdge_Proposal = 13 ; pub const WasmEdge_Proposal_FunctionReferences : WasmEdge_Proposal = 14 ; # [doc = " WASM Proposal C enumeration."] pub type WasmEdge_Proposal = :: std :: os :: raw :: c_uint ; pub const WasmEdge_HostRegistration_Wasi : WasmEdge_HostRegistration = 0 ; # [doc = " Host Module Registration C enumeration."] pub type WasmEdge_HostRegistration = :: std :: os :: raw :: c_uint ; pub const WasmEdge_CompilerOptimizationLevel_O0 : WasmEdge_CompilerOptimizationLevel = 0 ; pub const WasmEdge_CompilerOptimizationLevel_O1 : WasmEdge_CompilerOptimizationLevel = 1 ; pub const WasmEdge_CompilerOptimizationLevel_O2 : WasmEdge_CompilerOptimizationLevel = 2 ; pub const WasmEdge_CompilerOptimizationLevel_O3 : WasmEdge_CompilerOptimizationLevel = 3 ; pub const WasmEdge_CompilerOptimizationLevel_Os : WasmEdge_CompilerOptimizationLevel = 4 ; pub const WasmEdge_CompilerOptimizationLevel_Oz : WasmEdge_CompilerOptimizationLevel = 5 ; # [doc = " AOT compiler optimization level C enumeration."] pub type WasmEdge_CompilerOptimizationLevel = :: std :: os :: raw :: c_uint ; pub const WasmEdge_CompilerOutputFormat_Native : WasmEdge_CompilerOutputFormat = 0 ; pub const WasmEdge_CompilerOutputFormat_Wasm : WasmEdge_CompilerOutputFormat = 1 ; # [doc = " AOT compiler output binary format C enumeration."] pub type WasmEdge_CompilerOutputFormat = :: std :: os :: raw :: c_uint ; pub const WasmEdge_ErrCategory_WASM : WasmEdge_ErrCategory = 0 ; pub const WasmEdge_ErrCategory_UserLevelError : WasmEdge_ErrCategory = 1 ; # [doc = " Error category C enumeration."] pub type WasmEdge_ErrCategory = :: std :: os :: raw :: c_uint ; pub const WasmEdge_ErrCode_Success : WasmEdge_ErrCode = 0 ; pub const WasmEdge_ErrCode_Terminated : WasmEdge_ErrCode = 1 ; pub const WasmEdge_ErrCode_RuntimeError : WasmEdge_ErrCode = 2 ; pub const WasmEdge_ErrCode_CostLimitExceeded : WasmEdge_ErrCode = 3 ; pub const WasmEdge_ErrCode_WrongVMWorkflow : WasmEdge_ErrCode = 4 ; pub const WasmEdge_ErrCode_FuncNotFound : WasmEdge_ErrCode = 5 ; pub const WasmEdge_ErrCode_AOTDisabled : WasmEdge_ErrCode = 6 ; pub const WasmEdge_ErrCode_Interrupted : WasmEdge_ErrCode = 7 ; pub const WasmEdge_ErrCode_NotValidated : WasmEdge_ErrCode = 8 ; pub const WasmEdge_ErrCode_UserDefError : WasmEdge_ErrCode = 9 ; pub const WasmEdge_ErrCode_IllegalPath : WasmEdge_ErrCode = 32 ; pub const WasmEdge_ErrCode_ReadError : WasmEdge_ErrCode = 33 ; pub const WasmEdge_ErrCode_UnexpectedEnd : WasmEdge_ErrCode = 34 ; pub const WasmEdge_ErrCode_MalformedMagic : WasmEdge_ErrCode = 35 ; pub const WasmEdge_ErrCode_MalformedVersion : WasmEdge_ErrCode = 36 ; pub const WasmEdge_ErrCode_MalformedSection : WasmEdge_ErrCode = 37 ; pub const WasmEdge_ErrCode_SectionSizeMismatch : WasmEdge_ErrCode = 38 ; pub const WasmEdge_ErrCode_LengthOutOfBounds : WasmEdge_ErrCode = 39 ; pub const WasmEdge_ErrCode_JunkSection : WasmEdge_ErrCode = 40 ; pub const WasmEdge_ErrCode_IncompatibleFuncCode : WasmEdge_ErrCode = 41 ; pub const WasmEdge_ErrCode_IncompatibleDataCount : WasmEdge_ErrCode = 42 ; pub const WasmEdge_ErrCode_DataCountRequired : WasmEdge_ErrCode = 43 ; pub const WasmEdge_ErrCode_MalformedImportKind : WasmEdge_ErrCode = 44 ; pub const WasmEdge_ErrCode_MalformedExportKind : WasmEdge_ErrCode = 45 ; pub const WasmEdge_ErrCode_ExpectedZeroByte : WasmEdge_ErrCode = 46 ; pub const WasmEdge_ErrCode_InvalidMut : WasmEdge_ErrCode = 47 ; pub const WasmEdge_ErrCode_TooManyLocals : WasmEdge_ErrCode = 48 ; pub const WasmEdge_ErrCode_MalformedValType : WasmEdge_ErrCode = 49 ; pub const WasmEdge_ErrCode_MalformedElemType : WasmEdge_ErrCode = 50 ; pub const WasmEdge_ErrCode_MalformedRefType : WasmEdge_ErrCode = 51 ; pub const WasmEdge_ErrCode_MalformedUTF8 : WasmEdge_ErrCode = 52 ; pub const WasmEdge_ErrCode_IntegerTooLarge : WasmEdge_ErrCode = 53 ; pub const WasmEdge_ErrCode_IntegerTooLong : WasmEdge_ErrCode = 54 ; pub const WasmEdge_ErrCode_IllegalOpCode : WasmEdge_ErrCode = 55 ; pub const WasmEdge_ErrCode_ENDCodeExpected : WasmEdge_ErrCode = 56 ; pub const WasmEdge_ErrCode_IllegalGrammar : WasmEdge_ErrCode = 57 ; pub const WasmEdge_ErrCode_SharedMemoryNoMax : WasmEdge_ErrCode = 58 ; pub const WasmEdge_ErrCode_IntrinsicsTableNotFound : WasmEdge_ErrCode = 59 ; pub const WasmEdge_ErrCode_InvalidAlignment : WasmEdge_ErrCode = 64 ; pub const WasmEdge_ErrCode_TypeCheckFailed : WasmEdge_ErrCode = 65 ; pub const WasmEdge_ErrCode_InvalidLabelIdx : WasmEdge_ErrCode = 66 ; pub const WasmEdge_ErrCode_InvalidLocalIdx : WasmEdge_ErrCode = 67 ; pub const WasmEdge_ErrCode_InvalidFuncTypeIdx : WasmEdge_ErrCode = 68 ; pub const WasmEdge_ErrCode_InvalidFuncIdx : WasmEdge_ErrCode = 69 ; pub const WasmEdge_ErrCode_InvalidTableIdx : WasmEdge_ErrCode = 70 ; pub const WasmEdge_ErrCode_InvalidMemoryIdx : WasmEdge_ErrCode = 71 ; pub const WasmEdge_ErrCode_InvalidGlobalIdx : WasmEdge_ErrCode = 72 ; pub const WasmEdge_ErrCode_InvalidElemIdx : WasmEdge_ErrCode = 73 ; pub const WasmEdge_ErrCode_InvalidDataIdx : WasmEdge_ErrCode = 74 ; pub const WasmEdge_ErrCode_InvalidRefIdx : WasmEdge_ErrCode = 75 ; pub const WasmEdge_ErrCode_ConstExprRequired : WasmEdge_ErrCode = 76 ; pub const WasmEdge_ErrCode_DupExportName : WasmEdge_ErrCode = 77 ; pub const WasmEdge_ErrCode_ImmutableGlobal : WasmEdge_ErrCode = 78 ; pub const WasmEdge_ErrCode_InvalidResultArity : WasmEdge_ErrCode = 79 ; pub const WasmEdge_ErrCode_MultiTables : WasmEdge_ErrCode = 80 ; pub const WasmEdge_ErrCode_MultiMemories : WasmEdge_ErrCode = 81 ; pub const WasmEdge_ErrCode_InvalidLimit : WasmEdge_ErrCode = 82 ; pub const WasmEdge_ErrCode_InvalidMemPages : WasmEdge_ErrCode = 83 ; pub const WasmEdge_ErrCode_InvalidStartFunc : WasmEdge_ErrCode = 84 ; pub const WasmEdge_ErrCode_InvalidLaneIdx : WasmEdge_ErrCode = 85 ; pub const WasmEdge_ErrCode_ModuleNameConflict : WasmEdge_ErrCode = 96 ; pub const WasmEdge_ErrCode_IncompatibleImportType : WasmEdge_ErrCode = 97 ; pub const WasmEdge_ErrCode_UnknownImport : WasmEdge_ErrCode = 98 ; pub const WasmEdge_ErrCode_DataSegDoesNotFit : WasmEdge_ErrCode = 99 ; pub const WasmEdge_ErrCode_ElemSegDoesNotFit : WasmEdge_ErrCode = 100 ; pub const WasmEdge_ErrCode_WrongInstanceAddress : WasmEdge_ErrCode = 128 ; pub const WasmEdge_ErrCode_WrongInstanceIndex : WasmEdge_ErrCode = 129 ; pub const WasmEdge_ErrCode_InstrTypeMismatch : WasmEdge_ErrCode = 130 ; pub const WasmEdge_ErrCode_FuncSigMismatch : WasmEdge_ErrCode = 131 ; pub const WasmEdge_ErrCode_DivideByZero : WasmEdge_ErrCode = 132 ; pub const WasmEdge_ErrCode_IntegerOverflow : WasmEdge_ErrCode = 133 ; pub const WasmEdge_ErrCode_InvalidConvToInt : WasmEdge_ErrCode = 134 ; pub const WasmEdge_ErrCode_TableOutOfBounds : WasmEdge_ErrCode = 135 ; pub const WasmEdge_ErrCode_MemoryOutOfBounds : WasmEdge_ErrCode = 136 ; pub const WasmEdge_ErrCode_Unreachable : WasmEdge_ErrCode = 137 ; pub const WasmEdge_ErrCode_UninitializedElement : WasmEdge_ErrCode = 138 ; pub const WasmEdge_ErrCode_UndefinedElement : WasmEdge_ErrCode = 139 ; pub const WasmEdge_ErrCode_IndirectCallTypeMismatch : WasmEdge_ErrCode = 140 ; pub const WasmEdge_ErrCode_HostFuncError : WasmEdge_ErrCode = 141 ; pub const WasmEdge_ErrCode_RefTypeMismatch : WasmEdge_ErrCode = 142 ; pub const WasmEdge_ErrCode_UnalignedAtomicAccess : WasmEdge_ErrCode = 143 ; pub const WasmEdge_ErrCode_ExpectSharedMemory : WasmEdge_ErrCode = 144 ; # [doc = " Error code C enumeration."] pub type WasmEdge_ErrCode = :: std :: os :: raw :: c_uint ; pub const WasmEdge_ValType_I32 : WasmEdge_ValType = 127 ; pub const WasmEdge_ValType_I64 : WasmEdge_ValType = 126 ; pub const WasmEdge_ValType_F32 : WasmEdge_ValType = 125 ; pub const WasmEdge_ValType_F64 : WasmEdge_ValType = 124 ; pub const WasmEdge_ValType_V128 : WasmEdge_ValType = 123 ; pub const WasmEdge_ValType_FuncRef : WasmEdge_ValType = 112 ; pub const WasmEdge_ValType_ExternRef : WasmEdge_ValType = 111 ; # [doc = " WASM Value type C enumeration."] pub type WasmEdge_ValType = :: std :: os :: raw :: c_uint ; pub const WasmEdge_NumType_I32 : WasmEdge_NumType = 127 ; pub const WasmEdge_NumType_I64 : WasmEdge_NumType = 126 ; pub const WasmEdge_NumType_F32 : WasmEdge_NumType = 125 ; pub const WasmEdge_NumType_F64 : WasmEdge_NumType = 124 ; pub const WasmEdge_NumType_V128 : WasmEdge_NumType = 123 ; # [doc = " WASM Number type C enumeration."] pub type WasmEdge_NumType = :: std :: os :: raw :: c_uint ; pub const WasmEdge_RefType_FuncRef : WasmEdge_RefType = 112 ; pub const WasmEdge_RefType_ExternRef : WasmEdge_RefType = 111 ; # [doc = " WASM Reference type C enumeration."] pub type WasmEdge_RefType = :: std :: os :: raw :: c_uint ; pub const WasmEdge_Mutability_Const : WasmEdge_Mutability = 0 ; pub const WasmEdge_Mutability_Var : WasmEdge_Mutability = 1 ; # [doc = " WASM Mutability C enumeration."] pub type WasmEdge_Mutability = :: std :: os :: raw :: c_uint ; pub const WasmEdge_ExternalType_Function : WasmEdge_ExternalType = 0 ; pub const WasmEdge_ExternalType_Table : WasmEdge_ExternalType = 1 ; pub const WasmEdge_ExternalType_Memory : WasmEdge_ExternalType = 2 ; pub const WasmEdge_ExternalType_Global : WasmEdge_ExternalType = 3 ; # [doc = " WASM External type C enumeration."] pub type WasmEdge_ExternalType = :: std :: os :: raw :: c_uint ; pub type uint128_t = u128 ; pub type int128_t = i128 ; # [doc = " WasmEdge WASM value struct."] # [repr (C)] # [repr (align (16))] # [derive (Debug , Copy , Clone)] pub struct WasmEdge_Value { pub Value : uint128_t , pub Type : WasmEdge_ValType , } # [test] fn bindgen_test_layout_WasmEdge_Value () { const UNINIT : :: std :: mem :: MaybeUninit < WasmEdge_Value > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < WasmEdge_Value > () , 32usize , concat ! ("Size of: " , stringify ! (WasmEdge_Value))) ; assert_eq ! (:: std :: mem :: align_of :: < WasmEdge_Value > () , 16usize , concat ! ("Alignment of " , stringify ! (WasmEdge_Value))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . Value) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (WasmEdge_Value) , "::" , stringify ! (Value))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . Type) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (WasmEdge_Value) , "::" , stringify ! (Type))) ; } # [doc = " WasmEdge string struct."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct WasmEdge_String { pub Length : u32 , pub Buf : * const :: std :: os :: raw :: c_char , } # [test] fn bindgen_test_layout_WasmEdge_String () { const UNINIT : :: std :: mem :: MaybeUninit < WasmEdge_String > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < WasmEdge_String > () , 16usize , concat ! ("Size of: " , stringify ! (WasmEdge_String))) ; assert_eq ! (:: std :: mem :: align_of :: < WasmEdge_String > () , 8usize , concat ! ("Alignment of " , stringify ! (WasmEdge_String))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . Length) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (WasmEdge_String) , "::" , stringify ! (Length))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . Buf) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (WasmEdge_String) , "::" , stringify ! (Buf))) ; } # [doc = " WasmEdge result struct."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct WasmEdge_Result { pub Code : u32 , } # [test] fn bindgen_test_layout_WasmEdge_Result () { const UNINIT : :: std :: mem :: MaybeUninit < WasmEdge_Result > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < WasmEdge_Result > () , 4usize , concat ! ("Size of: " , stringify ! (WasmEdge_Result))) ; assert_eq ! (:: std :: mem :: align_of :: < WasmEdge_Result > () , 4usize , concat ! ("Alignment of " , stringify ! (WasmEdge_Result))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . Code) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (WasmEdge_Result) , "::" , stringify ! (Code))) ; } # [doc = " Struct of WASM limit."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct WasmEdge_Limit { # [doc = " Boolean to describe has max value or not."] pub HasMax : bool , # [doc = " Boolean to describe is shared memory or not."] pub Shared : bool , # [doc = " Minimum value."] pub Min : u32 , # [doc = " Maximum value. Will be ignored if the `HasMax` is false."] pub Max : u32 , } # [test] fn bindgen_test_layout_WasmEdge_Limit () { const UNINIT : :: std :: mem :: MaybeUninit < WasmEdge_Limit > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < WasmEdge_Limit > () , 12usize , concat ! ("Size of: " , stringify ! (WasmEdge_Limit))) ; assert_eq ! (:: std :: mem :: align_of :: < WasmEdge_Limit > () , 4usize , concat ! ("Alignment of " , stringify ! (WasmEdge_Limit))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . HasMax) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (WasmEdge_Limit) , "::" , stringify ! (HasMax))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . Shared) as usize - ptr as usize } , 1usize , concat ! ("Offset of field: " , stringify ! (WasmEdge_Limit) , "::" , stringify ! (Shared))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . Min) as usize - ptr as usize } , 4usize , concat ! ("Offset of field: " , stringify ! (WasmEdge_Limit) , "::" , stringify ! (Min))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . Max) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (WasmEdge_Limit) , "::" , stringify ! (Max))) ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct WasmEdge_ConfigureContext { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct WasmEdge_StatisticsContext { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct WasmEdge_ASTModuleContext { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct WasmEdge_FunctionTypeContext { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct WasmEdge_MemoryTypeContext { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct WasmEdge_TableTypeContext { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct WasmEdge_GlobalTypeContext { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct WasmEdge_ImportTypeContext { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct WasmEdge_ExportTypeContext { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct WasmEdge_CompilerContext { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct WasmEdge_LoaderContext { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct WasmEdge_ValidatorContext { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct WasmEdge_ExecutorContext { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct WasmEdge_StoreContext { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct WasmEdge_ModuleInstanceContext { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct WasmEdge_FunctionInstanceContext { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct WasmEdge_TableInstanceContext { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct WasmEdge_MemoryInstanceContext { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct WasmEdge_GlobalInstanceContext { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct WasmEdge_CallingFrameContext { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct WasmEdge_Async { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct WasmEdge_VMContext { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct WasmEdge_PluginContext { _unused : [u8 ; 0] , } # [doc = " No option value."] pub const WasmEdge_ProgramOptionType_None : WasmEdge_ProgramOptionType = 0 ; # [doc = " Boolean value."] pub const WasmEdge_ProgramOptionType_Toggle : WasmEdge_ProgramOptionType = 1 ; # [doc = " Boolean value."] pub const WasmEdge_ProgramOptionType_Int8 : WasmEdge_ProgramOptionType = 2 ; # [doc = " Boolean value."] pub const WasmEdge_ProgramOptionType_Int16 : WasmEdge_ProgramOptionType = 3 ; # [doc = " Boolean value."] pub const WasmEdge_ProgramOptionType_Int32 : WasmEdge_ProgramOptionType = 4 ; # [doc = " Boolean value."] pub const WasmEdge_ProgramOptionType_Int64 : WasmEdge_ProgramOptionType = 5 ; # [doc = " Boolean value."] pub const WasmEdge_ProgramOptionType_UInt8 : WasmEdge_ProgramOptionType = 6 ; # [doc = " Boolean value."] pub const WasmEdge_ProgramOptionType_UInt16 : WasmEdge_ProgramOptionType = 7 ; # [doc = " Boolean value."] pub const WasmEdge_ProgramOptionType_UInt32 : WasmEdge_ProgramOptionType = 8 ; # [doc = " Boolean value."] pub const WasmEdge_ProgramOptionType_UInt64 : WasmEdge_ProgramOptionType = 9 ; # [doc = " Boolean value."] pub const WasmEdge_ProgramOptionType_Float : WasmEdge_ProgramOptionType = 10 ; # [doc = " Boolean value."] pub const WasmEdge_ProgramOptionType_Double : WasmEdge_ProgramOptionType = 11 ; # [doc = " WasmEdge_String."] pub const WasmEdge_ProgramOptionType_String : WasmEdge_ProgramOptionType = 12 ; # [doc = " Type of option value."] pub type WasmEdge_ProgramOptionType = :: std :: os :: raw :: c_uint ; # [doc = " Program option for plugins."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct WasmEdge_ProgramOption { pub Name : * const :: std :: os :: raw :: c_char , pub Description : * const :: std :: os :: raw :: c_char , pub Type : WasmEdge_ProgramOptionType , pub Storage : * mut :: std :: os :: raw :: c_void , pub DefaultValue : * const :: std :: os :: raw :: c_void , } # [test] fn bindgen_test_layout_WasmEdge_ProgramOption () { const UNINIT : :: std :: mem :: MaybeUninit < WasmEdge_ProgramOption > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < WasmEdge_ProgramOption > () , 40usize , concat ! ("Size of: " , stringify ! (WasmEdge_ProgramOption))) ; assert_eq ! (:: std :: mem :: align_of :: < WasmEdge_ProgramOption > () , 8usize , concat ! ("Alignment of " , stringify ! (WasmEdge_ProgramOption))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . Name) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (WasmEdge_ProgramOption) , "::" , stringify ! (Name))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . Description) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (WasmEdge_ProgramOption) , "::" , stringify ! (Description))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . Type) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (WasmEdge_ProgramOption) , "::" , stringify ! (Type))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . Storage) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (WasmEdge_ProgramOption) , "::" , stringify ! (Storage))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . DefaultValue) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (WasmEdge_ProgramOption) , "::" , stringify ! (DefaultValue))) ; } # [doc = " Module descriptor for plugins."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct WasmEdge_ModuleDescriptor { pub Name : * const :: std :: os :: raw :: c_char , pub Description : * const :: std :: os :: raw :: c_char , pub Create : :: std :: option :: Option < unsafe extern "C" fn (arg1 : * const WasmEdge_ModuleDescriptor) -> * mut WasmEdge_ModuleInstanceContext > , } # [test] fn bindgen_test_layout_WasmEdge_ModuleDescriptor () { const UNINIT : :: std :: mem :: MaybeUninit < WasmEdge_ModuleDescriptor > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < WasmEdge_ModuleDescriptor > () , 24usize , concat ! ("Size of: " , stringify ! (WasmEdge_ModuleDescriptor))) ; assert_eq ! (:: std :: mem :: align_of :: < WasmEdge_ModuleDescriptor > () , 8usize , concat ! ("Alignment of " , stringify ! (WasmEdge_ModuleDescriptor))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . Name) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (WasmEdge_ModuleDescriptor) , "::" , stringify ! (Name))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . Description) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (WasmEdge_ModuleDescriptor) , "::" , stringify ! (Description))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . Create) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (WasmEdge_ModuleDescriptor) , "::" , stringify ! (Create))) ; } # [doc = " Version data for plugins."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct WasmEdge_PluginVersionData { pub Major : u32 , pub Minor : u32 , pub Patch : u32 , pub Build : u32 , } # [test] fn bindgen_test_layout_WasmEdge_PluginVersionData () { const UNINIT : :: std :: mem :: MaybeUninit < WasmEdge_PluginVersionData > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < WasmEdge_PluginVersionData > () , 16usize , concat ! ("Size of: " , stringify ! (WasmEdge_PluginVersionData))) ; assert_eq ! (:: std :: mem :: align_of :: < WasmEdge_PluginVersionData > () , 4usize , concat ! ("Alignment of " , stringify ! (WasmEdge_PluginVersionData))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . Major) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (WasmEdge_PluginVersionData) , "::" , stringify ! (Major))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . Minor) as usize - ptr as usize } , 4usize , concat ! ("Offset of field: " , stringify ! (WasmEdge_PluginVersionData) , "::" , stringify ! (Minor))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . Patch) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (WasmEdge_PluginVersionData) , "::" , stringify ! (Patch))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . Build) as usize - ptr as usize } , 12usize , concat ! ("Offset of field: " , stringify ! (WasmEdge_PluginVersionData) , "::" , stringify ! (Build))) ; } # [doc = " Plugin descriptor for plugins."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct WasmEdge_PluginDescriptor { pub Name : * const :: std :: os :: raw :: c_char , pub Description : * const :: std :: os :: raw :: c_char , pub APIVersion : u32 , pub Version : WasmEdge_PluginVersionData , pub ModuleCount : u32 , pub ProgramOptionCount : u32 , pub ModuleDescriptions : * mut WasmEdge_ModuleDescriptor , pub ProgramOptions : * mut WasmEdge_ProgramOption , } # [test] fn bindgen_test_layout_WasmEdge_PluginDescriptor () { const UNINIT : :: std :: mem :: MaybeUninit < WasmEdge_PluginDescriptor > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < WasmEdge_PluginDescriptor > () , 64usize , concat ! ("Size of: " , stringify ! (WasmEdge_PluginDescriptor))) ; assert_eq ! (:: std :: mem :: align_of :: < WasmEdge_PluginDescriptor > () , 8usize , concat ! ("Alignment of " , stringify ! (WasmEdge_PluginDescriptor))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . Name) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (WasmEdge_PluginDescriptor) , "::" , stringify ! (Name))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . Description) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (WasmEdge_PluginDescriptor) , "::" , stringify ! (Description))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . APIVersion) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (WasmEdge_PluginDescriptor) , "::" , stringify ! (APIVersion))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . Version) as usize - ptr as usize } , 20usize , concat ! ("Offset of field: " , stringify ! (WasmEdge_PluginDescriptor) , "::" , stringify ! (Version))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ModuleCount) as usize - ptr as usize } , 36usize , concat ! ("Offset of field: " , stringify ! (WasmEdge_PluginDescriptor) , "::" , stringify ! (ModuleCount))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ProgramOptionCount) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (WasmEdge_PluginDescriptor) , "::" , stringify ! (ProgramOptionCount))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ModuleDescriptions) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (WasmEdge_PluginDescriptor) , "::" , stringify ! (ModuleDescriptions))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ProgramOptions) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (WasmEdge_PluginDescriptor) , "::" , stringify ! (ProgramOptions))) ; } extern "C" { # [doc = " Get the version string of the WasmEdge C API."] # [doc = ""] # [doc = " The returned string must __NOT__ be destroyed."] # [doc = ""] # [doc = " \\returns NULL-terminated C string of version."] pub fn WasmEdge_VersionGet () -> * const :: std :: os :: raw :: c_char ; } extern "C" { # [doc = " Get the major version value of the WasmEdge C API."] # [doc = ""] # [doc = " \\returns Value of the major version."] pub fn WasmEdge_VersionGetMajor () -> u32 ; } extern "C" { # [doc = " Get the minor version value of the WasmEdge C API."] # [doc = ""] # [doc = " \\returns Value of the minor version."] pub fn WasmEdge_VersionGetMinor () -> u32 ; } extern "C" { # [doc = " Get the patch version value of the WasmEdge C API."] # [doc = ""] # [doc = " \\returns Value of the patch version."] pub fn WasmEdge_VersionGetPatch () -> u32 ; } extern "C" { # [doc = " Set the logging system to filter to error level."] pub fn WasmEdge_LogSetErrorLevel () ; } extern "C" { # [doc = " Set the logging system to filter to debug level."] pub fn WasmEdge_LogSetDebugLevel () ; } extern "C" { # [doc = " Set the logging system off."] pub fn WasmEdge_LogOff () ; } extern "C" { # [doc = " Generate the I32 WASM value."] # [doc = ""] # [doc = " \\param Val the I32 value."] # [doc = ""] # [doc = " \\returns WasmEdge_Value struct with the I32 value."] pub fn WasmEdge_ValueGenI32 (Val : i32) -> WasmEdge_Value ; } extern "C" { # [doc = " Generate the I64 WASM value."] # [doc = ""] # [doc = " \\param Val the I64 value."] # [doc = ""] # [doc = " \\returns WasmEdge_Value struct with the I64 value."] pub fn WasmEdge_ValueGenI64 (Val : i64) -> WasmEdge_Value ; } extern "C" { # [doc = " Generate the F32 WASM value."] # [doc = ""] # [doc = " \\param Val the F32 value."] # [doc = ""] # [doc = " \\returns WasmEdge_Value struct with the F32 value."] pub fn WasmEdge_ValueGenF32 (Val : f32) -> WasmEdge_Value ; } extern "C" { # [doc = " Generate the F64 WASM value."] # [doc = ""] # [doc = " \\param Val the F64 value."] # [doc = ""] # [doc = " \\returns WasmEdge_Value struct with the F64 value."] pub fn WasmEdge_ValueGenF64 (Val : f64) -> WasmEdge_Value ; } extern "C" { # [doc = " Generate the V128 WASM value."] # [doc = ""] # [doc = " \\param Val the V128 value."] # [doc = ""] # [doc = " \\returns WasmEdge_Value struct with the V128 value."] pub fn WasmEdge_ValueGenV128 (Val : int128_t) -> WasmEdge_Value ; } extern "C" { # [doc = " Generate the NULL reference WASM value."] # [doc = ""] # [doc = " The values generated by this function are only meaningful when the"] # [doc = " `WasmEdge_Proposal_BulkMemoryOperations` or the"] # [doc = " `WasmEdge_Proposal_ReferenceTypes` turns on in configuration."] # [doc = ""] # [doc = " \\param T the reference type."] # [doc = ""] # [doc = " \\returns WasmEdge_Value struct with the NULL reference."] pub fn WasmEdge_ValueGenNullRef (T : WasmEdge_RefType) -> WasmEdge_Value ; } extern "C" { # [doc = " Generate the function reference WASM value."] # [doc = ""] # [doc = " The values generated by this function are only meaningful when the"] # [doc = " `WasmEdge_Proposal_BulkMemoryOperations` or the"] # [doc = " `WasmEdge_Proposal_ReferenceTypes` turns on in configuration."] # [doc = ""] # [doc = " \\param Cxt the function instance context to convert to the reference."] # [doc = ""] # [doc = " \\returns WasmEdge_Value struct with the function reference."] pub fn WasmEdge_ValueGenFuncRef (Cxt : * const WasmEdge_FunctionInstanceContext) -> WasmEdge_Value ; } extern "C" { # [doc = " Generate the function reference WASM value."] # [doc = ""] # [doc = " The values generated by this function are only meaningful when the"] # [doc = " `WasmEdge_Proposal_ReferenceTypes` turns on in configuration."] # [doc = ""] # [doc = " \\param Ref the reference to the external object."] # [doc = ""] # [doc = " \\returns WasmEdge_Value struct with the external reference."] pub fn WasmEdge_ValueGenExternRef (Ref : * mut :: std :: os :: raw :: c_void) -> WasmEdge_Value ; } extern "C" { # [doc = " Retrieve the I32 value from the WASM value."] # [doc = ""] # [doc = " \\param Val the WasmEdge_Value struct."] # [doc = ""] # [doc = " \\returns I32 value in the input struct."] pub fn WasmEdge_ValueGetI32 (Val : WasmEdge_Value) -> i32 ; } extern "C" { # [doc = " Retrieve the I64 value from the WASM value."] # [doc = ""] # [doc = " \\param Val the WasmEdge_Value struct."] # [doc = ""] # [doc = " \\returns I64 value in the input struct."] pub fn WasmEdge_ValueGetI64 (Val : WasmEdge_Value) -> i64 ; } extern "C" { # [doc = " Retrieve the F32 value from the WASM value."] # [doc = ""] # [doc = " \\param Val the WasmEdge_Value struct."] # [doc = ""] # [doc = " \\returns F32 value in the input struct."] pub fn WasmEdge_ValueGetF32 (Val : WasmEdge_Value) -> f32 ; } extern "C" { # [doc = " Retrieve the F64 value from the WASM value."] # [doc = ""] # [doc = " \\param Val the WasmEdge_Value struct."] # [doc = ""] # [doc = " \\returns F64 value in the input struct."] pub fn WasmEdge_ValueGetF64 (Val : WasmEdge_Value) -> f64 ; } extern "C" { # [doc = " Retrieve the V128 value from the WASM value."] # [doc = ""] # [doc = " \\param Val the WasmEdge_Value struct."] # [doc = ""] # [doc = " \\returns V128 value in the input struct."] pub fn WasmEdge_ValueGetV128 (Val : WasmEdge_Value) -> int128_t ; } extern "C" { # [doc = " Specify the WASM value is a null reference or not."] # [doc = ""] # [doc = " \\param Val the WasmEdge_Value struct."] # [doc = ""] # [doc = " \\returns true if the value is a null reference, false if not."] pub fn WasmEdge_ValueIsNullRef (Val : WasmEdge_Value) -> bool ; } extern "C" { # [doc = " Retrieve the function instance context from the WASM value."] # [doc = ""] # [doc = " \\param Val the WasmEdge_Value struct."] # [doc = ""] # [doc = " \\returns pointer to function instance context in the input struct."] pub fn WasmEdge_ValueGetFuncRef (Val : WasmEdge_Value) -> * const WasmEdge_FunctionInstanceContext ; } extern "C" { # [doc = " Retrieve the external reference from the WASM value."] # [doc = ""] # [doc = " \\param Val the WasmEdge_Value struct."] # [doc = ""] # [doc = " \\returns external reference in the input struct."] pub fn WasmEdge_ValueGetExternRef (Val : WasmEdge_Value) -> * mut :: std :: os :: raw :: c_void ; } extern "C" { # [doc = " Creation of the WasmEdge_String with the C string."] # [doc = ""] # [doc = " The caller owns the object and should call `WasmEdge_StringDelete` to"] # [doc = " destroy it. This function only supports the C string with NULL termination."] # [doc = " If the input string may have `\\0` character, please use the"] # [doc = " `WasmEdge_StringCreateByBuffer` instead."] # [doc = ""] # [doc = " \\param Str the NULL-terminated C string to copy into the WasmEdge_String"] # [doc = " object."] # [doc = ""] # [doc = " \\returns string object. Length will be 0 and Buf will be NULL if failed or"] # [doc = " the input string is a NULL."] pub fn WasmEdge_StringCreateByCString (Str : * const :: std :: os :: raw :: c_char) -> WasmEdge_String ; } extern "C" { # [doc = " Creation of the WasmEdge_String with the buffer and its length."] # [doc = ""] # [doc = " The caller owns the object and should call `WasmEdge_StringDelete` to"] # [doc = " destroy it."] # [doc = ""] # [doc = " \\param Buf the buffer to copy into the WasmEdge_String object."] # [doc = " \\param Len the buffer length."] # [doc = ""] # [doc = " \\returns string object. Length will be 0 and Buf will be NULL if failed or"] # [doc = " the input buffer is a NULL."] pub fn WasmEdge_StringCreateByBuffer (Buf : * const :: std :: os :: raw :: c_char , Len : u32) -> WasmEdge_String ; } extern "C" { # [doc = " Create the WasmEdge_String wraps to the buffer."] # [doc = ""] # [doc = " This function creates a `WasmEdge_String` object which wraps to the input"] # [doc = " buffer. The caller should guarantee the life cycle of the input buffer, and"] # [doc = " should __NOT__ call the `WasmEdge_StringDelete`."] # [doc = ""] # [doc = " \\param Buf the buffer to copy into the WasmEdge_String object."] # [doc = " \\param Len the buffer length."] # [doc = ""] # [doc = " \\returns string object refer to the input buffer with its length."] pub fn WasmEdge_StringWrap (Buf : * const :: std :: os :: raw :: c_char , Len : u32) -> WasmEdge_String ; } extern "C" { # [doc = " Compare the two WasmEdge_String objects."] # [doc = ""] # [doc = " \\param Str1 the first WasmEdge_String object to compare."] # [doc = " \\param Str2 the second WasmEdge_String object to compare."] # [doc = ""] # [doc = " \\returns true if the content of two WasmEdge_String objects are the same,"] # [doc = " false if not."] pub fn WasmEdge_StringIsEqual (Str1 : WasmEdge_String , Str2 : WasmEdge_String) -> bool ; } extern "C" { # [doc = " Copy the content of WasmEdge_String object to the buffer."] # [doc = ""] # [doc = " This function copy at most `Len` characters from the `WasmEdge_String`"] # [doc = " object to the destination buffer. If the string length is less than `Len`"] # [doc = " characters long, the remainder of the buffer is filled with `\\0' characters."] # [doc = " Otherwise, the destination is not terminated."] # [doc = ""] # [doc = " \\param Str the source WasmEdge_String object to copy."] # [doc = " \\param Buf the buffer to fill the string content."] # [doc = " \\param Len the buffer length."] # [doc = ""] # [doc = " \\returns the copied length of string."] pub fn WasmEdge_StringCopy (Str : WasmEdge_String , Buf : * mut :: std :: os :: raw :: c_char , Len : u32) -> u32 ; } extern "C" { # [doc = " Deletion of the WasmEdge_String."] # [doc = ""] # [doc = " After calling this function, the resources in the WasmEdge_String object"] # [doc = " will be released and the object should __NOT__ be used."] # [doc = ""] # [doc = " \\param Str the WasmEdge_String object to destroy."] pub fn WasmEdge_StringDelete (Str : WasmEdge_String) ; } extern "C" { # [doc = " Check the result is a success or not."] # [doc = ""] # [doc = " \\param Res the WasmEdge_Result struct."] # [doc = ""] # [doc = " \\returns true if the error code is WasmEdge_Result_Success or"] # [doc = " WasmEdge_Result_Terminate, false for others."] pub fn WasmEdge_ResultOK (Res : WasmEdge_Result) -> bool ; } extern "C" { # [doc = " Generate the result with code."] # [doc = ""] # [doc = " \\param Category the WasmEdge_ErrCategory to specify the error category."] # [doc = " \\param Code the 24-bit length error code. The data exceeds 24 bits will be"] # [doc = " stripped."] # [doc = ""] # [doc = " \\returns WasmEdge_Result struct with the given data."] pub fn WasmEdge_ResultGen (Category : WasmEdge_ErrCategory , Code : u32) -> WasmEdge_Result ; } extern "C" { # [doc = " Get the result code."] # [doc = ""] # [doc = " \\param Res the WasmEdge_Result struct."] # [doc = ""] # [doc = " \\returns result code (24-bit size data) in the WasmEdge_Result struct."] pub fn WasmEdge_ResultGetCode (Res : WasmEdge_Result) -> u32 ; } extern "C" { # [doc = " Get the error category."] # [doc = ""] # [doc = " \\param Res the WasmEdge_Result struct."] # [doc = ""] # [doc = " \\returns error category in the WasmEdge_Result struct."] pub fn WasmEdge_ResultGetCategory (Res : WasmEdge_Result) -> WasmEdge_ErrCategory ; } extern "C" { # [doc = " Get the result message."] # [doc = ""] # [doc = " The returned string must __NOT__ be destroyed."] # [doc = " If the error category of the result is __NOT__ `WasmEdge_ErrCategory_WASM`,"] # [doc = " the message will always be \"user defined error code\"."] # [doc = ""] # [doc = " \\param Res the WasmEdge_Result struct."] # [doc = ""] # [doc = " \\returns NULL-terminated C string of the corresponding error message."] pub fn WasmEdge_ResultGetMessage (Res : WasmEdge_Result) -> * const :: std :: os :: raw :: c_char ; } extern "C" { # [doc = " Compare the two WasmEdge_Limit objects."] # [doc = ""] # [doc = " \\param Lim1 the first WasmEdge_Limit object to compare."] # [doc = " \\param Lim2 the second WasmEdge_Limit object to compare."] # [doc = ""] # [doc = " \\returns true if the content of two WasmEdge_Limit objects are the same,"] # [doc = " false if not."] pub fn WasmEdge_LimitIsEqual (Lim1 : WasmEdge_Limit , Lim2 : WasmEdge_Limit) -> bool ; } extern "C" { # [doc = " Creation of the WasmEdge_ConfigureContext."] # [doc = ""] # [doc = " The caller owns the object and should call `WasmEdge_ConfigureDelete` to"] # [doc = " destroy it."] # [doc = ""] # [doc = " \\returns pointer to the context, NULL if failed."] pub fn WasmEdge_ConfigureCreate () -> * mut WasmEdge_ConfigureContext ; } extern "C" { # [doc = " Add a proposal setting into the WasmEdge_ConfigureContext."] # [doc = ""] # [doc = " For turning on a specific WASM proposal in WasmEdge_VMContext, you can set"] # [doc = " the proposal value into the WasmEdge_ConfigureContext and create VM with"] # [doc = " this context."] # [doc = " ```c"] # [doc = " WasmEdge_ConfigureContext *Conf = WasmEdge_ConfigureCreate();"] # [doc = " WasmEdge_ConfigureAddProposal(Conf, WasmEdge_Proposal_BulkMemoryOperations);"] # [doc = " WasmEdge_ConfigureAddProposal(Conf, WasmEdge_Proposal_ReferenceTypes);"] # [doc = " WasmEdge_ConfigureAddProposal(Conf, WasmEdge_Proposal_SIMD);"] # [doc = " WasmEdge_VMContext *VM = WasmEdge_VMCreate(Conf, NULL);"] # [doc = " ```"] # [doc = ""] # [doc = " This function is thread-safe."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_ConfigureContext to add the proposal value."] # [doc = " \\param Prop the proposal value."] pub fn WasmEdge_ConfigureAddProposal (Cxt : * mut WasmEdge_ConfigureContext , Prop : WasmEdge_Proposal) ; } extern "C" { # [doc = " Remove a proposal setting in the WasmEdge_ConfigureContext."] # [doc = ""] # [doc = " This function is thread-safe."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_ConfigureContext to remove the proposal."] # [doc = " \\param Prop the proposal value."] pub fn WasmEdge_ConfigureRemoveProposal (Cxt : * mut WasmEdge_ConfigureContext , Prop : WasmEdge_Proposal) ; } extern "C" { # [doc = " Check if a proposal setting exists in the WasmEdge_ConfigureContext or not."] # [doc = ""] # [doc = " This function is thread-safe."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_ConfigureContext to check the proposal value."] # [doc = " \\param Prop the proposal value."] # [doc = ""] # [doc = " \\returns true if the proposal setting exists, false if not."] pub fn WasmEdge_ConfigureHasProposal (Cxt : * const WasmEdge_ConfigureContext , Prop : WasmEdge_Proposal) -> bool ; } extern "C" { # [doc = " Add a built-in host registration setting into WasmEdge_ConfigureContext."] # [doc = ""] # [doc = " For turning on the Wasi support in `WasmEdge_VMContext`, you can set the"] # [doc = " built-in host registration value into the `WasmEdge_ConfigureContext` and"] # [doc = " create VM with this context."] # [doc = " ```c"] # [doc = " WasmEdge_ConfigureContext *Conf = WasmEdge_ConfigureCreate();"] # [doc = " WasmEdge_ConfigureAddHostRegistration(Conf, WasmEdge_HostRegistration_Wasi);"] # [doc = " WasmEdge_VMContext *VM = WasmEdge_VMCreate(Conf, NULL);"] # [doc = " ```"] # [doc = ""] # [doc = " This function is thread-safe."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_ConfigureContext to add built-in host registration."] # [doc = " \\param Host the built-in host registration value."] pub fn WasmEdge_ConfigureAddHostRegistration (Cxt : * mut WasmEdge_ConfigureContext , Host : WasmEdge_HostRegistration) ; } extern "C" { # [doc = " Remove a built-in host registration setting in the"] # [doc = " WasmEdge_ConfigureContext."] # [doc = ""] # [doc = " This function is thread-safe."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_ConfigureContext to remove the host"] # [doc = " pre-registration."] # [doc = " \\param Host the built-in host registration value."] pub fn WasmEdge_ConfigureRemoveHostRegistration (Cxt : * mut WasmEdge_ConfigureContext , Host : WasmEdge_HostRegistration) ; } extern "C" { # [doc = " Check if a built-in host registration setting exists in the"] # [doc = " WasmEdge_ConfigureContext or not."] # [doc = ""] # [doc = " This function is thread-safe."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_ConfigureContext to check the host pre-registration."] # [doc = " \\param Host the built-in host registration value."] # [doc = ""] # [doc = " \\returns true if the built-in host registration setting exists, false if"] # [doc = " not."] pub fn WasmEdge_ConfigureHasHostRegistration (Cxt : * const WasmEdge_ConfigureContext , Host : WasmEdge_HostRegistration) -> bool ; } extern "C" { # [doc = " Set the page limit of memory instances."] # [doc = ""] # [doc = " Limit the page count (64KiB per page) in memory instances."] # [doc = ""] # [doc = " This function is thread-safe."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_ConfigureContext to set the maximum page count."] # [doc = " \\param Page the maximum page count."] pub fn WasmEdge_ConfigureSetMaxMemoryPage (Cxt : * mut WasmEdge_ConfigureContext , Page : u32) ; } extern "C" { # [doc = " Get the page limit of memory instances."] # [doc = ""] # [doc = " This function is thread-safe."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_ConfigureContext to get the maximum page count"] # [doc = " setting."] # [doc = ""] # [doc = " \\returns the page count limitation value."] pub fn WasmEdge_ConfigureGetMaxMemoryPage (Cxt : * const WasmEdge_ConfigureContext) -> u32 ; } extern "C" { # [doc = " Set the force interpreter mode execution option."] # [doc = ""] # [doc = " This function is thread-safe."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_ConfigureContext to set the boolean value."] # [doc = " \\param isForceInterpreter the boolean value to determine to forcibly run"] # [doc = " WASM in interpreter mode or not."] pub fn WasmEdge_ConfigureSetForceInterpreter (Cxt : * mut WasmEdge_ConfigureContext , isForceInterpreter : bool) ; } extern "C" { # [doc = " Get the force interpreter mode execution option."] # [doc = ""] # [doc = " This function is thread-safe."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_ConfigureContext to get the boolean value."] # [doc = ""] # [doc = " \\returns the boolean value to determine to forcibly run WASM in interpreter"] # [doc = " mode or not."] pub fn WasmEdge_ConfigureIsForceInterpreter (Cxt : * const WasmEdge_ConfigureContext) -> bool ; } extern "C" { # [doc = " Set the optimization level of AOT compiler."] # [doc = ""] # [doc = " This function is thread-safe."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_ConfigureContext to set the optimization level."] # [doc = " \\param Level the AOT compiler optimization level."] pub fn WasmEdge_ConfigureCompilerSetOptimizationLevel (Cxt : * mut WasmEdge_ConfigureContext , Level : WasmEdge_CompilerOptimizationLevel) ; } extern "C" { # [doc = " Get the optimization level of AOT compiler."] # [doc = ""] # [doc = " This function is thread-safe."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_ConfigureContext to get the optimization level."] # [doc = ""] # [doc = " \\returns the AOT compiler optimization level."] pub fn WasmEdge_ConfigureCompilerGetOptimizationLevel (Cxt : * const WasmEdge_ConfigureContext) -> WasmEdge_CompilerOptimizationLevel ; } extern "C" { # [doc = " Set the output binary format of AOT compiler."] # [doc = ""] # [doc = " This function is thread-safe."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_ConfigureContext to set the output binary format."] # [doc = " \\param Format the AOT compiler output binary format."] pub fn WasmEdge_ConfigureCompilerSetOutputFormat (Cxt : * mut WasmEdge_ConfigureContext , Format : WasmEdge_CompilerOutputFormat) ; } extern "C" { # [doc = " Get the output binary format of AOT compiler."] # [doc = ""] # [doc = " This function is thread-safe."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_ConfigureContext to get the output binary format."] # [doc = ""] # [doc = " \\returns the AOT compiler output binary format."] pub fn WasmEdge_ConfigureCompilerGetOutputFormat (Cxt : * const WasmEdge_ConfigureContext) -> WasmEdge_CompilerOutputFormat ; } extern "C" { # [doc = " Set the dump IR option of AOT compiler."] # [doc = ""] # [doc = " This function is thread-safe."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_ConfigureContext to set the boolean value."] # [doc = " \\param IsDump the boolean value to determine to dump IR or not when"] # [doc = " compilation in AOT compiler."] pub fn WasmEdge_ConfigureCompilerSetDumpIR (Cxt : * mut WasmEdge_ConfigureContext , IsDump : bool) ; } extern "C" { # [doc = " Get the dump IR option of AOT compiler."] # [doc = ""] # [doc = " This function is thread-safe."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_ConfigureContext to get the boolean value."] # [doc = ""] # [doc = " \\returns the boolean value to determine to dump IR or not when compilation"] # [doc = " in AOT compiler."] pub fn WasmEdge_ConfigureCompilerIsDumpIR (Cxt : * const WasmEdge_ConfigureContext) -> bool ; } extern "C" { # [doc = " Set the generic binary option of AOT compiler."] # [doc = ""] # [doc = " This function is thread-safe."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_ConfigureContext to set the boolean value."] # [doc = " \\param IsGeneric the boolean value to determine to generate the generic"] # [doc = " binary or not when compilation in AOT compiler."] pub fn WasmEdge_ConfigureCompilerSetGenericBinary (Cxt : * mut WasmEdge_ConfigureContext , IsGeneric : bool) ; } extern "C" { # [doc = " Get the generic binary option of AOT compiler."] # [doc = ""] # [doc = " This function is thread-safe."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_ConfigureContext to get the boolean value."] # [doc = ""] # [doc = " \\returns the boolean value to determine to generate the generic binary or"] # [doc = " not when compilation in AOT compiler."] pub fn WasmEdge_ConfigureCompilerIsGenericBinary (Cxt : * const WasmEdge_ConfigureContext) -> bool ; } extern "C" { # [doc = " Set the interruptible option of AOT compiler."] # [doc = ""] # [doc = " This function is thread-safe."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_ConfigureContext to set the boolean value."] # [doc = " \\param IsInterruptible the boolean value to determine to generate"] # [doc = " interruptible binary or not when compilation in AOT compiler."] pub fn WasmEdge_ConfigureCompilerSetInterruptible (Cxt : * mut WasmEdge_ConfigureContext , IsInterruptible : bool) ; } extern "C" { # [doc = " Get the interruptible option of AOT compiler."] # [doc = ""] # [doc = " This function is thread-safe."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_ConfigureContext to get the boolean value."] # [doc = ""] # [doc = " \\returns the boolean value to determine to generate interruptible binary or"] # [doc = " not when compilation in AOT compiler."] pub fn WasmEdge_ConfigureCompilerIsInterruptible (Cxt : * const WasmEdge_ConfigureContext) -> bool ; } extern "C" { # [doc = " Set the instruction counting option."] # [doc = ""] # [doc = " This function is thread-safe."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_ConfigureContext to set the boolean value."] # [doc = " \\param IsCount the boolean value to determine to support instruction"] # [doc = " counting when execution or not after compilation by the AOT compiler."] pub fn WasmEdge_ConfigureStatisticsSetInstructionCounting (Cxt : * mut WasmEdge_ConfigureContext , IsCount : bool) ; } extern "C" { # [doc = " Get the instruction counting option."] # [doc = ""] # [doc = " This function is thread-safe."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_ConfigureContext to get the boolean value."] # [doc = ""] # [doc = " \\returns the boolean value to determine to support instruction counting when"] # [doc = " execution or not after compilation by the AOT compiler."] pub fn WasmEdge_ConfigureStatisticsIsInstructionCounting (Cxt : * const WasmEdge_ConfigureContext) -> bool ; } extern "C" { # [doc = " Set the cost measuring option."] # [doc = ""] # [doc = " This function is thread-safe."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_ConfigureContext to set the boolean value."] # [doc = " \\param IsMeasure the boolean value to determine to support cost measuring"] # [doc = " when execution or not after compilation by the AOT compiler."] pub fn WasmEdge_ConfigureStatisticsSetCostMeasuring (Cxt : * mut WasmEdge_ConfigureContext , IsMeasure : bool) ; } extern "C" { # [doc = " Get the cost measuring option."] # [doc = ""] # [doc = " This function is thread-safe."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_ConfigureContext to get the boolean value."] # [doc = ""] # [doc = " \\returns the boolean value to determine to support cost measuring when"] # [doc = " execution or not after compilation by the AOT compiler."] pub fn WasmEdge_ConfigureStatisticsIsCostMeasuring (Cxt : * const WasmEdge_ConfigureContext) -> bool ; } extern "C" { # [doc = " Set the time measuring option."] # [doc = ""] # [doc = " This function is thread-safe."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_ConfigureContext to set the boolean value."] # [doc = " \\param IsMeasure the boolean value to determine to support time when"] # [doc = " execution or not after compilation by the AOT compiler."] pub fn WasmEdge_ConfigureStatisticsSetTimeMeasuring (Cxt : * mut WasmEdge_ConfigureContext , IsMeasure : bool) ; } extern "C" { # [doc = " Get the time measuring option."] # [doc = ""] # [doc = " This function is thread-safe."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_ConfigureContext to get the boolean value."] # [doc = ""] # [doc = " \\returns the boolean value to determine to support time measuring when"] # [doc = " execution or not after compilation by the AOT compiler."] pub fn WasmEdge_ConfigureStatisticsIsTimeMeasuring (Cxt : * const WasmEdge_ConfigureContext) -> bool ; } extern "C" { # [doc = " Deletion of the WasmEdge_ConfigureContext."] # [doc = ""] # [doc = " This function is thread-safe."] # [doc = ""] # [doc = " After calling this function, the context will be destroyed and should"] # [doc = " __NOT__ be used."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_ConfigureContext to destroy."] pub fn WasmEdge_ConfigureDelete (Cxt : * mut WasmEdge_ConfigureContext) ; } extern "C" { # [doc = " Creation of the WasmEdge_StatisticsContext."] # [doc = ""] # [doc = " The caller owns the object and should call `WasmEdge_StatisticsDelete` to"] # [doc = " destroy it."] # [doc = ""] # [doc = " \\returns pointer to context, NULL if failed."] pub fn WasmEdge_StatisticsCreate () -> * mut WasmEdge_StatisticsContext ; } extern "C" { # [doc = " Get the instruction count in execution."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_StatisticsContext to get data."] # [doc = ""] # [doc = " \\returns the instruction count in total execution."] pub fn WasmEdge_StatisticsGetInstrCount (Cxt : * const WasmEdge_StatisticsContext) -> u64 ; } extern "C" { # [doc = " Get the instruction count per second in execution."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_StatisticsContext to get data."] # [doc = ""] # [doc = " \\returns the instruction count per second."] pub fn WasmEdge_StatisticsGetInstrPerSecond (Cxt : * const WasmEdge_StatisticsContext) -> f64 ; } extern "C" { # [doc = " Get the total cost in execution."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_StatisticsContext to get data."] # [doc = ""] # [doc = " \\returns the total cost."] pub fn WasmEdge_StatisticsGetTotalCost (Cxt : * const WasmEdge_StatisticsContext) -> u64 ; } extern "C" { # [doc = " Set the costs of instructions."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_StatisticsContext to set the cost table."] # [doc = " \\param CostArr the cost table array."] # [doc = " \\param Len the length of the cost table array."] pub fn WasmEdge_StatisticsSetCostTable (Cxt : * mut WasmEdge_StatisticsContext , CostArr : * mut u64 , Len : u32) ; } extern "C" { # [doc = " Set the cost limit in execution."] # [doc = ""] # [doc = " The WASM execution will be aborted if the instruction costs exceeded the"] # [doc = " limit and the ErrCode::Value::CostLimitExceeded will be returned."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_StatisticsContext to set the cost table."] # [doc = " \\param Limit the cost limit."] pub fn WasmEdge_StatisticsSetCostLimit (Cxt : * mut WasmEdge_StatisticsContext , Limit : u64) ; } extern "C" { # [doc = " Clear all data in the WasmEdge_StatisticsContext."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_StatisticsContext to clear."] pub fn WasmEdge_StatisticsClear (Cxt : * mut WasmEdge_StatisticsContext) ; } extern "C" { # [doc = " Deletion of the WasmEdge_StatisticsContext."] # [doc = ""] # [doc = " After calling this function, the context will be destroyed and should"] # [doc = " __NOT__ be used."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_StatisticsContext to destroy."] pub fn WasmEdge_StatisticsDelete (Cxt : * mut WasmEdge_StatisticsContext) ; } extern "C" { # [doc = " Get the length of imports list of the AST module."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_ASTModuleContext."] # [doc = ""] # [doc = " \\returns length of the imports list."] pub fn WasmEdge_ASTModuleListImportsLength (Cxt : * const WasmEdge_ASTModuleContext) -> u32 ; } extern "C" { # [doc = " List the imports of the AST module."] # [doc = ""] # [doc = " If the `Imports` buffer length is smaller than the result of the imports"] # [doc = " list size, the overflowed return values will be discarded."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_ASTModuleContext."] # [doc = " \\param [out] Imports the import type contexts buffer. Can be NULL if import"] # [doc = " types are not needed."] # [doc = " \\param Len the buffer length."] # [doc = ""] # [doc = " \\returns actual exported function list size."] pub fn WasmEdge_ASTModuleListImports (Cxt : * const WasmEdge_ASTModuleContext , Imports : * mut * const WasmEdge_ImportTypeContext , Len : u32) -> u32 ; } extern "C" { # [doc = " Get the length of exports list of the AST module."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_ASTModuleContext."] # [doc = ""] # [doc = " \\returns length of the exports list."] pub fn WasmEdge_ASTModuleListExportsLength (Cxt : * const WasmEdge_ASTModuleContext) -> u32 ; } extern "C" { # [doc = " List the exports of the AST module."] # [doc = ""] # [doc = " If the `Exports` buffer length is smaller than the result of the exports"] # [doc = " list size, the overflowed return values will be discarded."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_ASTModuleContext."] # [doc = " \\param [out] Exports the export type contexts buffer. Can be NULL if export"] # [doc = " types are not needed."] # [doc = " \\param Len the buffer length."] # [doc = ""] # [doc = " \\returns actual exported function list size."] pub fn WasmEdge_ASTModuleListExports (Cxt : * const WasmEdge_ASTModuleContext , Exports : * mut * const WasmEdge_ExportTypeContext , Len : u32) -> u32 ; } extern "C" { # [doc = " Deletion of the WasmEdge_ASTModuleContext."] # [doc = ""] # [doc = " After calling this function, the context will be destroyed and should"] # [doc = " __NOT__ be used."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_ASTModuleContext to destroy."] pub fn WasmEdge_ASTModuleDelete (Cxt : * mut WasmEdge_ASTModuleContext) ; } extern "C" { # [doc = " Creation of the WasmEdge_FunctionTypeContext."] # [doc = ""] # [doc = " The caller owns the object and should call `WasmEdge_FunctionTypeDelete` to"] # [doc = " destroy it."] # [doc = ""] # [doc = " \\param ParamList the value types list of parameters. NULL if the length is"] # [doc = " 0."] # [doc = " \\param ParamLen the ParamList buffer length."] # [doc = " \\param ReturnList the value types list of returns. NULL if the length is 0."] # [doc = " \\param ReturnLen the ReturnList buffer length."] # [doc = ""] # [doc = " \\returns pointer to context, NULL if failed."] pub fn WasmEdge_FunctionTypeCreate (ParamList : * const WasmEdge_ValType , ParamLen : u32 , ReturnList : * const WasmEdge_ValType , ReturnLen : u32) -> * mut WasmEdge_FunctionTypeContext ; } extern "C" { # [doc = " Get the parameter types list length from the WasmEdge_FunctionTypeContext."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_FunctionTypeContext."] # [doc = ""] # [doc = " \\returns the parameter types list length."] pub fn WasmEdge_FunctionTypeGetParametersLength (Cxt : * const WasmEdge_FunctionTypeContext) -> u32 ; } extern "C" { # [doc = " Get the parameter types list from the WasmEdge_FunctionTypeContext."] # [doc = ""] # [doc = " If the `List` buffer length is smaller than the length of the parameter type"] # [doc = " list, the overflowed values will be discarded."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_FunctionTypeContext."] # [doc = " \\param [out] List the WasmEdge_ValType buffer to fill the parameter value"] # [doc = " types."] # [doc = " \\param Len the value type buffer length."] # [doc = ""] # [doc = " \\returns the actual parameter types list length."] pub fn WasmEdge_FunctionTypeGetParameters (Cxt : * const WasmEdge_FunctionTypeContext , List : * mut WasmEdge_ValType , Len : u32) -> u32 ; } extern "C" { # [doc = " Get the return types list length from the WasmEdge_FunctionTypeContext."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_FunctionTypeContext."] # [doc = ""] # [doc = " \\returns the return types list length."] pub fn WasmEdge_FunctionTypeGetReturnsLength (Cxt : * const WasmEdge_FunctionTypeContext) -> u32 ; } extern "C" { # [doc = " Get the return types list from the WasmEdge_FunctionTypeContext."] # [doc = ""] # [doc = " If the `List` buffer length is smaller than the length of the return type"] # [doc = " list, the overflowed values will be discarded."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_FunctionTypeContext."] # [doc = " \\param [out] List the WasmEdge_ValType buffer to fill the return value"] # [doc = " types."] # [doc = " \\param Len the value type buffer length."] # [doc = ""] # [doc = " \\returns the actual return types list length."] pub fn WasmEdge_FunctionTypeGetReturns (Cxt : * const WasmEdge_FunctionTypeContext , List : * mut WasmEdge_ValType , Len : u32) -> u32 ; } extern "C" { # [doc = " Deletion of the WasmEdge_FunctionTypeContext."] # [doc = ""] # [doc = " After calling this function, the context will be destroyed and should"] # [doc = " __NOT__ be used."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_FunctionTypeContext to destroy."] pub fn WasmEdge_FunctionTypeDelete (Cxt : * mut WasmEdge_FunctionTypeContext) ; } extern "C" { # [doc = " Creation of the WasmEdge_TableTypeContext."] # [doc = ""] # [doc = " The caller owns the object and should call `WasmEdge_TableTypeDelete` to"] # [doc = " destroy it."] # [doc = ""] # [doc = " \\param RefType the reference type of the table type."] # [doc = " \\param Limit the limit struct of the table type."] # [doc = ""] # [doc = " \\returns pointer to context, NULL if failed."] pub fn WasmEdge_TableTypeCreate (RefType : WasmEdge_RefType , Limit : WasmEdge_Limit) -> * mut WasmEdge_TableTypeContext ; } extern "C" { # [doc = " Get the reference type from a table type."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_TableTypeContext."] # [doc = ""] # [doc = " \\returns the reference type of the table type."] pub fn WasmEdge_TableTypeGetRefType (Cxt : * const WasmEdge_TableTypeContext) -> WasmEdge_RefType ; } extern "C" { # [doc = " Get the limit from a table type."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_TableTypeContext."] # [doc = ""] # [doc = " \\returns the limit struct of the table type."] pub fn WasmEdge_TableTypeGetLimit (Cxt : * const WasmEdge_TableTypeContext) -> WasmEdge_Limit ; } extern "C" { # [doc = " Deletion of the WasmEdge_TableTypeContext."] # [doc = ""] # [doc = " After calling this function, the context will be destroyed and should"] # [doc = " __NOT__ be used."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_TableTypeContext to destroy."] pub fn WasmEdge_TableTypeDelete (Cxt : * mut WasmEdge_TableTypeContext) ; } extern "C" { # [doc = " Creation of the WasmEdge_MemoryTypeContext."] # [doc = ""] # [doc = " The caller owns the object and should call `WasmEdge_MemoryTypeDelete` to"] # [doc = " destroy it."] # [doc = ""] # [doc = " \\param Limit the limit struct of the memory type."] # [doc = ""] # [doc = " \\returns pointer to context, NULL if failed."] pub fn WasmEdge_MemoryTypeCreate (Limit : WasmEdge_Limit) -> * mut WasmEdge_MemoryTypeContext ; } extern "C" { # [doc = " Get the limit from a memory type."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_MemoryTypeContext."] # [doc = ""] # [doc = " \\returns the limit struct of the memory type."] pub fn WasmEdge_MemoryTypeGetLimit (Cxt : * const WasmEdge_MemoryTypeContext) -> WasmEdge_Limit ; } extern "C" { # [doc = " Deletion of the WasmEdge_MemoryTypeContext."] # [doc = ""] # [doc = " After calling this function, the context will be destroyed and should"] # [doc = " __NOT__ be used."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_MemoryTypeContext to destroy."] pub fn WasmEdge_MemoryTypeDelete (Cxt : * mut WasmEdge_MemoryTypeContext) ; } extern "C" { # [doc = " Creation of the WasmEdge_GlobalTypeContext."] # [doc = ""] # [doc = " The caller owns the object and should call `WasmEdge_GlobalTypeDelete` to"] # [doc = " destroy it."] # [doc = ""] # [doc = " \\param ValType the value type of the global type."] # [doc = " \\param Mut the mutation of the global type."] # [doc = ""] # [doc = " \\returns pointer to context, NULL if failed."] pub fn WasmEdge_GlobalTypeCreate (ValType : WasmEdge_ValType , Mut : WasmEdge_Mutability) -> * mut WasmEdge_GlobalTypeContext ; } extern "C" { # [doc = " Get the value type from a global type."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_GlobalTypeContext."] # [doc = ""] # [doc = " \\returns the value type of the global type."] pub fn WasmEdge_GlobalTypeGetValType (Cxt : * const WasmEdge_GlobalTypeContext) -> WasmEdge_ValType ; } extern "C" { # [doc = " Get the mutability from a global type."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_GlobalTypeContext."] # [doc = ""] # [doc = " \\returns the mutability of the global type."] pub fn WasmEdge_GlobalTypeGetMutability (Cxt : * const WasmEdge_GlobalTypeContext) -> WasmEdge_Mutability ; } extern "C" { # [doc = " Deletion of the WasmEdge_GlobalTypeContext."] # [doc = ""] # [doc = " After calling this function, the context will be destroyed and should"] # [doc = " __NOT__ be used."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_GlobalTypeContext to destroy."] pub fn WasmEdge_GlobalTypeDelete (Cxt : * mut WasmEdge_GlobalTypeContext) ; } extern "C" { # [doc = " Get the external type from an import type."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_ImportTypeContext."] # [doc = ""] # [doc = " \\returns the external type of the import type."] pub fn WasmEdge_ImportTypeGetExternalType (Cxt : * const WasmEdge_ImportTypeContext) -> WasmEdge_ExternalType ; } extern "C" { # [doc = " Get the module name from an import type."] # [doc = ""] # [doc = " The returned string object is linked to the module name of the import type,"] # [doc = " and the caller should __NOT__ call the `WasmEdge_StringDelete`."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_ImportTypeContext."] # [doc = ""] # [doc = " \\returns string object. Length will be 0 and Buf will be NULL if failed."] pub fn WasmEdge_ImportTypeGetModuleName (Cxt : * const WasmEdge_ImportTypeContext) -> WasmEdge_String ; } extern "C" { # [doc = " Get the external name from an import type."] # [doc = ""] # [doc = " The returned string object is linked to the external name of the import"] # [doc = " type, and the caller should __NOT__ call the `WasmEdge_StringDelete`."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_ImportTypeContext."] # [doc = ""] # [doc = " \\returns string object. Length will be 0 and Buf will be NULL if failed."] pub fn WasmEdge_ImportTypeGetExternalName (Cxt : * const WasmEdge_ImportTypeContext) -> WasmEdge_String ; } extern "C" { # [doc = " Get the external value (which is function type) from an import type."] # [doc = ""] # [doc = " The import type context should be the one queried from the AST module"] # [doc = " context, or this function will cause unexpected error."] # [doc = " The function type context links to the function type in the import type"] # [doc = " context and the AST module context. The caller should __NOT__ call the"] # [doc = " `WasmEdge_FunctionTypeDelete`."] # [doc = ""] # [doc = " \\param ASTCxt the WasmEdge_ASTModuleContext."] # [doc = " \\param Cxt the WasmEdge_ImportTypeContext which queried from the `ASTCxt`."] # [doc = ""] # [doc = " \\returns the function type. NULL if failed or the external type of the"] # [doc = " import type is not `WasmEdge_ExternalType_Function`."] pub fn WasmEdge_ImportTypeGetFunctionType (ASTCxt : * const WasmEdge_ASTModuleContext , Cxt : * const WasmEdge_ImportTypeContext) -> * const WasmEdge_FunctionTypeContext ; } extern "C" { # [doc = " Get the external value (which is table type) from an import type."] # [doc = ""] # [doc = " The import type context should be the one queried from the AST module"] # [doc = " context, or this function will cause unexpected error."] # [doc = " The table type context links to the table type in the import type context"] # [doc = " and the AST module context. The caller should __NOT__ call the"] # [doc = " `WasmEdge_TableTypeDelete`."] # [doc = ""] # [doc = " \\param ASTCxt the WasmEdge_ASTModuleContext."] # [doc = " \\param Cxt the WasmEdge_ImportTypeContext which queried from the `ASTCxt`."] # [doc = ""] # [doc = " \\returns the table type. NULL if failed or the external type of the import"] # [doc = " type is not `WasmEdge_ExternalType_Table`."] pub fn WasmEdge_ImportTypeGetTableType (ASTCxt : * const WasmEdge_ASTModuleContext , Cxt : * const WasmEdge_ImportTypeContext) -> * const WasmEdge_TableTypeContext ; } extern "C" { # [doc = " Get the external value (which is memory type) from an import type."] # [doc = ""] # [doc = " The import type context should be the one queried from the AST module"] # [doc = " context, or this function will cause unexpected error."] # [doc = " The memory type context links to the memory type in the import type context"] # [doc = " and the AST module context. The caller should __NOT__ call the"] # [doc = " `WasmEdge_MemoryTypeDelete`."] # [doc = ""] # [doc = " \\param ASTCxt the WasmEdge_ASTModuleContext."] # [doc = " \\param Cxt the WasmEdge_ImportTypeContext which queried from the `ASTCxt`."] # [doc = ""] # [doc = " \\returns the memory type. NULL if failed or the external type of the import"] # [doc = " type is not `WasmEdge_ExternalType_Memory`."] pub fn WasmEdge_ImportTypeGetMemoryType (ASTCxt : * const WasmEdge_ASTModuleContext , Cxt : * const WasmEdge_ImportTypeContext) -> * const WasmEdge_MemoryTypeContext ; } extern "C" { # [doc = " Get the external value (which is global type) from an import type."] # [doc = ""] # [doc = " The import type context should be the one queried from the AST module"] # [doc = " context, or this function will cause unexpected error."] # [doc = " The global type context links to the global type in the import type context"] # [doc = " and the AST module context. The caller should __NOT__ call the"] # [doc = " `WasmEdge_GlobalTypeDelete`."] # [doc = ""] # [doc = " \\param ASTCxt the WasmEdge_ASTModuleContext."] # [doc = " \\param Cxt the WasmEdge_ImportTypeContext which queried from the `ASTCxt`."] # [doc = ""] # [doc = " \\returns the global type. NULL if failed or the external type of the import"] # [doc = " type is not `WasmEdge_ExternalType_Global`."] pub fn WasmEdge_ImportTypeGetGlobalType (ASTCxt : * const WasmEdge_ASTModuleContext , Cxt : * const WasmEdge_ImportTypeContext) -> * const WasmEdge_GlobalTypeContext ; } extern "C" { # [doc = " Get the external type from an export type."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_ExportTypeContext."] # [doc = ""] # [doc = " \\returns the external type of the export type."] pub fn WasmEdge_ExportTypeGetExternalType (Cxt : * const WasmEdge_ExportTypeContext) -> WasmEdge_ExternalType ; } extern "C" { # [doc = " Get the external name from an export type."] # [doc = ""] # [doc = " The returned string object is linked to the external name of the export"] # [doc = " type, and the caller should __NOT__ call the `WasmEdge_StringDelete`."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_ExportTypeContext."] # [doc = ""] # [doc = " \\returns string object. Length will be 0 and Buf will be NULL if failed."] pub fn WasmEdge_ExportTypeGetExternalName (Cxt : * const WasmEdge_ExportTypeContext) -> WasmEdge_String ; } extern "C" { # [doc = " Get the external value (which is function type) from an export type."] # [doc = ""] # [doc = " The export type context should be the one queried from the AST module"] # [doc = " context, or this function will cause unexpected error."] # [doc = " The function type context links to the function type in the export type"] # [doc = " context and the AST module context. The caller should __NOT__ call the"] # [doc = " `WasmEdge_FunctionTypeDelete`."] # [doc = ""] # [doc = " \\param ASTCxt the WasmEdge_ASTModuleContext."] # [doc = " \\param Cxt the WasmEdge_ExportTypeContext which queried from the `ASTCxt`."] # [doc = ""] # [doc = " \\returns the function type. NULL if failed or the external type of the"] # [doc = " export type is not `WasmEdge_ExternalType_Function`."] pub fn WasmEdge_ExportTypeGetFunctionType (ASTCxt : * const WasmEdge_ASTModuleContext , Cxt : * const WasmEdge_ExportTypeContext) -> * const WasmEdge_FunctionTypeContext ; } extern "C" { # [doc = " Get the external value (which is table type) from an export type."] # [doc = ""] # [doc = " The export type context should be the one queried from the AST module"] # [doc = " context, or this function will cause unexpected error."] # [doc = " The table type context links to the table type in the export type context"] # [doc = " and the AST module context. The caller should __NOT__ call the"] # [doc = " `WasmEdge_TableTypeDelete`."] # [doc = ""] # [doc = " \\param ASTCxt the WasmEdge_ASTModuleContext."] # [doc = " \\param Cxt the WasmEdge_ExportTypeContext which queried from the `ASTCxt`."] # [doc = ""] # [doc = " \\returns the table type. NULL if failed or the external type of the export"] # [doc = " type is not `WasmEdge_ExternalType_Table`."] pub fn WasmEdge_ExportTypeGetTableType (ASTCxt : * const WasmEdge_ASTModuleContext , Cxt : * const WasmEdge_ExportTypeContext) -> * const WasmEdge_TableTypeContext ; } extern "C" { # [doc = " Get the external value (which is memory type) from an export type."] # [doc = ""] # [doc = " The export type context should be the one queried from the AST module"] # [doc = " context, or this function will cause unexpected error."] # [doc = " The memory type context links to the memory type in the export type context"] # [doc = " and the AST module context. The caller should __NOT__ call the"] # [doc = " `WasmEdge_MemoryTypeDelete`."] # [doc = ""] # [doc = " \\param ASTCxt the WasmEdge_ASTModuleContext."] # [doc = " \\param Cxt the WasmEdge_ExportTypeContext which queried from the `ASTCxt`."] # [doc = ""] # [doc = " \\returns the memory type. NULL if failed or the external type of the export"] # [doc = " type is not `WasmEdge_ExternalType_Memory`."] pub fn WasmEdge_ExportTypeGetMemoryType (ASTCxt : * const WasmEdge_ASTModuleContext , Cxt : * const WasmEdge_ExportTypeContext) -> * const WasmEdge_MemoryTypeContext ; } extern "C" { # [doc = " Get the external value (which is global type) from an export type."] # [doc = ""] # [doc = " The export type context should be the one queried from the AST module"] # [doc = " context, or this function will cause unexpected error."] # [doc = " The global type context links to the global type in the export type context"] # [doc = " and the AST module context. The caller should __NOT__ call the"] # [doc = " `WasmEdge_GlobalTypeDelete`."] # [doc = ""] # [doc = " \\param ASTCxt the WasmEdge_ASTModuleContext."] # [doc = " \\param Cxt the WasmEdge_ExportTypeContext which queried from the `ASTCxt`."] # [doc = ""] # [doc = " \\returns the global type. NULL if failed or the external type of the export"] # [doc = " type is not `WasmEdge_ExternalType_Global`."] pub fn WasmEdge_ExportTypeGetGlobalType (ASTCxt : * const WasmEdge_ASTModuleContext , Cxt : * const WasmEdge_ExportTypeContext) -> * const WasmEdge_GlobalTypeContext ; } extern "C" { # [doc = " Creation of the WasmEdge_CompilerContext."] # [doc = ""] # [doc = " The caller owns the object and should call `WasmEdge_CompilerDelete` to"] # [doc = " delete it."] # [doc = ""] # [doc = " \\returns pointer to context, NULL if failed."] pub fn WasmEdge_CompilerCreate (ConfCxt : * const WasmEdge_ConfigureContext) -> * mut WasmEdge_CompilerContext ; } extern "C" { # [doc = " Compile the input WASM from the file path."] # [doc = ""] # [doc = " The compiler compiles the WASM from file path for the ahead-of-time mode and"] # [doc = " store the result to the output file path."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_CompilerContext."] # [doc = " \\param InPath the input WASM file path."] # [doc = " \\param OutPath the output WASM file path."] # [doc = ""] # [doc = " \\returns WasmEdge_Result. Call `WasmEdge_ResultGetMessage` for the error"] # [doc = " message."] pub fn WasmEdge_CompilerCompile (Cxt : * mut WasmEdge_CompilerContext , InPath : * const :: std :: os :: raw :: c_char , OutPath : * const :: std :: os :: raw :: c_char) -> WasmEdge_Result ; } extern "C" { # [doc = " Compile the input WASM from the given buffer."] # [doc = ""] # [doc = " The compiler compiles the WASM from the given buffer for the"] # [doc = " ahead-of-time mode and store the result to the output file path."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_CompilerContext."] # [doc = " \\param InBuffer the input WASM binary buffer."] # [doc = " \\param InBufferLen the length of the input WASM binary buffer."] # [doc = " \\param OutPath the output WASM file path."] # [doc = ""] # [doc = " \\returns WasmEdge_Result. Call `WasmEdge_ResultGetMessage` for the error"] # [doc = " message."] pub fn WasmEdge_CompilerCompileFromBuffer (Cxt : * mut WasmEdge_CompilerContext , InBuffer : * const u8 , InBufferLen : u64 , OutPath : * const :: std :: os :: raw :: c_char) -> WasmEdge_Result ; } extern "C" { # [doc = " Deletion of the WasmEdge_CompilerContext."] # [doc = ""] # [doc = " After calling this function, the context will be destroyed and should"] # [doc = " __NOT__ be used."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_CompilerContext to destroy."] pub fn WasmEdge_CompilerDelete (Cxt : * mut WasmEdge_CompilerContext) ; } extern "C" { # [doc = " Creation of the WasmEdge_LoaderContext."] # [doc = ""] # [doc = " The caller owns the object and should call `WasmEdge_LoaderDelete` to"] # [doc = " destroy it."] # [doc = ""] # [doc = " \\param ConfCxt the WasmEdge_ConfigureContext as the configuration of Loader."] # [doc = " NULL for the default configuration."] # [doc = ""] # [doc = " \\returns pointer to context, NULL if failed."] pub fn WasmEdge_LoaderCreate (ConfCxt : * const WasmEdge_ConfigureContext) -> * mut WasmEdge_LoaderContext ; } extern "C" { # [doc = " Load and parse the WASM module from a WASM file into a"] # [doc = " WasmEdge_ASTModuleContext."] # [doc = ""] # [doc = " Load and parse the WASM module from the file path, and return a"] # [doc = " `WasmEdge_ASTModuleContext` as the result. The caller owns the"] # [doc = " `WasmEdge_ASTModuleContext` object and should call"] # [doc = " `WasmEdge_ASTModuleDelete` to destroy it."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_LoaderContext."] # [doc = " \\param [out] Module the output WasmEdge_ASTModuleContext if succeeded."] # [doc = " \\param Path the NULL-terminated C string of the WASM file path."] # [doc = ""] # [doc = " \\returns WasmEdge_Result. Call `WasmEdge_ResultGetMessage` for the error"] # [doc = " message."] pub fn WasmEdge_LoaderParseFromFile (Cxt : * mut WasmEdge_LoaderContext , Module : * mut * mut WasmEdge_ASTModuleContext , Path : * const :: std :: os :: raw :: c_char) -> WasmEdge_Result ; } extern "C" { # [doc = " Load and parse the WASM module from a buffer into WasmEdge_ASTModuleContext."] # [doc = ""] # [doc = " Load and parse the WASM module from a buffer, and return a"] # [doc = " WasmEdge_ASTModuleContext as the result. The caller owns the"] # [doc = " WasmEdge_ASTModuleContext object and should call `WasmEdge_ASTModuleDelete`"] # [doc = " to destroy it."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_LoaderContext."] # [doc = " \\param [out] Module the output WasmEdge_ASTModuleContext if succeeded."] # [doc = " \\param Buf the buffer of WASM binary."] # [doc = " \\param BufLen the length of the buffer."] # [doc = ""] # [doc = " \\returns WasmEdge_Result. Call `WasmEdge_ResultGetMessage` for the error"] # [doc = " message."] pub fn WasmEdge_LoaderParseFromBuffer (Cxt : * mut WasmEdge_LoaderContext , Module : * mut * mut WasmEdge_ASTModuleContext , Buf : * const u8 , BufLen : u32) -> WasmEdge_Result ; } extern "C" { # [doc = " Deletion of the WasmEdge_LoaderContext."] # [doc = ""] # [doc = " After calling this function, the context will be destroyed and should"] # [doc = " __NOT__ be used."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_LoaderContext to destroy."] pub fn WasmEdge_LoaderDelete (Cxt : * mut WasmEdge_LoaderContext) ; } extern "C" { # [doc = " Creation of the WasmEdge_ValidatorContext."] # [doc = ""] # [doc = " The caller owns the object and should call `WasmEdge_ValidatorDelete` to"] # [doc = " destroy it."] # [doc = ""] # [doc = " \\param ConfCxt the WasmEdge_ConfigureContext as the configuration of"] # [doc = " Validator. NULL for the default configuration."] # [doc = ""] # [doc = " \\returns pointer to context, NULL if failed."] pub fn WasmEdge_ValidatorCreate (ConfCxt : * const WasmEdge_ConfigureContext) -> * mut WasmEdge_ValidatorContext ; } extern "C" { # [doc = " Validate the WasmEdge AST Module."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_ValidatorContext."] # [doc = " \\param ASTCxt the WasmEdge_ASTModuleContext to validate."] # [doc = ""] # [doc = " \\returns WasmEdge_Result. Call `WasmEdge_ResultGetMessage` for the error"] # [doc = " message."] pub fn WasmEdge_ValidatorValidate (Cxt : * mut WasmEdge_ValidatorContext , ASTCxt : * const WasmEdge_ASTModuleContext) -> WasmEdge_Result ; } extern "C" { # [doc = " Deletion of the WasmEdge_ValidatorContext."] # [doc = ""] # [doc = " After calling this function, the context will be destroyed and should"] # [doc = " __NOT__ be used."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_ValidatorContext to destroy."] pub fn WasmEdge_ValidatorDelete (Cxt : * mut WasmEdge_ValidatorContext) ; } extern "C" { # [doc = " Creation of the WasmEdge_ExecutorContext."] # [doc = ""] # [doc = " The caller owns the object and should call `WasmEdge_ExecutorDelete` to"] # [doc = " delete it."] # [doc = ""] # [doc = " \\param ConfCxt the WasmEdge_ConfigureContext as the configuration of"] # [doc = " Executor. NULL for the default configuration."] # [doc = " \\param StatCxt the WasmEdge_StatisticsContext as the statistics object set"] # [doc = " into Executor. The statistics will refer to this context, and the life cycle"] # [doc = " should be ensured until the executor context is deleted. NULL for not doing"] # [doc = " the statistics."] # [doc = ""] # [doc = " \\returns pointer to context, NULL if failed."] pub fn WasmEdge_ExecutorCreate (ConfCxt : * const WasmEdge_ConfigureContext , StatCxt : * mut WasmEdge_StatisticsContext) -> * mut WasmEdge_ExecutorContext ; } extern "C" { # [doc = " Instantiate an AST Module into a module instance."] # [doc = ""] # [doc = " Instantiate an AST Module, and return an instantiated"] # [doc = " WasmEdge_ASTModuleContext as the result. The caller owns the object and"] # [doc = " should call `WasmEdge_ModuleInstanceDelete` to destroy it."] # [doc = " Developers can use the `WasmEdge_ModuleInstanceListFunction`,"] # [doc = " `WasmEdge_ModuleInstanceFindFunction`, etc. APIs to retrieve the exported"] # [doc = " instances from the result module instance."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_ExecutorContext to instantiate the module."] # [doc = " \\param [out] ModuleCxt the output WasmEdge_ModuleInstanceContext if"] # [doc = " succeeded."] # [doc = " \\param StoreCxt the WasmEdge_StoreContext to link the imports."] # [doc = " \\param ASTCxt the WasmEdge AST Module context generated by loader or"] # [doc = " compiler."] # [doc = ""] # [doc = " \\returns WasmEdge_Result. Call `WasmEdge_ResultGetMessage` for the error"] # [doc = " message."] pub fn WasmEdge_ExecutorInstantiate (Cxt : * mut WasmEdge_ExecutorContext , ModuleCxt : * mut * mut WasmEdge_ModuleInstanceContext , StoreCxt : * mut WasmEdge_StoreContext , ASTCxt : * const WasmEdge_ASTModuleContext) -> WasmEdge_Result ; } extern "C" { # [doc = " Instantiate and register an AST Module into a named module instance."] # [doc = ""] # [doc = " Instantiate an AST Module with the module name, and return an instantiated"] # [doc = " WasmEdge_ASTModuleContext as the result. The caller owns the object and"] # [doc = " should call `WasmEdge_ModuleInstanceDelete` to destroy it."] # [doc = " Developers can use the `WasmEdge_ModuleInstanceListFunction`,"] # [doc = " `WasmEdge_ModuleInstanceFindFunction`, etc. APIs to retrieve the exported"] # [doc = " instances from the result module instance."] # [doc = " After calling this function, the module is registered into the store, and"] # [doc = " the other modules can import the instances for linking when instantiation."] # [doc = " Developers should guarantee the life cycle of this registered module"] # [doc = " instance, or the error will occur when in execution after the module"] # [doc = " instance destroyed if it has been imported by other modules."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_ExecutorContext to instantiate the module."] # [doc = " \\param [out] ModuleCxt the output WasmEdge_ModuleInstanceContext if"] # [doc = " succeeded."] # [doc = " \\param StoreCxt the WasmEdge_StoreContext to link the imports."] # [doc = " \\param ASTCxt the WasmEdge AST Module context generated by loader or"] # [doc = " compiler."] # [doc = " \\param ModuleName the module name WasmEdge_String for all exported"] # [doc = " instances."] # [doc = ""] # [doc = " \\returns WasmEdge_Result. Call `WasmEdge_ResultGetMessage` for the error"] # [doc = " message."] pub fn WasmEdge_ExecutorRegister (Cxt : * mut WasmEdge_ExecutorContext , ModuleCxt : * mut * mut WasmEdge_ModuleInstanceContext , StoreCxt : * mut WasmEdge_StoreContext , ASTCxt : * const WasmEdge_ASTModuleContext , ModuleName : WasmEdge_String) -> WasmEdge_Result ; } extern "C" { # [doc = " Register a module instance into a store with exporting its module name."] # [doc = ""] # [doc = " Register an existing module into the store with its module name."] # [doc = " After calling this function, the module instance is registered into the"] # [doc = " store, and the other modules can import the instances for linking when"] # [doc = " instantiation. Developers should guarantee the life cycle of this registered"] # [doc = " module instance, or the error will occur when in execution after the module"] # [doc = " instance destroyed if it has been imported by other modules."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_ExecutorContext to instantiate the module."] # [doc = " \\param StoreCxt the WasmEdge_StoreContext to store the instantiated module."] # [doc = " \\param ImportCxt the WasmEdge_ModuleInstanceContext to register."] # [doc = ""] # [doc = " \\returns WasmEdge_Result. Call `WasmEdge_ResultGetMessage` for the error"] # [doc = " message."] pub fn WasmEdge_ExecutorRegisterImport (Cxt : * mut WasmEdge_ExecutorContext , StoreCxt : * mut WasmEdge_StoreContext , ImportCxt : * const WasmEdge_ModuleInstanceContext) -> WasmEdge_Result ; } extern "C" { # [doc = " Invoke a WASM function by the function instance."] # [doc = ""] # [doc = " After instantiating a WASM module, developers can get the function instance"] # [doc = " context from the module instance. Then developers can invoke the function"] # [doc = " through this API."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_ExecutorContext."] # [doc = " \\param FuncCxt the function instance context to invoke."] # [doc = " \\param Params the WasmEdge_Value buffer with the parameter values."] # [doc = " \\param ParamLen the parameter buffer length."] # [doc = " \\param [out] Returns the WasmEdge_Value buffer to fill the return values."] # [doc = " \\param ReturnLen the return buffer length."] # [doc = ""] # [doc = " \\returns WasmEdge_Result. Call `WasmEdge_ResultGetMessage` for the error"] # [doc = " message."] pub fn WasmEdge_ExecutorInvoke (Cxt : * mut WasmEdge_ExecutorContext , FuncCxt : * const WasmEdge_FunctionInstanceContext , Params : * const WasmEdge_Value , ParamLen : u32 , Returns : * mut WasmEdge_Value , ReturnLen : u32) -> WasmEdge_Result ; } extern "C" { # [doc = " Deletion of the WasmEdge_ExecutorContext."] # [doc = ""] # [doc = " After calling this function, the context will be destroyed and should"] # [doc = " __NOT__ be used."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_ExecutorContext to destroy."] pub fn WasmEdge_ExecutorDelete (Cxt : * mut WasmEdge_ExecutorContext) ; } extern "C" { # [doc = " Creation of the WasmEdge_StoreContext."] # [doc = ""] # [doc = " The caller owns the object and should call `WasmEdge_StoreDelete` to destroy"] # [doc = " it."] # [doc = ""] # [doc = " \\returns pointer to context, NULL if failed."] pub fn WasmEdge_StoreCreate () -> * mut WasmEdge_StoreContext ; } extern "C" { # [doc = " Get the module instance context by the module name."] # [doc = ""] # [doc = " After registering a WASM module, you can call this function to get the"] # [doc = " registered module instance context by the module name."] # [doc = ""] # [doc = " This function is thread-safe."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_StoreContext."] # [doc = " \\param Name the module name WasmEdge_String."] # [doc = ""] # [doc = " \\returns pointer to the module instance context. NULL if not found."] pub fn WasmEdge_StoreFindModule (Cxt : * const WasmEdge_StoreContext , Name : WasmEdge_String) -> * const WasmEdge_ModuleInstanceContext ; } extern "C" { # [doc = " Get the length of registered module list in store."] # [doc = ""] # [doc = " This function is thread-safe."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_StoreContext."] # [doc = ""] # [doc = " \\returns length of registered named module list."] pub fn WasmEdge_StoreListModuleLength (Cxt : * const WasmEdge_StoreContext) -> u32 ; } extern "C" { # [doc = " List the registered module names."] # [doc = ""] # [doc = " This function will list all registered module names."] # [doc = " The returned module names filled into the `Names` array are linked to the"] # [doc = " registered module names in the store context, and the caller should __NOT__"] # [doc = " call the `WasmEdge_StringDelete`."] # [doc = " If the `Names` buffer length is smaller than the result of the registered"] # [doc = " named module list size, the overflowed return values will be discarded."] # [doc = ""] # [doc = " This function is thread-safe."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_StoreContext."] # [doc = " \\param [out] Names the output names WasmEdge_String buffer of named modules."] # [doc = " \\param Len the buffer length."] # [doc = ""] # [doc = " \\returns actual registered named module list size."] pub fn WasmEdge_StoreListModule (Cxt : * const WasmEdge_StoreContext , Names : * mut WasmEdge_String , Len : u32) -> u32 ; } extern "C" { # [doc = " Deletion of the WasmEdge_StoreContext."] # [doc = ""] # [doc = " After calling this function, the context will be destroyed and should"] # [doc = " __NOT__ be used."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_StoreContext to destroy."] pub fn WasmEdge_StoreDelete (Cxt : * mut WasmEdge_StoreContext) ; } extern "C" { # [doc = " Creation of the WasmEdge_ModuleInstanceContext."] # [doc = ""] # [doc = " Create a module instance context with exported module name for host"] # [doc = " instances. Developer can use this API to create a module instance for"] # [doc = " collecting host functions, tables, memories, and globals."] # [doc = " The caller owns the object and should call `WasmEdge_ModuleInstanceDelete`"] # [doc = " to destroy it."] # [doc = ""] # [doc = " \\param ModuleName the module name WasmEdge_String of this host module to"] # [doc = " import."] # [doc = ""] # [doc = " \\returns pointer to context, NULL if failed."] pub fn WasmEdge_ModuleInstanceCreate (ModuleName : WasmEdge_String) -> * mut WasmEdge_ModuleInstanceContext ; } extern "C" { # [doc = " Creation of the WasmEdge_ModuleInstanceContext for the WASI specification."] # [doc = ""] # [doc = " This function will create a WASI host module that contains the WASI host"] # [doc = " functions and initialize it. The caller owns the object and should call"] # [doc = " `WasmEdge_ModuleInstanceDelete` to destroy it."] # [doc = ""] # [doc = " \\param Args the command line arguments. The first argument suggests being"] # [doc = " the program name. NULL if the length is 0."] # [doc = " \\param ArgLen the length of the command line arguments."] # [doc = " \\param Envs the environment variables in the format `ENV=VALUE`. NULL if the"] # [doc = " length is 0."] # [doc = " \\param EnvLen the length of the environment variables."] # [doc = " \\param Preopens the directory paths to preopen. String format in"] # [doc = " `PATH1:PATH2` means the path mapping, or the same path will be mapped. NULL"] # [doc = " if the length is 0."] # [doc = " \\param PreopenLen the length of the directory paths to preopen."] # [doc = ""] # [doc = " \\returns pointer to context, NULL if failed."] pub fn WasmEdge_ModuleInstanceCreateWASI (Args : * const * const :: std :: os :: raw :: c_char , ArgLen : u32 , Envs : * const * const :: std :: os :: raw :: c_char , EnvLen : u32 , Preopens : * const * const :: std :: os :: raw :: c_char , PreopenLen : u32) -> * mut WasmEdge_ModuleInstanceContext ; } extern "C" { # [doc = " Initialize the WasmEdge_ModuleInstanceContext for the WASI specification."] # [doc = ""] # [doc = " This function will initialize the WASI host module with the parameters."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_ModuleInstanceContext of WASI import object."] # [doc = " \\param Args the command line arguments. The first argument suggests being"] # [doc = " the program name. NULL if the length is 0."] # [doc = " \\param ArgLen the length of the command line arguments."] # [doc = " \\param Envs the environment variables in the format `ENV=VALUE`. NULL if the"] # [doc = " length is 0."] # [doc = " \\param EnvLen the length of the environment variables."] # [doc = " \\param Preopens the directory paths to preopen. String format in"] # [doc = " `PATH1:PATH2` means the path mapping, or the same path will be mapped. NULL"] # [doc = " if the length is 0."] # [doc = " \\param PreopenLen the length of the directory paths to preopen."] pub fn WasmEdge_ModuleInstanceInitWASI (Cxt : * mut WasmEdge_ModuleInstanceContext , Args : * const * const :: std :: os :: raw :: c_char , ArgLen : u32 , Envs : * const * const :: std :: os :: raw :: c_char , EnvLen : u32 , Preopens : * const * const :: std :: os :: raw :: c_char , PreopenLen : u32) ; } extern "C" { # [doc = " Get the WASI exit code."] # [doc = ""] # [doc = " This function will return the exit code after running the \"_start\" function"] # [doc = " of a `wasm32-wasi` program."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_ModuleInstanceContext of WASI import object."] # [doc = ""] # [doc = " \\returns the exit code after executing the \"_start\" function. Return"] # [doc = " `EXIT_FAILURE` if the `Cxt` is NULL or not a WASI host module."] pub fn WasmEdge_ModuleInstanceWASIGetExitCode (Cxt : * const WasmEdge_ModuleInstanceContext) -> u32 ; } extern "C" { # [doc = " Get the native handler from the WASI mapped FD/Handler."] # [doc = ""] # [doc = " This function will return the raw FD/Handler from a given mapped Fd"] # [doc = " or Handler."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_ModuleInstanceContext of WASI import object."] # [doc = " \\param Fd the WASI mapped Fd."] # [doc = " \\param [out] NativeHandler the raw Fd/Handler."] # [doc = ""] # [doc = " \\returns the error code. Return `0` if the Native Handler is found."] # [doc = " Return `1` if the `Cxt` is `NULL`."] # [doc = " Return `2` if the given mapped Fd/handler is not found."] pub fn WasmEdge_ModuleInstanceWASIGetNativeHandler (Cxt : * const WasmEdge_ModuleInstanceContext , Fd : i32 , NativeHandler : * mut u64) -> u32 ; } extern "C" { # [doc = " Initialize the WasmEdge_ModuleInstanceContext for the wasmedge_process"] # [doc = " specification."] # [doc = ""] # [doc = " This function will initialize the wasmedge_process host module with the"] # [doc = " parameters."] # [doc = ""] # [doc = " \\param AllowedCmds the allowed commands white list. NULL if the"] # [doc = " length is 0."] # [doc = " \\param CmdsLen the length of the allowed commands white list."] # [doc = " \\param AllowAll the boolean value to allow all commands. `false` is"] # [doc = " suggested. If this value is `true`, the allowed commands white list will not"] # [doc = " be recorded and all commands can be executed by wasmedge_process."] pub fn WasmEdge_ModuleInstanceInitWasmEdgeProcess (AllowedCmds : * const * const :: std :: os :: raw :: c_char , CmdsLen : u32 , AllowAll : bool) ; } extern "C" { # [doc = " Get the export module name of a module instance."] # [doc = ""] # [doc = " The returned string object is linked to the module name of the module"] # [doc = " instance, and the caller should __NOT__ call the `WasmEdge_StringDelete`."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_ModuleInstanceContext."] # [doc = ""] # [doc = " \\returns string object. Length will be 0 and Buf will be NULL if failed."] pub fn WasmEdge_ModuleInstanceGetModuleName (Cxt : * const WasmEdge_ModuleInstanceContext) -> WasmEdge_String ; } extern "C" { # [doc = " Get the exported function instance context of a module instance."] # [doc = ""] # [doc = " The result function instance context links to the function instance in the"] # [doc = " module instance context and owned by the module instance context, and the"] # [doc = " caller should __NOT__ call the `WasmEdge_FunctionInstanceDelete`."] # [doc = ""] # [doc = " This function is thread-safe."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_ModuleInstanceContext."] # [doc = " \\param Name the function name WasmEdge_String."] # [doc = ""] # [doc = " \\returns pointer to the function instance context. NULL if not found."] pub fn WasmEdge_ModuleInstanceFindFunction (Cxt : * const WasmEdge_ModuleInstanceContext , Name : WasmEdge_String) -> * mut WasmEdge_FunctionInstanceContext ; } extern "C" { # [doc = " Get the exported table instance context of a module instance."] # [doc = ""] # [doc = " The result table instance context links to the table instance in the module"] # [doc = " instance context and owned by the module instance context, and the caller"] # [doc = " should __NOT__ call the `WasmEdge_TableInstanceDelete`."] # [doc = ""] # [doc = " This function is thread-safe."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_ModuleInstanceContext."] # [doc = " \\param Name the table name WasmEdge_String."] # [doc = ""] # [doc = " \\returns pointer to the table instance context. NULL if not found."] pub fn WasmEdge_ModuleInstanceFindTable (Cxt : * const WasmEdge_ModuleInstanceContext , Name : WasmEdge_String) -> * mut WasmEdge_TableInstanceContext ; } extern "C" { # [doc = " Get the exported memory instance context of a module instance."] # [doc = ""] # [doc = " The result memory instance context links to the memory instance in the"] # [doc = " module instance context and owned by the module instance context, and the"] # [doc = " caller should __NOT__ call the `WasmEdge_MemoryInstanceDelete`."] # [doc = ""] # [doc = " This function is thread-safe."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_ModuleInstanceContext."] # [doc = " \\param Name the memory name WasmEdge_String."] # [doc = ""] # [doc = " \\returns pointer to the memory instance context. NULL if not found."] pub fn WasmEdge_ModuleInstanceFindMemory (Cxt : * const WasmEdge_ModuleInstanceContext , Name : WasmEdge_String) -> * mut WasmEdge_MemoryInstanceContext ; } extern "C" { # [doc = " Get the exported global instance context of a module instance."] # [doc = ""] # [doc = " The result global instance context links to the global instance in the"] # [doc = " module instance context and owned by the module instance context, and the"] # [doc = " caller should __NOT__ call the `WasmEdge_GlobalInstanceDelete`."] # [doc = ""] # [doc = " This function is thread-safe."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_ModuleInstanceContext."] # [doc = " \\param Name the global name WasmEdge_String."] # [doc = ""] # [doc = " \\returns pointer to the global instance context. NULL if not found."] pub fn WasmEdge_ModuleInstanceFindGlobal (Cxt : * const WasmEdge_ModuleInstanceContext , Name : WasmEdge_String) -> * mut WasmEdge_GlobalInstanceContext ; } extern "C" { # [doc = " Get the length of exported function list of a module instance."] # [doc = ""] # [doc = " This function is thread-safe."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_ModuleInstanceContext."] # [doc = ""] # [doc = " \\returns length of the exported function list."] pub fn WasmEdge_ModuleInstanceListFunctionLength (Cxt : * const WasmEdge_ModuleInstanceContext) -> u32 ; } extern "C" { # [doc = " List the exported function names of a module instance."] # [doc = ""] # [doc = " The returned function names filled into the `Names` array are linked to the"] # [doc = " exported names of functions of the module instance context, and the caller"] # [doc = " should __NOT__ call the `WasmEdge_StringDelete`."] # [doc = " If the `Names` buffer length is smaller than the result of the exported"] # [doc = " function list size, the overflowed return values will be discarded."] # [doc = ""] # [doc = " This function is thread-safe."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_ModuleInstanceContext."] # [doc = " \\param [out] Names the output WasmEdge_String buffer of the function names."] # [doc = " \\param Len the buffer length."] # [doc = ""] # [doc = " \\returns actual exported function list size."] pub fn WasmEdge_ModuleInstanceListFunction (Cxt : * const WasmEdge_ModuleInstanceContext , Names : * mut WasmEdge_String , Len : u32) -> u32 ; } extern "C" { # [doc = " Get the length of exported table list of a module instance."] # [doc = ""] # [doc = " This function is thread-safe."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_ModuleInstanceContext."] # [doc = ""] # [doc = " \\returns length of the exported table list."] pub fn WasmEdge_ModuleInstanceListTableLength (Cxt : * const WasmEdge_ModuleInstanceContext) -> u32 ; } extern "C" { # [doc = " List the exported table names of a module instance."] # [doc = ""] # [doc = " The returned table names filled into the `Names` array are linked to the"] # [doc = " exported names of tables of the module instance context, and the caller"] # [doc = " should __NOT__ call the `WasmEdge_StringDelete`."] # [doc = " If the `Names` buffer length is smaller than the result of the exported"] # [doc = " table list size, the overflowed return values will be discarded."] # [doc = ""] # [doc = " This function is thread-safe."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_ModuleInstanceContext."] # [doc = " \\param [out] Names the output WasmEdge_String buffer of the table names."] # [doc = " \\param Len the buffer length."] # [doc = ""] # [doc = " \\returns actual exported table list size."] pub fn WasmEdge_ModuleInstanceListTable (Cxt : * const WasmEdge_ModuleInstanceContext , Names : * mut WasmEdge_String , Len : u32) -> u32 ; } extern "C" { # [doc = " Get the length of exported memory list of a module instance."] # [doc = ""] # [doc = " This function is thread-safe."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_ModuleInstanceContext."] # [doc = ""] # [doc = " \\returns length of the exported memory list."] pub fn WasmEdge_ModuleInstanceListMemoryLength (Cxt : * const WasmEdge_ModuleInstanceContext) -> u32 ; } extern "C" { # [doc = " List the exported memory names of a module instance."] # [doc = ""] # [doc = " The returned memory names filled into the `Names` array are linked to the"] # [doc = " exported names of memories of the module instance context, and the caller"] # [doc = " should __NOT__ call the `WasmEdge_StringDelete`."] # [doc = " If the `Names` buffer length is smaller than the result of the exported"] # [doc = " memory list size, the overflowed return values will be discarded."] # [doc = ""] # [doc = " This function is thread-safe."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_ModuleInstanceContext."] # [doc = " \\param [out] Names the output WasmEdge_String buffer of the memory names."] # [doc = " \\param Len the buffer length."] # [doc = ""] # [doc = " \\returns actual exported memory list size."] pub fn WasmEdge_ModuleInstanceListMemory (Cxt : * const WasmEdge_ModuleInstanceContext , Names : * mut WasmEdge_String , Len : u32) -> u32 ; } extern "C" { # [doc = " Get the length of exported global list of a module instance."] # [doc = ""] # [doc = " This function is thread-safe."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_ModuleInstanceContext."] # [doc = ""] # [doc = " \\returns length of the exported global list."] pub fn WasmEdge_ModuleInstanceListGlobalLength (Cxt : * const WasmEdge_ModuleInstanceContext) -> u32 ; } extern "C" { # [doc = " List the exported global names of a module instance."] # [doc = ""] # [doc = " The returned global names filled into the `Names` array are linked to the"] # [doc = " exported names of globals of the module instance context, and the caller"] # [doc = " should __NOT__ call the `WasmEdge_StringDelete`."] # [doc = " If the `Names` buffer length is smaller than the result of the exported"] # [doc = " global list size, the overflowed return values will be discarded."] # [doc = ""] # [doc = " This function is thread-safe."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_ModuleInstanceContext."] # [doc = " \\param [out] Names the output WasmEdge_String buffer of the global names."] # [doc = " \\param Len the buffer length."] # [doc = ""] # [doc = " \\returns actual exported global list size."] pub fn WasmEdge_ModuleInstanceListGlobal (Cxt : * const WasmEdge_ModuleInstanceContext , Names : * mut WasmEdge_String , Len : u32) -> u32 ; } extern "C" { # [doc = " Add a function instance context into a WasmEdge_ModuleInstanceContext."] # [doc = ""] # [doc = " Export and move the ownership of the function instance into the module"] # [doc = " instance. The caller should __NOT__ access or destroy the function instance"] # [doc = " context after calling this function."] # [doc = ""] # [doc = " This function is thread-safe."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_ModuleInstanceContext to add the function instance."] # [doc = " \\param Name the export function name WasmEdge_String."] # [doc = " \\param FuncCxt the WasmEdge_FunctionInstanceContext to add."] pub fn WasmEdge_ModuleInstanceAddFunction (Cxt : * mut WasmEdge_ModuleInstanceContext , Name : WasmEdge_String , FuncCxt : * mut WasmEdge_FunctionInstanceContext) ; } extern "C" { # [doc = " Add a table instance context into a WasmEdge_ModuleInstanceContext."] # [doc = ""] # [doc = " Export and move the ownership of the table instance into the module"] # [doc = " instance. The caller should __NOT__ access or destroy the table instance"] # [doc = " context after calling this function."] # [doc = ""] # [doc = " This function is thread-safe."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_ModuleInstanceContext to add the table instance."] # [doc = " \\param Name the export table name WasmEdge_String."] # [doc = " \\param TableCxt the WasmEdge_TableInstanceContext to add."] pub fn WasmEdge_ModuleInstanceAddTable (Cxt : * mut WasmEdge_ModuleInstanceContext , Name : WasmEdge_String , TableCxt : * mut WasmEdge_TableInstanceContext) ; } extern "C" { # [doc = " Add a memory instance context into a WasmEdge_ModuleInstanceContext."] # [doc = ""] # [doc = " Export and move the ownership of the memory instance into the module"] # [doc = " instance. The caller should __NOT__ access or destroy the memory instance"] # [doc = " context after calling this function."] # [doc = ""] # [doc = " This function is thread-safe."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_ModuleInstanceContext to add the memory instance."] # [doc = " \\param Name the export memory name WasmEdge_String."] # [doc = " \\param MemoryCxt the WasmEdge_MemoryInstanceContext to add."] pub fn WasmEdge_ModuleInstanceAddMemory (Cxt : * mut WasmEdge_ModuleInstanceContext , Name : WasmEdge_String , MemoryCxt : * mut WasmEdge_MemoryInstanceContext) ; } extern "C" { # [doc = " Add a global instance context into a WasmEdge_ModuleInstanceContext."] # [doc = ""] # [doc = " Export and move the ownership of the global instance into the module"] # [doc = " instance. The caller should __NOT__ access or destroy the global instance"] # [doc = " context after calling this function."] # [doc = ""] # [doc = " This function is thread-safe."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_ModuleInstanceContext to add the global instance."] # [doc = " \\param Name the export global name WasmEdge_String."] # [doc = " \\param GlobalCxt the WasmEdge_GlobalInstanceContext to add."] pub fn WasmEdge_ModuleInstanceAddGlobal (Cxt : * mut WasmEdge_ModuleInstanceContext , Name : WasmEdge_String , GlobalCxt : * mut WasmEdge_GlobalInstanceContext) ; } extern "C" { # [doc = " Deletion of the WasmEdge_ModuleInstanceContext."] # [doc = ""] # [doc = " After calling this function, the context will be destroyed and should"] # [doc = " __NOT__ be used."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_ModuleInstanceContext to destroy."] pub fn WasmEdge_ModuleInstanceDelete (Cxt : * mut WasmEdge_ModuleInstanceContext) ; } pub type WasmEdge_HostFunc_t = :: std :: option :: Option < unsafe extern "C" fn (Data : * mut :: std :: os :: raw :: c_void , CallFrameCxt : * const WasmEdge_CallingFrameContext , Params : * const WasmEdge_Value , Returns : * mut WasmEdge_Value) -> WasmEdge_Result > ; extern "C" { # [doc = " Creation of the WasmEdge_FunctionInstanceContext for host functions."] # [doc = ""] # [doc = " The caller owns the object and should call `WasmEdge_FunctionInstanceDelete`"] # [doc = " to destroy it if the returned object is not added into a"] # [doc = " `WasmEdge_ModuleInstanceContext`. The following is an example to create a"] # [doc = " host function context."] # [doc = " ```c"] # [doc = " WasmEdge_Result FuncAdd(void *Data,"] # [doc = "                         const WasmEdge_CallingFrameContext *CallFrameCxt,"] # [doc = "                         const WasmEdge_Value *In, WasmEdge_Value *Out) {"] # [doc = "   // Function to return A + B."] # [doc = "   int32_t A = WasmEdge_ValueGetI32(In[0]);"] # [doc = "   int32_t B = WasmEdge_ValueGetI32(In[1]);"] # [doc = "   Out[0] = WasmEdge_ValueGenI32(A + B);"] # [doc = "   // Return execution status"] # [doc = "   return WasmEdge_Result_Success;"] # [doc = " }"] # [doc = ""] # [doc = " enum WasmEdge_ValType Params[2] = {WasmEdge_ValType_I32,"] # [doc = "                                    WasmEdge_ValType_I32};"] # [doc = " enum WasmEdge_ValType Returns[1] = {WasmEdge_ValType_I32};"] # [doc = " WasmEdge_FunctionTypeContext *FuncType ="] # [doc = "     WasmEdge_FunctionTypeCreate(Params, 2, Returns, 1);"] # [doc = " WasmEdge_FunctionInstanceContext *HostFunc ="] # [doc = "     WasmEdge_FunctionInstanceCreate(FuncType, FuncAdd, NULL, 0);"] # [doc = " WasmEdge_FunctionTypeDelete(FuncType);"] # [doc = " ..."] # [doc = " ```"] # [doc = ""] # [doc = " \\param Type the function type context to describe the host function"] # [doc = " signature."] # [doc = " \\param HostFunc the host function pointer. The host function signature must"] # [doc = " be as following:"] # [doc = " ```c"] # [doc = " typedef WasmEdge_Result (*WasmEdge_HostFunc_t)("] # [doc = "     void *Data,"] # [doc = "     const WasmEdge_CallingFrameContext *CallFrameCxt,"] # [doc = "     const WasmEdge_Value *Params,"] # [doc = "     WasmEdge_Value *Returns);"] # [doc = " ```"] # [doc = " The `Params` is the input parameters array with length guaranteed to be the"] # [doc = " same as the parameter types in the `Type`. The `Returns` is the output"] # [doc = " results array with length guaranteed to be the same as the result types in"] # [doc = " the `Type`. The return value is `WasmEdge_Result` for the execution status."] # [doc = " \\param Data the additional object, such as the pointer to a data structure,"] # [doc = " to set to this host function context. The caller should guarantee the life"] # [doc = " cycle of the object. NULL if the additional data object is not needed."] # [doc = " \\param Cost the function cost in statistics. Pass 0 if the calculation is"] # [doc = " not needed."] # [doc = ""] # [doc = " \\returns pointer to context, NULL if failed."] pub fn WasmEdge_FunctionInstanceCreate (Type : * const WasmEdge_FunctionTypeContext , HostFunc : WasmEdge_HostFunc_t , Data : * mut :: std :: os :: raw :: c_void , Cost : u64) -> * mut WasmEdge_FunctionInstanceContext ; } pub type WasmEdge_WrapFunc_t = :: std :: option :: Option < unsafe extern "C" fn (This : * mut :: std :: os :: raw :: c_void , Data : * mut :: std :: os :: raw :: c_void , CallFrameCxt : * const WasmEdge_CallingFrameContext , Params : * const WasmEdge_Value , ParamLen : u32 , Returns : * mut WasmEdge_Value , ReturnLen : u32) -> WasmEdge_Result > ; extern "C" { # [doc = " Creation of the WasmEdge_FunctionInstanceContext for host functions."] # [doc = ""] # [doc = " This function is for the languages which cannot pass the function pointer of"] # [doc = " the host function into this shared library directly. The caller owns the"] # [doc = " object and should call `WasmEdge_FunctionInstanceDelete` to destroy it if"] # [doc = " the returned object is not added into a `WasmEdge_ModuleInstanceContext`."] # [doc = " The following is an example to create a host function context for other"] # [doc = " languages."] # [doc = " ```c"] # [doc = " // `RealFunc` is the pointer to the function in other languages."] # [doc = ""] # [doc = " WasmEdge_Result FuncAddWrap("] # [doc = "     void *This, void *Data,"] # [doc = "     const WasmEdge_CallingFrameContext *CallFrameCxt,"] # [doc = "     const WasmEdge_Value *In, const uint32_t InLen, WasmEdge_Value *Out,"] # [doc = "     const uint32_t OutLen) {"] # [doc = "   // Wrapper function of host function to return A + B."] # [doc = ""] # [doc = "   // `This` is the same as `RealFunc`."] # [doc = "   int32_t A = WasmEdge_ValueGetI32(In[0]);"] # [doc = "   int32_t B = WasmEdge_ValueGetI32(In[1]);"] # [doc = ""] # [doc = "   // Call the function of `This` in the host language ..."] # [doc = "   int32_t Result = ...;"] # [doc = ""] # [doc = "   Out[0] = Result;"] # [doc = "   // Return the execution status."] # [doc = "   return WasmEdge_Result_Success;"] # [doc = " }"] # [doc = ""] # [doc = " enum WasmEdge_ValType Params[2] = {WasmEdge_ValType_I32,"] # [doc = "                                    WasmEdge_ValType_I32};"] # [doc = " enum WasmEdge_ValType Returns[1] = {WasmEdge_ValType_I32};"] # [doc = " WasmEdge_FunctionTypeContext *FuncType ="] # [doc = "     WasmEdge_FunctionTypeCreate(Params, 2, Returns, 1);"] # [doc = " WasmEdge_FunctionInstanceContext *HostFunc ="] # [doc = "     WasmEdge_FunctionInstanceCreateBinding("] # [doc = "         FuncType, FuncAddWrap, RealFunc, NULL, 0);"] # [doc = " WasmEdge_FunctionTypeDelete(FuncType);"] # [doc = " ..."] # [doc = " ```"] # [doc = ""] # [doc = " \\param Type the function type context to describe the host function"] # [doc = " signature."] # [doc = " \\param WrapFunc the wrapper function pointer. The wrapper function signature"] # [doc = " must be as following:"] # [doc = " ```c"] # [doc = " typedef WasmEdge_Result (*WasmEdge_WrapFunc_t)("] # [doc = "     void *This,"] # [doc = "     void *Data,"] # [doc = "     WasmEdge_CallingFrameContext *FrameCxt,"] # [doc = "     const WasmEdge_Value *Params,"] # [doc = "     const uint32_t ParamLen,"] # [doc = "     WasmEdge_Value *Returns,"] # [doc = "     const uint32_t ReturnLen);"] # [doc = " ```"] # [doc = " The `This` is the pointer the same as the `Binding` parameter of this"] # [doc = " function. The `Params` is the input parameters array with length guaranteed"] # [doc = " to be the same as the parameter types in the `Type`, and the `ParamLen` is"] # [doc = " the length of the array. The `Returns` is the output results array with"] # [doc = " length guaranteed to be the same as the result types in the `Type`, and the"] # [doc = " `ReturnLen` is the length of the array. The return value is"] # [doc = " `WasmEdge_Result` for the execution status."] # [doc = " \\param Binding the `this` pointer of the host function target or the"] # [doc = " function indexing maintained by the caller which can specify the host"] # [doc = " function. When invoking the host function, this pointer will be the first"] # [doc = " argument of the wrapper function."] # [doc = " \\param Data the additional object, such as the pointer to a data structure,"] # [doc = " to set to this host function context. The caller should guarantee the life"] # [doc = " cycle of the object. NULL if the additional data object is not needed."] # [doc = " \\param Cost the function cost in statistics. Pass 0 if the calculation is"] # [doc = " not needed."] # [doc = ""] # [doc = " \\returns pointer to context, NULL if failed."] pub fn WasmEdge_FunctionInstanceCreateBinding (Type : * const WasmEdge_FunctionTypeContext , WrapFunc : WasmEdge_WrapFunc_t , Binding : * mut :: std :: os :: raw :: c_void , Data : * mut :: std :: os :: raw :: c_void , Cost : u64) -> * mut WasmEdge_FunctionInstanceContext ; } extern "C" { # [doc = " Get the function type context of the function instance."] # [doc = ""] # [doc = " The function type context links to the function type in the function"] # [doc = " instance context and owned by the context. The caller should __NOT__ call"] # [doc = " the `WasmEdge_FunctionTypeDelete`."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_FunctionInstanceContext."] # [doc = ""] # [doc = " \\returns pointer to context, NULL if failed."] pub fn WasmEdge_FunctionInstanceGetFunctionType (Cxt : * const WasmEdge_FunctionInstanceContext) -> * const WasmEdge_FunctionTypeContext ; } extern "C" { # [doc = " Deletion of the WasmEdge_FunctionInstanceContext."] # [doc = ""] # [doc = " After calling this function, the context will be destroyed and should"] # [doc = " __NOT__ be used."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_FunctionInstanceContext to destroy."] pub fn WasmEdge_FunctionInstanceDelete (Cxt : * mut WasmEdge_FunctionInstanceContext) ; } extern "C" { # [doc = " Creation of the WasmEdge_TableInstanceContext."] # [doc = ""] # [doc = " The caller owns the object and should call `WasmEdge_TableInstanceDelete` to"] # [doc = " destroy it."] # [doc = ""] # [doc = " \\param TabType the table type context to initialize the table instance"] # [doc = " context."] # [doc = ""] # [doc = " \\returns pointer to context, NULL if failed."] pub fn WasmEdge_TableInstanceCreate (TabType : * const WasmEdge_TableTypeContext) -> * mut WasmEdge_TableInstanceContext ; } extern "C" { # [doc = " Get the table type context from a table instance."] # [doc = ""] # [doc = " The table type context links to the table type in the table instance context"] # [doc = " and owned by the context. The caller should __NOT__ call the"] # [doc = " `WasmEdge_TableTypeDelete`."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_TableInstanceContext."] # [doc = ""] # [doc = " \\returns pointer to context, NULL if failed."] pub fn WasmEdge_TableInstanceGetTableType (Cxt : * const WasmEdge_TableInstanceContext) -> * const WasmEdge_TableTypeContext ; } extern "C" { # [doc = " Get the reference value in a table instance."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_TableInstanceContext."] # [doc = " \\param [out] Data the result reference value."] # [doc = " \\param Offset the reference value offset (index) in the table instance."] # [doc = ""] # [doc = " \\returns WasmEdge_Result. Call `WasmEdge_ResultGetMessage` for the error"] # [doc = " message."] pub fn WasmEdge_TableInstanceGetData (Cxt : * const WasmEdge_TableInstanceContext , Data : * mut WasmEdge_Value , Offset : u32) -> WasmEdge_Result ; } extern "C" { # [doc = " Set the reference value into a table instance."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_TableInstanceContext."] # [doc = " \\param Data the reference value to set into the table instance."] # [doc = " \\param Offset the reference value offset (index) in the table instance."] # [doc = ""] # [doc = " \\returns WasmEdge_Result. Call `WasmEdge_ResultGetMessage` for the error"] # [doc = " message."] pub fn WasmEdge_TableInstanceSetData (Cxt : * mut WasmEdge_TableInstanceContext , Data : WasmEdge_Value , Offset : u32) -> WasmEdge_Result ; } extern "C" { # [doc = " Get the size of a table instance."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_TableInstanceContext."] # [doc = ""] # [doc = " \\returns the size of the table instance."] pub fn WasmEdge_TableInstanceGetSize (Cxt : * const WasmEdge_TableInstanceContext) -> u32 ; } extern "C" { # [doc = " Grow a table instance with a size."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_TableInstanceContext."] # [doc = " \\param Size the count of reference values to grow in the table instance."] # [doc = ""] # [doc = " \\returns WasmEdge_Result. Call `WasmEdge_ResultGetMessage` for the error"] # [doc = " message."] pub fn WasmEdge_TableInstanceGrow (Cxt : * mut WasmEdge_TableInstanceContext , Size : u32) -> WasmEdge_Result ; } extern "C" { # [doc = " Deletion of the WasmEdge_TableInstanceContext."] # [doc = ""] # [doc = " After calling this function, the context will be destroyed and should"] # [doc = " __NOT__ be used."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_TableInstanceContext to destroy."] pub fn WasmEdge_TableInstanceDelete (Cxt : * mut WasmEdge_TableInstanceContext) ; } extern "C" { # [doc = " Creation of the WasmEdge_MemoryInstanceContext."] # [doc = ""] # [doc = " The caller owns the object and should call `WasmEdge_MemoryInstanceDelete`"] # [doc = " to destroy it."] # [doc = ""] # [doc = " \\param MemType the memory type context to initialize the memory instance"] # [doc = " context."] # [doc = ""] # [doc = " \\returns pointer to context, NULL if failed."] pub fn WasmEdge_MemoryInstanceCreate (MemType : * const WasmEdge_MemoryTypeContext) -> * mut WasmEdge_MemoryInstanceContext ; } extern "C" { # [doc = " Get the memory type context from a memory instance."] # [doc = ""] # [doc = " The memory type context links to the memory type in the memory instance"] # [doc = " context and owned by the context. The caller should __NOT__ call the"] # [doc = " `WasmEdge_MemoryTypeDelete`."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_MemoryInstanceContext."] # [doc = ""] # [doc = " \\returns pointer to context, NULL if failed."] pub fn WasmEdge_MemoryInstanceGetMemoryType (Cxt : * const WasmEdge_MemoryInstanceContext) -> * const WasmEdge_MemoryTypeContext ; } extern "C" { # [doc = " Copy the data to the output buffer from a memory instance."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_MemoryInstanceContext."] # [doc = " \\param [out] Data the result data buffer of copying destination."] # [doc = " \\param Offset the data start offset in the memory instance."] # [doc = " \\param Length the requested data length. If the `Offset + Length` is larger"] # [doc = " than the data size in the memory instance, this function will failed."] # [doc = ""] # [doc = " \\returns WasmEdge_Result. Call `WasmEdge_ResultGetMessage` for the error"] # [doc = " message."] pub fn WasmEdge_MemoryInstanceGetData (Cxt : * const WasmEdge_MemoryInstanceContext , Data : * mut u8 , Offset : u32 , Length : u32) -> WasmEdge_Result ; } extern "C" { # [doc = " Copy the data into a memory instance from the input buffer."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_MemoryInstanceContext."] # [doc = " \\param Data the data buffer to copy."] # [doc = " \\param Offset the data start offset in the memory instance."] # [doc = " \\param Length the data buffer length. If the `Offset + Length` is larger"] # [doc = " than the data size in the memory instance, this function will failed."] # [doc = ""] # [doc = " \\returns WasmEdge_Result. Call `WasmEdge_ResultGetMessage` for the error"] # [doc = " message."] pub fn WasmEdge_MemoryInstanceSetData (Cxt : * mut WasmEdge_MemoryInstanceContext , Data : * const u8 , Offset : u32 , Length : u32) -> WasmEdge_Result ; } extern "C" { # [doc = " Get the data pointer in a memory instance."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_MemoryInstanceContext."] # [doc = " \\param Offset the data start offset in the memory instance."] # [doc = " \\param Length the requested data length. If the `Offset + Length` is larger"] # [doc = " than the data size in the memory instance, this function will return NULL."] # [doc = ""] # [doc = " \\returns the pointer to data with the start offset. NULL if failed."] pub fn WasmEdge_MemoryInstanceGetPointer (Cxt : * mut WasmEdge_MemoryInstanceContext , Offset : u32 , Length : u32) -> * mut u8 ; } extern "C" { # [doc = " Get the const data pointer in a const memory instance."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_MemoryInstanceContext."] # [doc = " \\param Offset the data start offset in the memory instance."] # [doc = " \\param Length the requested data length. If the `Offset + Length` is larger"] # [doc = " than the data size in the memory instance, this function will return NULL."] # [doc = ""] # [doc = " \\returns the pointer to data with the start offset. NULL if failed."] pub fn WasmEdge_MemoryInstanceGetPointerConst (Cxt : * const WasmEdge_MemoryInstanceContext , Offset : u32 , Length : u32) -> * const u8 ; } extern "C" { # [doc = " Get the current page size (64 KiB of each page) of a memory instance."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_MemoryInstanceContext."] # [doc = ""] # [doc = " \\returns the page size of the memory instance."] pub fn WasmEdge_MemoryInstanceGetPageSize (Cxt : * const WasmEdge_MemoryInstanceContext) -> u32 ; } extern "C" { # [doc = " Grow a memory instance with a page size."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_MemoryInstanceContext."] # [doc = " \\param Page the page count to grow in the memory instance."] # [doc = ""] # [doc = " \\returns WasmEdge_Result. Call `WasmEdge_ResultGetMessage` for the error"] # [doc = " message."] pub fn WasmEdge_MemoryInstanceGrowPage (Cxt : * mut WasmEdge_MemoryInstanceContext , Page : u32) -> WasmEdge_Result ; } extern "C" { # [doc = " Deletion of the WasmEdge_MemoryInstanceContext."] # [doc = ""] # [doc = " After calling this function, the context will be destroyed and should"] # [doc = " __NOT__ be used."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_MemoryInstanceContext to destroy."] pub fn WasmEdge_MemoryInstanceDelete (Cxt : * mut WasmEdge_MemoryInstanceContext) ; } extern "C" { # [doc = " Creation of the WasmEdge_GlobalInstanceContext."] # [doc = ""] # [doc = " The caller owns the object and should call `WasmEdge_GlobalInstanceDelete`"] # [doc = " to destroy it."] # [doc = ""] # [doc = " \\param GlobType the global type context to initialize the global instance"] # [doc = " context."] # [doc = " \\param Value the initial value with its value type of the global instance."] # [doc = " This function will fail if the value type of `GlobType` and `Value` are not"] # [doc = " the same."] # [doc = ""] # [doc = " \\returns pointer to context, NULL if failed."] pub fn WasmEdge_GlobalInstanceCreate (GlobType : * const WasmEdge_GlobalTypeContext , Value : WasmEdge_Value) -> * mut WasmEdge_GlobalInstanceContext ; } extern "C" { # [doc = " Get the global type context from a global instance."] # [doc = ""] # [doc = " The global type context links to the global type in the global instance"] # [doc = " context and owned by the context. The caller should __NOT__ call the"] # [doc = " `WasmEdge_GlobalTypeDelete`."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_GlobalInstanceContext."] # [doc = ""] # [doc = " \\returns pointer to context, NULL if failed."] pub fn WasmEdge_GlobalInstanceGetGlobalType (Cxt : * const WasmEdge_GlobalInstanceContext) -> * const WasmEdge_GlobalTypeContext ; } extern "C" { # [doc = " Get the value from a global instance."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_GlobalInstanceContext."] # [doc = ""] # [doc = " \\returns the current value of the global instance."] pub fn WasmEdge_GlobalInstanceGetValue (Cxt : * const WasmEdge_GlobalInstanceContext) -> WasmEdge_Value ; } extern "C" { # [doc = " Set the value from a global instance."] # [doc = ""] # [doc = " This function will do nothing if the global context is set as the `Const`"] # [doc = " mutation or the value type not matched."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_GlobalInstanceContext."] # [doc = " \\param Value the value to set into the global context."] pub fn WasmEdge_GlobalInstanceSetValue (Cxt : * mut WasmEdge_GlobalInstanceContext , Value : WasmEdge_Value) ; } extern "C" { # [doc = " Deletion of the WasmEdge_GlobalInstanceContext."] # [doc = ""] # [doc = " After calling this function, the context will be destroyed and should"] # [doc = " __NOT__ be used."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_GlobalInstanceContext to destroy."] pub fn WasmEdge_GlobalInstanceDelete (Cxt : * mut WasmEdge_GlobalInstanceContext) ; } extern "C" { # [doc = " Get the executor context from the current calling frame."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_CallingFrameContext."] # [doc = ""] # [doc = " \\returns the executor context, NULL if the Cxt is NULL."] pub fn WasmEdge_CallingFrameGetExecutor (Cxt : * const WasmEdge_CallingFrameContext) -> * mut WasmEdge_ExecutorContext ; } extern "C" { # [doc = " Get the module instance of the current calling frame."] # [doc = ""] # [doc = " When a WASM function is executing and start to call a host function, a frame"] # [doc = " with the module instance which the WASM function belongs to will be pushed"] # [doc = " onto the stack. And therefore the calling frame context will record that"] # [doc = " module instance."] # [doc = " So in one case that the module instance will be `NULL`: developers execute"] # [doc = " the function instance which is a host function and not added into a module"] # [doc = " instance."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_CallingFrameContext."] # [doc = ""] # [doc = " \\returns the module instance of the current calling frame."] pub fn WasmEdge_CallingFrameGetModuleInstance (Cxt : * const WasmEdge_CallingFrameContext) -> * const WasmEdge_ModuleInstanceContext ; } extern "C" { # [doc = " Get the memory instance by index from the module instance of the current"] # [doc = " calling frame."] # [doc = ""] # [doc = " By default, a WASM module only have one memory instance after instantiation."] # [doc = " Therefore, developers can use:"] # [doc = "   `WasmEdge_CallingFrameGetMemoryInstance(Cxt, 0)`"] # [doc = " to get the memory instance in host function body."] # [doc = " This extension is for the WASM multiple memories proposal. After enabling"] # [doc = " the proposal, there may be greater than 1 memory instances in a WASM module."] # [doc = " So developers can use this function to access the memory instances which are"] # [doc = " not in 0 index."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_CallingFrameContext."] # [doc = " \\param Idx the index of memory instance in the module instance."] # [doc = ""] # [doc = " \\returns the memory instance, NULL if not found."] pub fn WasmEdge_CallingFrameGetMemoryInstance (Cxt : * const WasmEdge_CallingFrameContext , Idx : u32) -> * mut WasmEdge_MemoryInstanceContext ; } extern "C" { # [doc = " Wait a WasmEdge_Async execution."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_ASync."] pub fn WasmEdge_AsyncWait (Cxt : * const WasmEdge_Async) ; } extern "C" { # [doc = " Wait a WasmEdge_Async execution with timeout."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_ASync."] # [doc = " \\param Milliseconds times to wait."] # [doc = ""] # [doc = " \\returns Result of waiting, true for execution ended, false for timeout"] # [doc = " occurred."] pub fn WasmEdge_AsyncWaitFor (Cxt : * const WasmEdge_Async , Milliseconds : u64) -> bool ; } extern "C" { # [doc = " Cancel a WasmEdge_Async execution."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_ASync."] pub fn WasmEdge_AsyncCancel (Cxt : * mut WasmEdge_Async) ; } extern "C" { # [doc = " Wait and get the return list length of the WasmEdge_Async execution."] # [doc = ""] # [doc = " This function will wait until the execution finished and return the return"] # [doc = " value list length of the executed function. This function will return 0 if"] # [doc = " the `Cxt` is NULL, the execution was failed, or the execution was canceled."] # [doc = " Developers can call the `WasmEdge_AsyncGet` to get the execution status and"] # [doc = " the return values."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_ASync."] # [doc = ""] # [doc = " \\returns the return list length of the executed function."] pub fn WasmEdge_AsyncGetReturnsLength (Cxt : * const WasmEdge_Async) -> u32 ; } extern "C" { # [doc = " Wait and get the result of WasmEdge_Async execution."] # [doc = ""] # [doc = " This function will wait until the execution finished and return the"] # [doc = " execution status and the return values."] # [doc = " If the `Returns` buffer length is smaller than the arity of the function,"] # [doc = " the overflowed return values will be discarded."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_ASync."] # [doc = " \\param [out] Returns the WasmEdge_Value buffer to fill the return values."] # [doc = " \\param ReturnLen the return buffer length."] # [doc = ""] # [doc = " \\returns WasmEdge_Result. Call `WasmEdge_ResultGetMessage` for the error"] # [doc = " message."] pub fn WasmEdge_AsyncGet (Cxt : * const WasmEdge_Async , Returns : * mut WasmEdge_Value , ReturnLen : u32) -> WasmEdge_Result ; } extern "C" { # [doc = " Deletion of the WasmEdge_Async."] # [doc = ""] # [doc = " After calling this function, the context will be destroyed and should"] # [doc = " __NOT__ be used."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_ASync to destroy."] pub fn WasmEdge_AsyncDelete (Cxt : * mut WasmEdge_Async) ; } extern "C" { # [doc = " Creation of the WasmEdge_VMContext."] # [doc = ""] # [doc = " The caller owns the object and should call `WasmEdge_VMDelete` to destroy"] # [doc = " it."] # [doc = ""] # [doc = " \\param ConfCxt the WasmEdge_ConfigureContext as the configuration of VM."] # [doc = " NULL for the default configuration."] # [doc = " \\param StoreCxt the WasmEdge_StoreContext as the external WASM store of VM."] # [doc = " The instantiation and execution will refer to this store context, and the"] # [doc = " life cycle should be ensured until the VM context is deleted. NULL for the"] # [doc = " default store owned by `WasmEdge_VMContext`."] # [doc = ""] # [doc = " \\returns pointer to context, NULL if failed."] pub fn WasmEdge_VMCreate (ConfCxt : * const WasmEdge_ConfigureContext , StoreCxt : * mut WasmEdge_StoreContext) -> * mut WasmEdge_VMContext ; } extern "C" { # [doc = " Register and instantiate WASM into the store in VM from a WASM file."] # [doc = ""] # [doc = " Load a WASM file from the path, and register all exported instances and"] # [doc = " instantiate them into the store into the VM with their exported name and"] # [doc = " module name."] # [doc = ""] # [doc = " This function is thread-safe."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_VMContext which contains the store."] # [doc = " \\param ModuleName the WasmEdge_String of module name for all exported"] # [doc = " instances."] # [doc = " \\param Path the NULL-terminated C string of the WASM file path."] # [doc = ""] # [doc = " \\returns WasmEdge_Result. Call `WasmEdge_ResultGetMessage` for the error"] # [doc = " message."] pub fn WasmEdge_VMRegisterModuleFromFile (Cxt : * mut WasmEdge_VMContext , ModuleName : WasmEdge_String , Path : * const :: std :: os :: raw :: c_char) -> WasmEdge_Result ; } extern "C" { # [doc = " Register and instantiate WASM into the store in VM from a buffer."] # [doc = ""] # [doc = " Load a WASM module from a buffer, and register all exported instances and"] # [doc = " instantiate them into the store into the VM with their exported name and"] # [doc = " module name."] # [doc = ""] # [doc = " This function is thread-safe."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_VMContext which contains the store."] # [doc = " \\param ModuleName the WasmEdge_String of module name for all exported"] # [doc = " instances."] # [doc = " \\param Buf the buffer of WASM binary."] # [doc = " \\param BufLen the length of the buffer."] # [doc = ""] # [doc = " \\returns WasmEdge_Result. Call `WasmEdge_ResultGetMessage` for the error"] # [doc = " message."] pub fn WasmEdge_VMRegisterModuleFromBuffer (Cxt : * mut WasmEdge_VMContext , ModuleName : WasmEdge_String , Buf : * const u8 , BufLen : u32) -> WasmEdge_Result ; } extern "C" { # [doc = " Instantiate and register an AST Module into a named module instance in VM."] # [doc = ""] # [doc = " Load from the AST Module, and register all exported instances and"] # [doc = " instantiate them into the store in VM with their exported name and module"] # [doc = " name."] # [doc = ""] # [doc = " This function is thread-safe."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_VMContext which contains the store."] # [doc = " \\param ModuleName the WasmEdge_String of module name for all exported"] # [doc = " instances."] # [doc = " \\param ASTCxt the WasmEdge AST Module context generated by loader or"] # [doc = " compiler."] # [doc = ""] # [doc = " \\returns WasmEdge_Result. Call `WasmEdge_ResultGetMessage` for the error"] # [doc = " message."] pub fn WasmEdge_VMRegisterModuleFromASTModule (Cxt : * mut WasmEdge_VMContext , ModuleName : WasmEdge_String , ASTCxt : * const WasmEdge_ASTModuleContext) -> WasmEdge_Result ; } extern "C" { # [doc = " Register a module instance into the store in VM with exporting its module"] # [doc = " name."] # [doc = ""] # [doc = " Register an existing module into the store in VM with its module name."] # [doc = " After calling this function, the module instance is registered into the"] # [doc = " store in VM, and the other modules can import the instances for linking when"] # [doc = " instantiating other modules. Developers should guarantee the life cycle of"] # [doc = " this registered module instance, or the error will occur when in execution"] # [doc = " after the module instance destroyed if it has been imported by other"] # [doc = " modules."] # [doc = ""] # [doc = " This function is thread-safe."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_VMContext which contains the store."] # [doc = " \\param ImportCxt the WasmEdge_ModuleInstanceContext to register."] # [doc = ""] # [doc = " \\returns WasmEdge_Result. Call `WasmEdge_ResultGetMessage` for the error"] # [doc = " message."] pub fn WasmEdge_VMRegisterModuleFromImport (Cxt : * mut WasmEdge_VMContext , ImportCxt : * const WasmEdge_ModuleInstanceContext) -> WasmEdge_Result ; } extern "C" { # [doc = " Instantiate the WASM module from a WASM file and invoke a function by name."] # [doc = ""] # [doc = " This is the function to invoke a WASM function rapidly."] # [doc = " Load and instantiate the WASM module from the file path, and then invoke a"] # [doc = " function by name and parameters. If the `Returns` buffer length is smaller"] # [doc = " than the arity of the function, the overflowed return values will be"] # [doc = " discarded."] # [doc = " After calling this function, a new module instance is instantiated, and the"] # [doc = " old one will be destroyed."] # [doc = ""] # [doc = " This function is thread-safe."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_VMContext."] # [doc = " \\param Path the NULL-terminated C string of the WASM file path."] # [doc = " \\param FuncName the function name WasmEdge_String."] # [doc = " \\param Params the WasmEdge_Value buffer with the parameter values."] # [doc = " \\param ParamLen the parameter buffer length."] # [doc = " \\param [out] Returns the WasmEdge_Value buffer to fill the return values."] # [doc = " \\param ReturnLen the return buffer length."] # [doc = ""] # [doc = " \\returns WasmEdge_Result. Call `WasmEdge_ResultGetMessage` for the error"] # [doc = " message."] pub fn WasmEdge_VMRunWasmFromFile (Cxt : * mut WasmEdge_VMContext , Path : * const :: std :: os :: raw :: c_char , FuncName : WasmEdge_String , Params : * const WasmEdge_Value , ParamLen : u32 , Returns : * mut WasmEdge_Value , ReturnLen : u32) -> WasmEdge_Result ; } extern "C" { # [doc = " Instantiate the WASM module from a buffer and invoke a function by name."] # [doc = ""] # [doc = " This is the function to invoke a WASM function rapidly."] # [doc = " Load and instantiate the WASM module from a buffer, and then invoke a"] # [doc = " function by name and parameters. If the `Returns` buffer length is smaller"] # [doc = " than the arity of the function, the overflowed return values will be"] # [doc = " discarded."] # [doc = " After calling this function, a new module instance is instantiated, and the"] # [doc = " old one will be destroyed."] # [doc = ""] # [doc = " This function is thread-safe."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_VMContext."] # [doc = " \\param Buf the buffer of WASM binary."] # [doc = " \\param BufLen the length of the buffer."] # [doc = " \\param FuncName the function name WasmEdge_String."] # [doc = " \\param Params the WasmEdge_Value buffer with the parameter values."] # [doc = " \\param ParamLen the parameter buffer length."] # [doc = " \\param [out] Returns the WasmEdge_Value buffer to fill the return values."] # [doc = " \\param ReturnLen the return buffer length."] # [doc = ""] # [doc = " \\returns WasmEdge_Result. Call `WasmEdge_ResultGetMessage` for the error"] # [doc = " message."] pub fn WasmEdge_VMRunWasmFromBuffer (Cxt : * mut WasmEdge_VMContext , Buf : * const u8 , BufLen : u32 , FuncName : WasmEdge_String , Params : * const WasmEdge_Value , ParamLen : u32 , Returns : * mut WasmEdge_Value , ReturnLen : u32) -> WasmEdge_Result ; } extern "C" { # [doc = " Instantiate the WASM module from a WasmEdge AST Module and invoke a function"] # [doc = " by name."] # [doc = ""] # [doc = " This is the function to invoke a WASM function rapidly."] # [doc = " Load and instantiate the WASM module from the WasmEdge AST Module, and then"] # [doc = " invoke the function by name and parameters. If the `Returns` buffer length"] # [doc = " is smaller than the arity of the function, the overflowed return values will"] # [doc = " be discarded."] # [doc = " After calling this function, a new module instance is instantiated, and the"] # [doc = " old one will be destroyed."] # [doc = ""] # [doc = " This function is thread-safe."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_VMContext."] # [doc = " \\param ASTCxt the WasmEdge AST Module context generated by loader or"] # [doc = " compiler."] # [doc = " \\param FuncName the function name WasmEdge_String."] # [doc = " \\param Params the WasmEdge_Value buffer with the parameter values."] # [doc = " \\param ParamLen the parameter buffer length."] # [doc = " \\param [out] Returns the WasmEdge_Value buffer to fill the return values."] # [doc = " \\param ReturnLen the return buffer length."] # [doc = ""] # [doc = " \\returns WasmEdge_Result. Call `WasmEdge_ResultGetMessage` for the error"] # [doc = " message."] pub fn WasmEdge_VMRunWasmFromASTModule (Cxt : * mut WasmEdge_VMContext , ASTCxt : * const WasmEdge_ASTModuleContext , FuncName : WasmEdge_String , Params : * const WasmEdge_Value , ParamLen : u32 , Returns : * mut WasmEdge_Value , ReturnLen : u32) -> WasmEdge_Result ; } extern "C" { # [doc = " Instantiate the WASM module from a WASM file and asynchronous invoke a"] # [doc = " function by name."] # [doc = ""] # [doc = " This is the function to invoke a WASM function rapidly."] # [doc = " Load and instantiate the WASM module from the file path, and then invoke a"] # [doc = " function by name and parameters. If the `Returns` buffer length is smaller"] # [doc = " than the arity of the function, the overflowed return values will be"] # [doc = " discarded."] # [doc = " After calling this function, a new module instance is instantiated, and the"] # [doc = " old one will be destroyed."] # [doc = ""] # [doc = " The caller owns the object and should call `WasmEdge_AsyncDelete` to destroy"] # [doc = " it."] # [doc = ""] # [doc = " This function is thread-safe."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_VMContext."] # [doc = " \\param Path the NULL-terminated C string of the WASM file path."] # [doc = " \\param FuncName the function name WasmEdge_String."] # [doc = " \\param Params the WasmEdge_Value buffer with the parameter values."] # [doc = " \\param ParamLen the parameter buffer length."] # [doc = ""] # [doc = " \\returns WasmEdge_Async. Call `WasmEdge_AsyncGet` for the result, and call"] # [doc = " `WasmEdge_AsyncDelete` to destroy this object."] pub fn WasmEdge_VMAsyncRunWasmFromFile (Cxt : * mut WasmEdge_VMContext , Path : * const :: std :: os :: raw :: c_char , FuncName : WasmEdge_String , Params : * const WasmEdge_Value , ParamLen : u32) -> * mut WasmEdge_Async ; } extern "C" { # [doc = " Instantiate the WASM module from a buffer and asynchronous invoke a function"] # [doc = " by name."] # [doc = ""] # [doc = " This is the function to invoke a WASM function rapidly."] # [doc = " Load and instantiate the WASM module from a buffer, and then invoke a"] # [doc = " function by name and parameters. If the `Returns` buffer length is smaller"] # [doc = " than the arity of the function, the overflowed return values will be"] # [doc = " discarded."] # [doc = " After calling this function, a new module instance is instantiated, and the"] # [doc = " old one will be destroyed."] # [doc = ""] # [doc = " The caller owns the object and should call `WasmEdge_AsyncDelete` to destroy"] # [doc = " it."] # [doc = ""] # [doc = " This function is thread-safe."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_VMContext."] # [doc = " \\param Buf the buffer of WASM binary."] # [doc = " \\param BufLen the length of the buffer."] # [doc = " \\param FuncName the function name WasmEdge_String."] # [doc = " \\param Params the WasmEdge_Value buffer with the parameter values."] # [doc = " \\param ParamLen the parameter buffer length."] # [doc = ""] # [doc = " \\returns WasmEdge_Async. Call `WasmEdge_AsyncGet` for the result, and call"] # [doc = " `WasmEdge_AsyncDelete` to destroy this object."] pub fn WasmEdge_VMAsyncRunWasmFromBuffer (Cxt : * mut WasmEdge_VMContext , Buf : * const u8 , BufLen : u32 , FuncName : WasmEdge_String , Params : * const WasmEdge_Value , ParamLen : u32) -> * mut WasmEdge_Async ; } extern "C" { # [doc = " Instantiate the WASM module from a WasmEdge AST Module and asynchronous"] # [doc = " invoke a function by name."] # [doc = ""] # [doc = " This is the function to invoke a WASM function rapidly."] # [doc = " Load and instantiate the WASM module from the WasmEdge AST Module, and then"] # [doc = " invoke the function by name and parameters. If the `Returns` buffer length"] # [doc = " is smaller than the arity of the function, the overflowed return values will"] # [doc = " be discarded."] # [doc = " After calling this function, a new module instance is instantiated, and the"] # [doc = " old one will be destroyed."] # [doc = ""] # [doc = " The caller owns the object and should call `WasmEdge_AsyncDelete` to destroy"] # [doc = " it."] # [doc = ""] # [doc = " This function is thread-safe."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_VMContext."] # [doc = " \\param ASTCxt the WasmEdge AST Module context generated by loader or"] # [doc = " compiler."] # [doc = " \\param FuncName the function name WasmEdge_String."] # [doc = " \\param Params the WasmEdge_Value buffer with the parameter values."] # [doc = " \\param ParamLen the parameter buffer length."] # [doc = ""] # [doc = " \\returns WasmEdge_Async. Call `WasmEdge_AsyncGet` for the result, and call"] # [doc = " `WasmEdge_AsyncDelete` to destroy this object."] pub fn WasmEdge_VMAsyncRunWasmFromASTModule (Cxt : * mut WasmEdge_VMContext , ASTCxt : * const WasmEdge_ASTModuleContext , FuncName : WasmEdge_String , Params : * const WasmEdge_Value , ParamLen : u32) -> * mut WasmEdge_Async ; } extern "C" { # [doc = " Load the WASM module from a WASM file."] # [doc = ""] # [doc = " This is the first step to invoke a WASM function step by step."] # [doc = " Load and parse the WASM module from the file path. You can then call"] # [doc = " `WasmEdge_VMValidate` for the next step."] # [doc = ""] # [doc = " This function is thread-safe."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_VMContext."] # [doc = " \\param Path the NULL-terminated C string of the WASM file path."] # [doc = ""] # [doc = " \\returns WasmEdge_Result. Call `WasmEdge_ResultGetMessage` for the error"] # [doc = " message."] pub fn WasmEdge_VMLoadWasmFromFile (Cxt : * mut WasmEdge_VMContext , Path : * const :: std :: os :: raw :: c_char) -> WasmEdge_Result ; } extern "C" { # [doc = " Load the WASM module from a buffer."] # [doc = ""] # [doc = " This is the first step to invoke a WASM function step by step."] # [doc = " Load and parse the WASM module from a buffer. You can then call"] # [doc = " `WasmEdge_VMValidate` for the next step."] # [doc = ""] # [doc = " This function is thread-safe."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_VMContext."] # [doc = " \\param Buf the buffer of WASM binary."] # [doc = " \\param BufLen the length of the buffer."] # [doc = ""] # [doc = " \\returns WasmEdge_Result. Call `WasmEdge_ResultGetMessage` for the error"] # [doc = " message."] pub fn WasmEdge_VMLoadWasmFromBuffer (Cxt : * mut WasmEdge_VMContext , Buf : * const u8 , BufLen : u32) -> WasmEdge_Result ; } extern "C" { # [doc = " Load the WASM module from loaded WasmEdge AST Module."] # [doc = ""] # [doc = " This is the first step to invoke a WASM function step by step."] # [doc = " Copy the loaded WasmEdge AST Module context into VM. The VM context has no"] # [doc = " dependency on the input AST Module context. You can then call"] # [doc = " `WasmEdge_VMValidate` for the next step."] # [doc = ""] # [doc = " This function is thread-safe."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_VMContext."] # [doc = " \\param ASTCxt the WasmEdge AST Module context generated by loader or"] # [doc = " compiler."] # [doc = ""] # [doc = " \\returns WasmEdge_Result. Call `WasmEdge_ResultGetMessage` for the error"] # [doc = " message."] pub fn WasmEdge_VMLoadWasmFromASTModule (Cxt : * mut WasmEdge_VMContext , ASTCxt : * const WasmEdge_ASTModuleContext) -> WasmEdge_Result ; } extern "C" { # [doc = " Validate the WASM module loaded into the VM context."] # [doc = ""] # [doc = " This is the second step to invoke a WASM function step by step."] # [doc = " After loading a WASM module into VM context, You can call this function to"] # [doc = " validate it. And you can then call `WasmEdge_VMInstantiate` for the next"] # [doc = " step. Note that only validated WASM modules can be instantiated in the VM"] # [doc = " context."] # [doc = ""] # [doc = " This function is thread-safe."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_VMContext."] # [doc = ""] # [doc = " \\returns WasmEdge_Result. Call `WasmEdge_ResultGetMessage` for the error"] # [doc = " message."] pub fn WasmEdge_VMValidate (Cxt : * mut WasmEdge_VMContext) -> WasmEdge_Result ; } extern "C" { # [doc = " Instantiate the validated WASM module in the VM context."] # [doc = ""] # [doc = " This is the third step to invoke a WASM function step by step."] # [doc = " After validating a WASM module in the VM context, You can call this function"] # [doc = " to instantiate it. And you can then call `WasmEdge_VMExecute` for invoking"] # [doc = " the exported function in this WASM module."] # [doc = " After calling this function, a new module instance is instantiated, and the"] # [doc = " old one will be destroyed."] # [doc = ""] # [doc = " This function is thread-safe."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_VMContext."] # [doc = ""] # [doc = " \\returns WasmEdge_Result. Call `WasmEdge_ResultGetMessage` for the error"] # [doc = " message."] pub fn WasmEdge_VMInstantiate (Cxt : * mut WasmEdge_VMContext) -> WasmEdge_Result ; } extern "C" { # [doc = " Invoke a WASM function by name."] # [doc = ""] # [doc = " This is the final step to invoke a WASM function step by step."] # [doc = " After instantiating a WASM module in the VM context, the WASM module is"] # [doc = " registered into the store in the VM context as an anonymous module. Then you"] # [doc = " can repeatedly call this function to invoke the exported WASM functions by"] # [doc = " their names until the VM context is reset or a new WASM module is registered"] # [doc = " or loaded. For calling the functions in registered WASM modules with module"] # [doc = " names, please use `WasmEdge_VMExecuteRegistered` instead. If the `Returns`"] # [doc = " buffer length is smaller than the arity of the function, the overflowed"] # [doc = " return values will be discarded."] # [doc = ""] # [doc = " This function is thread-safe."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_VMContext."] # [doc = " \\param FuncName the function name WasmEdge_String."] # [doc = " \\param Params the WasmEdge_Value buffer with the parameter values."] # [doc = " \\param ParamLen the parameter buffer length."] # [doc = " \\param [out] Returns the WasmEdge_Value buffer to fill the return values."] # [doc = " \\param ReturnLen the return buffer length."] # [doc = ""] # [doc = " \\returns WasmEdge_Result. Call `WasmEdge_ResultGetMessage` for the error"] # [doc = " message."] pub fn WasmEdge_VMExecute (Cxt : * mut WasmEdge_VMContext , FuncName : WasmEdge_String , Params : * const WasmEdge_Value , ParamLen : u32 , Returns : * mut WasmEdge_Value , ReturnLen : u32) -> WasmEdge_Result ; } extern "C" { # [doc = " Invoke a WASM function by its module name and function name."] # [doc = ""] # [doc = " After registering a WASM module in the VM context, you can repeatedly call"] # [doc = " this function to invoke exported WASM functions by their module names and"] # [doc = " function names until the VM context is reset. If the `Returns` buffer length"] # [doc = " is smaller than the arity of the function, the overflowed return values will"] # [doc = " be discarded."] # [doc = ""] # [doc = " This function is thread-safe."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_VMContext."] # [doc = " \\param ModuleName the module name WasmEdge_String."] # [doc = " \\param FuncName the function name WasmEdge_String."] # [doc = " \\param Params the WasmEdge_Value buffer with the parameter values."] # [doc = " \\param ParamLen the parameter buffer length."] # [doc = " \\param [out] Returns the WasmEdge_Value buffer to fill the return values."] # [doc = " \\param ReturnLen the return buffer length."] # [doc = ""] # [doc = " \\returns WasmEdge_Result. Call `WasmEdge_ResultGetMessage` for the error"] # [doc = " message."] pub fn WasmEdge_VMExecuteRegistered (Cxt : * mut WasmEdge_VMContext , ModuleName : WasmEdge_String , FuncName : WasmEdge_String , Params : * const WasmEdge_Value , ParamLen : u32 , Returns : * mut WasmEdge_Value , ReturnLen : u32) -> WasmEdge_Result ; } extern "C" { # [doc = " Asynchronous invoke a WASM function by name."] # [doc = ""] # [doc = " This is the final step to invoke a WASM function step by step."] # [doc = " After instantiating a WASM module in the VM context, the WASM module is"] # [doc = " registered into the store in the VM context as an anonymous module. Then you"] # [doc = " can repeatedly call this function to invoke the exported WASM functions by"] # [doc = " their names until the VM context is reset or a new WASM module is registered"] # [doc = " or loaded. For calling the functions in registered WASM modules with module"] # [doc = " names, please use `WasmEdge_VMAsyncExecuteRegistered` instead."] # [doc = ""] # [doc = " This function is thread-safe."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_VMContext."] # [doc = " \\param FuncName the function name WasmEdge_String."] # [doc = " \\param Params the WasmEdge_Value buffer with the parameter values."] # [doc = " \\param ParamLen the parameter buffer length."] # [doc = ""] # [doc = " \\returns WasmEdge_Async. Call `WasmEdge_AsyncGet` for the result, and call"] # [doc = " `WasmEdge_AsyncDelete` to destroy this object."] pub fn WasmEdge_VMAsyncExecute (Cxt : * mut WasmEdge_VMContext , FuncName : WasmEdge_String , Params : * const WasmEdge_Value , ParamLen : u32) -> * mut WasmEdge_Async ; } extern "C" { # [doc = " Asynchronous invoke a WASM function by its module name and function name."] # [doc = ""] # [doc = " After registering a WASM module in the VM context, you can repeatedly call"] # [doc = " this function to invoke exported WASM functions by their module names and"] # [doc = " function names until the VM context is reset."] # [doc = ""] # [doc = " This function is thread-safe."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_VMContext."] # [doc = " \\param ModuleName the module name WasmEdge_String."] # [doc = " \\param FuncName the function name WasmEdge_String."] # [doc = " \\param Params the WasmEdge_Value buffer with the parameter values."] # [doc = " \\param ParamLen the parameter buffer length."] # [doc = ""] # [doc = " \\returns WasmEdge_Async. Call `WasmEdge_AsyncGet` for the result, and call"] # [doc = " `WasmEdge_AsyncDelete` to destroy this object."] pub fn WasmEdge_VMAsyncExecuteRegistered (Cxt : * mut WasmEdge_VMContext , ModuleName : WasmEdge_String , FuncName : WasmEdge_String , Params : * const WasmEdge_Value , ParamLen : u32) -> * mut WasmEdge_Async ; } extern "C" { # [doc = " Get the function type by function name."] # [doc = ""] # [doc = " After instantiating a WASM module in the VM context, the WASM module is"] # [doc = " registered into the store in the VM context as an anonymous module. Then you"] # [doc = " can call this function to get the function type by the exported function"] # [doc = " name until the VM context is reset or a new WASM module is registered or"] # [doc = " loaded. For getting the function type of functions in registered WASM"] # [doc = " modules with module names, please use `WasmEdge_VMGetFunctionTypeRegistered`"] # [doc = " instead."] # [doc = " The returned function type context are linked to the context owned by the VM"] # [doc = " context, and the caller should __NOT__ call the"] # [doc = " `WasmEdge_FunctionTypeDelete` to destroy it."] # [doc = ""] # [doc = " This function is thread-safe."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_VMContext."] # [doc = " \\param FuncName the function name WasmEdge_String."] # [doc = ""] # [doc = " \\returns the function type. NULL if the function not found."] pub fn WasmEdge_VMGetFunctionType (Cxt : * const WasmEdge_VMContext , FuncName : WasmEdge_String) -> * const WasmEdge_FunctionTypeContext ; } extern "C" { # [doc = " Get the function type by function name."] # [doc = ""] # [doc = " After registering a WASM module in the VM context, you can call this"] # [doc = " function to get the function type by the functions' exported module names"] # [doc = " and function names until the VM context is reset."] # [doc = " The returned function type context are linked to the context owned by the VM"] # [doc = " context, and the caller should __NOT__ call the"] # [doc = " `WasmEdge_FunctionTypeDelete` to destroy it."] # [doc = ""] # [doc = " This function is thread-safe."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_VMContext."] # [doc = " \\param ModuleName the module name WasmEdge_String."] # [doc = " \\param FuncName the function name WasmEdge_String."] # [doc = ""] # [doc = " \\returns the function type. NULL if the function not found."] pub fn WasmEdge_VMGetFunctionTypeRegistered (Cxt : * const WasmEdge_VMContext , ModuleName : WasmEdge_String , FuncName : WasmEdge_String) -> * const WasmEdge_FunctionTypeContext ; } extern "C" { # [doc = " Reset of WasmEdge_VMContext."] # [doc = ""] # [doc = " After calling this function, the statistics, loaded module, the instantiated"] # [doc = " instances, and the registered instances except the WASI and plug-ins will"] # [doc = " all be cleared."] # [doc = ""] # [doc = " This function is thread-safe."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_VMContext to reset."] pub fn WasmEdge_VMCleanup (Cxt : * mut WasmEdge_VMContext) ; } extern "C" { # [doc = " Get the length of exported function list."] # [doc = ""] # [doc = " This function is thread-safe."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_VMContext."] # [doc = ""] # [doc = " \\returns length of exported function list."] pub fn WasmEdge_VMGetFunctionListLength (Cxt : * const WasmEdge_VMContext) -> u32 ; } extern "C" { # [doc = " Get the exported function list."] # [doc = ""] # [doc = " The returned function names filled into the `Names` array link to the"] # [doc = " exported names of functions owned by the vm context, and the caller should"] # [doc = " __NOT__ call the `WasmEdge_StringDelete` to destroy them."] # [doc = " The function type contexts filled into the `FuncTypes` array of the"] # [doc = " corresponding function names link to the context owned by the VM context."] # [doc = " The caller should __NOT__ call the `WasmEdge_FunctionTypeDelete` to destroy"] # [doc = " them."] # [doc = " If the `Names` and `FuncTypes` buffer lengths are smaller than the result of"] # [doc = " the exported function list size, the overflowed return values will be"] # [doc = " discarded."] # [doc = ""] # [doc = " This function is thread-safe."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_VMContext."] # [doc = " \\param [out] Names the output names WasmEdge_String buffer of exported"] # [doc = " functions. Can be NULL if names are not needed."] # [doc = " \\param [out] FuncTypes the function type contexts buffer. Can be NULL if"] # [doc = " function types are not needed."] # [doc = " \\param Len the buffer length."] # [doc = ""] # [doc = " \\returns actual exported function list size."] pub fn WasmEdge_VMGetFunctionList (Cxt : * const WasmEdge_VMContext , Names : * mut WasmEdge_String , FuncTypes : * mut * const WasmEdge_FunctionTypeContext , Len : u32) -> u32 ; } extern "C" { # [doc = " Get the module instance corresponding to the WasmEdge_HostRegistration"] # [doc = " settings."] # [doc = ""] # [doc = " When creating the VM context with a configuration, the built-in host module"] # [doc = " will be registered according to the `WasmEdge_HostRegistration` settings"] # [doc = " added into the `WasmEdge_ConfigureContext`. You can call this function to"] # [doc = " get the `WasmEdge_ModuleInstanceContext` corresponding to the settings. The"] # [doc = " module instance context links to the context owned by the VM context. The"] # [doc = " caller should __NOT__ call the `WasmEdge_ModuleInstanceDelete`."] # [doc = ""] # [doc = " ```c"] # [doc = " WasmEdge_ConfigureContext *Conf = WasmEdge_ConfigureCreate();"] # [doc = " WasmEdge_ConfigureAddHostRegistration(Conf, WasmEdge_HostRegistration_Wasi);"] # [doc = " WasmEdge_VMContext *VM = WasmEdge_VMCreate(Conf, NULL);"] # [doc = " WasmEdge_ModuleInstanceContext *WasiMod ="] # [doc = "     WasmEdge_VMGetImportModuleContext(VM, WasmEdge_HostRegistration_Wasi);"] # [doc = " ```"] # [doc = ""] # [doc = " This function is thread-safe."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_VMContext."] # [doc = " \\param Reg the host registration value to get the import module."] # [doc = ""] # [doc = " \\returns pointer to the module instance context. NULL if not found."] pub fn WasmEdge_VMGetImportModuleContext (Cxt : * const WasmEdge_VMContext , Reg : WasmEdge_HostRegistration) -> * mut WasmEdge_ModuleInstanceContext ; } extern "C" { # [doc = " Get the current instantiated module in VM."] # [doc = ""] # [doc = " After instantiating a module instance into the VM, developers can call this"] # [doc = " API to get the module instance to retrieve the exported instances. The"] # [doc = " module instance context links to the context owned by the VM context. The"] # [doc = " caller should __NOT__ call the `WasmEdge_ModuleInstanceDelete`."] # [doc = ""] # [doc = " This function is thread-safe."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_VMContext."] # [doc = ""] # [doc = " \\returns pointer to the module instance context. NULL if not found."] pub fn WasmEdge_VMGetActiveModule (Cxt : * const WasmEdge_VMContext) -> * const WasmEdge_ModuleInstanceContext ; } extern "C" { # [doc = " Get the registered module in VM by the module name."] # [doc = ""] # [doc = " After registering a WASM module into the VM context, developers can call"] # [doc = " this function to get the module instance by the module name. The returned"] # [doc = " module instance context links to the context owned by the VM context, and"] # [doc = " the caller should __NOT__ call the `WasmEdge_ModuleInstanceDelete` to"] # [doc = " destroy it."] # [doc = ""] # [doc = " This function is thread-safe."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_VMContext."] # [doc = " \\param ModuleName the module name WasmEdge_String."] # [doc = ""] # [doc = " \\returns pointer to the module instance context. NULL if not found."] pub fn WasmEdge_VMGetRegisteredModule (Cxt : * const WasmEdge_VMContext , ModuleName : WasmEdge_String) -> * const WasmEdge_ModuleInstanceContext ; } extern "C" { # [doc = " Get the length of registered module list in the WasmEdge_VMContext."] # [doc = ""] # [doc = " This function is thread-safe."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_VMContext."] # [doc = ""] # [doc = " \\returns length of registered module list."] pub fn WasmEdge_VMListRegisteredModuleLength (Cxt : * const WasmEdge_VMContext) -> u32 ; } extern "C" { # [doc = " List the registered module names in the WasmEdge_VMContext."] # [doc = ""] # [doc = " This function will list all registered module names."] # [doc = " The returned module names filled into the `Names` array are linked to the"] # [doc = " registered module names in the VM context, and the caller should __NOT__"] # [doc = " call the `WasmEdge_StringDelete`."] # [doc = " If the `Names` buffer length is smaller than the result of the registered"] # [doc = " named module list size, the overflowed return values will be discarded."] # [doc = ""] # [doc = " This function is thread-safe."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_VMContext."] # [doc = " \\param [out] Names the output names WasmEdge_String buffer of the registered"] # [doc = " modules."] # [doc = " \\param Len the buffer length."] # [doc = ""] # [doc = " \\returns actual registered module list size."] pub fn WasmEdge_VMListRegisteredModule (Cxt : * const WasmEdge_VMContext , Names : * mut WasmEdge_String , Len : u32) -> u32 ; } extern "C" { # [doc = " Get the store context used in the WasmEdge_VMContext."] # [doc = ""] # [doc = " The returned store context links to the store in the VM context and owned by"] # [doc = " the VM context. This function will return NULL if error occurs. The caller"] # [doc = " should __NOT__ call the `WasmEdge_StoreDelete`."] # [doc = ""] # [doc = " This function is thread-safe."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_VMContext."] # [doc = ""] # [doc = " \\returns pointer to the store context."] pub fn WasmEdge_VMGetStoreContext (Cxt : * mut WasmEdge_VMContext) -> * mut WasmEdge_StoreContext ; } extern "C" { # [doc = " Get the loader context used in the WasmEdge_VMContext."] # [doc = ""] # [doc = " The returned loader context links to the loader in the VM context and owned"] # [doc = " by the VM context. This function will return NULL if error occurs. The"] # [doc = " caller should __NOT__ call the `WasmEdge_LoaderDelete`."] # [doc = ""] # [doc = " This function is thread-safe."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_VMContext."] # [doc = ""] # [doc = " \\returns pointer to the loader context."] pub fn WasmEdge_VMGetLoaderContext (Cxt : * mut WasmEdge_VMContext) -> * mut WasmEdge_LoaderContext ; } extern "C" { # [doc = " Get the validator context used in the WasmEdge_VMContext."] # [doc = ""] # [doc = " The returned validator context links to the validator in the VM context and"] # [doc = " owned by the VM context. This function will return NULL if error occurs. The"] # [doc = " caller should __NOT__ call the `WasmEdge_ValidatorDelete`."] # [doc = ""] # [doc = " This function is thread-safe."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_VMContext."] # [doc = ""] # [doc = " \\returns pointer to the validator context."] pub fn WasmEdge_VMGetValidatorContext (Cxt : * mut WasmEdge_VMContext) -> * mut WasmEdge_ValidatorContext ; } extern "C" { # [doc = " Get the executor context used in the WasmEdge_VMContext."] # [doc = ""] # [doc = " The returned executor context links to the executor in the VM context and"] # [doc = " owned by the VM context. This function will return NULL if error occurs. The"] # [doc = " caller should __NOT__ call the `WasmEdge_ExecutorDelete`."] # [doc = ""] # [doc = " This function is thread-safe."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_VMContext."] # [doc = ""] # [doc = " \\returns pointer to the executor context."] pub fn WasmEdge_VMGetExecutorContext (Cxt : * mut WasmEdge_VMContext) -> * mut WasmEdge_ExecutorContext ; } extern "C" { # [doc = " Get the statistics context used in the WasmEdge_VMContext."] # [doc = ""] # [doc = " The statistics context links to the statistics in the VM context and owned"] # [doc = " by the VM context. The caller should __NOT__ call the"] # [doc = " `WasmEdge_StatisticsDelete`."] # [doc = ""] # [doc = " This function is thread-safe."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_VMContext."] # [doc = ""] # [doc = " \\returns pointer to the statistics context."] pub fn WasmEdge_VMGetStatisticsContext (Cxt : * mut WasmEdge_VMContext) -> * mut WasmEdge_StatisticsContext ; } extern "C" { # [doc = " Deletion of the WasmEdge_VMContext."] # [doc = ""] # [doc = " After calling this function, the context will be destroyed and should"] # [doc = " __NOT__ be used."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_VMContext to destroy."] pub fn WasmEdge_VMDelete (Cxt : * mut WasmEdge_VMContext) ; } extern "C" { # [doc = " Entrypoint for the compiler tool."] # [doc = ""] # [doc = " This function provides an entrypoint to the WasmEdge AOT compiler tool with"] # [doc = " the command line arguments."] # [doc = ""] # [doc = " \\param Argc the argument count."] # [doc = " \\param Argv the argument vector."] # [doc = ""] # [doc = " \\returns the execution status."] pub fn WasmEdge_Driver_Compiler (Argc : :: std :: os :: raw :: c_int , Argv : * mut * const :: std :: os :: raw :: c_char) -> :: std :: os :: raw :: c_int ; } extern "C" { # [doc = " Entrypoint for the runtime tool."] # [doc = ""] # [doc = " This function provides an entrypoint to the WasmEdge runtime tool with the"] # [doc = " command line arguments."] # [doc = ""] # [doc = " \\param Argc the argument count."] # [doc = " \\param Argv the argument vector."] # [doc = ""] # [doc = " \\returns the execution status."] pub fn WasmEdge_Driver_Tool (Argc : :: std :: os :: raw :: c_int , Argv : * mut * const :: std :: os :: raw :: c_char) -> :: std :: os :: raw :: c_int ; } extern "C" { # [doc = " Load plugins with the default search paths."] # [doc = ""] # [doc = " The default paths are:"] # [doc = "   1. The environment variable \"WASMEDGE_PLUGIN_PATH\"."] # [doc = "   2. The \"../plugin/\" directory related to the WasmEdge installation path."] # [doc = "   3. The \"wasmedge/\" directory under the library path if the WasmEdge is"] # [doc = "      installed under the \"/usr\"."] pub fn WasmEdge_PluginLoadWithDefaultPaths () ; } extern "C" { # [doc = " Load the plugin with the given file or directory."] # [doc = ""] # [doc = " For the given file path, this function will load the plug-in."] # [doc = " For the given directory path, this function will load the plug-ins under the"] # [doc = " directory recursively."] # [doc = ""] # [doc = " \\param Path the path to plug-in file or directory."] pub fn WasmEdge_PluginLoadFromPath (Path : * const :: std :: os :: raw :: c_char) ; } extern "C" { # [doc = " Get the length of loaded plug-in list."] # [doc = ""] # [doc = " \\returns length of loaded plug-in list."] pub fn WasmEdge_PluginListPluginsLength () -> u32 ; } extern "C" { # [doc = " List the loaded plug-ins with their names."] # [doc = ""] # [doc = " The returned plug-in names filled into the `Names` array are owned by the"] # [doc = " internal WasmEdge plug-in storage, and the caller should __NOT__ call the"] # [doc = " `WasmEdge_StringDelete`."] # [doc = " If the `Names` buffer length is smaller than the result of the loaded"] # [doc = " plug-in list size, the overflowed return values will be discarded."] # [doc = ""] # [doc = " \\param [out] Names the output WasmEdge_String buffer of the function names."] # [doc = " \\param Len the buffer length."] # [doc = ""] # [doc = " \\returns actual loaded plug-in list size."] pub fn WasmEdge_PluginListPlugins (Names : * mut WasmEdge_String , Len : u32) -> u32 ; } extern "C" { # [doc = " Find the loaded plug-in context by name."] # [doc = ""] # [doc = " After loading the plug-ins from default paths or the given path, developers"] # [doc = " can use this API to retrieve the plug-in context by name. Then developers"] # [doc = " can create the module instance from the plug-in contexts."] # [doc = ""] # [doc = " \\param Name the plug-in name WasmEdge_String."] # [doc = ""] # [doc = " \\returns pointer to the plug-in context. NULL if the plug-in not found."] pub fn WasmEdge_PluginFind (Name : WasmEdge_String) -> * const WasmEdge_PluginContext ; } extern "C" { # [doc = " Get the plug-in name of the plug-in context."] # [doc = ""] # [doc = " The returned string object is linked to the plug-in name of the plug-in"] # [doc = " context, and the caller should __NOT__ call the `WasmEdge_StringDelete`."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_PluginContext."] # [doc = ""] # [doc = " \\returns string object. Length will be 0 and Buf will be NULL if failed."] pub fn WasmEdge_PluginGetPluginName (Cxt : * const WasmEdge_PluginContext) -> WasmEdge_String ; } extern "C" { # [doc = " Get the length of module list in the plug-in context."] # [doc = ""] # [doc = " There may be several modules in a plug-in. Developers can use this function"] # [doc = " to get the length of the module list in a plug-in."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_PluginContext to get the length of the module list."] # [doc = ""] # [doc = " \\returns length of module list."] pub fn WasmEdge_PluginListModuleLength (Cxt : * const WasmEdge_PluginContext) -> u32 ; } extern "C" { # [doc = " List the modules in the plug-in context with their names."] # [doc = ""] # [doc = " The returned module names filled into the `Names` array are owned by the"] # [doc = " internal WasmEdge plug-in storage, and the caller should __NOT__ call the"] # [doc = " `WasmEdge_StringDelete`."] # [doc = " If the `Names` buffer length is smaller than the result of the loaded"] # [doc = " plug-in list size, the overflowed return values will be discarded."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_PluginContext to list the modules."] # [doc = " \\param [out] Names the output WasmEdge_String buffer of the function names."] # [doc = " \\param Len the buffer length."] # [doc = ""] # [doc = " \\returns actual module list size of the plug-in."] pub fn WasmEdge_PluginListModule (Cxt : * const WasmEdge_PluginContext , Names : * mut WasmEdge_String , Len : u32) -> u32 ; } extern "C" { # [doc = " Create the module instance in the plug-in by the module name."] # [doc = ""] # [doc = " By giving the module name, developers can retrieve the module in the plug-in"] # [doc = " and create the module instance."] # [doc = " The caller owns the object and should call `WasmEdge_ModuleInstanceDelete`"] # [doc = " to destroy it."] # [doc = ""] # [doc = " \\param Cxt the WasmEdge_PluginContext to retrieve and create module."] # [doc = " \\param ModuleName the module name to retrieve."] # [doc = ""] # [doc = " \\returns pointer to the module instance context, NULL if the module name not"] # [doc = " found in the plug-in or the plug-in is not valid."] pub fn WasmEdge_PluginCreateModule (Cxt : * const WasmEdge_PluginContext , ModuleName : WasmEdge_String) -> * mut WasmEdge_ModuleInstanceContext ; } extern "C" { # [doc = " Implement by plugins for returning the plugin descriptor."] # [doc = ""] # [doc = " \\returns the plugin descriptor."] pub fn WasmEdge_Plugin_GetDescriptor () -> * const WasmEdge_PluginDescriptor ; }