Changeset 374 for asp3_tinet_ecnl_rx/trunk/ntshell/fatfs/ff.h
- Timestamp:
- Apr 5, 2019, 9:26:53 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
asp3_tinet_ecnl_rx/trunk/ntshell/fatfs/ff.h
r337 r374 28 28 #include "ffconf.h" /* FatFs configuration options */ 29 29 #include "diskio.h" 30 #if _FATFS != _FFCONF30 #if _FATFS != FFCONF_DEF 31 31 #error Wrong configuration file (ffconf.h). 32 32 #endif … … 36 36 /* Definitions of volume management */ 37 37 38 #if _MULTI_PARTITION /* Multiple partition configuration */38 #if FF_MULTI_PARTITION /* Multiple partition configuration */ 39 39 typedef struct { 40 40 BYTE pd; /* Physical drive number */ … … 55 55 /* Type of path name strings on FatFs API */ 56 56 57 #if _LFN_UNICODE /* Unicode string */58 #if ! _USE_LFN59 #error _LFN_UNICODE must be 0 at non-LFN cfg.57 #if FF_LFN_UNICODE /* Unicode string */ 58 #if !FF_USE_LFN 59 #error FF_LFN_UNICODE must be 0 at non-LFN cfg. 60 60 #endif 61 61 #ifndef _INC_TCHAR … … 87 87 WORD id; /* File system mount ID */ 88 88 WORD n_rootdir; /* Number of root directory entries (FAT12/16) */ 89 #if _MAX_SS !=_MIN_SS89 #if FF_MAX_SS != FF_MIN_SS 90 90 WORD ssize; /* Bytes per sector (512, 1024, 2048 or 4096) */ 91 91 #endif 92 #if _FS_REENTRANT93 _SYNC_t sobj; /* Identifier of sync object */94 #endif 95 #if ! _FS_READONLY92 #if FF_FS_REENTRANT 93 FF_SYNC_t sobj; /* Identifier of sync object */ 94 #endif 95 #if !FF_FS_READONLY 96 96 DWORD last_clust; /* Last allocated cluster */ 97 97 DWORD free_clust; /* Number of free clusters */ 98 98 #endif 99 #if _FS_RPATH99 #if FF_FS_RPATH 100 100 DWORD cdir; /* Current directory start cluster (0:root) */ 101 101 #endif … … 107 107 DWORD database; /* Data start sector */ 108 108 DWORD winsect; /* Current sector appearing in the win[] */ 109 BYTE win[ _MAX_SS]; /* Disk access window for Directory, FAT (and file data at tiny cfg) */109 BYTE win[FF_MAX_SS]; /* Disk access window for Directory, FAT (and file data at tiny cfg) */ 110 110 } FATFS; 111 111 … … 124 124 DWORD clust; /* Current cluster of fpter (not valid when fprt is 0) */ 125 125 DWORD dsect; /* Sector number appearing in buf[] (0:invalid) */ 126 #if ! _FS_READONLY126 #if !FF_FS_READONLY 127 127 DWORD dir_sect; /* Sector number containing the directory entry */ 128 128 BYTE* dir_ptr; /* Pointer to the directory entry in the win[] */ 129 129 #endif 130 #if _USE_FASTSEEK130 #if FF_USE_FASTSEEK 131 131 DWORD* cltbl; /* Pointer to the cluster link map table (Nulled on file open) */ 132 132 #endif 133 #if _FS_LOCK133 #if FF_FS_LOCK != 0 134 134 UINT lockid; /* File lock ID origin from 1 (index of file semaphore table Files[]) */ 135 135 #endif 136 #if ! _FS_TINY137 BYTE buf[ _MAX_SS]; /* File private data read/write window */136 #if !FF_FS_TINY 137 BYTE buf[FF_MAX_SS]; /* File private data read/write window */ 138 138 #endif 139 139 } FIL; … … 141 141 142 142 143 /* Directory object structure ( DIR) */143 /* Directory object structure (FATFS_DIR) */ 144 144 145 145 typedef struct __dirstream { … … 152 152 BYTE* dir; /* Pointer to the current SFN entry in the win[] */ 153 153 BYTE* fn; /* Pointer to the SFN (in/out) {file[8],ext[3],status[1]} */ 154 #if _FS_LOCK154 #if FF_FS_LOCK != 0 155 155 UINT lockid; /* File lock ID (index of file semaphore table Files[]) */ 156 156 #endif 157 #if _USE_LFN157 #if FF_USE_LFN 158 158 WCHAR* lfn; /* Pointer to the LFN working buffer */ 159 159 WORD lfn_idx; /* Last matched LFN index number (0xFFFF:No LFN) */ 160 160 #endif 161 #if _USE_FIND161 #if FF_USE_FIND 162 162 const TCHAR* pat; /* Pointer to the name matching pattern */ 163 163 #endif 164 } DIR;164 } FATFS_DIR; 165 165 166 166 … … 174 174 BYTE fattrib; /* Attribute */ 175 175 TCHAR fname[13]; /* Short file name (8.3 format) */ 176 #if _USE_LFN176 #if FF_USE_LFN 177 177 TCHAR* lfname; /* Pointer to the LFN buffer */ 178 178 UINT lfsize; /* Size of LFN buffer in TCHAR */ … … 203 203 FR_LOCKED, /* (16) The operation is rejected according to the file sharing policy */ 204 204 FR_NOT_ENOUGH_CORE, /* (17) LFN working buffer could not be allocated */ 205 FR_TOO_MANY_OPEN_FILES, /* (18) Number of open files > _FS_LOCK */205 FR_TOO_MANY_OPEN_FILES, /* (18) Number of open files > FF_FS_LOCK */ 206 206 FR_INVALID_PARAMETER /* (19) Given parameter is invalid */ 207 207 } FRESULT; … … 220 220 FRESULT f_truncate (FIL* fp); /* Truncate file */ 221 221 FRESULT f_sync (FIL* fp); /* Flush cached data of a writing file */ 222 FRESULT f_opendir ( DIR* dp, const TCHAR* path); /* Open a directory */223 FRESULT f_closedir ( DIR* dp); /* Close an open directory */224 FRESULT f_readdir ( DIR* dp, FILINFO* fno); /* Read a directory item */225 FRESULT f_findfirst ( DIR* dp, FILINFO* fno, const TCHAR* path, const TCHAR* pattern); /* Find first file */226 FRESULT f_findnext ( DIR* dp, FILINFO* fno); /* Find next file */222 FRESULT f_opendir (FATFS_DIR* dp, const TCHAR* path); /* Open a directory */ 223 FRESULT f_closedir (FATFS_DIR* dp); /* Close an open directory */ 224 FRESULT f_readdir (FATFS_DIR* dp, FILINFO* fno); /* Read a directory item */ 225 FRESULT f_findfirst (FATFS_DIR* dp, FILINFO* fno, const TCHAR* path, const TCHAR* pattern); /* Find first file */ 226 FRESULT f_findnext (FATFS_DIR* dp, FILINFO* fno); /* Find next file */ 227 227 FRESULT f_mkdir (const TCHAR* path); /* Create a sub directory */ 228 228 FRESULT f_unlink (const TCHAR* path); /* Delete an existing file or directory */ … … 270 270 271 271 /* RTC function */ 272 #if ! _FS_READONLY && !_FS_NORTC272 #if !FF_FS_READONLY && !FF_FS_NORTC 273 273 DWORD get_fattime (void); 274 274 #endif 275 275 276 276 /* Unicode support functions */ 277 #if _USE_LFN /* Unicode - OEM code conversion */277 #if FF_USE_LFN /* Unicode - OEM code conversion */ 278 278 WCHAR ff_convert (WCHAR chr, UINT dir); /* OEM-Unicode bidirectional conversion */ 279 279 WCHAR ff_wtoupper (WCHAR chr); /* Unicode upper-case conversion */ 280 #if _USE_LFN == 3 /* Memory functions */280 #if FF_USE_LFN == 3 /* Memory functions */ 281 281 void* ff_memalloc (UINT msize); /* Allocate memory block */ 282 282 void ff_memfree (void* mblock); /* Free memory block */ … … 285 285 286 286 /* Sync functions */ 287 #if _FS_REENTRANT288 int ff_cre_syncobj (BYTE vol, _SYNC_t* sobj); /* Create a sync object */289 int ff_req_grant ( _SYNC_t sobj); /* Lock sync object */290 void ff_rel_grant ( _SYNC_t sobj); /* Unlock sync object */291 int ff_del_syncobj ( _SYNC_t sobj); /* Delete a sync object */287 #if FF_FS_REENTRANT 288 int ff_cre_syncobj (BYTE vol, FF_SYNC_t* sobj); /* Create a sync object */ 289 int ff_req_grant (FF_SYNC_t sobj); /* Lock sync object */ 290 void ff_rel_grant (FF_SYNC_t sobj); /* Unlock sync object */ 291 int ff_del_syncobj (FF_SYNC_t sobj); /* Delete a sync object */ 292 292 #endif 293 293 … … 304 304 #define FA_OPEN_EXISTING 0x00 305 305 306 #if ! _FS_READONLY306 #if !FF_FS_READONLY 307 307 #define FA_WRITE 0x02 308 308 #define FA_CREATE_NEW 0x04 309 309 #define FA_CREATE_ALWAYS 0x08 310 310 #define FA_OPEN_ALWAYS 0x10 311 #define FA__WRITTEN 0x20 312 #define FA__DIRTY 0x40 311 #define FA_OPEN_APPEND 0x30 312 #define FA_MODIFIED 0x20 313 #define FA_DIRTY 0x40 313 314 #endif 314 315 … … 341 342 /* Multi-byte word access macros */ 342 343 343 #if _WORD_ACCESS == 1 /* Enable word access to the FAT structure */344 #if FF_WORD_ACCESS == 1 /* Enable word access to the FAT structure */ 344 345 #define LD_WORD(ptr) (WORD)(*(WORD*)(BYTE*)(ptr)) 345 346 #define LD_DWORD(ptr) (DWORD)(*(DWORD*)(BYTE*)(ptr))
Note:
See TracChangeset
for help on using the changeset viewer.