os/kernelhwsrv/userlibandfileserver/fileserver/inc/rofs.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/kernelhwsrv/userlibandfileserver/fileserver/inc/rofs.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,151 @@
     1.4 +// Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of the License "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +//
    1.18 +// WARNING: This file contains some APIs which are internal and are subject
    1.19 +//          to change without notice. Such APIs should therefore not be used
    1.20 +//          outside the Kernel and Hardware Services package.
    1.21 +//
    1.22 +
    1.23 +/**
    1.24 + @file
    1.25 + @internalAll
    1.26 +*/
    1.27 +
    1.28 +#ifndef ROFS_H
    1.29 +#define ROFS_H
    1.30 +
    1.31 +/**
    1.32 +@internalAll
    1.33 +@released
    1.34 +*/
    1.35 +const TUint16 KRofsFormatVersion = 0x200;
    1.36 +
    1.37 +class TRofsEntry
    1.38 +/**
    1.39 +@internalAll
    1.40 +@released
    1.41 +*/
    1.42 +	{
    1.43 +public:
    1.44 +	TUint16 iStructSize;	// Total size of entry, header + name + any padding
    1.45 +	TUint8	iUids[sizeof(TCheckedUid)];		// A copy of all the UID info
    1.46 +	TUint8	iNameOffset;	// offset of iName from start of entry
    1.47 +	TUint8	iAtt;			// standard file attributes
    1.48 +	TUint32 iFileSize;		// real size of file in bytes (may be different from size in image)
    1.49 +							// for subdirectories this is the total size of the directory
    1.50 +							// block entry excluding padding
    1.51 +	TUint32 iFileAddress;	// address in image of file start
    1.52 +	TUint8	iAttExtra;		// extra ROFS attributes (these are inverted so 0 = enabled)
    1.53 +	TUint8	iNameLength;	// length of iName
    1.54 +	TUint16 iName[1];
    1.55 +	};
    1.56 +
    1.57 +/**
    1.58 +@internalAll
    1.59 +@released
    1.60 +*/
    1.61 +const TUint KRofsEntryNameOffset = _FOFF( TRofsEntry, iName );
    1.62 +/**
    1.63 +@internalAll
    1.64 +@released
    1.65 +*/
    1.66 +const TUint KRofsEntryHeaderSize = KRofsEntryNameOffset;
    1.67 +
    1.68 +class TRofsDir
    1.69 +/**
    1.70 +@internalAll
    1.71 +@released
    1.72 +*/
    1.73 +	{
    1.74 +	public:
    1.75 +	TUint16	iStructSize;		// Total size of this directory block including padding
    1.76 +	TUint8	padding;
    1.77 +	TUint8	iFirstEntryOffset;	// offset to first entry
    1.78 +	TUint32 iFileBlockAddress;	// address of associated file block
    1.79 +	TUint32	iFileBlockSize;		// size of associated file block
    1.80 +	TRofsEntry	iSubDir;		// first subdir entry (not present if no subdirs)
    1.81 +	};
    1.82 +
    1.83 +/**
    1.84 +@internalAll
    1.85 +@released
    1.86 +*/
    1.87 +const TUint KRofsDirFirstEntryOffset = _FOFF( TRofsDir, iSubDir );
    1.88 +/**
    1.89 +@internalAll
    1.90 +@released
    1.91 +*/
    1.92 +const TUint KRofsDirHeaderSize = KRofsDirFirstEntryOffset;
    1.93 +
    1.94 +class TRofsHeader
    1.95 +/**
    1.96 +@internalAll
    1.97 +@released
    1.98 +*/
    1.99 +	{
   1.100 +	public:
   1.101 +	TUint8		iIdentifier[4];		// ROFS identifier
   1.102 +	TUint8		iHeaderSize;
   1.103 +	TUint8		iReserved;
   1.104 +	TUint16		iRofsFormatVersion;
   1.105 +	TUint		iDirTreeOffset;	// offset to start of directory structure
   1.106 +	TUint		iDirTreeSize;		// size in bytes of directory
   1.107 +	TUint		iDirFileEntriesOffset;	// offset to start of file entries
   1.108 +	TUint		iDirFileEntriesSize;	// size in bytes of file entry block
   1.109 +	TInt64		iTime;
   1.110 +	TVersion	iImageVersion;		// licensee image version
   1.111 +	TUint32		iImageSize;
   1.112 +	TUint		iCheckSum;
   1.113 +	TUint32		iMaxImageSize;
   1.114 +	};
   1.115 +/**
   1.116 +@internalAll
   1.117 +@released
   1.118 +*/
   1.119 +
   1.120 +class TExtensionRofsHeader
   1.121 +	{
   1.122 +	public:    
   1.123 +	TUint8		iIdentifier[4];		// ROFS Extension identifier
   1.124 +	TUint8		iHeaderSize;
   1.125 +	TUint8		iReserved;
   1.126 +	TUint16		iRofsFormatVersion;
   1.127 +	TUint		iDirTreeOffset;	        // offset to start of directory structure
   1.128 +	TUint		iDirTreeSize;		// size in bytes of directory
   1.129 +	TUint		iDirFileEntriesOffset;	// offset to start of file entries
   1.130 +	TUint		iDirFileEntriesSize;	// size in bytes of file entry block
   1.131 +	TInt64		iTime;
   1.132 +	TVersion	iImageVersion;		// licensee image version
   1.133 +	TUint32		iImageSize;
   1.134 +	TUint		iCheckSum;
   1.135 +	TUint32		iMaxImageSize;
   1.136 +	};
   1.137 +
   1.138 +const TUint KRofsHeaderSize = sizeof(TRofsHeader);
   1.139 +const TUint KExtensionRofsHeaderSize = sizeof(TExtensionRofsHeader);
   1.140 +
   1.141 +/**
   1.142 +@internalAll
   1.143 +@released
   1.144 +*/
   1.145 +const TInt16 KEarliestSupportedFormatVersion = KRofsFormatVersion;
   1.146 +/**
   1.147 +@internalAll
   1.148 +@released
   1.149 +*/
   1.150 +const TInt16 KLatestSupportedFormatVersion = KRofsFormatVersion;
   1.151 +
   1.152 +const TUint KRofsMangleNameLength = 7;
   1.153 +
   1.154 +#endif