userlibandfileserver/fileserver/sfat/common_constants.h
changeset 15 4122176ea935
parent 0 a41df078684a
equal deleted inserted replaced
0:a41df078684a 15:4122176ea935
    19 /**
    19 /**
    20  @file
    20  @file
    21  @internalTechnology
    21  @internalTechnology
    22 */
    22 */
    23 
    23 
       
    24 //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
       
    25 //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
       
    26 //!!
       
    27 //!! WARNING!! DO NOT edit this file !! '\sfat' component is obsolete and is not being used. '\sfat32'replaces it
       
    28 //!!
       
    29 //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
       
    30 //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
       
    31 
       
    32 
    24 #ifndef COMMON_CONSTANTS_H
    33 #ifndef COMMON_CONSTANTS_H
    25 #define COMMON_CONSTANTS_H
    34 #define COMMON_CONSTANTS_H
    26 
    35 
    27 
    36 
    28 
    37 
    38 
    47 
    39 
    48 
    40 #if defined(_DEBUG) || defined(_DEBUG_RELEASE)
    49 #if defined(_DEBUG) || defined(_DEBUG_RELEASE)
    41 
    50 
    42 #ifndef FORCE_LOGS
    51 #ifndef FORCE_LOGS
    43     #define __PRINT(t)          		{if (DebugRegister()&KFSYS) RDebug::Print(t);}
    52     #define __PRINT(t)                  {if (DebugRegister()&KFSYS) RDebug::Print(t);}
    44     #define __PRINT1(t,a)       		{if (DebugRegister()&KFSYS) RDebug::Print(t,a);}
    53     #define __PRINT1(t,a)               {if (DebugRegister()&KFSYS) RDebug::Print(t,a);}
    45     #define __PRINT2(t,a,b)     		{if (DebugRegister()&KFSYS) RDebug::Print(t,a,b);}
    54     #define __PRINT2(t,a,b)             {if (DebugRegister()&KFSYS) RDebug::Print(t,a,b);}
    46     #define __PRINT3(t,a,b,c)   		{if (DebugRegister()&KFSYS) RDebug::Print(t,a,b,c);}
    55     #define __PRINT3(t,a,b,c)           {if (DebugRegister()&KFSYS) RDebug::Print(t,a,b,c);}
    47     #define __PRINT4(t,a,b,c,d) 		{if (DebugRegister()&KFSYS) RDebug::Print(t,a,b,c,d);}
    56     #define __PRINT4(t,a,b,c,d)         {if (DebugRegister()&KFSYS) RDebug::Print(t,a,b,c,d);}
    48     #define __PRINT5(t,a,b,c,d,e) 		{if (DebugRegister()&KFSYS) RDebug::Print(t,a,b,c,d,e);}
    57     #define __PRINT5(t,a,b,c,d,e)       {if (DebugRegister()&KFSYS) RDebug::Print(t,a,b,c,d,e);}
    49     #define __PRINT6(t,a,b,c,d,e,f) 	{if (DebugRegister()&KFSYS) RDebug::Print(t,a,b,c,d,e,f);}
    58     #define __PRINT6(t,a,b,c,d,e,f)     {if (DebugRegister()&KFSYS) RDebug::Print(t,a,b,c,d,e,f);}
    50     #define __PRINT7(t,a,b,c,d,e,f,g)	{if (DebugRegister()&KFSYS) RDebug::Print(t,a,b,c,d,e,f,g);}
    59     #define __PRINT7(t,a,b,c,d,e,f,g)   {if (DebugRegister()&KFSYS) RDebug::Print(t,a,b,c,d,e,f,g);}
    51     #define __PRINT8BIT1(t,a)           {if (DebugRegister()&KFSYS){TFileName temp;temp.Copy(a);RDebug::Print(t,&temp);}}
    60     #define __PRINT8BIT1(t,a)           {if (DebugRegister()&KFSYS){TFileName temp;temp.Copy(a);RDebug::Print(t,&temp);}}
    52     #define __PRINT1TEMP(t,a)           {if (DebugRegister()&KFSERV) {TBuf<KMaxFileName>temp(a);RDebug::Print(t,&temp);}}
    61     #define __PRINT1TEMP(t,a)           {if (DebugRegister()&KFSERV) {TBuf<KMaxFileName>temp(a);RDebug::Print(t,&temp);}}
    53 #else //FORCE_LOGS
    62 #else //FORCE_LOGS
    54     #define __PRINT(t)          		{RDebug::Print(t);}
    63     #define __PRINT(t)                  {RDebug::Print(t);}
    55     #define __PRINT1(t,a)       		{RDebug::Print(t,a);}
    64     #define __PRINT1(t,a)               {RDebug::Print(t,a);}
    56     #define __PRINT2(t,a,b)     		{RDebug::Print(t,a,b);}
    65     #define __PRINT2(t,a,b)             {RDebug::Print(t,a,b);}
    57     #define __PRINT3(t,a,b,c)   		{RDebug::Print(t,a,b,c);}
    66     #define __PRINT3(t,a,b,c)           {RDebug::Print(t,a,b,c);}
    58     #define __PRINT4(t,a,b,c,d) 		{RDebug::Print(t,a,b,c,d);}
    67     #define __PRINT4(t,a,b,c,d)         {RDebug::Print(t,a,b,c,d);}
    59     #define __PRINT5(t,a,b,c,d,e) 		{RDebug::Print(t,a,b,c,d,e);}
    68     #define __PRINT5(t,a,b,c,d,e)       {RDebug::Print(t,a,b,c,d,e);}
    60     #define __PRINT6(t,a,b,c,d,e,f) 	{RDebug::Print(t,a,b,c,d,e,f);}
    69     #define __PRINT6(t,a,b,c,d,e,f)     {RDebug::Print(t,a,b,c,d,e,f);}
    61     #define __PRINT7(t,a,b,c,d,e,f,g)	{RDebug::Print(t,a,b,c,d,e,f,g);}
    70     #define __PRINT7(t,a,b,c,d,e,f,g)   {RDebug::Print(t,a,b,c,d,e,f,g);}
    62     #define __PRINT8BIT1(t,a)           {{TFileName temp;temp.Copy(a);RDebug::Print(t,&temp);}}
    71     #define __PRINT8BIT1(t,a)           {{TFileName temp;temp.Copy(a);RDebug::Print(t,&temp);}}
    63     #define __PRINT1TEMP(t,a)           {{TBuf<KMaxFileName>temp(a);RDebug::Print(t,&temp);}}
    72     #define __PRINT1TEMP(t,a)           {{TBuf<KMaxFileName>temp(a);RDebug::Print(t,&temp);}}
    64 #endif//FORCE_LOGS
    73 #endif//FORCE_LOGS
    65 
    74 
    66 #define DBG_STATEMENT(text) text
    75 #define DBG_STATEMENT(text) text
   105 _LIT8(KFileSystemName12,"FAT12   ");    ///< Name in BPB given to a Fat12 volume
   114 _LIT8(KFileSystemName12,"FAT12   ");    ///< Name in BPB given to a Fat12 volume
   106 _LIT8(KFileSystemName16,"FAT16   ");    ///< Name in BPB given to a Fat16 volume
   115 _LIT8(KFileSystemName16,"FAT16   ");    ///< Name in BPB given to a Fat16 volume
   107 _LIT8(KFileSystemName32,"FAT32   ");    ///< Name in BPB given to a Fat32 volume
   116 _LIT8(KFileSystemName32,"FAT32   ");    ///< Name in BPB given to a Fat32 volume
   108 _LIT8(KDefaultVendorID, "EPOC");        ///< Vendor Name for BPB for any volume formated using a Symbian OS device
   117 _LIT8(KDefaultVendorID, "EPOC");        ///< Vendor Name for BPB for any volume formated using a Symbian OS device
   109 
   118 
   110 const TInt KMaxFatFileNameExt=3;		///< Maximum Fat file system file/directory name extension length
   119 const TInt KMaxFatFileNameExt=3;        ///< Maximum Fat file system file/directory name extension length
   111 const TInt KNumberOfFatsInternal=1;     ///< Number of FATs for an internal drive
   120 const TInt KNumberOfFatsInternal=1;     ///< Number of FATs for an internal drive
   112 const TInt KNumberOfFatsExternal=2;     ///< Number of FATs for an internal drive
   121 const TInt KNumberOfFatsExternal=2;     ///< Number of FATs for an internal drive
   113 const TInt KMaxFatFileName=12;          ///< Maximum Fat file system file/directory name length
   122 const TInt KMaxFatFileName=12;          ///< Maximum Fat file system file/directory name length
   114 const TInt KMaxFatFileNameWithoutExt=8; ///< Maximum Fat file system file/directory name length without extension
   123 const TInt KMaxFatFileNameWithoutExt=8; ///< Maximum Fat file system file/directory name length without extension
   115 const TInt KMaxDuplicateShortName=0xFFFF;
   124 const TInt KMaxDuplicateShortName=0xFFFF;
   116 const TInt KMaxVFatEntryName=13;        ///< Maximum entries in a VFat name
   125 const TInt KMaxVFatEntryName=13;        ///< Maximum entries in a VFat name
   117 const TInt KMaxFAT16Entries=0xFFF0;	    ///< Maximum number of clusters in a Fat16 Fat table, 65520
   126 const TInt KMaxFAT16Entries=0xFFF0;     ///< Maximum number of clusters in a Fat16 Fat table, 65520
   118 const TInt KMaxFAT12Entries=0xFF0;	    ///< Maximum number of clusters in a Fat12 Fat table, 4080
   127 const TInt KMaxFAT12Entries=0xFF0;      ///< Maximum number of clusters in a Fat12 Fat table, 4080
   119 const TUint8 KBootSectorMediaDescriptor=0xF8;   ///< Media descriptor for a Fat volume, Generic disk
   128 const TUint8 KBootSectorMediaDescriptor=0xF8;   ///< Media descriptor for a Fat volume, Generic disk
   120 const TUint8 KEntryErasedMarker=0xE5;           ///< Erased entry marker for a directory entry
   129 const TUint8 KEntryErasedMarker=0xE5;           ///< Erased entry marker for a directory entry
   121 
   130 
   122 const TUint KDefSectorSzLog2=9;                         ///< Log2 of the default sector size for FAT
   131 const TUint KDefSectorSzLog2=9;                         ///< Log2 of the default sector size for FAT
   123 const TUint KDefaultSectorSize = 1 << KDefSectorSzLog2; ///< Default sector size for FAT, 512 bytes
   132 const TUint KDefaultSectorSize = 1 << KDefSectorSzLog2; ///< Default sector size for FAT, 512 bytes
   142 
   151 
   143 /**
   152 /**
   144 Internal fault codes for FAT fsy
   153 Internal fault codes for FAT fsy
   145 */
   154 */
   146 enum TFault
   155 enum TFault
   147 	{
   156     {
   148 	EVFatNoLongName,                // 0
   157     EVFatNoLongName,                // 0
   149 	EFatBadParameter,               // 1
   158     EFatBadParameter,               // 1
   150 	EFatBadLocalDrive,              // 2
   159     EFatBadLocalDrive,              // 2
   151 	EFatBadBootSectorParameter,     // 3
   160     EFatBadBootSectorParameter,     // 3
   152 	EFatBadDirEntryParameter,       // 4
   161     EFatBadDirEntryParameter,       // 4
   153 	EFatBadStdFormatName,           // 5
   162     EFatBadStdFormatName,           // 5
   154 	EFatBadDosFormatName,           // 6
   163     EFatBadDosFormatName,           // 6
   155 	EFatCorrupt,                    // 7
   164     EFatCorrupt,                    // 7
   156 	EFatChkDskIllegalClusterNumber, // 8
   165     EFatChkDskIllegalClusterNumber, // 8
   157 	EFatChkDskClusterAlreadyInUse,  // 9
   166     EFatChkDskClusterAlreadyInUse,  // 9
   158 	EFatChkDskBadCluster,           // 10
   167     EFatChkDskBadCluster,           // 10
   159 	EFatChkDskInvalidEntrySize,     // 11
   168     EFatChkDskInvalidEntrySize,     // 11
   160 	EFatFilePosBeyondEnd,			// 12
   169     EFatFilePosBeyondEnd,           // 12
   161 	EFatFileSeekIndexTooSmall,      // 13
   170     EFatFileSeekIndexTooSmall,      // 13
   162 	EFatFileSeekIndexTooSmall2,     // 14
   171     EFatFileSeekIndexTooSmall2,     // 14
   163 	ELruCacheBadGranularity,        // 15
   172     ELruCacheBadGranularity,        // 15
   164 	EFatRawReadTooBig,              // 16
   173     EFatRawReadTooBig,              // 16
   165 	EFatReadUidFailed,              // 17
   174     EFatReadUidFailed,              // 17
   166 	ELruCacheFlushNotSupported,     // 18
   175     ELruCacheFlushNotSupported,     // 18
   167 	EReadFileSectionFailed,         // 19
   176     EReadFileSectionFailed,         // 19
   168 	EBadReplacementForUnconvertibleUnicodeCharacters, // 20
   177     EBadReplacementForUnconvertibleUnicodeCharacters, // 20
   169 
   178 
   170     EFatRAMDriveSizeInvalid,        // 21
   179     EFatRAMDriveSizeInvalid,        // 21
   171 	EFatRAMDriveFreeInvalid,        // 22
   180     EFatRAMDriveFreeInvalid,        // 22
   172     ECheckFatIndexZero,             // 23
   181     ECheckFatIndexZero,             // 23
   173 
   182 
   174     EFatCache_BadGranularity,       // 24
   183     EFatCache_BadGranularity,       // 24
   175     EFatCache_DiscardingDirtyData,  // 25
   184     EFatCache_DiscardingDirtyData,  // 25
   176     EFatCache_NotImplemented,       // 26
   185     EFatCache_NotImplemented,       // 26
   177     EFatCache_BadFatType,           // 27
   186     EFatCache_BadFatType,           // 27
   178 
   187 
   179     EFatTable_InvalidIndex,         // 28
   188     EFatTable_InvalidIndex,         // 28
   180 
   189 
   181 	};
   190     };
   182 
   191 
   183 //-----------------------------------------------------------------------------
   192 //-----------------------------------------------------------------------------
   184 
   193 
   185 
   194 
   186 #if defined(_DEBUG)
   195 #if defined(_DEBUG)
   195     EIsRuggedFSys,          ///< 4
   204     EIsRuggedFSys,          ///< 4
   196     ENCNotifierHang,        ///< 5
   205     ENCNotifierHang,        ///< 5
   197     ENCNotifierClear,       ///< 6
   206     ENCNotifierClear,       ///< 6
   198     ECNotifier,             ///< 7
   207     ECNotifier,             ///< 7
   199     ECNotifierCancel,       ///< 8
   208     ECNotifierCancel,       ///< 8
   200 	ENCNotifierRepeat,      ///< 9
   209     ENCNotifierRepeat,      ///< 9
   201 
   210 
   202 	ELocalTimeForRemovableMediaOn,  ///< 10
   211     ELocalTimeForRemovableMediaOn,  ///< 10
   203 	ELocalTimeForRemovableMediaOff, ///< 11
   212     ELocalTimeForRemovableMediaOff, ///< 11
   204 	ELocalTimeUsedOnRemovableMedia, ///< 12
   213     ELocalTimeUsedOnRemovableMedia, ///< 12
   205 	ECreationTime,                  ///< 13
   214     ECreationTime,                  ///< 13
   206 
   215 
   207 	EDisableFATDirCache,			///<14
   216     EDisableFATDirCache,            ///<14
   208 	EDumpFATDirCache,				///<15
   217     EDumpFATDirCache,               ///<15
   209 	EFATDirCacheInfo,				///<16
   218     EFATDirCacheInfo,               ///<16
   210 	
   219     
   211     EExtCustom=KMaxTInt/2
   220     EExtCustom=KMaxTInt/2
   212     };
   221     };
   213 
   222 
   214 
   223 
   215 const TUid KSID_Test1={0x10210EB3}; ///< SID of the test that will define and set test property to control volume mounting
   224 const TUid KSID_Test1={0x10210EB3}; ///< SID of the test that will define and set test property to control volume mounting