| 1624 | } |
| 1625 | |
| 1626 | WASMEDGE_CAPI_EXPORT const WasmEdge_FunctionTypeContext * |
| 1627 | WasmEdge_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 | |
| 1642 | WASMEDGE_CAPI_EXPORT const WasmEdge_TableTypeContext * |
| 1643 | WasmEdge_ImportTypeGetTableType( |