#include "basetype.h"Go to the source code of this file.
Compounds | |
| struct | geVFile_Hints |
| struct | geVFile_MemoryContext |
| struct | geVFile_Properties |
| struct | geVFile_Time |
Defines | |
| #define | GE_VFILE_ATTRIB_READONLY 0x00000001 |
| #define | GE_VFILE_ATTRIB_DIRECTORY 0x00000002 |
| #define | GE_VFILE_TYPE_DOS ( (geVFile_TypeIdentifier) 1L ) |
| #define | GE_VFILE_TYPE_MEMORY ( (geVFile_TypeIdentifier) 2L ) |
| #define | GE_VFILE_TYPE_VIRTUAL ( (geVFile_TypeIdentifier) 3L ) |
| #define | GE_VFILE_OPEN_READONLY 0x00000001 |
| #define | GE_VFILE_OPEN_UPDATE 0x00000002 |
| #define | GE_VFILE_OPEN_CREATE 0x00000004 |
| #define | GE_VFILE_OPEN_DIRECTORY 0x00000008 |
Typedefs | |
| typedef geVFile | geVFile |
| typedef geVFile_Finder | geVFile_Finder |
| typedef int | geVFile_TypeIdentifier |
| typedef unsigned int | geVFile_Attributes |
| typedef geVFile_Hints | geVFile_Hints |
| typedef geVFile_Time | geVFile_Time |
| typedef geVFile_Properties | geVFile_Properties |
| typedef geVFile_MemoryContext | geVFile_MemoryContext |
Enumerations | |
| enum | geVFile_Whence { GE_VFILE_SEEKCUR = 0, GE_VFILE_SEEKEND = 1, GE_VFILE_SEEKSET = 2 } |
Functions | |
| GENESISAPI geVFile_Finder *GENESISCC | geVFile_CreateFinder (geVFile *FileSystem, const char *FileSpec) |
| GENESISAPI void GENESISCC | geVFile_DestroyFinder (geVFile_Finder *Finder) |
| GENESISAPI geBoolean GENESISCC | geVFile_FinderGetNextFile (geVFile_Finder *Finder) |
| GENESISAPI geBoolean GENESISCC | geVFile_FinderGetProperties (const geVFile_Finder *Finder, geVFile_Properties *Properties) |
| GENESISAPI geVFile *GENESISCC | geVFile_OpenNewSystem (geVFile *FS, geVFile_TypeIdentifier FileSystemType, const char *Name, void *Context, unsigned int OpenModeFlags) |
| GENESISAPI geBoolean GENESISCC | geVFile_UpdateContext (geVFile *FS, void *Context, int ContextSize) |
| GENESISAPI geVFile *GENESISCC | geVFile_GetContext (const geVFile *File) |
| GENESISAPI geVFile *GENESISCC | geVFile_Open (geVFile *FS, const char *Name, unsigned int OpenModeFlags) |
| GENESISAPI geBoolean GENESISCC | geVFile_AddPath (geVFile *FS1, const geVFile *FS2, geBoolean Append) |
| GENESISAPI geBoolean GENESISCC | geVFile_DeleteFile (geVFile *FS, const char *FileName) |
| GENESISAPI geBoolean GENESISCC | geVFile_RenameFile (geVFile *FS, const char *FileName, const char *NewName) |
| GENESISAPI geBoolean GENESISCC | geVFile_FileExists (geVFile *FS, const char *FileName) |
| GENESISAPI geBoolean GENESISCC | geVFile_Close (geVFile *File) |
| GENESISAPI void GENESISCC | geVFile_CloseAPI (void) |
| GENESISAPI geBoolean GENESISCC | geVFile_GetS (geVFile *File, void *Buff, int MaxLen) |
| GENESISAPI geBoolean GENESISCC | geVFile_Read (geVFile *File, void *Buff, int Count) |
| GENESISAPI geBoolean GENESISCC | geVFile_Write (geVFile *File, const void *Buff, int Count) |
| GENESISAPI geBoolean GENESISCC | geVFile_Seek (geVFile *File, int where, geVFile_Whence Whence) |
| GENESISAPI geBoolean GENESISCC | geVFile_Printf (geVFile *File, const char *Format,...) |
| GENESISAPI geBoolean GENESISCC | geVFile_EOF (const geVFile *File) |
| GENESISAPI geBoolean GENESISCC | geVFile_Tell (const geVFile *File, long *Position) |
| GENESISAPI geBoolean GENESISCC | geVFile_GetProperties (const geVFile *File, geVFile_Properties *Properties) |
| GENESISAPI geBoolean GENESISCC | geVFile_Size (const geVFile *File, long *Size) |
| GENESISAPI geBoolean GENESISCC | geVFile_SetSize (geVFile *File, long Size) |
| GENESISAPI geBoolean GENESISCC | geVFile_SetAttributes (geVFile *File, geVFile_Attributes Attributes) |
| GENESISAPI geBoolean GENESISCC | geVFile_SetTime (geVFile *File, const geVFile_Time *Time) |
| GENESISAPI geBoolean GENESISCC | geVFile_SetHints (geVFile *File, const geVFile_Hints *Hints) |
|
|
Definition at line 52 of file vfile.h. Referenced by DirTree_AddFile(), DirTree_Create(), DirTree_GetFileOffset(), DirTree_SetFileAttributes(), DirTree_SetFileOffset(), FSDos_FinderGetProperties(), and FSDos_GetProperties(). |
|
|
Definition at line 51 of file vfile.h. Referenced by DirTree_SetFileAttributes(), FSDos_FinderGetProperties(), FSDos_GetProperties(), FSDos_SetAttributes(), and FSVFS_SetAttributes(). |
|
|
Definition at line 103 of file vfile.h. Referenced by CheckOpenFlags(), DirTree_GetSize(), FSDos_Open(), FSMemory_OpenNewSystem(), FSVFS_Close(), FSVFS_Open(), FSVFS_OpenNewSystem(), geActor_DefWriteToFile(), geBitmap_WriteToFile(), geBitmap_WriteToFileName(), geBody_WriteToFile(), and geVFile_Open(). |
|
|
Definition at line 105 of file vfile.h. Referenced by CheckOpenFlags(), FSDos_Open(), FSMemory_OpenNewSystem(), FSVFS_Open(), FSVFS_OpenNewSystem(), geActor_DefCreateFromFile(), geActor_DefWriteToFile(), geBody_CreateFromFile(), geBody_WriteToFile(), geVFile_OpenNewSystem(), ProcEng_Create(), and WinMain(). |
|
|
|
Definition at line 102 of file vfile.h. Referenced by CheckOpenFlags(), FSDos_Open(), FSMemory_OpenNewSystem(), FSVFS_Close(), and FSVFS_Open(). |
|
|
Definition at line 94 of file vfile.h. Referenced by geBitmap_CreateFromFileName(), geBitmap_WriteToFileName(), geBitmapUtil_CreateFromFileName(), geVFile_OpenNewSystem(), ProcEng_Create(), RegisterBuiltInAPIs(), and WinMain(). |
|
|
Definition at line 95 of file vfile.h. Referenced by DirTree_GetSize(), DoSplashScreen(), geEngine_InitFonts(), GetABitmap(), LoadEntitySet(), and RegisterBuiltInAPIs(). |
|
|
Definition at line 96 of file vfile.h. Referenced by geActor_DefCreateFromFile(), geActor_DefWriteToFile(), geBody_CreateFromFile(), geBody_WriteToFile(), geVFile_OpenNewSystem(), and RegisterBuiltInAPIs(). |
|
|
|
|
|
Definition at line 37 of file vfile.h. Referenced by FSDos_FinderGetProperties(), and FSDos_GetProperties(). |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 36 of file vfile.h. Referenced by RegisterBuiltInAPIs(). |
|
|
Definition at line 163 of file vfile.h.
00164 {
00165 GE_VFILE_SEEKCUR = 0,
00166 GE_VFILE_SEEKEND = 1,
00167 GE_VFILE_SEEKSET = 2
00168 } geVFile_Whence;
|
|
||||||||||||||||
|
Definition at line 380 of file vfile.c. References CopySearchList(), FSSearchList, GE_FALSE, GE_TRUE, geBoolean, GENESISAPI, GENESISCC, FSSearchList::Next, and geVFile::SearchList.
00381 {
00382 FSSearchList * SearchList;
00383
00384 assert(FS1);
00385 assert(FS2);
00386
00387 SearchList = CopySearchList(FS2->SearchList);
00388 if (!SearchList)
00389 return GE_FALSE;
00390
00391 if (Append == GE_FALSE)
00392 {
00393 SearchList->Next = FS1->SearchList;
00394 FS1->SearchList = SearchList;
00395 }
00396 else
00397 {
00398 FSSearchList Temp;
00399 FSSearchList * pTemp;
00400
00401 Temp.Next = FS1->SearchList;
00402 pTemp = &Temp;
00403 while (pTemp->Next)
00404 {
00405 pTemp = pTemp->Next;
00406 }
00407
00408 pTemp->Next = SearchList;
00409 }
00410
00411 return GE_TRUE;
00412 }
|
|
|
|
Definition at line 92 of file vfile.c. References GENESISCC, geRam_Free, and RegisteredAPIs.
00093 {
00094 geRam_Free(RegisteredAPIs);
00095 }
|
|
||||||||||||
|
Definition at line 563 of file vfile.c. References geVFile_Finder::APIs, geVFile::APIs, geVFile_Finder::Data, geVFile_SystemAPIs::FinderCreate, geVFile::FSData, GENESISAPI, GENESISCC, geRam_Allocate, geRam_Free, and NULL. Referenced by ProcEng_Create().
00566 {
00567 geVFile_Finder * Finder;
00568
00569 assert(FileSystem);
00570 assert(FileSpec);
00571
00572 Finder = geRam_Allocate(sizeof(*Finder));
00573 if (!Finder)
00574 return Finder;
00575
00576 Finder->Data = FileSystem->APIs->FinderCreate(FileSystem, FileSystem->FSData, FileSpec);
00577 if (!Finder->Data)
00578 {
00579 geRam_Free(Finder);
00580 return NULL;
00581 }
00582
00583 Finder->APIs = FileSystem->APIs;
00584
00585 return Finder;
00586 }
|
|
||||||||||||
|
Definition at line 414 of file vfile.c. References geVFile::APIs, geVFile_SystemAPIs::DeleteFile, geVFile::FSData, geBoolean, GENESISAPI, and GENESISCC.
00415 {
00416 assert(FS);
00417 assert(FileName);
00418
00419 return FS->APIs->DeleteFile(FS, FS->FSData, FileName);
00420 }
|
|
|
Definition at line 588 of file vfile.c. References geVFile_Finder::APIs, geVFile_Finder::Data, geVFile_SystemAPIs::FinderDestroy, GENESISAPI, GENESISCC, and geRam_Free. Referenced by ProcEng_Create().
00589 {
00590 assert(Finder);
00591 assert(Finder->APIs);
00592
00593 Finder->APIs->FinderDestroy(Finder->Data);
00594 geRam_Free(Finder);
00595 }
|
|
|
Definition at line 507 of file vfile.c. References geVFile::APIs, geVFile_SystemAPIs::Eof, geVFile::FSData, geBoolean, GENESISAPI, and GENESISCC.
|
|
||||||||||||
|
Definition at line 431 of file vfile.c. References geVFile::APIs, geVFile_SystemAPIs::FileExists, geVFile::FSData, geBoolean, GENESISAPI, and GENESISCC.
00432 {
00433 return FS->APIs->FileExists(FS, FS->FSData, FileName);
00434 }
|
|
|
Definition at line 597 of file vfile.c. References geVFile_Finder::APIs, geVFile_Finder::Data, geVFile_SystemAPIs::FinderGetNextFile, geBoolean, GENESISAPI, and GENESISCC. Referenced by ProcEng_Create().
00598 {
00599 assert(Finder);
00600 assert(Finder->APIs);
00601 assert(Finder->Data);
00602 return Finder->APIs->FinderGetNextFile(Finder->Data);
00603 }
|
|
||||||||||||
|
Definition at line 605 of file vfile.c. References geVFile_Finder::APIs, geVFile_Finder::Data, geVFile_SystemAPIs::FinderGetProperties, geBoolean, GENESISAPI, and GENESISCC. Referenced by ProcEng_Create().
00606 {
00607 assert(Finder);
00608 assert(Finder->APIs);
00609 assert(Finder->Data);
00610
00611 return Finder->APIs->FinderGetProperties(Finder->Data, Properties);
00612 }
|
|
|
Definition at line 330 of file vfile.c. References geVFile::Context, GENESISAPI, and GENESISCC. Referenced by geActor_DefCreateHeader().
00331 {
00332 assert(File);
00333
00334 return File->Context;
00335 }
|
|
||||||||||||
|
Definition at line 528 of file vfile.c. References geVFile::APIs, geVFile::FSData, geBoolean, GENESISAPI, GENESISCC, and geVFile_SystemAPIs::GetProperties.
00529 {
00530 assert(File);
00531
00532 return File->APIs->GetProperties(File->FSData, Properties);
00533 }
|
|
||||||||||||||||
|
||||||||||||||||
|
Definition at line 261 of file vfile.c. References geVFile::APIs, CheckOpenFlags(), geVFile::Context, FSSearchList::FS, geVFile::FSData, FSSearchList, GE_FALSE, GE_VFILE_OPEN_CREATE, GENESISAPI, GENESISCC, geRam_Allocate, geRam_Free, FSSearchList::Next, NULL, geVFile::SearchList, and geVFile::SystemType. Referenced by Electric_Init(), GameMgr_SetActorIndex(), GameMgr_SetSoundIndex(), GameMgr_SetWorld(), geActor_DefCreateFromFile(), geActor_DefWriteToFile(), geBitmap_CreateFromFileName(), geBitmap_WriteToFileName(), geBitmapUtil_CreateFromFileName(), geBody_CreateFromFile(), geBody_WriteToFile(), and Text_Create().
00265 {
00266 FSSearchList * SearchList;
00267 geVFile * StartContext;
00268 geVFile * File;
00269 void * FSData;
00270
00271 assert(Name);
00272
00273 if (!FS)
00274 return NULL;
00275
00276 if (CheckOpenFlags(OpenModeFlags) == GE_FALSE)
00277 return NULL;
00278
00279 StartContext = FS;
00280
00281 SearchList = FS->SearchList;
00282 assert(SearchList);
00283 assert(SearchList->FS == FS);
00284 if (!(OpenModeFlags & GE_VFILE_OPEN_CREATE))
00285 {
00286 while (SearchList)
00287 {
00288 FS = SearchList->FS;
00289 if (FS->APIs->FileExists(FS, FS->FSData, Name))
00290 break;
00291 SearchList = SearchList->Next;
00292 }
00293 }
00294
00295 if (!SearchList)
00296 return NULL;
00297
00298 FSData = FS->APIs->Open(FS, FS->FSData, Name, NULL, OpenModeFlags);
00299 if (!FSData)
00300 return NULL;
00301
00302 File = geRam_Allocate(sizeof(*File));
00303 if (!File)
00304 {
00305 FS->APIs->Close(FSData);
00306 return NULL;
00307 }
00308
00309 memset(File, 0, sizeof(*File));
00310
00311 File->SystemType = 0;
00312 File->APIs = FS->APIs;
00313 File->FSData = FSData;
00314 File->SearchList = geRam_Allocate(sizeof(*File->SearchList));
00315 File->Context = FS;
00316
00317 if (!File->SearchList)
00318 {
00319 geRam_Free(File);
00320 FS->APIs->Close(FSData);
00321 return NULL;
00322 }
00323
00324 File->SearchList->FS = File;
00325 File->SearchList->Next = StartContext->SearchList;
00326
00327 return File;
00328 }
|
|
||||||||||||||||||||||||
|
Definition at line 167 of file vfile.c. References geVFile::APIs, geVFile::BaseFile, CheckOpenFlags(), geVFile_SystemAPIs::Close, FSSearchList::FS, geVFile::FSData, GE_FALSE, GE_VFILE_OPEN_DIRECTORY, GE_VFILE_TYPE_DOS, GE_VFILE_TYPE_VIRTUAL, GENESISAPI, GENESISCC, geRam_Allocate, geRam_Free, geVFile_Close(), FSSearchList::Next, NULL, geVFile_SystemAPIs::OpenNewSystem, RegisterBuiltInAPIs(), RegisteredAPIs, geVFile::SearchList, SystemCount, and geVFile::SystemType. Referenced by DirTree_GetSize(), DoSplashScreen(), geActor_DefCreateFromFile(), geActor_DefWriteToFile(), geBitmap_CreateFromFile(), geBitmap_CreateFromFileName(), geBitmap_WriteToFile(), geBitmap_WriteToFileName(), geBitmapUtil_CreateFromFileName(), geBody_CreateFromFile(), geBody_WriteToFile(), geEngine_InitFonts(), GetABitmap(), LoadEntitySet(), ProcEng_Create(), and WinMain().
00173 {
00174 const geVFile_SystemAPIs * APIs;
00175 geVFile * File;
00176 void * FSData;
00177 geVFile * BaseFile;
00178
00179
00180 if (RegisterBuiltInAPIs() == GE_FALSE)
00181 return GE_FALSE;
00182
00183 if ((FileSystemType == 0) || (FileSystemType > SystemCount))
00184 return NULL;
00185
00186 if (CheckOpenFlags(OpenModeFlags) == GE_FALSE)
00187 return NULL;
00188
00189 // Sugarcoating support for a taste test
00190 if (FS == NULL && (FileSystemType == GE_VFILE_TYPE_VIRTUAL
00191 //
00192 // add tests for file types here
00193
00194 // || FileSystemType == GE_VFILE_TYPE_CVIRTUAL
00195
00196 ))
00197 {
00198 assert(Name);
00199 BaseFile = geVFile_OpenNewSystem(NULL,
00200 GE_VFILE_TYPE_DOS,
00201 Name,
00202 NULL,
00203 OpenModeFlags & ~GE_VFILE_OPEN_DIRECTORY);
00204 if (!BaseFile)
00205 return NULL;
00206 FS = BaseFile;
00207 Name = NULL;
00208 }
00209 else
00210 BaseFile = NULL;
00211
00212 APIs = RegisteredAPIs[FileSystemType - 1];
00213 assert(APIs);
00214 FSData = APIs->OpenNewSystem(FS, Name, Context, OpenModeFlags);
00215
00216 if (!FSData)
00217 {
00218 if (BaseFile)
00219 geVFile_Close(BaseFile);
00220 return NULL;
00221 }
00222
00223 File = geRam_Allocate(sizeof(*File));
00224 if (!File)
00225 {
00226 if (BaseFile)
00227 geVFile_Close(BaseFile);
00228 APIs->Close(FSData);
00229 return NULL;
00230 }
00231
00232 File->SystemType = FileSystemType;
00233 File->APIs = APIs;
00234 File->FSData = FSData;
00235 File->SearchList = geRam_Allocate(sizeof(*File->SearchList));
00236 File->BaseFile = BaseFile;
00237
00238 if (!File->SearchList)
00239 {
00240 if (BaseFile)
00241 geVFile_Close(BaseFile);
00242 geRam_Free(File);
00243 APIs->Close(FSData);
00244 return NULL;
00245 }
00246
00247 File->SearchList->FS = File;
00248 File->SearchList->Next = NULL;
00249
00250 return File;
00251 }
|
|
||||||||||||||||
|
Definition at line 492 of file vfile.c. References geVFile::APIs, geVFile::FSData, geBoolean, GENESISAPI, GENESISCC, and geVFile_SystemAPIs::Write. Referenced by geMotion_WriteLeaf(), geMotion_WriteToFile(), gePath_WriteToFile(), geQKFrame_WriteToFile(), geStrBlock_WriteToFile(), geTKEvents_WriteToFile(), and geVKFrame_WriteToFile().
|
|
||||||||||||||||
|
||||||||||||||||
|
Definition at line 422 of file vfile.c. References geVFile::APIs, geVFile::FSData, geBoolean, GENESISAPI, GENESISCC, and geVFile_SystemAPIs::RenameFile.
00423 {
00424 assert(FS);
00425 assert(FileName);
00426 assert(NewName);
00427
00428 return FS->APIs->RenameFile(FS, FS->FSData, FileName, NewName);
00429 }
|
|
||||||||||||||||
|
Definition at line 485 of file vfile.c. References geVFile::APIs, geVFile::FSData, geBoolean, GENESISAPI, GENESISCC, and geVFile_SystemAPIs::Seek. Referenced by DirTree_WriteToFile1(), ForceFilePos(), FSVFS_Close(), FSVFS_OpenNewSystem(), FSVFS_Seek(), geBitmap_CreateFromFile(), geBitmap_IsTGA(), geBitmap_ReadFromBMP(), geBitmap_ReadFromTGA(), ProcEng_Create(), VFile_SeekPastSpaces(), VFile_SeekPastString(), and VFile_UnGetC().
|
|
||||||||||||
|
Definition at line 542 of file vfile.c. References geVFile::APIs, geVFile::FSData, geBoolean, GENESISAPI, GENESISCC, and geVFile_SystemAPIs::SetAttributes.
00543 {
00544 assert(File);
00545
00546 return File->APIs->SetAttributes(File->FSData, Attributes);
00547 }
|
|
||||||||||||
|
Definition at line 556 of file vfile.c. References geVFile::APIs, geVFile::FSData, geBoolean, GENESISAPI, GENESISCC, and geVFile_SystemAPIs::SetHints.
|
|
||||||||||||
|
Definition at line 535 of file vfile.c. References geVFile::APIs, geVFile::FSData, geBoolean, GENESISAPI, GENESISCC, and geVFile_SystemAPIs::SetSize.
|
|
||||||||||||
|
Definition at line 549 of file vfile.c. References geVFile::APIs, geVFile::FSData, geBoolean, GENESISAPI, GENESISCC, and geVFile_SystemAPIs::SetTime.
|
|
||||||||||||
|
Definition at line 521 of file vfile.c. References geVFile::APIs, geVFile::FSData, geBoolean, GENESISAPI, GENESISCC, and geVFile_SystemAPIs::Size. Referenced by DirTree_GetSize(), and GetSoundData().
|
|
||||||||||||
|
Definition at line 514 of file vfile.c. References geVFile::APIs, geVFile::FSData, geBoolean, GENESISAPI, GENESISCC, and geVFile_SystemAPIs::Tell. Referenced by DirTree_CreateFromFile(), DirTree_WriteToFile1(), FSVFS_Close(), FSVFS_OpenNewSystem(), UpdateFilePos(), VFile_SeekPastSpaces(), and VFile_SeekPastString().
|
|
||||||||||||||||
|
Definition at line 253 of file vfile.c. References geVFile::APIs, geVFile::FSData, geBoolean, GENESISAPI, GENESISCC, and geVFile_SystemAPIs::UpdateContext.
00254 {
00255 assert(FS);
00256 assert(Context);
00257
00258 return FS->APIs->UpdateContext(FS, FS->FSData, Context, ContextSize);
00259 }
|
|
||||||||||||||||
1.3.2