Index: asp3_tinet_ecnl_rx/trunk/ntshell/fatfs/ff.h
===================================================================
--- asp3_tinet_ecnl_rx/trunk/ntshell/fatfs/ff.h	(revision 337)
+++ asp3_tinet_ecnl_rx/trunk/ntshell/fatfs/ff.h	(revision 374)
@@ -28,5 +28,5 @@
 #include "ffconf.h"		/* FatFs configuration options */
 #include "diskio.h"
-#if _FATFS != _FFCONF
+#if _FATFS != FFCONF_DEF
 #error Wrong configuration file (ffconf.h).
 #endif
@@ -36,5 +36,5 @@
 /* Definitions of volume management */
 
-#if _MULTI_PARTITION		/* Multiple partition configuration */
+#if FF_MULTI_PARTITION		/* Multiple partition configuration */
 typedef struct {
 	BYTE pd;	/* Physical drive number */
@@ -55,7 +55,7 @@
 /* Type of path name strings on FatFs API */
 
-#if _LFN_UNICODE			/* Unicode string */
-#if !_USE_LFN
-#error _LFN_UNICODE must be 0 at non-LFN cfg.
+#if FF_LFN_UNICODE			/* Unicode string */
+#if !FF_USE_LFN
+#error FF_LFN_UNICODE must be 0 at non-LFN cfg.
 #endif
 #ifndef _INC_TCHAR
@@ -87,15 +87,15 @@
 	WORD	id;				/* File system mount ID */
 	WORD	n_rootdir;		/* Number of root directory entries (FAT12/16) */
-#if _MAX_SS != _MIN_SS
+#if FF_MAX_SS != FF_MIN_SS
 	WORD	ssize;			/* Bytes per sector (512, 1024, 2048 or 4096) */
 #endif
-#if _FS_REENTRANT
-	_SYNC_t	sobj;			/* Identifier of sync object */
-#endif
-#if !_FS_READONLY
+#if FF_FS_REENTRANT
+	FF_SYNC_t	sobj;			/* Identifier of sync object */
+#endif
+#if !FF_FS_READONLY
 	DWORD	last_clust;		/* Last allocated cluster */
 	DWORD	free_clust;		/* Number of free clusters */
 #endif
-#if _FS_RPATH
+#if FF_FS_RPATH
 	DWORD	cdir;			/* Current directory start cluster (0:root) */
 #endif
@@ -107,5 +107,5 @@
 	DWORD	database;		/* Data start sector */
 	DWORD	winsect;		/* Current sector appearing in the win[] */
-	BYTE	win[_MAX_SS];	/* Disk access window for Directory, FAT (and file data at tiny cfg) */
+	BYTE	win[FF_MAX_SS];	/* Disk access window for Directory, FAT (and file data at tiny cfg) */
 } FATFS;
 
@@ -124,16 +124,16 @@
 	DWORD	clust;			/* Current cluster of fpter (not valid when fprt is 0) */
 	DWORD	dsect;			/* Sector number appearing in buf[] (0:invalid) */
-#if !_FS_READONLY
+#if !FF_FS_READONLY
 	DWORD	dir_sect;		/* Sector number containing the directory entry */
 	BYTE*	dir_ptr;		/* Pointer to the directory entry in the win[] */
 #endif
-#if _USE_FASTSEEK
+#if FF_USE_FASTSEEK
 	DWORD*	cltbl;			/* Pointer to the cluster link map table (Nulled on file open) */
 #endif
-#if _FS_LOCK
+#if FF_FS_LOCK != 0
 	UINT	lockid;			/* File lock ID origin from 1 (index of file semaphore table Files[]) */
 #endif
-#if !_FS_TINY
-	BYTE	buf[_MAX_SS];	/* File private data read/write window */
+#if !FF_FS_TINY
+	BYTE	buf[FF_MAX_SS];	/* File private data read/write window */
 #endif
 } FIL;
@@ -141,5 +141,5 @@
 
 
-/* Directory object structure (DIR) */
+/* Directory object structure (FATFS_DIR) */
 
 typedef struct __dirstream {
@@ -152,15 +152,15 @@
 	BYTE*	dir;			/* Pointer to the current SFN entry in the win[] */
 	BYTE*	fn;				/* Pointer to the SFN (in/out) {file[8],ext[3],status[1]} */
-#if _FS_LOCK
+#if FF_FS_LOCK != 0
 	UINT	lockid;			/* File lock ID (index of file semaphore table Files[]) */
 #endif
-#if _USE_LFN
+#if FF_USE_LFN
 	WCHAR*	lfn;			/* Pointer to the LFN working buffer */
 	WORD	lfn_idx;		/* Last matched LFN index number (0xFFFF:No LFN) */
 #endif
-#if _USE_FIND
+#if FF_USE_FIND
 	const TCHAR*	pat;	/* Pointer to the name matching pattern */
 #endif
-} DIR;
+} FATFS_DIR;
 
 
@@ -174,5 +174,5 @@
 	BYTE	fattrib;		/* Attribute */
 	TCHAR	fname[13];		/* Short file name (8.3 format) */
