28 #ifndef INC_FS_OC_FS_H_ 29 #define INC_FS_OC_FS_H_ 36 #include <oc_errors.h> 43 #define _________________________________________TYPES_SECTION______________________________________________________________________________ 59 oC_FileSystem_ModeFlags__FailIfExists = (1<<2),
60 oC_FileSystem_ModeFlags__FailIfNotExists= (1<<3),
61 oC_FileSystem_ModeFlags__Open = (1<<4),
62 oC_FileSystem_ModeFlags__Create = (1<<5),
64 oC_FileSystem_ModeFlags__FailIfNotExists ,
66 oC_FileSystem_ModeFlags__Create ,
68 oC_FileSystem_ModeFlags__FailIfExists,
74 oC_FileSystem_FileAttributes_ReadOnly = (1<<0),
75 oC_FileSystem_FileAttributes_Archive = (1<<1),
76 oC_FileSystem_FileAttributes_System = (1<<2),
77 oC_FileSystem_FileAttributes_Hidden = (1<<3)
78 } oC_FileSystem_FileAttributes_t;
82 oC_FileSystem_FileType_File ,
83 oC_FileSystem_FileType_Directory
84 } oC_FileSystem_FileType_t;
90 oC_Timestamp_t Timestamp;
93 oC_FileSystem_FileType_t FileType;
98 typedef oC_ErrorCode_t (*oC_FileSystem_init_t) ( oC_FileSystem_Context_t * outContext );
99 typedef oC_ErrorCode_t (*oC_FileSystem_deinit_t) ( oC_FileSystem_Context_t Context );
100 typedef oC_ErrorCode_t (*oC_FileSystem_fopen_t) ( oC_FileSystem_Context_t Context , oC_File_t * outFile ,
const char * Path ,
oC_FileSystem_ModeFlags_t Mode , oC_FileSystem_FileAttributes_t Attributes );
101 typedef oC_ErrorCode_t (*oC_FileSystem_fclose_t) ( oC_FileSystem_Context_t Context , oC_File_t File );
102 typedef oC_ErrorCode_t (*oC_FileSystem_fread_t) ( oC_FileSystem_Context_t Context , oC_File_t File ,
void * outBuffer , uint32_t * Size );
103 typedef oC_ErrorCode_t (*oC_FileSystem_fwrite_t) ( oC_FileSystem_Context_t Context , oC_File_t File ,
const void * Buffer , uint32_t * Size );
104 typedef oC_ErrorCode_t (*oC_FileSystem_lseek_t) ( oC_FileSystem_Context_t Context , oC_File_t File , uint32_t Offset );
105 typedef oC_ErrorCode_t (*oC_FileSystem_ioctl_t) ( oC_FileSystem_Context_t Context , oC_File_t File , oC_Ioctl_Command_t Command ,
void * Pointer);
106 typedef oC_ErrorCode_t (*oC_FileSystem_sync_t) ( oC_FileSystem_Context_t Context , oC_File_t File );
107 typedef oC_ErrorCode_t (*oC_FileSystem_getc_t) ( oC_FileSystem_Context_t Context ,
char * outCharacter , oC_File_t File );
108 typedef oC_ErrorCode_t (*oC_FileSystem_putc_t) ( oC_FileSystem_Context_t Context ,
char Character , oC_File_t File );
109 typedef int32_t (*oC_FileSystem_tell_t) ( oC_FileSystem_Context_t Context , oC_File_t File );
110 typedef bool (*oC_FileSystem_eof_t) ( oC_FileSystem_Context_t Context , oC_File_t File );
111 typedef uint32_t (*oC_FileSystem_size_t) ( oC_FileSystem_Context_t Context , oC_File_t File );
114 typedef oC_ErrorCode_t (*oC_FileSystem_opendir_t) ( oC_FileSystem_Context_t Context , oC_Dir_t * outDir ,
const char * Path );
115 typedef oC_ErrorCode_t (*oC_FileSystem_closedir_t) ( oC_FileSystem_Context_t Context , oC_Dir_t Dir );
116 typedef oC_ErrorCode_t (*oC_FileSystem_readdir_t) ( oC_FileSystem_Context_t Context , oC_Dir_t Dir ,
oC_FileInfo_t * outFileInfo );
118 typedef oC_ErrorCode_t (*oC_FileSystem_stat_t) ( oC_FileSystem_Context_t Context ,
const char * Path ,
oC_FileInfo_t * outFileInfo);
119 typedef oC_ErrorCode_t (*oC_FileSystem_unlink_t) ( oC_FileSystem_Context_t Context ,
const char * Path);
120 typedef oC_ErrorCode_t (*oC_FileSystem_rename_t) ( oC_FileSystem_Context_t Context ,
const char * OldName ,
const char * NewName);
121 typedef oC_ErrorCode_t (*oC_FileSystem_chmod_t) ( oC_FileSystem_Context_t Context ,
const char * Path, oC_FileSystem_FileAttributes_t Attributes , oC_FileSystem_FileAttributes_t Mask);
122 typedef oC_ErrorCode_t (*oC_FileSystem_utime_t) ( oC_FileSystem_Context_t Context ,
const char * Path , oC_Timestamp_t Timestamp );
123 typedef oC_ErrorCode_t (*oC_FileSystem_mkdir_t) ( oC_FileSystem_Context_t Context ,
const char * Path);
124 typedef bool (*oC_FileSystem_DirExists_t)( oC_FileSystem_Context_t Context ,
const char * Path);
129 oC_FileSystem_init_t init;
130 oC_FileSystem_deinit_t deinit;
131 oC_FileSystem_fopen_t fopen;
132 oC_FileSystem_fclose_t fclose;
133 oC_FileSystem_fread_t fread;
134 oC_FileSystem_fwrite_t fwrite;
135 oC_FileSystem_lseek_t lseek;
136 oC_FileSystem_ioctl_t ioctl;
137 oC_FileSystem_sync_t sync;
138 oC_FileSystem_getc_t Getc;
139 oC_FileSystem_putc_t Putc;
140 oC_FileSystem_tell_t tell;
141 oC_FileSystem_eof_t eof;
142 oC_FileSystem_size_t size;
144 oC_FileSystem_opendir_t opendir;
145 oC_FileSystem_closedir_t closedir;
146 oC_FileSystem_readdir_t readdir;
148 oC_FileSystem_stat_t stat;
149 oC_FileSystem_unlink_t unlink;
150 oC_FileSystem_rename_t rename;
151 oC_FileSystem_chmod_t chmod;
152 oC_FileSystem_utime_t utime;
153 oC_FileSystem_mkdir_t mkdir;
154 oC_FileSystem_DirExists_t DirExists;
159 #undef _________________________________________TYPES_SECTION______________________________________________________________________________ open file (create new if it does not exist)
specifies read access to the file
create new file (fails if file exists)
The library with time definitions.
The file with list library.
oC_FileSystem_ModeFlags_t
create new file (overwrite if exists)
The file with interface for IOCTL.
specifies write access to the file
open file (fails if file does not exist)
moves offset pointer to the end of the file