os/kernelhwsrv/userlibandfileserver/fileserver/inc/rofs.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 // Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     4 // under the terms of the License "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 //
    15 // WARNING: This file contains some APIs which are internal and are subject
    16 //          to change without notice. Such APIs should therefore not be used
    17 //          outside the Kernel and Hardware Services package.
    18 //
    19 
    20 /**
    21  @file
    22  @internalAll
    23 */
    24 
    25 #ifndef ROFS_H
    26 #define ROFS_H
    27 
    28 /**
    29 @internalAll
    30 @released
    31 */
    32 const TUint16 KRofsFormatVersion = 0x200;
    33 
    34 class TRofsEntry
    35 /**
    36 @internalAll
    37 @released
    38 */
    39 	{
    40 public:
    41 	TUint16 iStructSize;	// Total size of entry, header + name + any padding
    42 	TUint8	iUids[sizeof(TCheckedUid)];		// A copy of all the UID info
    43 	TUint8	iNameOffset;	// offset of iName from start of entry
    44 	TUint8	iAtt;			// standard file attributes
    45 	TUint32 iFileSize;		// real size of file in bytes (may be different from size in image)
    46 							// for subdirectories this is the total size of the directory
    47 							// block entry excluding padding
    48 	TUint32 iFileAddress;	// address in image of file start
    49 	TUint8	iAttExtra;		// extra ROFS attributes (these are inverted so 0 = enabled)
    50 	TUint8	iNameLength;	// length of iName
    51 	TUint16 iName[1];
    52 	};
    53 
    54 /**
    55 @internalAll
    56 @released
    57 */
    58 const TUint KRofsEntryNameOffset = _FOFF( TRofsEntry, iName );
    59 /**
    60 @internalAll
    61 @released
    62 */
    63 const TUint KRofsEntryHeaderSize = KRofsEntryNameOffset;
    64 
    65 class TRofsDir
    66 /**
    67 @internalAll
    68 @released
    69 */
    70 	{
    71 	public:
    72 	TUint16	iStructSize;		// Total size of this directory block including padding
    73 	TUint8	padding;
    74 	TUint8	iFirstEntryOffset;	// offset to first entry
    75 	TUint32 iFileBlockAddress;	// address of associated file block
    76 	TUint32	iFileBlockSize;		// size of associated file block
    77 	TRofsEntry	iSubDir;		// first subdir entry (not present if no subdirs)
    78 	};
    79 
    80 /**
    81 @internalAll
    82 @released
    83 */
    84 const TUint KRofsDirFirstEntryOffset = _FOFF( TRofsDir, iSubDir );
    85 /**
    86 @internalAll
    87 @released
    88 */
    89 const TUint KRofsDirHeaderSize = KRofsDirFirstEntryOffset;
    90 
    91 class TRofsHeader
    92 /**
    93 @internalAll
    94 @released
    95 */
    96 	{
    97 	public:
    98 	TUint8		iIdentifier[4];		// ROFS identifier
    99 	TUint8		iHeaderSize;
   100 	TUint8		iReserved;
   101 	TUint16		iRofsFormatVersion;
   102 	TUint		iDirTreeOffset;	// offset to start of directory structure
   103 	TUint		iDirTreeSize;		// size in bytes of directory
   104 	TUint		iDirFileEntriesOffset;	// offset to start of file entries
   105 	TUint		iDirFileEntriesSize;	// size in bytes of file entry block
   106 	TInt64		iTime;
   107 	TVersion	iImageVersion;		// licensee image version
   108 	TUint32		iImageSize;
   109 	TUint		iCheckSum;
   110 	TUint32		iMaxImageSize;
   111 	};
   112 /**
   113 @internalAll
   114 @released
   115 */
   116 
   117 class TExtensionRofsHeader
   118 	{
   119 	public:    
   120 	TUint8		iIdentifier[4];		// ROFS Extension identifier
   121 	TUint8		iHeaderSize;
   122 	TUint8		iReserved;
   123 	TUint16		iRofsFormatVersion;
   124 	TUint		iDirTreeOffset;	        // offset to start of directory structure
   125 	TUint		iDirTreeSize;		// size in bytes of directory
   126 	TUint		iDirFileEntriesOffset;	// offset to start of file entries
   127 	TUint		iDirFileEntriesSize;	// size in bytes of file entry block
   128 	TInt64		iTime;
   129 	TVersion	iImageVersion;		// licensee image version
   130 	TUint32		iImageSize;
   131 	TUint		iCheckSum;
   132 	TUint32		iMaxImageSize;
   133 	};
   134 
   135 const TUint KRofsHeaderSize = sizeof(TRofsHeader);
   136 const TUint KExtensionRofsHeaderSize = sizeof(TExtensionRofsHeader);
   137 
   138 /**
   139 @internalAll
   140 @released
   141 */
   142 const TInt16 KEarliestSupportedFormatVersion = KRofsFormatVersion;
   143 /**
   144 @internalAll
   145 @released
   146 */
   147 const TInt16 KLatestSupportedFormatVersion = KRofsFormatVersion;
   148 
   149 const TUint KRofsMangleNameLength = 7;
   150 
   151 #endif