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

Function fxGetArchiveCode

xs/sources/xsAPI.c:2028–2050  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2026}
2027
2028void* fxGetArchiveCode(txMachine* the, void* archive, txString path, size_t* size)
2029{
2030 txU4 atomSize;
2031 txU1 *p = fxGetArchiveModules(the, archive, &atomSize), *q;
2032 if (!p)
2033 return NULL;
2034 q = p + atomSize;
2035 while (p < q) {
2036 // PATH
2037 atomSize = c_read32be(p);
2038 if (!c_strcmp(path, (txString)(p + sizeof(Atom)))) {
2039 p += atomSize;
2040 atomSize = c_read32be(p);
2041 *size = atomSize - sizeof(Atom);
2042 return p + sizeof(Atom);
2043 }
2044 p += atomSize;
2045 // CODE
2046 atomSize = c_read32be(p);
2047 p += atomSize;
2048 }
2049 return C_NULL;
2050}
2051
2052txInteger fxGetArchiveCodeCount(txMachine* the, void* archive)
2053{

Callers 3

fxMapModuleDescriptorFunction · 0.85
fxFindModuleFunction · 0.85
fxLoadModuleFunction · 0.85

Calls 1

fxGetArchiveModulesFunction · 0.85

Tested by

no test coverage detected