void VirtualFileInit() { //On enregistre les sources par défaut if (VF_MEMORY < 0) VF_MEMORY = VirtualFileRegisterSource(&vfsMemory); if (VF_FILE < 0) VF_FILE = oslInitVfsFile(); //By default, load from files //oslSetDefaultVirtualFileSource(VF_FILE); osl_defaultVirtualFileSource = VF_FILE; //Allocate data for the virtual file list osl_virtualFileListSize = DEFAULT_TABLE_SIZE; osl_virtualFileListNumber = 0; //I suppose it never fails osl_virtualFileList = (OSL_VIRTUALFILENAME*)malloc(DEFAULT_TABLE_SIZE * sizeof(OSL_VIRTUALFILENAME)); osl_tempFile.name = osl_tempFileName; osl_tempFile.type = NULL; }
int oslInitVfsFile() { VF_FILE = VirtualFileRegisterSource(&vfsFile); return VF_FILE; }
int vfsGzFileInit() { if (VF_GZFILE < 0) VF_GZFILE = VirtualFileRegisterSource(&vfsGzFile); return VF_GZFILE; }