| 334 | // Helper function for retrieving exported maps. |
| 335 | template <typename T> |
| 336 | inline uint32_t fillMap(const std::map<std::string, T *, std::less<>> &Map, |
| 337 | WasmEdge_String *Names, const uint32_t Len) noexcept { |
| 338 | uint32_t I = 0; |
| 339 | for (auto &&Pair : Map) { |
| 340 | if (I >= Len) { |
| 341 | break; |
| 342 | } |
| 343 | if (Names) { |
| 344 | Names[I] = WasmEdge_String{ |
| 345 | /* Length */ static_cast<uint32_t>(Pair.first.length()), |
| 346 | /* Buf */ Pair.first.data()}; |
| 347 | } |
| 348 | I++; |
| 349 | } |
| 350 | return static_cast<uint32_t>(Map.size()); |
| 351 | } |
| 352 | |
| 353 | // Helper functions of context conversions. |
| 354 | #define CONVTO(SIMP, INST, NAME, QUANT) \ |
no test coverage detected