| 30 | } |
| 31 | |
| 32 | void Resource_constructor(xsMachine *the) |
| 33 | { |
| 34 | xsStringValue path = xsToString(xsArg(0)); |
| 35 | const void *data = NULL; |
| 36 | size_t size; |
| 37 | if ((xsToInteger(xsArgc) > 1) && xsTest(xsArg(1))) |
| 38 | data = fxGetArchiveData(the, xsGetHostData(xsArg(1)), path, &size); |
| 39 | if (!data) |
| 40 | data = fxGetArchiveData(the, the->archive, path, &size); |
| 41 | if (!data) |
| 42 | data = mcGetResource(the, path, &size); |
| 43 | if (!data) |
| 44 | xsURIError("Resource not found: %s", path); |
| 45 | xsSetHostBuffer(xsThis, (void *)data, size); |
| 46 | xsPetrifyHostBuffer(xsThis); |
| 47 | } |
| 48 | |
| 49 | void Resource_exists(xsMachine *the) |
| 50 | { |
nothing calls this directly
no test coverage detected