heavy overhaul of documentation organizaton
This commit is contained in:
@@ -6030,12 +6030,16 @@ JSC_CCALL(io_globfs,
|
||||
globs[globs_len] = NULL;
|
||||
data.globs = globs;
|
||||
|
||||
PHYSFS_enumerate("", globfs_cb, &data);
|
||||
const char *path = NULL;
|
||||
if (!JS_IsUndefined(argv[1])) path = JS_ToCString(js,argv[1]);
|
||||
printf("LOOKING INTO %s\n", path);
|
||||
PHYSFS_enumerate(path, globfs_cb, &data);
|
||||
|
||||
for (int i = 0; i < globs_len; i++)
|
||||
JS_FreeCString(js,globs[i]);
|
||||
|
||||
ret = data.arr;
|
||||
JS_FreeCString(js,path);
|
||||
)
|
||||
|
||||
static int enumerate_cb(void *udata, const char *dir, const char *fname)
|
||||
@@ -6123,7 +6127,7 @@ static const JSCFunctionListEntry js_io_funcs[] = {
|
||||
MIST_FUNC_DEF(io, rm, 1),
|
||||
MIST_FUNC_DEF(io, mkdir, 1),
|
||||
MIST_FUNC_DEF(io,stat,1),
|
||||
MIST_FUNC_DEF(io, globfs, 1),
|
||||
MIST_FUNC_DEF(io, globfs, 2),
|
||||
MIST_FUNC_DEF(io, match, 2),
|
||||
MIST_FUNC_DEF(io, exists, 1),
|
||||
MIST_FUNC_DEF(io, mount, 2),
|
||||
|
||||
@@ -89,12 +89,15 @@ int main(int argc, char **argv) {
|
||||
PHYSFS_init(argv[0]);
|
||||
char *base = PHYSFS_getBaseDir();
|
||||
PHYSFS_setWriteDir(base);
|
||||
PHYSFS_mount(base, NULL, 0);
|
||||
PHYSFS_mount(base, "/", 0);
|
||||
int ret = PHYSFS_mountMemory(zip_buffer_global + zip_offset, appended_zip_size, free_zip,
|
||||
"core.zip", "/", 0);
|
||||
|
||||
if (!ret) printf("COULD NOT MOUNT! Reason: %s\n", PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()));
|
||||
PHYSFS_mount(base, "/", 0);
|
||||
int ret = PHYSFS_mountMemory(zip_buffer_global + zip_offset, appended_zip_size, free_zip, "core.zip", NULL, 0);
|
||||
|
||||
if (!ret) {
|
||||
printf("COULD NOT MOUNT! Reason: %s\n", PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()));
|
||||
return 1;
|
||||
}
|
||||
|
||||
script_startup(argc, argv); // runs engine.js
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user