-#if _USE_LFN
+#if FF_USE_LFN
 	TCHAR*	lfname;			/* Pointer to the LFN buffer */
 	UINT 	lfsize;			/* Size of LFN buffer in TCHAR */
@@ -203,5 +203,5 @@
 	FR_LOCKED,				/* (16) The operation is rejected according to the file sharing policy */
 	FR_NOT_ENOUGH_CORE,		/* (17) LFN working buffer could not be allocated */
-	FR_TOO_MANY_OPEN_FILES,	/* (18) Number of open files > _FS_LOCK */
+	FR_TOO_MANY_OPEN_FILES,	/* (18) Number of open files > FF_FS_LOCK */
 	FR_INVALID_PARAMETER	/* (19) Given parameter is invalid */
 } FRESULT;
@@ -220,9 +220,9 @@
 FRESULT f_truncate (FIL* fp);										/* Truncate file */
 FRESULT f_sync (FIL* fp);											/* Flush cached data of a writing file */
-FRESULT f_opendir (DIR* dp, const TCHAR* path);						/* Open a directory */
-FRESULT f_closedir (DIR* dp);										/* Close an open directory */
-FRESULT f_readdir (DIR* dp, FILINFO* fno);							/* Read a directory item */
-FRESULT f_findfirst (DIR* dp, FILINFO* fno, const TCHAR* path, const TCHAR* pattern);	/* Find first file */
-FRESULT f_findnext (DIR* dp, FILINFO* fno);							/* Find next file */
+FRESULT f_opendir (FATFS_DIR* dp, const TCHAR* path);						/* Open a directory */
+FRESULT f_closedir (FATFS_DIR* dp);										/* Close an open directory */
+FRESULT f_readdir (FATFS_DIR* dp, FILINFO* fno);							/* Read a directory item */
+FRESULT f_findfirst (FATFS_DIR* dp, FILINFO* fno, const TCHAR* path, const TCHAR* pattern);	/* Find first file */
+FRESULT f_findnext (FATFS_DIR* dp, FILINFO* fno);							/* Find next file */
 FRESULT f_mkdir (const TCHAR* path);								/* Create a sub directory */
 FRESULT f_unlink (const TCHAR* path);								/* Delete an existing file or directory */
@@ -270,13 +270,13 @@
 
 /* RTC function */
-#if !_FS_READONLY && !_FS_NORTC
+#if !FF_FS_READONLY && !FF_FS_NORTC
 DWORD get_fattime (void);
 #endif
 
 /* Unicode support functions */
-#if _USE_LFN							/* Unicode - OEM code conversion */
+#if FF_USE_LFN							/* Unicode - OEM code conversion */
 WCHAR ff_convert (WCHAR chr, UINT dir);	/* OEM-Unicode bidirectional conversion */
 WCHAR ff_wtoupper (WCHAR chr);			/* Unicode upper-case conversion */
-#if _USE_LFN == 3						/* Memory functions */
+#if FF_USE_LFN == 3						/* Memory functions */
 void* ff_memalloc (UINT msize);			/* Allocate memory block */
 void ff_memfree (void* mblock);			/* Free memory block */
@@ -285,9 +285,9 @@
 
 /* Sync functions */
-#if _FS_REENTRANT
-int ff_cre_syncobj (BYTE vol, _SYNC_t* sobj);	/* Create a sync object */
-int ff_req_grant (_SYNC_t sobj);				/* Lock sync object */
-void ff_rel_grant (_SYNC_t sobj);				/* Unlock sync object */
-int ff_del_syncobj (_SYNC_t sobj);				/* Delete a sync object */
+#if FF_FS_REENTRANT
+int ff_cre_syncobj (BYTE vol, FF_SYNC_t* sobj);	/* Create a sync object */
+int ff_req_grant (FF_SYNC_t sobj);				/* Lock sync object */
+void ff_rel_grant (FF_SYNC_t sobj);				/* Unlock sync object */
+int ff_del_syncobj (FF_SYNC_t sobj);				/* Delete a sync object */
 #endif
 
@@ -304,11 +304,12 @@
 #define	FA_OPEN_EXISTING	0x00
 
-#if !_FS_READONLY
+#if !FF_FS_READONLY
 #define	FA_WRITE			0x02
 #define	FA_CREATE_NEW		0x04
 #define	FA_CREATE_ALWAYS	0x08
 #define	FA_OPEN_ALWAYS		0x10
-#define FA__WRITTEN			0x20
-#define FA__DIRTY			0x40
+#define	FA_OPEN_APPEND		0x30
+#define FA_MODIFIED			0x20
+#define FA_DIRTY			0x40
 #endif
 
@@ -341,5 +342,5 @@
 /* Multi-byte word access macros  */
 
-#if _WORD_ACCESS == 1	/* Enable word access to the FAT structure */
+#if FF_WORD_ACCESS == 1	/* Enable word access to the FAT structure */
 #define	LD_WORD(ptr)		(WORD)(*(WORD*)(BYTE*)(ptr))
 #define	LD_DWORD(ptr)		(DWORD)(*(DWORD*)(BYTE*)(ptr))
