MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / fxSetHostChunk

Function fxSetHostChunk

xs/sources/xsAPI.c:885–905  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

883}
884
885void *fxSetHostChunk(txMachine* the, txSlot* slot, void* theValue, txSize theSize)
886{
887 txSlot* host = fxCheckHostObject(the, slot);
888 if (host) {
889 host->flag |= XS_HOST_CHUNK_FLAG;
890 if (theSize) {
891 host->value.host.data = fxNewChunk(the, theSize);
892 if (theValue)
893 c_memcpy(host->value.host.data, theValue, theSize);
894 else
895 c_memset(host->value.host.data, 0, theSize);
896 }
897 else
898 host->value.host.data = NULL;
899 return host->value.host.data;
900 }
901 else
902 mxSyntaxError("C: fxSetHostChunk: not a host object");
903
904 return NULL;
905}
906
907void fxSetHostData(txMachine* the, txSlot* slot, void* theData)
908{

Callers 1

fx_mutabilitiesFunction · 0.85

Calls 2

fxCheckHostObjectFunction · 0.85
fxNewChunkFunction · 0.85

Tested by

no test coverage detected