04f17717b43bc68958cdaa37150c2c521d93f7ec
[genesis3d.git] / G3D / VFile / vfile._h
1 /****************************************************************************************/\r
2 /*  VFILE._H                                                                             */\r
3 /*                                                                                      */\r
4 /*  Author: Eli Boling                                                                  */\r
5 /*  Description: Systems internal interfaces for vfiles                                 */\r
6 /*                                                                                      */\r
7 /*  The contents of this file are subject to the Genesis3D Public License               */\r
8 /*  Version 1.01 (the "License"); you may not use this file except in                   */\r
9 /*  compliance with the License. You may obtain a copy of the License at                */\r
10 /*  http://www.genesis3d.com                                                            */\r
11 /*                                                                                      */\r
12 /*  Software distributed under the License is distributed on an "AS IS"                 */\r
13 /*  basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.  See                */\r
14 /*  the License for the specific language governing rights and limitations              */\r
15 /*  under the License.                                                                  */\r
16 /*                                                                                      */\r
17 /*  The Original Code is Genesis3D, released March 25, 1999.                            */\r
18 /*  Genesis3D Version 1.1 released November 15, 1999                                 */\r
19 /*  Copyright (C) 1999 WildTangent, Inc. All Rights Reserved           */\r
20 /*                                                                                      */\r
21 /****************************************************************************************/\r
22 #ifndef VFILE__H\r
23 #define VFILE__H\r
24 \r
25 #include        "basetype.h"\r
26 #include        "vfile.h"\r
27 \r
28 typedef void *          (GENESISCC *geVFile_FinderCreateFN)(geVFile *FileSystem, void *Handle, const char *FileSpec);\r
29 typedef geBoolean       (GENESISCC *geVFile_FinderGetNextFileFN)(void *Handle);\r
30 typedef geBoolean       (GENESISCC *geVFile_FinderGetPropertiesFN)(void *Handle, geVFile_Properties *Properties);\r
31 typedef void            (GENESISCC *geVFile_FinderDestroyFN)(void *Handle);\r
32 \r
33 typedef void *  (GENESISCC *geVFile_OpenNewSystemFN)(geVFile *FS,\r
34                                          const char *Name,\r
35                                          void * Context,\r
36                                          unsigned int OpenModeFlags);\r
37 \r
38 typedef geBoolean (GENESISCC *geVFile_UpdateContextFN)(geVFile *FS, void *Handle, void *Context, int ContextSize);\r
39 \r
40 typedef void *  (GENESISCC *geVFile_OpenFN)(geVFile *FS,\r
41                                          void *Handle,\r
42                                          const char *Name,\r
43                                          void * Context,\r
44                                          unsigned int OpenModeFlags);\r
45 \r
46 typedef geBoolean  (GENESISCC *geVFile_DeleteFileFN)(geVFile *FS, void *Handle, const char *FileName);\r
47 typedef geBoolean  (GENESISCC *geVFile_RenameFileFN)(geVFile *FS, void *Handle, const char *FileName, const char *NewFileName);\r
48 typedef geBoolean  (GENESISCC *geVFile_FileExistsFN)(geVFile *FS, void *Handle, const char *FileName);\r
49 typedef geBoolean  (GENESISCC *geVFile_DisperseFN)(geVFile *FS, void *Handle, const char *Directory, geBoolean Recursive);\r
50 typedef void      (GENESISCC *geVFile_CloseFN)(void *Handle);\r
51 \r
52 typedef geBoolean  (GENESISCC *geVFile_GetSFN)(void *Handle, void *Buff, int MaxSize);\r
53 typedef geBoolean  (GENESISCC *geVFile_ReadFN)(void *Handle, void *Buff, int Count);\r
54 typedef geBoolean  (GENESISCC *geVFile_WriteFN)(void *Handle, const void *Buff, int Count);\r
55 typedef geBoolean  (GENESISCC *geVFile_SeekFN)(void *Handle, int Where, geVFile_Whence Whence);\r
56 typedef geBoolean  (GENESISCC *geVFile_EOFFN)(const void *Handle);\r
57 typedef geBoolean  (GENESISCC *geVFile_TellFN)(const void *Handle, long *Position);\r
58 typedef geBoolean  (GENESISCC *geVFile_GetPropertiesFN)(const void *Handle, geVFile_Properties *Properties);\r
59 \r
60 typedef geBoolean  (GENESISCC *geVFile_SizeFN)(const void *Handle, long *Size);\r
61 typedef geBoolean  (GENESISCC *geVFile_SetSizeFN)(void *Handle, long Size);\r
62 typedef geBoolean  (GENESISCC *geVFile_SetAttributesFN)(void *Handle, geVFile_Attributes Attributes);\r
63 typedef geBoolean  (GENESISCC *geVFile_SetTimeFN)(void *Handle, const geVFile_Time *Time);\r
64 typedef geBoolean  (GENESISCC *geVFile_SetHintsFN)(void *Handle, const geVFile_Hints *Hints);\r
65 \r
66 typedef struct  geVFile_SystemAPIs\r
67 {\r
68         geVFile_FinderCreateFN          FinderCreate;\r
69         geVFile_FinderGetNextFileFN     FinderGetNextFile;\r
70         geVFile_FinderGetPropertiesFN FinderGetProperties;\r
71         geVFile_FinderDestroyFN         FinderDestroy;\r
72 \r
73         geVFile_OpenNewSystemFN         OpenNewSystem;\r
74         geVFile_UpdateContextFN         UpdateContext;\r
75         geVFile_OpenFN                          Open;\r
76         geVFile_DeleteFileFN            DeleteFile;\r
77         geVFile_RenameFileFN            RenameFile;\r
78         geVFile_FileExistsFN            FileExists;\r
79         geVFile_DisperseFN                      Disperse;\r
80         geVFile_CloseFN                         Close;\r
81 \r
82         geVFile_GetSFN                          GetS;\r
83         geVFile_ReadFN                          Read;\r
84         geVFile_WriteFN                         Write;\r
85         geVFile_SeekFN                          Seek;\r
86         geVFile_EOFFN                           Eof;\r
87         geVFile_TellFN                          Tell;\r
88         geVFile_SizeFN                          Size;\r
89 \r
90         geVFile_GetPropertiesFN         GetProperties;\r
91 \r
92         geVFile_SetSizeFN                       SetSize;\r
93         geVFile_SetAttributesFN         SetAttributes;\r
94         geVFile_SetTimeFN                       SetTime;\r
95         geVFile_SetHintsFN                      SetHints;\r
96 }       geVFile_SystemAPIs;\r
97 \r
98 geBoolean GENESISCC VFile_RegisterFileSystem(\r
99         const geVFile_SystemAPIs *      APIs,\r
100         geVFile_TypeIdentifier *        Type);\r
101 \r
102 #endif\r
103 \r