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

Function WasmEdge_StringCopy

lib/api/wasmedge.cpp:806–817  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

804}
805
806WASMEDGE_CAPI_EXPORT uint32_t WasmEdge_StringCopy(const WasmEdge_String Str,
807 char *Buf,
808 const uint32_t Len) noexcept {
809 uint32_t RealLength = std::min(Len, Str.Length);
810 if (Buf) {
811 std::memset(Buf, 0, Len);
812 if (RealLength > 0) {
813 std::copy_n(Str.Buf, RealLength, Buf);
814 }
815 }
816 return RealLength;
817}
818
819WASMEDGE_CAPI_EXPORT void WasmEdge_StringDelete(WasmEdge_String Str) noexcept {
820 if (Str.Buf) {

Callers 1

TESTFunction · 0.85

Calls

no outgoing calls

Tested by 1

TESTFunction · 0.68