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

Function Resource_exists

modules/files/resource/Resource.c:49–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47}
48
49void Resource_exists(xsMachine *the)
50{
51 xsStringValue path = xsToString(xsArg(0));
52 const void *data = NULL;
53 size_t size;
54 if ((xsToInteger(xsArgc) > 1) && xsTest(xsArg(1)))
55 data = fxGetArchiveData(the, xsGetHostData(xsArg(1)), path, &size);
56 if (!data)
57 data = fxGetArchiveData(the, the->archive, path, &size);
58 if (!data)
59 data = mcGetResource(the, path, &size);
60 xsResult = data ? xsTrue : xsFalse;
61}
62
63void Resource_get_byteLength(xsMachine *the)
64{

Callers

nothing calls this directly

Calls 2

fxGetArchiveDataFunction · 0.85
mcGetResourceFunction · 0.50

Tested by

no test coverage detected