22#define FF_DEFINED 80286
30#if FF_DEFINED != FFCONF_DEF
31#error Wrong configuration file (ffconf.h).
39typedef unsigned __int64 QWORD;
41#define isnan(v) _isnan(v)
42#define isinf(v) (!_finite(v))
44#elif (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__cplusplus)
47typedef unsigned int UINT;
48typedef unsigned char BYTE;
50typedef uint32_t DWORD;
51typedef uint64_t QWORD;
56typedef unsigned int UINT;
57typedef unsigned char BYTE;
58typedef unsigned short WORD;
59typedef unsigned long DWORD;
67#error exFAT feature wants C99 or later
77#error exFAT needs to be enabled when enable 64-bit LBA
85#if FF_USE_LFN && FF_LFN_UNICODE == 1
89#elif FF_USE_LFN && FF_LFN_UNICODE == 2
93#elif FF_USE_LFN && FF_LFN_UNICODE == 3
97#elif FF_USE_LFN && (FF_LFN_UNICODE < 0 || FF_LFN_UNICODE > 3)
98#error Wrong FF_LFN_UNICODE setting
107#if FF_MULTI_PARTITION
113extern PARTITION VolToPart[];
117#ifndef FF_VOLUME_STRS
118extern const char* VolumeStr[FF_VOLUMES];
134#if FF_MAX_SS != FF_MIN_SS
235 TCHAR altname[FF_SFN_BUF + 1];
236 TCHAR fname[FF_LFN_BUF + 1];
273 FR_TOO_MANY_OPEN_FILES,
281FRESULT f_open(
FIL* fp,
const TCHAR* path, BYTE mode);
282FRESULT f_close(
FIL* fp);
283FRESULT f_read(
FIL* fp,
void* buff, UINT btr, UINT* br);
284FRESULT f_write(
FIL* fp,
const void* buff, UINT btw, UINT* bw);
285FRESULT f_lseek(
FIL* fp, FSIZE_t ofs);
286FRESULT f_truncate(
FIL* fp);
287FRESULT f_sync(
FIL* fp);
288FRESULT f_opendir(
DIR* dp,
const TCHAR* path);
289FRESULT f_closedir(
DIR* dp);
291FRESULT f_findfirst(
DIR* dp,
FILINFO* fno,
const TCHAR* path,
const TCHAR* pattern);
293FRESULT f_mkdir(
const TCHAR* path);
294FRESULT f_unlink(
const TCHAR* path);
295FRESULT f_rename(
const TCHAR* path_old,
const TCHAR* path_new);
296FRESULT f_stat(
const TCHAR* path,
FILINFO* fno);
297FRESULT f_chmod(
const TCHAR* path, BYTE attr, BYTE mask);
298FRESULT f_utime(
const TCHAR* path,
const FILINFO* fno);
299FRESULT f_chdir(
const TCHAR* path);
300FRESULT f_chdrive(
const TCHAR* path);
301FRESULT f_getcwd(TCHAR* buff, UINT len);
302FRESULT f_getfree(
const TCHAR* path, DWORD* nclst,
FATFS** fatfs);
303FRESULT f_getlabel(
const TCHAR* path, TCHAR* label, DWORD* vsn);
304FRESULT f_setlabel(
const TCHAR* label);
305FRESULT f_forward(
FIL* fp, UINT (*func)(
const BYTE*, UINT), UINT btf, UINT* bf);
306FRESULT f_expand(
FIL* fp, FSIZE_t fsz, BYTE opt);
307FRESULT f_mount(
FATFS* fs,
const TCHAR* path, BYTE opt);
308FRESULT f_mkfs(
const TCHAR* path,
const MKFS_PARM* opt,
void* work, UINT len);
309FRESULT f_fdisk(BYTE pdrv,
const LBA_t ptbl[],
void* work);
310FRESULT f_setcp(WORD cp);
311int f_putc(TCHAR c,
FIL* fp);
312int f_puts(
const TCHAR* str,
FIL* cp);
313int f_printf(
FIL* fp,
const TCHAR* str, ...);
314TCHAR* f_gets(TCHAR* buff,
int len,
FIL* fp);
318#define f_eof(fp) ((int)((fp)->fptr == (fp)->obj.objsize))
319#define f_error(fp) ((fp)->err)
320#define f_tell(fp) ((fp)->fptr)
321#define f_size(fp) ((fp)->obj.objsize)
322#define f_rewind(fp) f_lseek((fp), 0)
323#define f_rewinddir(dp) f_readdir((dp), 0)
324#define f_rmdir(path) f_unlink(path)
325#define f_unmount(path) f_mount(0, path, 0)
332#if !FF_FS_READONLY && !FF_FS_NORTC
333DWORD get_fattime(
void);
339WCHAR ff_oem2uni(WCHAR oem, WORD cp);
340WCHAR ff_uni2oem(DWORD uni, WORD cp);
341DWORD ff_wtoupper(DWORD uni);
347void* ff_memalloc(UINT msize);
348void ff_memfree(
void* mblock);
351int ff_mutex_create(
int vol);
352void ff_mutex_delete(
int vol);
353int ff_mutex_take(
int vol);
354void ff_mutex_give(
int vol);
364#define FA_OPEN_EXISTING 0x00
365#define FA_CREATE_NEW 0x04
366#define FA_CREATE_ALWAYS 0x08
367#define FA_OPEN_ALWAYS 0x10
368#define FA_OPEN_APPEND 0x30
371#define CREATE_LINKMAP ((FSIZE_t)0 - 1)