Host function to output std::string through std::ostream
| 191 | |
| 192 | // Host function to output std::string through std::ostream |
| 193 | WasmEdge_Result ExternSTLOStreamStr(void *, |
| 194 | const WasmEdge_CallingFrameContext *, |
| 195 | const WasmEdge_Value *In, |
| 196 | WasmEdge_Value *) { |
| 197 | // Function type: {externref, externref} -> {} |
| 198 | void *Ptr0 = WasmEdge_ValueGetExternRef(In[0]); |
| 199 | void *Ptr1 = WasmEdge_ValueGetExternRef(In[1]); |
| 200 | std::ostream &RefOS = *reinterpret_cast<std::ostream *>(Ptr0); |
| 201 | std::string &RefStr = *reinterpret_cast<std::string *>(Ptr1); |
| 202 | RefOS << RefStr; |
| 203 | return WasmEdge_Result_Success; |
| 204 | } |
| 205 | |
| 206 | // Host function to output uint32_t through std::ostream |
| 207 | WasmEdge_Result ExternSTLOStreamU32(void *, |
nothing calls this directly
no test coverage detected