MCPcopy Create free account
hub / github.com/WasmEdge/WasmEdge / WasmEdge_ImportTypeGetFunctionType

Function WasmEdge_ImportTypeGetFunctionType

lib/api/wasmedge.cpp:1626–1640  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1624}
1625
1626WASMEDGE_CAPI_EXPORT const WasmEdge_FunctionTypeContext *
1627WasmEdge_ImportTypeGetFunctionType(
1628 const WasmEdge_ASTModuleContext *ASTCxt,
1629 const WasmEdge_ImportTypeContext *Cxt) noexcept {
1630 if (ASTCxt && Cxt &&
1631 fromImpTypeCxt(Cxt)->getExternalType() ==
1632 WasmEdge::ExternalType::Function) {
1633 uint32_t Idx = fromImpTypeCxt(Cxt)->getExternalFuncTypeIdx();
1634 auto SubTypes = fromASTModCxt(ASTCxt)->getTypeSection().getContent();
1635 if (Idx < SubTypes.size() && SubTypes[Idx].getCompositeType().isFunc()) {
1636 return toFuncTypeCxt(&(SubTypes[Idx].getCompositeType().getFuncType()));
1637 }
1638 }
1639 return nullptr;
1640}
1641
1642WASMEDGE_CAPI_EXPORT const WasmEdge_TableTypeContext *
1643WasmEdge_ImportTypeGetTableType(

Callers 1

TESTFunction · 0.85

Calls 5

getExternalTypeMethod · 0.80
getContentMethod · 0.45
sizeMethod · 0.45
isFuncMethod · 0.45

Tested by 1

TESTFunction · 0.68