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