imgtools/romtools/rofsbuild/r_obey.cpp
author jjkang
Wed, 23 Jun 2010 16:56:47 +0800
changeset 590 360bd6b35136
parent 0 044383f39525
child 607 378360dbbdba
permissions -rw-r--r--
buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
590
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
     1
/*
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
     2
* Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
     3
* All rights reserved.
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
     4
* This component and the accompanying materials are made available
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
     5
* under the terms of the License "Eclipse Public License v1.0"
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
     6
* which accompanies this distribution, and is available
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
     8
*
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
     9
* Initial Contributors:
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    10
* Nokia Corporation - initial contribution.
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    11
*
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    12
* Contributors:
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    13
*
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    14
* Description: 
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    15
* @internalComponent * @released
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    16
* Rofsbuild Obey file class and its reader class.
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    17
*
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    18
*/
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    19
 
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    20
#include <strstream>
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    21
#include <iomanip>
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    22
 
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    23
#include <string.h>
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    24
#include <stdlib.h>
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    25
#include <stdio.h>
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    26
#include <time.h>
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    27
#include <assert.h>
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    28
#include <errno.h>
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    29
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    30
#include <e32std.h>
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    31
#include <e32std_private.h>
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    32
#include <e32rom.h>
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    33
#include <u32std.h>
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    34
#include <f32file.h>
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    35
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    36
#include "h_utl.h"
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    37
#include "r_obey.h"
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    38
#include "r_coreimage.h"
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    39
#include "patchdataprocessor.h"
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    40
#include "filesysteminterface.h" 
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    41
#include "r_driveimage.h"
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    42
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    43
extern TInt gCodePagingOverride;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    44
extern TInt gDataPagingOverride;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    45
extern ECompression gCompress;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    46
extern TBool gEnableStdPathWarning; // Default to not warn if destination path provided for a file is not in standard path.
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    47
extern TBool gKeepGoing;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    48
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    49
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    50
#define _P(word)	word, sizeof(word)-1	// match prefix, optionally followed by [HWVD]
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    51
#define _K(word)	word, 0					// match whole word
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    52
static char* const NullString = "" ;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    53
const ObeyFileKeyword ObeyFileReader::iKeywords[] =
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    54
{
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    55
	{_K("file"),		2,-2, EKeywordFile, "File to be copied into ROFS"},
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    56
	{_K("data"),		2,-2, EKeywordData, "same as file"},
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    57
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    58
	{_K("rofsname"),	1, 1, EKeywordRofsName, "output file for ROFS image"},
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    59
	{_K("romsize"),		1, 1, EKeywordRomSize, "size of ROM image"}, 
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    60
	{_P("hide"),	    2, -1, EKeywordHide, "Exclude named file from ROM directory structure"},
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    61
	{_P("alias"),	    2, -2, EKeywordAlias, "Create alias for existing file in ROM directory structure"},
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    62
	{_P("rename"),	    2, -2, EKeywordRename, "Change the name of a file in the ROM directory structure"},
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    63
	{_K("rofssize"),		1, 1, EKeywordRofsSize, "maximum size of ROFS image"},
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    64
	{_K("romchecksum"),	1, 1, EKeywordRofsChecksum, "desired 32-bit checksum value for the whole image"},
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    65
	{_K("version"),		1, 1, EKeywordVersion, "ROFS image version number"},
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    66
	{_K("time"),	    1,-1, EKeywordTime, "ROFS image timestamp"},
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    67
	{_K("extensionrofs"),1+2, 1, EKeywordExtensionRofs, "Start of definition of optional Extension ROFS"},
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    68
	{_K("extensionrofsname"),1, 1, EKeywordCoreRofsName, "ROFS image on which extension ROFS is based"},
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    69
	{_K("rem"),			0, 0, EKeywordNone, "comment"},
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    70
	{_K("stop"),		0, 0, EKeywordNone, "Terminates OBEY file prematurely"},
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    71
	{_K("romchecksum"),	1, 1, EKeywordRomChecksum, "desired 32-bit checksum value for the whole ROFS image"},
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    72
	{_K("coreimage"),	1, 1, EKeywordCoreImage, "Core image to be used for extension directory structure"},
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    73
	{_K("autosize"),	1, 1, EKeywordRofsAutoSize, "Automatically adjust maximum image size to actual used"},
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    74
	{_K("pagingoverride"),	1, 1, EKeywordPagingOverride, "Overide the demand paging attributes for every file in ROM, NOPAGING|DEFAULTUNPAGED|DEFAULTPAGED"},
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    75
	{_K("codepagingoverride"),	1, 1, EKeywordCodePagingOverride, "Overide the code paging attributes for every file in ROM, NOPAGING|DEFAULTUNPAGED|DEFAULTPAGED"},
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    76
	{_K("datapagingoverride"),	1, 1, EKeywordDataPagingOverride, "Overide the data paging attributes for every file in ROM, NOPAGING|DEFAULTUNPAGED|DEFAULTPAGED"},
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    77
	{_K("dataimagename"),1, 1,EKeywordDataImageName, "Data Drive image file name"},
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    78
	{_K("dataimagefilesystem"),1, 1,EKeywordDataImageFileSystem, "Drive image file system format"},
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    79
	{_K("dataimagesize"),1, 1,EKeywordDataImageSize, "Maximum size of Data Drive image"},
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    80
	{_K("volume"),1, -1,EKeywordDataImageVolume, "Volume Label of Data Drive image"},
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    81
	{_K("sectorsize"),1, 1,EKeywordDataImageSectorSize, "Sector size(in bytes) of Data Drive image"},
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    82
	{_K("fattable"),1, 1,EKeywordDataImageNoOfFats, "Number of FATs in the Data Drive image"},
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    83
	// things we don't normally report in the help information
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    84
	{_K("trace"),		1, 1, EKeywordTrace, "(ROMBUILD activity trace flags)"},
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    85
	{_K("filecompress"),2, -2,EKeywordFileCompress,"Non-XIP Executable to be loaded into the ROM compressed" },
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    86
	{_K("fileuncompress"),2, -2,EKeywordFileUncompress,"Non-XIP Executable to be loaded into the ROM uncompressed" },
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    87
	{_K("patchdata"),2, 5,EKeywordPatchDllData, "Patch exported data"},
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    88
	{_K("imagename"), 1, 1, EKeywordSmrImageName, "output file for SMR image"},
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    89
	{_K("hcrdata"), 1, 1, EKeywordSmrFileData, "file data for HCR SMR image"},
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    90
	{_K("formatversion"), 1, 1, EKeywordSmrFormatVersion, "format version for HCR SMR image"},
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    91
	{_K("payloadflags"), 1, 1, EKeywordSmrFlags, "payload flags for the HCR SMR image"},
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    92
	{_K("payloaduid"), 1, 1, EKeywordSmrUID, "payload UID for the HCR SMR image"},
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    93
	{0,0,0,0,EKeywordNone,""}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    94
};
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    95
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    96
void ObeyFileReader::KeywordHelp() { // static
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    97
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    98
	cout << "Obey file keywords:\n";
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
    99
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   100
	const ObeyFileKeyword* k=0;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   101
	for (k=iKeywords; k->iKeyword!=0; k++)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   102
	{
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   103
		if (k->iHelpText == 0)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   104
			continue;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   105
		if (k->iHelpText[0]=='(' && !H.iVerbose)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   106
			continue;	// don't normally report things in (parentheses)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   107
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   108
		char buf[32];
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   109
		sprintf(buf, "%-20s", k->iKeyword);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   110
		if (k->iKeywordLength)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   111
			memcpy(buf+k->iKeywordLength,"[HWVD]",6);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   112
		if (H.iVerbose)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   113
			sprintf(buf+20,"%2d",k->iNumArgs);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   114
		cout << "    " << buf << " " << k->iHelpText << endl;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   115
	}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   116
	cout << endl;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   117
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   118
	cout << "File attributes:\n";
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   119
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   120
	const FileAttributeKeyword* f=0;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   121
	for (f=iAttributeKeywords; f->iKeyword!=0; f++)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   122
	{
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   123
		if (f->iHelpText == 0)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   124
			continue;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   125
		if (f->iHelpText[0]=='(' && !H.iVerbose)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   126
			continue;	// don't normally report things in (parentheses)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   127
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   128
		char buf[32];
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   129
		sprintf(buf, "%-20s", f->iKeyword);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   130
		if (H.iVerbose)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   131
			sprintf(buf+20,"%2d",k->iNumArgs);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   132
		cout << "    " << buf << " " << f->iHelpText << endl;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   133
	}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   134
	cout << endl;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   135
}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   136
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   137
ObeyFileReader::ObeyFileReader(const char* aFileName):iCurrentLine(0),
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   138
iFileName(aFileName),iNumWords(0),iLine(0),iMarkLine(0),iCurrentObeyStatement(0)	{  
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   139
	for(TUint i = 0 ; i < KNumWords ; i++)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   140
		iWord[i] = NullString;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   141
	*iSuffix = 0 ; 
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   142
}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   143
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   144
ObeyFileReader::~ObeyFileReader() {	  
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   145
	if(iCurrentObeyStatement) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   146
		delete []iCurrentObeyStatement;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   147
		iCurrentObeyStatement = 0 ;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   148
	}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   149
	if(iLine) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   150
		delete []iLine; 
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   151
		iLine = 0 ;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   152
	}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   153
}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   154
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   155
//
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   156
// Open the file & return a status
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   157
//
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   158
TBool ObeyFileReader::Open() {     
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   159
	ifstream ifs(iFileName.c_str(),ios_base::in + ios_base::binary);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   160
	if (!ifs.is_open()) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   161
		Print(EError,"Cannot open obey file %s\n",iFileName.c_str());
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   162
		return EFalse;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   163
	}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   164
	iLines.clear();
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   165
	if(iLine){
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   166
		delete []iLine;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   167
		iLine = 0 ;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   168
	}		
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   169
	ifs.seekg(0,ios_base::end);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   170
	size_t length = ifs.tellg();
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   171
	char* buffer = new char[length + 2];
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   172
	if (0 == buffer) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   173
		Print(EError,"Insufficent Memory to Continue.");	
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   174
		ifs.close();
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   175
		return EFalse;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   176
	}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   177
	ifs.seekg(0,ios_base::beg);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   178
	ifs.read(buffer,length);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   179
	size_t readcout = ifs.gcount() ;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   180
	if(readcout != length){ 	
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   181
		Print(EError,"Cannot Read All of File.");	
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   182
		delete []buffer ;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   183
		ifs.close();
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   184
		return EFalse;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   185
	}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   186
	buffer[length] = '\n';
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   187
	buffer[length + 1] = 0 ;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   188
	ifs.close();
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   189
	char* lineStart = buffer ;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   190
	char* end = buffer + length ;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   191
	string line ;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   192
	size_t maxLengthOfLine = 0 ;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   193
	while(lineStart < end){
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   194
		while(*lineStart == ' ' || *lineStart == '\t') //trimleft 
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   195
			lineStart ++ ;		
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   196
		char* lineEnd = lineStart ;	 
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   197
		while(*lineEnd != '\r' && *lineEnd != '\n')
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   198
			lineEnd ++ ;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   199
		if(strnicmp(lineStart,"REM",3) == 0){
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   200
			line = "" ; // REMOVE "REM ... "
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   201
		}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   202
		else {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   203
			TInt lastIndex = lineEnd - lineStart - 1;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   204
			while(lastIndex >= 0 &&  // trimright
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   205
				(lineStart[lastIndex] == ' ' || lineStart[lastIndex] == '\t'))
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   206
				lastIndex -- ;			
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   207
			if(lastIndex >= 0)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   208
				line.assign(lineStart,lastIndex + 1);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   209
			else
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   210
				line = "";
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   211
		}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   212
		if(line.length() > maxLengthOfLine)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   213
			maxLengthOfLine = line.length();
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   214
		iLines.push_back(line);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   215
		if(*lineEnd == '\r') {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   216
			if(lineEnd[1] == '\n')
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   217
				lineStart = lineEnd + 2 ;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   218
			else
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   219
				lineStart = lineEnd + 1 ;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   220
		}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   221
		else // '\n'
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   222
			lineStart = lineEnd + 1 ;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   223
	}	
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   224
	delete []buffer ;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   225
	iLine = new char[maxLengthOfLine + 1];
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   226
	iCurrentObeyStatement = new char[maxLengthOfLine + 1];
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   227
	*iCurrentObeyStatement = 0 ;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   228
	*iLine = 0 ;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   229
	iCurrentLine = 0 ;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   230
	iMarkLine = 0 ;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   231
	return ETrue;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   232
}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   233
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   234
void ObeyFileReader::Mark()	{ 
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   235
	iMarkLine = iCurrentLine - 1;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   236
}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   237
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   238
void ObeyFileReader::MarkNext() { 
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   239
	iMarkLine = iCurrentLine;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   240
}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   241
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   242
void ObeyFileReader::Rewind() {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   243
	iCurrentLine = iMarkLine;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   244
}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   245
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   246
char* ObeyFileReader::DupWord(TInt aIndex) const {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   247
	char* retVal = 0 ;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   248
	if(aIndex >= 0 && aIndex < (TInt)KNumWords){
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   249
		size_t len = strlen(iWord[aIndex]) + 1;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   250
		retVal = new char[len];
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   251
		if(retVal)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   252
			memcpy(retVal,iWord[aIndex],len);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   253
	} 
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   254
	return retVal ;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   255
}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   256
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   257
TInt ObeyFileReader::ReadAndParseLine() {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   258
	if (iCurrentLine >= (TInt)iLines.size())
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   259
		return KErrEof;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   260
	iCurrentLine++; 	
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   261
	iNumWords = Parse();
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   262
	return KErrNone;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   263
}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   264
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   265
TInt ObeyFileReader::NextLine(TInt aPass, enum EKeyword& aKeyword) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   266
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   267
NextLine:
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   268
	TInt err = ReadAndParseLine();
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   269
	if (err == KErrEof)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   270
		return KErrEof;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   271
	if(iNumWords == 0)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   272
		goto NextLine;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   273
	if (stricmp(iWord[0], "stop")==0)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   274
		return KErrEof;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   275
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   276
	const ObeyFileKeyword* k=0;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   277
	for (k=iKeywords; k->iKeyword!=0; k++) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   278
		if (k->iKeywordLength == 0) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   279
			// Exact case-insensitive match on keyword
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   280
			if (stricmp(iWord[0], k->iKeyword) != 0)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   281
				continue;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   282
			*iSuffix = 0;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   283
		}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   284
		else {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   285
			// Prefix match
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   286
			if (strnicmp(iWord[0], k->iKeyword, k->iKeywordLength) != 0)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   287
				continue;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   288
			// Suffix must be empty, or a variant number in []
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   289
			strncpy(iSuffix,iWord[0] + k->iKeywordLength,80);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   290
			if (*iSuffix != '\0' && *iSuffix != '[')
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   291
				continue;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   292
		}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   293
		// found a match
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   294
		if ((k->iPass & aPass) == 0)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   295
			goto NextLine;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   296
		if (k->iNumArgs>=0 && (1+k->iNumArgs != iNumWords)) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   297
			Print(EError, "Incorrect number of arguments for keyword %s on line %d.\n",
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   298
				iWord[0], iCurrentLine);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   299
			goto NextLine;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   300
		}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   301
		if (k->iNumArgs<0 && (1-k->iNumArgs > iNumWords)) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   302
			Print(EError, "Too few arguments for keyword %s on line %d.\n",
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   303
				iWord[0], iCurrentLine);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   304
			goto NextLine;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   305
		}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   306
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   307
		aKeyword = k->iKeywordEnum;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   308
		return KErrNone;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   309
	}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   310
	if (aPass == 1)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   311
		Print(EWarning, "Unknown keyword '%s'.  Line %d ignored\n", iWord[0], iCurrentLine);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   312
	goto NextLine;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   313
}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   314
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   315
//
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   316
// splits a line into words, and returns the number of words found
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   317
// 
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   318
TInt ObeyFileReader::Parse() {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   319
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   320
	for (TUint i = 0; i < KNumWords; i++)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   321
		iWord[i] = NullString;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   322
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   323
	enum TState {EInWord, EInQuotedWord, EInGap};
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   324
	TState state = EInGap;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   325
	const string& line = iLines[iCurrentLine - 1]; 	
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   326
	size_t len = line.length();	
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   327
	memcpy(iLine,line.c_str(),len);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   328
	memcpy(iCurrentObeyStatement,iLine,len);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   329
	iLine[len] = 0 ; 
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   330
	iCurrentObeyStatement[len] = 0 ;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   331
	TUint i = 0;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   332
	char* linestr = iLine;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   333
	while (i < KNumWords && *linestr != 0) {	 
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   334
		switch (state)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   335
		{
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   336
		case EInGap:
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   337
			if (*linestr =='\"') {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   338
				if (linestr[1] != 0 && linestr[1]!='\"')
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   339
					iWord[i++] = linestr + 1;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   340
				state = EInQuotedWord;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   341
			}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   342
			else if (!IsGap(*linestr)) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   343
				iWord[i++] = linestr;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   344
				state=EInWord;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   345
			}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   346
			else
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   347
				*linestr=0;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   348
			break;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   349
		case EInWord:
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   350
			if (*linestr == '\"') {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   351
				*linestr = 0;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   352
				if (linestr[1] != 0 && linestr[1] != '\"')
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   353
					iWord[i++] = linestr+1;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   354
				state=EInQuotedWord;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   355
			}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   356
			else if (IsGap(*linestr)) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   357
				*linestr=0;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   358
				state=EInGap;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   359
			}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   360
			break;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   361
		case EInQuotedWord:
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   362
			if (*linestr == '\"'){
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   363
				*linestr = 0;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   364
				state = EInGap;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   365
			}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   366
			break;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   367
		}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   368
		linestr++;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   369
	}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   370
	return i;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   371
}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   372
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   373
//
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   374
// Process the timestamp
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   375
//
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   376
void ObeyFileReader::ProcessTime(TInt64& aTime) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   377
	char timebuf[256];
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   378
	if (iNumWords>2)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   379
		sprintf(timebuf, "%s_%s", iWord[1], iWord[2]);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   380
	else
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   381
		strncpy(timebuf, iWord[1],256);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   382
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   383
	TInt r = StringToTime(aTime, timebuf);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   384
	if (r==KErrGeneral) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   385
		Print(EError, "incorrect format for time keyword on line %d\n", iCurrentLine);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   386
		exit(0x670);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   387
	}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   388
	if (r==KErrArgument){
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   389
		Print(EError, "Time out of range on line %d\n", iCurrentLine);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   390
		exit(0x670);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   391
	}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   392
}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   393
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   394
TInt64 ObeyFileReader::iTimeNow = 0;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   395
void ObeyFileReader::TimeNow(TInt64& aTime) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   396
	if (iTimeNow==0) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   397
		TInt sysTime = time(0);					// seconds since midnight Jan 1st, 1970
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   398
		sysTime -= (30*365*24*60*60+7*24*60*60);	// seconds since midnight Jan 1st, 2000
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   399
		TInt64 daysTo2000AD=730497;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   400
		TInt64 t=daysTo2000AD*24*3600+sysTime;	// seconds since 0000
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   401
		t = t+3600;								// BST (?)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   402
		iTimeNow=t*1000000;						// milliseconds
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   403
	}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   404
	aTime=iTimeNow;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   405
}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   406
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   407
 
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   408
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   409
// File attributes.
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   410
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   411
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   412
const FileAttributeKeyword ObeyFileReader::iAttributeKeywords[] =
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   413
{
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   414
	{"attrib",3			,0,1,EAttributeAtt, "File attributes in ROM file system"},
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   415
	{"exattrib",3		,0,1,EAttributeAttExtra, "File extra attributes in ROM file system"},
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   416
	//	{_K("compress")		,1,1,EAttributeCompress, "Compress file"},
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   417
	{"stack",3			,1,1,EAttributeStack, "?"},
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   418
	{"fixed",3			,1,0,EAttributeFixed, "Relocate to a fixed address space"},
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   419
	{"priority",3		,1,1,EAttributePriority, "Override process priority"},
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   420
	{_K("uid1")			,1,1,EAttributeUid1, "Override first UID"},
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   421
	{_K("uid2")			,1,1,EAttributeUid2, "Override second UID"},
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   422
	{_K("uid3")			,1,1,EAttributeUid3, "Override third UID"},
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   423
	{_K("heapmin")		,1,1,EAttributeHeapMin, "Override initial heap size"},
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   424
	{_K("heapmax")		,1,1,EAttributeHeapMax, "Override maximum heap size"},
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   425
	{_K("capability")	,1,1,EAttributeCapability, "Override capabilities"},
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   426
	{_K("unpaged")		,1,0,EAttributeUnpaged, "Don't page code or data for this file"},
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   427
	{_K("paged")		,1,0,EAttributePaged, "Page code and data for this file"},
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   428
	{_K("unpagedcode")	,1,0,EAttributeUnpagedCode, "Don't page code for this file"},
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   429
	{_K("pagedcode")	,1,0,EAttributePagedCode, "Page code for this file"},
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   430
	{_K("unpageddata")	,1,0,EAttributeUnpagedData, "Don't page data for this file"},
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   431
	{_K("pageddata")	,1,0,EAttributePagedData, "Page data for this file"},
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   432
	{0,0,0,0,EAttributeAtt,0}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   433
};
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   434
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   435
TInt ObeyFileReader::NextAttribute(TInt& aIndex, TInt aHasFile, enum EFileAttribute& aKeyword, char*& aArg)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   436
{
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   437
NextAttribute:
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   438
	if (aIndex >= iNumWords)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   439
		return KErrEof;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   440
	char* word=iWord[aIndex++];
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   441
	const FileAttributeKeyword* k;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   442
	for (k=iAttributeKeywords; k->iKeyword!=0; k++)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   443
	{
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   444
		if (k->iKeywordLength == 0)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   445
		{
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   446
			// Exact match on keyword
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   447
			if (stricmp(word, k->iKeyword) != 0)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   448
				continue;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   449
		}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   450
		else
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   451
		{
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   452
			// Prefix match
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   453
			if (strnicmp(word, k->iKeyword, k->iKeywordLength) != 0)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   454
				continue;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   455
		}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   456
		// found a match
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   457
		if (k->iNumArgs>0)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   458
		{
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   459
			TInt argIndex = aIndex;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   460
			aIndex += k->iNumArgs;		// interface only really supports 1 argument
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   461
			if (aIndex>iNumWords)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   462
			{
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   463
				Print(EError, "Missing argument for attribute %s on line %d\n", word, iCurrentLine);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   464
				return KErrArgument;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   465
			}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   466
			aArg=iWord[argIndex];
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   467
		}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   468
		if (k->iIsFileAttribute && !aHasFile)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   469
		{
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   470
			Print(EError, "File attribute %s applied to non-file on line %d\n", word, iCurrentLine);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   471
			return KErrNotSupported;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   472
		}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   473
		aKeyword=k->iAttributeEnum;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   474
		return KErrNone;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   475
	}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   476
	Print(EWarning, "Unknown attribute '%s' skipped on line %d\n", word, iCurrentLine);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   477
	goto NextAttribute;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   478
}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   479
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   480
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   481
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   482
/**
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   483
Constructor:
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   484
1.Obey file instance.
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   485
2.used by both rofs and datadrive image.
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   486
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   487
@param aReader - obey file reader object.
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   488
*/
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   489
CObeyFile::CObeyFile(ObeyFileReader& aReader):
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   490
iRomFileName(NULL),
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   491
iExtensionRofsName(0),
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   492
iKernelRofsName(0),
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   493
iRomSize(0),
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   494
iVersion(0,0,0),
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   495
iCheckSum(0),
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   496
iNumberOfFiles(0),
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   497
iTime(0),
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   498
iRootDirectory(0),
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   499
iNumberOfDataFiles(0),
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   500
iDriveFileName(0),
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   501
iDataSize(0),
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   502
iDriveFileFormat(0),
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   503
iConfigurableFatAttributes(new ConfigurableFatAttributes),
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   504
iReader(aReader), 
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   505
iMissingFiles(0), 
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   506
iLastExecutable(0),
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   507
iFirstFile(0), 	
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   508
iCurrentFile(0),
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   509
iAutoSize(EFalse),
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   510
iAutoPageSize(4096),
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   511
iPagingOverrideParsed(0),
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   512
iCodePagingOverrideParsed(0),
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   513
iDataPagingOverrideParsed(0),
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   514
iPatchData(new CPatchDataProcessor)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   515
{
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   516
	iNextFilePtrPtr = &iFirstFile ;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   517
}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   518
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   519
/**
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   520
Obey file Destructor.
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   521
1.Release the tree memory.
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   522
2.Release all allocated memory if any.
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   523
*/
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   524
CObeyFile::~CObeyFile() {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   525
	if(iDriveFileName){
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   526
		delete[] iDriveFileName;					
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   527
		iDriveFileName = 0 ;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   528
	}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   529
	if(iDriveFileFormat) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   530
		delete[] iDriveFileFormat;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   531
		iDriveFileFormat = 0 ;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   532
	}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   533
	iRootDirectory->deleteTheFirstNode();                
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   534
	iRootDirectory->InitializeCount();
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   535
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   536
	Release();
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   537
	if(iRomFileName){ 
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   538
		delete [] iRomFileName;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   539
		iRomFileName = 0 ;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   540
	}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   541
	if (iRootDirectory)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   542
		iRootDirectory->Destroy();
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   543
	if(iConfigurableFatAttributes)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   544
		delete iConfigurableFatAttributes;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   545
	if(iPatchData)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   546
		delete iPatchData;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   547
}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   548
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   549
//
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   550
// Free resources not needed after building a ROM
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   551
//
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   552
void CObeyFile::Release() {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   553
	iFirstFile = 0;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   554
	iNextFilePtrPtr = &iFirstFile;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   555
}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   556
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   557
TRomBuilderEntry *CObeyFile::FirstFile() {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   558
	iCurrentFile = iFirstFile;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   559
	return iCurrentFile;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   560
}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   561
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   562
TRomBuilderEntry *CObeyFile::NextFile() {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   563
	iCurrentFile = iCurrentFile ? iCurrentFile->iNext : 0;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   564
	return iCurrentFile;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   565
}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   566
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   567
char* CObeyFile::ProcessCoreImage() const {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   568
	// check for coreimage keyword and return filename	 
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   569
	enum EKeyword keyword;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   570
	char* coreImageFileName = 0;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   571
	iReader.Rewind();
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   572
	while (iReader.NextLine(1,keyword) != KErrEof) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   573
		if (keyword == EKeywordCoreImage) {  			  
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   574
			coreImageFileName = iReader.DupWord(1);	
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   575
			iReader.MarkNext();
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   576
			break;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   577
		}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   578
	}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   579
	return coreImageFileName;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   580
}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   581
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   582
void CObeyFile::SkipToExtension() {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   583
	iReader.Rewind();
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   584
	enum EKeyword keyword;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   585
	while (iReader.NextLine(1,keyword) != KErrEof) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   586
		if (keyword == EKeywordExtensionRofs) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   587
			iReader.Mark(); // ready for processing extension
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   588
			break;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   589
		}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   590
	}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   591
}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   592
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   593
TInt CObeyFile::ProcessRofs() {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   594
	
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   595
	//
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   596
	// First pass through the obey file to set up key variables
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   597
	//
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   598
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   599
	iReader.Rewind();
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   600
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   601
	TInt count=0;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   602
	enum EKeyword keyword;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   603
	while (iReader.NextLine(1,keyword) != KErrEof) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   604
		if (keyword == EKeywordExtensionRofs){
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   605
			if (count==0)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   606
				return KErrNotFound;		// no core ROFS, just extension ROFSs.
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   607
			break;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   608
		}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   609
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   610
		count++;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   611
		if (! ProcessKeyword(keyword))
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   612
			return KErrGeneral;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   613
	}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   614
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   615
	if (!GotKeyVariables())
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   616
		return KErrGeneral;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   617
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   618
	//
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   619
	// second pass to process the file specifications in the obey file building
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   620
	// up the TRomNode directory structure and the TRomBuilderEntry list
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   621
	//
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   622
	iReader.Rewind();
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   623
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   624
	iRootDirectory = new TRomNode("");
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   625
	iLastExecutable = iRootDirectory;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   626
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   627
	TInt align=0;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   628
	while (iReader.NextLine(2,keyword)!=KErrEof) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   629
		if (keyword == EKeywordExtensionRofs)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   630
			break;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   631
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   632
		if (keyword == EKeywordHide)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   633
			keyword = EKeywordHideV2;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   634
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   635
		switch (keyword) 
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   636
		{
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   637
		case EKeywordHide:
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   638
		case EKeywordAlias:
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   639
		case EKeywordRename:
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   640
			if (!ProcessRenaming(keyword))
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   641
				return KErrGeneral;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   642
			break;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   643
		case EKeywordPatchDllData:
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   644
			{
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   645
				// Collect patchdata statements to process at the end
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   646
				StringVector patchDataTokens;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   647
				SplitPatchDataStatement(patchDataTokens); 
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   648
				iPatchData->AddPatchDataStatement(patchDataTokens);									
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   649
				break;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   650
			}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   651
		default:
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   652
			if (!ProcessFile(align, keyword))
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   653
				return KErrGeneral;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   654
			align=0;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   655
			break;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   656
		}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   657
	}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   658
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   659
	if(!ParsePatchDllData())
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   660
		return KErrGeneral;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   661
	iReader.Mark();			// ready for processing the extension rom(s)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   662
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   663
	if (iMissingFiles!=0) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   664
		return KErrGeneral;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   665
	}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   666
	if ( 0 == iNumberOfFiles ){
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   667
		Print(EError, "No files specified.\n");
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   668
		return KErrGeneral;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   669
	}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   670
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   671
	return KErrNone;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   672
}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   673
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   674
TBool CObeyFile::Process() {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   675
	TBool result = ETrue;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   676
	iReader.Rewind();
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   677
	enum EKeyword keyword;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   678
	while(iReader.NextLine(1, keyword) != KErrEof){
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   679
		string key = iReader.Word(0);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   680
		string value = iReader.Word(1);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   681
		if(iKeyValues.find(key) != iKeyValues.end()){
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   682
			iKeyValues[key].push_back(value);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   683
		}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   684
		else {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   685
			StringVector values;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   686
			values.push_back(value);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   687
			iKeyValues[key]=values;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   688
		}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   689
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   690
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   691
	}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   692
	return result;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   693
}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   694
StringVector CObeyFile::getValues(const string& aKey) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   695
	StringVector values;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   696
	if(iKeyValues.find(aKey) != iKeyValues.end()){
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   697
		values = iKeyValues[aKey];
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   698
	}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   699
	return values;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   700
}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   701
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   702
/**
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   703
Process drive obey file and construct the tree.
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   704
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   705
@return - Return the status,
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   706
'KErrnone' for Success,
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   707
'KErrGeneral' for failure (required keywords not there in obey file or failed
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   708
to construct the tree).
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   709
*/
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   710
TInt CObeyFile::ProcessDataDrive() {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   711
	iReader.Rewind();
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   712
	enum EKeyword keyword;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   713
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   714
	// First pass through the obey file to set up key variables
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   715
	while (iReader.NextLine(1,keyword) != KErrEof) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   716
		if (!ProcessDriveKeyword(keyword))			
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   717
			return KErrGeneral;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   718
	}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   719
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   720
	if (!GotKeyDriveVariables())
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   721
		return KErrGeneral;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   722
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   723
	// Second pass to process the file specifications in the obey file.
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   724
	// Build the TRomNode directory structure and the TRomBuilderEntry list
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   725
	iReader.Rewind();
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   726
	iRootDirectory = new TRomNode("//");					
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   727
	iLastExecutable = iRootDirectory;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   728
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   729
	while(iReader.NextLine(2,keyword)!=KErrEof) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   730
		switch (keyword) 
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   731
		{
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   732
		case EKeywordPatchDllData:
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   733
			{	// Collect patchdata statements to process at the end
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   734
				StringVector patchDataTokens;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   735
				SplitPatchDataStatement(patchDataTokens); 				
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   736
				iPatchData->AddPatchDataStatement(patchDataTokens);									
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   737
				break;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   738
			}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   739
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   740
		case EKeywordHide:						
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   741
		case EKeywordFile:
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   742
		case EKeywordData:
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   743
		case EKeywordFileCompress:
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   744
		case EKeywordFileUncompress:
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   745
			if (!ProcessDriveFile(keyword))
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   746
				return KErrGeneral;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   747
			break;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   748
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   749
		default:							
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   750
			break;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   751
		}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   752
	}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   753
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   754
	if(!ParsePatchDllData())
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   755
		return KErrGeneral;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   756
	if (iMissingFiles) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   757
		Print(EError, "Source Files Missing.\n");
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   758
		return KErrGeneral;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   759
	}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   760
	if (!iNumberOfFiles)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   761
		Print(EWarning,"No files specified.\n");
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   762
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   763
	return KErrNone;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   764
}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   765
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   766
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   767
/**
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   768
Process and stores the keyword information.
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   769
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   770
@param aKeyword - keyword to update its value to variables.
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   771
@return - Return the status i.e Success,
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   772
*/
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   773
TBool CObeyFile::ProcessDriveKeyword(enum EKeyword aKeyword) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   774
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   775
	TBool success = ETrue;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   776
	switch (aKeyword)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   777
	{
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   778
	case EKeywordDataImageName:
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   779
		iDriveFileName = iReader.DupWord(1);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   780
		break;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   781
	case EKeywordDataImageFileSystem:
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   782
		iDriveFileFormat = iReader.DupWord(1);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   783
		break;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   784
	case EKeywordDataImageSize:
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   785
		{
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   786
			const char* bigString = iReader.Word(1);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   787
			if(*bigString == '\0')
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   788
			{
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   789
				Print(EWarning,"Not a valid Image Size. Default size is considered\n");		
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   790
				break;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   791
			}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   792
#ifdef __LINUX__
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   793
			errno = 0;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   794
			iDataSize = strtoll(bigString,NULL,10);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   795
			if((iDataSize == LONG_MAX) || (iDataSize == LONG_MIN) ||(errno == ERANGE))
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   796
			{
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   797
				Print(EWarning,"Invalid Range. Default size is considered\n");		
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   798
			}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   799
#else
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   800
			iDataSize = _atoi64(bigString);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   801
#endif
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   802
		}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   803
		break;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   804
	case EKeywordDataImageVolume:
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   805
		{				
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   806
			// Get the volume label provided by using "volume" keyword.
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   807
			// e.g. vlolume = NO NAME
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   808
			string volumeLabel = iReader.GetCurrentObeyStatement();
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   809
			string volumeLabelKeyword = "volume";
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   810
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   811
			TUint position = volumeLabel.find(volumeLabelKeyword.c_str(),0,volumeLabelKeyword.size());
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   812
			position += volumeLabelKeyword.size();
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   813
			if (volumeLabel.find('=',position) != string::npos) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   814
				position=volumeLabel.find('=',position);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   815
				++position;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   816
			}								
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   817
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   818
			position = volumeLabel.find_first_not_of(' ',position);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   819
			if (position != string::npos) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   820
				volumeLabel = volumeLabel.substr(position);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   821
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   822
				// Remove the new line character from the end
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   823
				position = volumeLabel.find_first_of("\r\n");
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   824
				if (position != string::npos)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   825
					volumeLabel = volumeLabel.substr(0,position);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   826
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   827
				iConfigurableFatAttributes->iDriveVolumeLabel = volumeLabel.data() ;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   828
			}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   829
			else {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   830
				Print(EWarning,"Value for Volume Label is not provided. Default value is considered.\n");
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   831
			}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   832
			break;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   833
		}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   834
	case EKeywordDataImageSectorSize:
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   835
		{
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   836
			const char* bigString = iReader.Word(1);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   837
			TInt sectorSize = atoi(bigString);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   838
			if(sectorSize <= 0)	{
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   839
				Print(EWarning,"Invalid Sector Size value. Default value is considered.\n");
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   840
			}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   841
			else {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   842
				iConfigurableFatAttributes->iDriveSectorSize = atoi(bigString);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   843
			}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   844
		}			
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   845
		break;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   846
	case EKeywordDataImageNoOfFats:
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   847
		{
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   848
			const char* bigString = iReader.Word(1);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   849
			TInt noOfFats = atoi(bigString);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   850
			if (noOfFats <=0)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   851
				Print(EWarning,"Invalid No of FATs specified. Default value is considered.\n");
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   852
			else
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   853
				iConfigurableFatAttributes->iDriveNoOfFATs = atoi(bigString);			
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   854
		}			
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   855
		break;			
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   856
	default:
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   857
		// unexpected keyword iReader.Word(0), keep going.
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   858
		break;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   859
	}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   860
	return success;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   861
}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   862
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   863
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   864
/**
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   865
Checks whether obeyfile has supplied enough variables to continue.
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   866
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   867
@return - Return the status 
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   868
ETrue - Supplied valid values,
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   869
EFalse- Not valied values.
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   870
*/
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   871
TBool CObeyFile::GotKeyDriveVariables() {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   872
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   873
	TBool retVal=ETrue;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   874
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   875
	// Mandatory keywords
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   876
	if (iDriveFileName==0) {                                                  
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   877
		Print(EError,"The name of the image file has not been supplied.\n");
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   878
		Print(EError,"Use the keyword \"dataimagename\".\n");
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   879
		retVal = EFalse;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   880
	}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   881
	// Check for '-'ve entered value.
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   882
	if(iDataSize <= 0){
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   883
		Print(EWarning,"Image Size should be positive. Default size is Considered.\n");
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   884
	}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   885
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   886
	// File system format.
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   887
	if(iDriveFileFormat==0) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   888
		Print(EError,"The name of the file system not been supplied.\n");
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   889
		Print(EError,"Use the keyword \"dataimagefilesystem\".\n");
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   890
		retVal = EFalse;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   891
	}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   892
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   893
	// Checking the validity of file system format.
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   894
	if(iDriveFileFormat){
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   895
		strupr((char *)iDriveFileFormat);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   896
		enum TFileSystem check = (TFileSystem)0;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   897
		if(!(CDriveImage::FormatTranslation(iDriveFileFormat,check))) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   898
			Print(EError,"The name of the file system not supported : %s\n",iDriveFileFormat);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   899
			retVal = EFalse;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   900
		}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   901
	}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   902
	if(retVal)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   903
		Print(ELog,"\nCreating Data Drive image : %s\n", iDriveFileName);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   904
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   905
	return retVal;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   906
}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   907
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   908
/**
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   909
Process a parsed line to set up one or more new TRomBuilder entry objects.
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   910
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   911
@param  - obey file keyword.
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   912
// iWord[0] = the keyword (file,)      
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   913
// iWord[1] = the PC pathname
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   914
// iWord[2] = the EPOC pathname
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   915
// iWord[3] = start of the file attributes
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   916
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   917
@return - Return the status 
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   918
ETrue - Successful generation of tree.
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   919
EFalse- Fail to generate the tree.
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   920
*/
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   921
TBool CObeyFile::ProcessDriveFile(enum EKeyword aKeyword) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   922
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   923
	TBool isPeFile = ETrue;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   924
	TBool aFileCompressOption, aFileUncompressOption;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   925
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   926
	TInt epocPathStart=2;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   927
	aFileCompressOption = aFileUncompressOption = EFalse;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   928
	// do some validation of the keyword
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   929
	TInt currentLine = iReader.CurrentLine();
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   930
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   931
	switch (aKeyword)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   932
	{
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   933
	case EKeywordData:
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   934
	case EKeywordHide:
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   935
		isPeFile = EFalse;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   936
		break;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   937
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   938
	case EKeywordFile:
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   939
		break;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   940
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   941
	case EKeywordFileCompress:
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   942
		aFileCompressOption = ETrue;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   943
		break;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   944
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   945
	case EKeywordFileUncompress:
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   946
		aFileUncompressOption = ETrue;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   947
		break;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   948
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   949
	default:
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   950
		return EFalse;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   951
	}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   952
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   953
	if (aKeyword!=EKeywordHide) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   954
		// check the PC file exists
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   955
		char* nname = NormaliseFileName(iReader.Word(1));		  
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   956
		ifstream test(nname);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   957
		if(!test.is_open()){
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   958
			Print(EError,"Cannot open file %s for input.\n",iReader.Word(1));
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   959
			iMissingFiles++;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   960
		}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   961
		test.close();
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   962
		delete []nname ;												
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   963
		 
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   964
	}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   965
	else
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   966
		epocPathStart=1;   
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   967
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   968
	iNumberOfFiles++;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   969
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   970
	TBool endOfName=EFalse;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   971
	const char *epocStartPtr= IsValidFilePath(iReader.Word(epocPathStart));
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   972
	char *epocEndPtr = const_cast<char*>(epocStartPtr);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   973
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   974
	if (epocStartPtr == NULL) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   975
		Print(EError, "Invalid destination path on line %d\n",currentLine);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   976
		return EFalse;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   977
	}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   978
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   979
	TRomNode* dir=iRootDirectory;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   980
	TRomNode* subDir=0;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   981
	TRomBuilderEntry *file=0;      
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   982
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   983
	while (!endOfName) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   984
		endOfName = GetNextBitOfFileName(epocEndPtr);      
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   985
		if (endOfName) { // file		
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   986
			TRomNode* alreadyExists=dir->FindInDirectory(epocStartPtr);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   987
			if ((aKeyword != EKeywordHide) && alreadyExists) { // duplicate file		
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   988
				if (gKeepGoing) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   989
					Print(EWarning, "Duplicate file for %s on line %d, will be ignored\n",iReader.Word(1),iReader.CurrentLine());
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   990
					iNumberOfFiles--;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   991
					return ETrue;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   992
				}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   993
				else {	
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   994
					Print(EError, "Duplicate file for %s on line %d\n",iReader.Word(1),iReader.CurrentLine());
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   995
					return EFalse;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   996
				}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   997
			}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   998
			else if((aKeyword == EKeywordHide) && (alreadyExists)) { 
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
   999
				alreadyExists->iEntry->iHidden = ETrue;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1000
				alreadyExists->iHidden = ETrue;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1001
				return ETrue;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1002
			}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1003
			else if((aKeyword == EKeywordHide) && (!alreadyExists)) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1004
				Print(EWarning, "Hiding non-existent file %s on line %d\n",iReader.Word(1),iReader.CurrentLine());
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1005
				return ETrue;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1006
			}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1007
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1008
			file = new TRomBuilderEntry(iReader.Word(1), epocStartPtr);                   
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1009
			file->iExecutable=isPeFile;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1010
			if( aFileCompressOption ) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1011
				file->iCompressEnabled = ECompressionCompress;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1012
			}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1013
			else if(aFileUncompressOption )	{
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1014
				file->iCompressEnabled = ECompressionUncompress;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1015
			}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1016
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1017
			TRomNode* node=new TRomNode(epocStartPtr, file);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1018
			if (node==0)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1019
				return EFalse;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1020
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1021
			TInt r=ParseFileAttributes(node, file, aKeyword);         
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1022
			if (r!=KErrNone)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1023
				return EFalse;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1024
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1025
			if(gCompress != ECompressionUnknown) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1026
				node->iFileUpdate = ETrue;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1027
			}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1028
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1029
			if((node->iOverride) || (aFileCompressOption) || (aFileUncompressOption)) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1030
				node->iFileUpdate = ETrue;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1031
			}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1032
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1033
			dir->AddFile(node);	// to drive directory structure.
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1034
		}		 
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1035
		else {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1036
			// directory
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1037
			subDir = dir->FindInDirectory(epocStartPtr);      
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1038
			if (!subDir){ // sub directory does not exist			
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1039
				if(aKeyword==EKeywordHide) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1040
					Print(EWarning, "Hiding non-existent file %s on line %d\n",
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1041
						iReader.Word(1),iReader.CurrentLine());
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1042
					return ETrue;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1043
				}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1044
				subDir = dir->NewSubDir(epocStartPtr);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1045
				if (!subDir)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1046
					return EFalse;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1047
			}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1048
			dir=subDir;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1049
			epocStartPtr = epocEndPtr;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1050
		}  // end of else.
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1051
	}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1052
	return ETrue;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1053
}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1054
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1055
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1056
TInt CObeyFile::SetStackSize(TRomNode *aNode, const char* aStr) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1057
	if (EFalse == IsValidNumber(aStr))
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1058
		return Print(EError, "Number required as argument for keyword 'stack'.\n"); 
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1059
	TInt size ;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1060
	TInt err = Val(size,aStr);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1061
	if(KErrNone == err){
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1062
		aNode->SetStackSize(size );
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1063
	}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1064
	return err;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1065
}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1066
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1067
TInt CObeyFile::SetHeapSizeMin(TRomNode *aNode, const char* aStr) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1068
	if (EFalse == IsValidNumber(aStr))
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1069
		return Print(EError, "Number required as argument for keyword 'heapmin'.\n");
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1070
	TInt size ;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1071
	TInt err = Val(size,aStr);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1072
	if(KErrNone == err){
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1073
		aNode->SetHeapSizeMin(size );
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1074
	}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1075
	return err;	 
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1076
}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1077
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1078
TInt CObeyFile::SetHeapSizeMax(TRomNode *aNode, const char* aStr) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1079
	if (EFalse == IsValidNumber(aStr))
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1080
		return Print(EError, "Number required as argument for keyword 'heapmax'.\n");
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1081
	TInt size ;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1082
	TInt err = Val(size,aStr);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1083
	if(KErrNone == err){
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1084
		aNode->SetHeapSizeMax(size );
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1085
	}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1086
	return err;	
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1087
	 
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1088
}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1089
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1090
TInt CObeyFile::SetCapability(TRomNode *aNode, const char* aStr) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1091
	if ( IsValidNumber(aStr)){
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1092
		Print(EDiagnostic,"Old style numeric CAPABILTY specification ignored.\n");
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1093
		return KErrNone;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1094
	}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1095
	SCapabilitySet cap;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1096
	TInt r = ParseCapabilitiesArg(cap, (char*)aStr);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1097
	if( KErrNone == r ) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1098
		aNode->SetCapability( cap );
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1099
	}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1100
	return r;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1101
}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1102
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1103
TInt CObeyFile::SetPriority(TRomNode *aNode, const char* aStr) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1104
	TProcessPriority priority;	
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1105
	
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1106
	if ( IsValidNumber(aStr)) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1107
		TUint32 temp = 0;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1108
		Val(temp,aStr) ;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1109
		priority = (TProcessPriority)temp ; 
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1110
	}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1111
	else {	 
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1112
		if (stricmp(aStr, "low")==0)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1113
			priority=EPriorityLow;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1114
		else if (strnicmp(aStr, "background", 4)==0)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1115
			priority=EPriorityBackground;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1116
		else if (strnicmp(aStr, "foreground", 4)==0)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1117
			priority=EPriorityForeground;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1118
		else if (stricmp(aStr, "high")==0)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1119
			priority=EPriorityHigh;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1120
		else if (strnicmp(aStr, "windowserver",3)==0)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1121
			priority=EPriorityWindowServer;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1122
		else if (strnicmp(aStr, "fileserver",4)==0)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1123
			priority=EPriorityFileServer;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1124
		else if (strnicmp(aStr, "realtimeserver",4)==0)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1125
			priority=EPriorityRealTimeServer;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1126
		else if (strnicmp(aStr, "supervisor",3)==0)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1127
			priority=EPrioritySupervisor;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1128
		else
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1129
			return Print(EError, "Unrecognised priority keyword.\n");
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1130
	}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1131
	if (priority<EPriorityLow || priority>EPrioritySupervisor)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1132
		return Print(EError, "Priority out of range.\n");
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1133
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1134
	aNode->SetPriority( priority );
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1135
	return KErrNone;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1136
}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1137
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1138
TInt CObeyFile::SetUid1(TRomNode *aNode, const char* aStr){
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1139
	if (EFalse == IsValidNumber(aStr))
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1140
		return Print(EError, "Number required as argument for keyword 'uid1'.\n");
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1141
	TInt size ;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1142
	TInt err = Val(size,aStr);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1143
	if(KErrNone == err){
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1144
		aNode->SetUid1(size );
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1145
	}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1146
	return err;		 
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1147
}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1148
TInt CObeyFile::SetUid2(TRomNode *aNode, const char* aStr) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1149
	if (EFalse == IsValidNumber(aStr))
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1150
		return Print(EError, "Number required as argument for keyword 'uid2'.\n");
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1151
	TInt size ;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1152
	TInt err = Val(size,aStr);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1153
	if(KErrNone == err){
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1154
		aNode->SetUid2(size );
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1155
	}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1156
	return err;	
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1157
}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1158
TInt CObeyFile::SetUid3(TRomNode *aNode, const char* aStr) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1159
	if (EFalse == IsValidNumber(aStr))
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1160
		return Print(EError, "Number required as argument for keyword 'uid3'.\n");
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1161
	TInt size ;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1162
	TInt err = Val(size,aStr);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1163
	if(KErrNone == err){
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1164
		aNode->SetUid3(size );
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1165
	}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1166
	return err;	
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1167
}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1168
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1169
//
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1170
// Process any inline keywords
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1171
//
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1172
TInt CObeyFile::ParseFileAttributes(TRomNode *aNode, TRomBuilderEntry* aFile, enum EKeyword aKeyword) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1173
	TInt currentLine = iReader.CurrentLine();
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1174
	enum EFileAttribute attribute;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1175
	TInt r=KErrNone;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1176
	TInt index=3;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1177
	char* arg=0;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1178
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1179
	while(r==KErrNone) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1180
		r=iReader.NextAttribute(index,(aFile!=0),attribute,arg);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1181
		if (r!=KErrNone)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1182
			break;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1183
		switch(attribute)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1184
		{
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1185
		case EAttributeAtt:
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1186
			r=aNode->SetAtt(arg);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1187
			break;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1188
		case EAttributeAttExtra:
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1189
			r=aNode->SetAttExtra(arg, aFile, aKeyword);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1190
			break;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1191
		case EAttributeStack:
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1192
			r=SetStackSize(aNode, arg);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1193
			break;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1194
		case EAttributeFixed:
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1195
			aNode->SetFixed();
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1196
			r = KErrNone;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1197
			break;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1198
		case EAttributeUid1:
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1199
			r=SetUid1(aNode, arg);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1200
			break;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1201
		case EAttributeUid2:
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1202
			r=SetUid2(aNode, arg);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1203
			break;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1204
		case EAttributeUid3:
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1205
			r=SetUid3(aNode, arg);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1206
			break;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1207
		case EAttributeHeapMin:
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1208
			r=SetHeapSizeMin(aNode, arg);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1209
			break;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1210
		case EAttributeHeapMax:
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1211
			r=SetHeapSizeMax(aNode, arg);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1212
			break;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1213
		case EAttributePriority:
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1214
			r=SetPriority(aNode, arg);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1215
			break;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1216
		case EAttributeCapability:
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1217
			r=SetCapability(aNode, arg);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1218
			break;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1219
		case EAttributeUnpaged:
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1220
			aNode->iOverride |= KOverrideCodeUnpaged|KOverrideDataUnpaged;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1221
			aNode->iOverride &= ~(KOverrideCodePaged|KOverrideDataPaged);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1222
			break;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1223
		case EAttributePaged:
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1224
			aNode->iOverride |= KOverrideCodePaged;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1225
			aNode->iOverride &= ~(KOverrideCodeUnpaged);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1226
			break;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1227
		case EAttributeUnpagedCode:
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1228
			aNode->iOverride |= KOverrideCodeUnpaged;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1229
			aNode->iOverride &= ~KOverrideCodePaged;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1230
			break;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1231
		case EAttributePagedCode:
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1232
			aNode->iOverride |= KOverrideCodePaged;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1233
			aNode->iOverride &= ~KOverrideCodeUnpaged;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1234
			break;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1235
		case EAttributeUnpagedData:
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1236
			aNode->iOverride |= KOverrideDataUnpaged;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1237
			aNode->iOverride &= ~KOverrideDataPaged;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1238
			break;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1239
		case EAttributePagedData:
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1240
			aNode->iOverride |= KOverrideDataPaged;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1241
			aNode->iOverride &= ~KOverrideDataUnpaged;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1242
			break;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1243
		default:
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1244
			return Print(EError, "Unrecognised keyword in file attributes on line %d.\n",currentLine);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1245
		}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1246
	}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1247
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1248
	if (r==KErrEof)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1249
		return KErrNone;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1250
	return r;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1251
}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1252
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1253
//
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1254
// Process a parsed line to set up one or more new TRomBuilder entry objects.
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1255
// iWord[0] = the keyword (file, primary or secondary)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1256
// iWord[1] = the PC pathname
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1257
// iWord[2] = the EPOC pathname
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1258
// iWord[3] = start of the file attributes
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1259
//
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1260
TBool CObeyFile::ProcessFile(TInt /*aAlign*/, enum EKeyword aKeyword){
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1261
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1262
	TBool isPeFile = ETrue;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1263
	TBool aFileCompressOption, aFileUncompressOption;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1264
	TInt epocPathStart=2;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1265
	aFileCompressOption = aFileUncompressOption = EFalse;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1266
	TBool warnFlag = EFalse;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1267
	static const char aStdPath[] = "SYS\\BIN\\";
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1268
	static const int sysBinLength = sizeof(aStdPath)-1;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1269
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1270
	// do some validation of the keyword
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1271
	TInt currentLine = iReader.CurrentLine();
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1272
	switch (aKeyword)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1273
	{
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1274
	case EKeywordData:
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1275
	case EKeywordHideV2:
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1276
		iNumberOfDataFiles++;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1277
		isPeFile = EFalse;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1278
		break;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1279
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1280
	case EKeywordFile:
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1281
		warnFlag = gEnableStdPathWarning;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1282
		break;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1283
	case EKeywordFileCompress:
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1284
		aFileCompressOption = ETrue;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1285
		warnFlag = gEnableStdPathWarning;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1286
		break;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1287
	case EKeywordFileUncompress:
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1288
		aFileUncompressOption = ETrue;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1289
		warnFlag = gEnableStdPathWarning;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1290
		break;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1291
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1292
	default:
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1293
		Print(EError,"Unexpected keyword '%s' on line %d.\n",iReader.Word(0),currentLine);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1294
		return EFalse;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1295
	}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1296
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1297
	if (aKeyword!=EKeywordHideV2) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1298
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1299
		// check the PC file exists
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1300
		char* nname = NormaliseFileName(iReader.Word(1)); 
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1301
		ifstream test(nname);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1302
		if (!test) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1303
			Print(EError,"Cannot open file %s for input.\n",iReader.Word(1));
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1304
			iMissingFiles++;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1305
		}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1306
		test.close();
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1307
		delete []nname;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1308
	}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1309
	else
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1310
		epocPathStart=1;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1311
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1312
	iNumberOfFiles++;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1313
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1314
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1315
	TBool endOfName=EFalse;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1316
	const char *epocStartPtr=IsValidFilePath(iReader.Word(epocPathStart));
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1317
	char *epocEndPtr=const_cast<char*>(epocStartPtr);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1318
	if (epocStartPtr==NULL) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1319
		Print(EError, "Invalid destination path on line %d\n",currentLine);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1320
		return EFalse;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1321
	}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1322
	if(warnFlag){	// Check for the std destination path(for executables) as per platsec.	
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1323
		if(strnicmp(aStdPath,epocStartPtr,sysBinLength) != 0) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1324
			Print(EWarning,"Invalid destination path on line %d. \"%s\" \n",currentLine,epocStartPtr);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1325
		}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1326
	}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1327
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1328
	TRomNode* dir=iRootDirectory;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1329
	TRomNode* subDir=0;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1330
	TRomBuilderEntry *file=0;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1331
	while (!endOfName) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1332
		endOfName = GetNextBitOfFileName(epocEndPtr);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1333
		if (endOfName) {// file		
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1334
			TRomNode* alreadyExists=dir->FindInDirectory(epocStartPtr);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1335
			/*
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1336
			* The EKeywordHideV2 keyword is used to indicate that:
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1337
			*	1. if the file exists in the same image and then hidden, mark it hidden
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1338
			*	2. if the file exists in another image, but in this (ROFS) image, it is
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1339
			*		required to hide that file, create a 0 length file entry setting the 'hide'
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1340
			*		flag so that at runtime, file gets hidden in the composite filesystem.
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1341
			*/
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1342
			if ((aKeyword != EKeywordHideV2) && alreadyExists){ // duplicate file		
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1343
				if(gKeepGoing){	
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1344
					Print(EWarning, "Duplicate file for %s on line %d, will be ignored\n",iReader.Word(1),iReader.CurrentLine());
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1345
					switch (aKeyword)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1346
					{
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1347
					case EKeywordData:
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1348
					case EKeywordHideV2:
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1349
						iNumberOfDataFiles--;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1350
					default:
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1351
						break;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1352
					}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1353
					iNumberOfFiles--;	 	
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1354
					return ETrue;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1355
				}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1356
				else {					
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1357
					Print(EError, "Duplicate file for %s on line %d\n",iReader.Word(1),iReader.CurrentLine());
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1358
					return EFalse;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1359
				}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1360
			}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1361
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1362
			TBool aHidden = aKeyword==EKeywordHideV2;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1363
			/* The file is only marked hidden and hence the source file name isn't known 
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1364
			* here as hide statement says :
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1365
			*	hide <filename as in ROM>
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1366
			* Therefore, create TRomBuilderEntry with iFileName as 0 for hidden file when
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1367
			* the file doesn't exist in the same ROM image. Otherwise, the src file name
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1368
			* is known because of alreadyExists (which comes from the 'file'/'data' statement).
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1369
			*/
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1370
			if(aHidden)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1371
				file = new TRomBuilderEntry(0, epocStartPtr);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1372
			else
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1373
				file = new TRomBuilderEntry(iReader.Word(1), epocStartPtr);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1374
			file->iExecutable=isPeFile;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1375
			file->iHidden= aHidden;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1376
			if( aFileCompressOption ){
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1377
				file->iCompressEnabled = ECompressionCompress;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1378
			}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1379
			else if(aFileUncompressOption )	{
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1380
				file->iCompressEnabled = ECompressionUncompress;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1381
			}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1382
			TRomNode* node=new TRomNode(epocStartPtr, file);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1383
			if (node==0)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1384
				return EFalse;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1385
			TInt r=ParseFileAttributes(node, file, aKeyword);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1386
			if (r!=KErrNone)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1387
				return EFalse;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1388
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1389
			dir->AddFile(node);	// to ROFS directory structure
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1390
			AddFile(file);		// to our list of files
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1391
		}		 
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1392
		else { // directory		
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1393
			subDir = dir->FindInDirectory(epocStartPtr);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1394
			if (!subDir) { // sub directory does not exist			
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1395
				subDir = dir->NewSubDir(epocStartPtr);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1396
				if (!subDir)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1397
					return EFalse;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1398
			}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1399
			dir=subDir;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1400
			epocStartPtr = epocEndPtr;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1401
		}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1402
	}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1403
	return ETrue;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1404
}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1405
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1406
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1407
TBool CObeyFile::ProcessRenaming(enum EKeyword aKeyword) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1408
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1409
	// find existing file
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1410
	TBool endOfName=EFalse;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1411
	const char *epocStartPtr=IsValidFilePath(iReader.Word(1));
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1412
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1413
	// Store the current name and new name to maintain renamed file map
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1414
	string currentName=iReader.Word(1);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1415
	string newName=iReader.Word(2);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1416
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1417
	char *epocEndPtr= const_cast<char*>(epocStartPtr);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1418
	if (epocStartPtr == NULL) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1419
		Print(EError, "Invalid source path on line %d\n",iReader.CurrentLine());
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1420
		return EFalse;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1421
	}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1422
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1423
	char saved_srcname[257];
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1424
	strncpy(saved_srcname, iReader.Word(1),257);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1425
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1426
	TRomNode* dir=iRootDirectory;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1427
	TRomNode* existingFile=0;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1428
	while (!endOfName){
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1429
		endOfName = GetNextBitOfFileName(epocEndPtr);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1430
		if (endOfName) { // file
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1431
			existingFile=dir->FindInDirectory(epocStartPtr);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1432
			if (existingFile) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1433
				TInt fileCount=0;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1434
				TInt dirCount=0;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1435
				existingFile->CountDirectory(fileCount, dirCount);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1436
				if (dirCount != 0 || fileCount != 0) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1437
					Print(EError, "Keyword %s not applicable to directories - line %d\n",
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1438
						iReader.Word(0),iReader.CurrentLine());
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1439
					return EFalse;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1440
				}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1441
			}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1442
		}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1443
		else { // directory		
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1444
			TRomNode* subDir = dir->FindInDirectory(epocStartPtr);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1445
			if (!subDir) // sub directory does not exist
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1446
				break;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1447
			dir=subDir;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1448
			epocStartPtr = epocEndPtr;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1449
		}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1450
	}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1451
	if (aKeyword == EKeywordHide) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1452
		/*
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1453
		* The EKeywordHide keyword is used to indicate that if the file exists in 
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1454
		* the primary ROFS image and then hidden in extension ROFS, mark it hidden.
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1455
		*/
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1456
		if (!existingFile) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1457
			Print(EWarning, "Hiding non-existent file %s on line %d\n", 
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1458
				saved_srcname, iReader.CurrentLine());
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1459
			// Just a warning, as we've achieved the right overall effect.
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1460
		}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1461
		else if (existingFile->iFileStartOffset==(TUint)KFileHidden){
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1462
			Print(EWarning, "Hiding already hidden file %s on line %d\n", 
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1463
				saved_srcname, iReader.CurrentLine());
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1464
			// We will igrore this request, otherwise it will "undelete" it.
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1465
		}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1466
		else {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1467
			//hidden files will not be placed to the image
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1468
			existingFile->iHidden = ETrue;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1469
		}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1470
		return ETrue;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1471
	}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1472
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1473
	if (!existingFile) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1474
		Print(EError, "Can't %s non-existent source file %s on line %d\n",
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1475
			iReader.Word(0), saved_srcname, iReader.CurrentLine());
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1476
		return EFalse;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1477
	}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1478
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1479
	epocStartPtr = IsValidFilePath(iReader.Word(2));
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1480
	epocEndPtr = const_cast<char*>(epocStartPtr);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1481
	endOfName = EFalse;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1482
	if (epocStartPtr == NULL) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1483
		Print(EError, "Invalid destination path on line %d\n",iReader.CurrentLine());
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1484
		return EFalse;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1485
	}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1486
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1487
	TRomNode* newdir=iRootDirectory;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1488
	while (!endOfName) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1489
		endOfName = GetNextBitOfFileName(epocEndPtr);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1490
		if (endOfName) {// file		
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1491
			TRomNode* alreadyExists=newdir->FindInDirectory(epocStartPtr);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1492
			if (alreadyExists && !(alreadyExists->iHidden)) {// duplicate file	
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1493
				if(gKeepGoing){
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1494
					Print(EWarning, "Duplicate file for %s on line %d, renaming will be skipped\n",saved_srcname,iReader.CurrentLine());
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1495
					return ETrue;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1496
				}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1497
				else {							
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1498
					Print(EError, "Duplicate file for %s on line %d\n",saved_srcname,iReader.CurrentLine());
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1499
					return EFalse;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1500
				}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1501
			}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1502
		}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1503
		else { // directory		
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1504
			TRomNode* subDir = newdir->FindInDirectory(epocStartPtr);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1505
			if (!subDir) {// sub directory does not exist			
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1506
				subDir = newdir->NewSubDir(epocStartPtr);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1507
				if (!subDir)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1508
					return EFalse;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1509
			}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1510
			newdir=subDir;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1511
			epocStartPtr = epocEndPtr;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1512
		}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1513
	}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1514
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1515
	if (aKeyword == EKeywordRename) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1516
		// rename => remove existingFile and insert into tree at new place
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1517
		// has no effect on the iNextExecutable or iNextNodeForSameFile links
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1518
		TInt r=ParseFileAttributes(existingFile, existingFile->iEntry, aKeyword);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1519
		if (r!=KErrNone)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1520
			return EFalse;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1521
		existingFile->Rename(dir, newdir, epocStartPtr);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1522
		// Store the current and new name of file in the renamed file map.
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1523
		iPatchData->AddToRenamedFileMap(currentName, newName);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1524
		return ETrue;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1525
	}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1526
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1527
	// alias => create new TRomNode entry and insert into tree
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1528
	TRomNode* node = new TRomNode(epocStartPtr, 0);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1529
	if (node == 0) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1530
		Print(EError, "Out of memory\n");
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1531
		return EFalse;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1532
	}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1533
	node->Alias(existingFile);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1534
	TInt r=ParseFileAttributes(node, 0, aKeyword);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1535
	if (r!=KErrNone)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1536
		return EFalse;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1537
	newdir->AddFile(node);	// to ROFS directory structure, though possibly hidden
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1538
	return ETrue;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1539
}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1540
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1541
TInt ParsePagingPolicy(const char* policy){
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1542
	if(stricmp(policy,"NOPAGING") == 0)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1543
		return EKernelConfigPagingPolicyNoPaging;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1544
	else if (stricmp(policy,"ALWAYSPAGE") == 0)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1545
		return EKernelConfigPagingPolicyAlwaysPage;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1546
	else if(stricmp(policy,"DEFAULTUNPAGED") == 0)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1547
		return EKernelConfigPagingPolicyDefaultUnpaged;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1548
	else if(stricmp(policy,"DEFAULTPAGED") == 0)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1549
		return EKernelConfigPagingPolicyDefaultPaged;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1550
	return KErrArgument;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1551
}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1552
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1553
TBool CObeyFile::ProcessKeyword(enum EKeyword aKeyword) { 
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1554
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1555
	TBool success = ETrue;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1556
	switch (aKeyword)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1557
	{
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1558
	case EKeywordRofsName:
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1559
		iRomFileName = iReader.DupWord(1);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1560
		break;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1561
	case EKeywordRofsSize:
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1562
		Val(iRomSize,iReader.Word(1));
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1563
		break;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1564
	case EKeywordVersion:
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1565
		{
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1566
			istringstream val(iReader.Word(1)); 
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1567
			val >> iVersion;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1568
		}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1569
		break;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1570
	case EKeywordRofsChecksum:
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1571
		Val(iCheckSum,iReader.Word(1));
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1572
		break;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1573
	case EKeywordTime:
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1574
		iReader.ProcessTime(iTime);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1575
		break;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1576
	case EKeywordPagingOverride:
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1577
		{
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1578
			if(iPagingOverrideParsed)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1579
				Print(EWarning, "PagingOverride redefined - previous PagingOverride values lost\n");
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1580
			if(iCodePagingOverrideParsed)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1581
				Print(EWarning, "PagingOverride defined - previous CodePagingOverride values lost\n");
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1582
			iPagingOverrideParsed = true;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1583
			TInt policy = ParsePagingPolicy(iReader.Word(1));
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1584
			if(policy < 0) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1585
				Print(EError,"Unrecognized option for PAGINGOVERRIDE keyword\n");
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1586
				success = false;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1587
			}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1588
			else {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1589
				gCodePagingOverride = policy;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1590
				if((policy == EKernelConfigPagingPolicyNoPaging) || (policy == EKernelConfigPagingPolicyDefaultUnpaged))
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1591
					gDataPagingOverride = policy;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1592
			}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1593
		}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1594
		break;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1595
	case EKeywordCodePagingOverride:
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1596
		{
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1597
			if(iCodePagingOverrideParsed)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1598
				Print(EWarning, "CodePagingOverride redefined - previous CodePagingOverride values lost\n");
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1599
			if(iPagingOverrideParsed)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1600
				Print(EWarning, "CodePagingOverride defined - previous PagingOverride values lost\n");
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1601
			iCodePagingOverrideParsed = true;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1602
			TInt policy = ParsePagingPolicy(iReader.Word(1));
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1603
			if(policy<0)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1604
			{
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1605
				Print(EError,"Unrecognized option for CODEPAGINGOVERRIDE keyword\n");
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1606
				success = false;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1607
			}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1608
			else
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1609
				gCodePagingOverride = policy;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1610
		}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1611
		break;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1612
	case EKeywordDataPagingOverride:
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1613
		{
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1614
			if(iDataPagingOverrideParsed)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1615
				Print(EWarning, "DataPagingOverride redefined - previous DataPagingOverride values lost\n");
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1616
/*			if(iPagingOverrideParsed){
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1617
				Print(EError, "DataPagingOverride defined - previous PagingOverride values lost\n");
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1618
				success = false;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1619
				break;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1620
			}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1621
*/
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1622
			iDataPagingOverrideParsed = true;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1623
			TInt policy = ParsePagingPolicy(iReader.Word(1));
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1624
			if(policy < 0) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1625
				Print(EError,"Unrecognized option for DATAPAGINGOVERRIDE keyword\n");
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1626
				success = false;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1627
			}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1628
			else
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1629
				gDataPagingOverride = policy;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1630
		}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1631
		break;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1632
	case EKeywordRofsAutoSize:
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1633
		iAutoSize = ETrue;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1634
		Val(iAutoPageSize,iReader.Word(1));
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1635
		break;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1636
	default:
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1637
		// unexpected keyword iReader.Word(0)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1638
		break;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1639
	}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1640
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1641
	return success;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1642
}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1643
//
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1644
// Checks that the obeyfile has supplied enough variables to continue
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1645
//
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1646
TBool CObeyFile::GotKeyVariables() {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1647
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1648
	TBool retVal=ETrue;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1649
	// Mandatory keywords
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1650
	if (iRomFileName == 0) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1651
		Print(EAlways,"The name of the image file has not been supplied.\n");
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1652
		Print(EAlways,"Use the keyword \"rofsname\".\n");
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1653
		retVal = EFalse;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1654
	}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1655
	if (iRomSize == 0) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1656
		Print(EAlways,"The size of the image has not been supplied.\n");
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1657
		Print(EAlways,"Use the keyword \"rofssize\".\n");
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1658
		retVal = EFalse;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1659
	}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1660
	// Apply defaults as necessary
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1661
	if (iTime == 0)	{
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1662
		Print(ELog, "No timestamp specified. Using current time...\n");
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1663
		ObeyFileReader::TimeNow(iTime);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1664
	}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1665
	Print(ELog, "\nCreating Rofs image %s\n", iRomFileName);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1666
	return retVal;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1667
}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1668
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1669
//
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1670
// Check the path is valid
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1671
//
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1672
const char* CObeyFile::IsValidFilePath(const char* aPath) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1673
	// skip leading "\"
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1674
	if (*aPath == '/' || *aPath == '\\')
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1675
		aPath++;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1676
	if (*aPath == 0)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1677
		return NULL; // file ends in a backslash
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1678
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1679
	const char *p = aPath;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1680
	TInt len=0;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1681
	while(*p) {			
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1682
		if (*p == '/' || *p == '\\') {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1683
			if (len == 0)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1684
				return NULL;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1685
			len=0;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1686
		}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1687
		len++;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1688
		p++;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1689
	}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1690
	return (len ? aPath : NULL);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1691
}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1692
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1693
//
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1694
// Move the end pointer past the next directory separator, replacing it with 0
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1695
//
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1696
TBool CObeyFile::GetNextBitOfFileName(char*& epocEndPtr) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1697
	while (*epocEndPtr != '/' && *epocEndPtr != '\\'){ // until reach the directory separator		
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1698
		if (*epocEndPtr == 0) // if reach end of string, return TRUE, it's the filename
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1699
			return ETrue;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1700
		epocEndPtr++;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1701
	}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1702
	*epocEndPtr = 0; // overwrite the directory separator with a 0
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1703
	epocEndPtr++; // point past the 0 ready for the next one
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1704
	return EFalse;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1705
}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1706
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1707
void CObeyFile::AddFile(TRomBuilderEntry* aFile) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1708
	*iNextFilePtrPtr = aFile;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1709
	iNextFilePtrPtr = &(aFile->iNext);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1710
}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1711
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1712
//
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1713
// First pass through the obey file to set up key variables
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1714
//
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1715
TInt CObeyFile::ProcessExtensionRofs(MRofsImage* aKernelRom) { 
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1716
	
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1717
	iReader.Rewind();
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1718
	enum EKeyword keyword;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1719
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1720
	// Deal with the "extensionrofs" keyword, which should be first
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1721
	// however, you may've found "time" before it.
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1722
	while(iReader.NextLine(1,keyword) != KErrEof) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1723
		if(EKeywordExtensionRofs == keyword)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1724
			break ;		
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1725
	}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1726
	if(EKeywordExtensionRofs != keyword) return KErrEof;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1727
	iRomFileName = iReader.DupWord(1);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1728
	Print(ELog, "\n========================================================\n");
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1729
	Print(ELog, "Extension ROFS %s starting at line %d\n\n", iRomFileName, iReader.CurrentLine());
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1730
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1731
	iReader.MarkNext();		// so that we rewind to the line after the extensionrom keyword
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1732
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1733
	while (iReader.NextLine(1,keyword) != KErrEof) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1734
		if (keyword == EKeywordExtensionRofs)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1735
			break;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1736
		ProcessExtensionKeyword(keyword);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1737
	}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1738
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1739
	if (!GotExtensionVariables(aKernelRom))
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1740
		return KErrGeneral;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1741
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1742
	// second pass to process the file specifications in the obey file building
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1743
	// up the TRomNode directory structure and the TRomBuilderEntry list
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1744
	//
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1745
	iReader.Rewind();
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1746
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1747
	//
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1748
	if (aKernelRom == 0)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1749
		return Print(EError, "Option to extend a kernel ROFS image not yet implemented\n");
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1750
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1751
	iRootDirectory = new TRomNode("");
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1752
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1753
	iLastExecutable = 0;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1754
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1755
	(aKernelRom->RootDirectory())->deleteTheFirstNode();
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1756
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1757
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1758
	iRootDirectory = aKernelRom->CopyDirectory(iLastExecutable);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1759
	aKernelRom->SetRootDirectory(iRootDirectory);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1760
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1761
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1762
	TInt align=0;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1763
	while (iReader.NextLine(2,keyword)!=KErrEof) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1764
		if (keyword == EKeywordExtensionRofs)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1765
			break;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1766
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1767
		switch (keyword)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1768
		{
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1769
		case EKeywordHide:
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1770
		case EKeywordAlias:
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1771
		case EKeywordRename:
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1772
			if (!ProcessRenaming(keyword))
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1773
				return KErrGeneral;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1774
			break;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1775
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1776
		case EKeywordPatchDllData:
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1777
			{	
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1778
				// Collect patchdata statements to process at the end
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1779
				StringVector patchDataTokens;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1780
				SplitPatchDataStatement(patchDataTokens); 
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1781
				iPatchData->AddPatchDataStatement(patchDataTokens);									
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1782
				break;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1783
			}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1784
		default:
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1785
			if (!ProcessFile(align, keyword))
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1786
				return KErrGeneral;			
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1787
			align=0;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1788
			break;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1789
		}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1790
	}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1791
	
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1792
	if(!ParsePatchDllData() )
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1793
		return KErrGeneral;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1794
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1795
	iReader.MarkNext();			// ready for processing the next extension rom(s)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1796
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1797
	if (iMissingFiles!=0)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1798
		return KErrGeneral;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1799
	if (iNumberOfFiles == 0) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1800
		Print(EError, "No files specified.\n");
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1801
		return KErrGeneral;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1802
	}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1803
	return KErrNone;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1804
}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1805
void CObeyFile::ProcessExtensionKeyword(enum EKeyword aKeyword)	{ 
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1806
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1807
	switch (aKeyword)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1808
	{
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1809
	case EKeywordCoreRofsName:
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1810
		iKernelRofsName = iReader.DupWord(1);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1811
		return;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1812
	case EKeywordRofsSize:
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1813
		Val(iRomSize,iReader.Word(1));
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1814
		return;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1815
	case EKeywordVersion:
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1816
		{
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1817
			istringstream val(iReader.Word(1)); 
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1818
			val >> iVersion;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1819
		}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1820
		return;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1821
	case EKeywordRomChecksum:
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1822
		Val(iCheckSum,iReader.Word(1)); //--
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1823
		return;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1824
	case EKeywordTime:
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1825
		iReader.ProcessTime(iTime);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1826
		return;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1827
	case EKeywordRofsAutoSize:
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1828
		iAutoSize = ETrue;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1829
		Val(iAutoPageSize , iReader.Word(1)); 
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1830
		return;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1831
	default:
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1832
		Print(EError,"Keyword '%s' not valid in extension ROFS - line %d\n", iReader.Word(0), iReader.CurrentLine());
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1833
		break;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1834
	}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1835
	return;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1836
}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1837
//
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1838
// Checks that the obeyfile has supplied enough variables to continue
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1839
//
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1840
TBool CObeyFile::GotExtensionVariables(MRofsImage* aRom) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1841
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1842
	TBool retVal=ETrue;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1843
	const char* kernelRofsName = iKernelRofsName;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1844
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1845
	// Mandatory keywords
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1846
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1847
	if (iRomSize == 0){
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1848
		Print(EAlways,"The size of the extension ROFS has not been supplied.\n");
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1849
		Print(EAlways,"Use the keyword \"rofssize\".\n");
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1850
		retVal = EFalse;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1851
	}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1852
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1853
	// keywords we need if we don't already have a ROFS image to work from
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1854
	if (aRom == 0) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1855
		if (iKernelRofsName == 0) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1856
			Print(EAlways,"The name of the core ROFS has not been supplied.\n");
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1857
			Print(EAlways,"Use the keyword \"rofsname\".\n");
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1858
			retVal = EFalse;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1859
		}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1860
	}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1861
	else {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1862
		if (iKernelRofsName != 0){
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1863
			Print(EWarning,"Keyword \"rofsname\" ignored.\n");
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1864
		}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1865
		kernelRofsName = aRom->RomFileName();
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1866
	}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1867
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1868
	// validation
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1869
	// Apply defaults as necessary
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1870
	if (iTime == 0)	{
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1871
		Print(ELog, "No timestamp specified. Using current time...\n");
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1872
		ObeyFileReader::TimeNow(iTime);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1873
	}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1874
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1875
	// fix up "*" in rofsname
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1876
	char newname[256];
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1877
	char* p=newname;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1878
	char* q=iRomFileName;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1879
	char c;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1880
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1881
	while ((c=*q++)!='\0'){
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1882
		if (c!='*') {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1883
			*p++=c;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1884
			continue;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1885
		}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1886
		const char *r = kernelRofsName;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1887
		while ((c=*r++)!='\0')
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1888
			*p++=c;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1889
	}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1890
	*p++ = '\0';
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1891
	delete []iRomFileName;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1892
	size_t len = p - newname ;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1893
	iRomFileName = new char[len];
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1894
	memcpy(iRomFileName,newname,len);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1895
	Print(ELog, "\nCreating ROFS image %s\n", iRomFileName);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1896
	return retVal;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1897
}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1898
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1899
// Fuction to split patchdata statement 
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1900
void CObeyFile::SplitPatchDataStatement(StringVector& aPatchDataTokens) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1901
	// Get the value of symbol size, address/ordinal and new value 
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1902
	// to be patched from the patchdata statement.
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1903
	// Syntax of patchdata statements is as follows:
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1904
	// 1)	patchdata dll_name  ordinal OrdinalNumber size_in_bytes   new_value 
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1905
	// 2)   patchdata dll_name  addr    Address       size_in_bytes   new_value
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1906
	for(TInt count=1; count<=5; count++) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1907
		aPatchDataTokens.push_back(iReader.Word(count));
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1908
	}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1909
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1910
	// Store the the value of current line which will be used
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1911
	// when displaying error messages.
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1912
	ostringstream outStrStream;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1913
	outStrStream<<iReader.CurrentLine();
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1914
	aPatchDataTokens.push_back(outStrStream.str());
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1915
}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1916
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1917
TBool CObeyFile::ParsePatchDllData() {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1918
	// Get the list of patchdata statements
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1919
	VectorOfStringVector patchDataStatements=iPatchData->GetPatchDataStatements();
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1920
	// Get the list of renamed file map
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1921
	MapOfString RenamedFileMap=iPatchData->GetRenamedFileMap();
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1922
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1923
	for(TUint count=0; count < patchDataStatements.size(); count++) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1924
		
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1925
		StringVector strVector = patchDataStatements.at(count);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1926
		string filename=strVector.at(0);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1927
		string lineNoStr = strVector.at(5);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1928
		TUint lineNo = 0 ;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1929
		Val(lineNo,lineNoStr.c_str());
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1930
		TRomNode* existingFile = NULL;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1931
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1932
		do {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1933
			TRomNode* dir=iRootDirectory;			
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1934
			TBool endOfName=EFalse; 
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1935
			
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1936
			if (!IsValidFilePath(filename.c_str())) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1937
				Print(EError, "Invalid source path on line %d\n",lineNo);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1938
				return EFalse;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1939
			}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1940
			char* epocStartPtr =NormaliseFileName(filename.c_str());
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1941
			char* savedPtr = epocStartPtr;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1942
			if(*epocStartPtr == '/' ||*epocStartPtr == '\\')
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1943
				epocStartPtr++ ;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1944
			char* epocEndPtr = epocStartPtr;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1945
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1946
			while (!endOfName) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1947
				endOfName = GetNextBitOfFileName(epocEndPtr);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1948
				if (endOfName) {// file				
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1949
					existingFile=dir->FindInDirectory(epocStartPtr);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1950
					if (existingFile) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1951
						TInt fileCount=0;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1952
						TInt dirCount=0;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1953
						existingFile->CountDirectory(fileCount, dirCount);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1954
						if (dirCount != 0 || fileCount != 0) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1955
							Print(EError, "Keyword %s not applicable to directories - line %d\n","patchdata",lineNo);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1956
							return EFalse;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1957
						}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1958
					}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1959
				}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1960
				else {// directory				
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1961
					TRomNode* subDir = dir->FindInDirectory(epocStartPtr);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1962
					if (!subDir) // sub directory does not exist
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1963
						break;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1964
					dir=subDir;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1965
					epocStartPtr = epocEndPtr;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1966
				}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1967
			}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1968
			delete []savedPtr;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1969
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1970
			if(!existingFile) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1971
				// If the E32Image file to be patched is not included then check if the
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1972
				// file was renamed.
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1973
				MapOfStringIterator RenamedFileMapIterator;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1974
				if ((RenamedFileMapIterator=RenamedFileMap.find(filename)) != RenamedFileMap.end())
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1975
					filename = (*RenamedFileMapIterator).second; 				
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1976
				else {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1977
					Print(EError, "File %s not found - line %d\n", filename.c_str(), lineNo);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1978
					return EFalse;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1979
				}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1980
			}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1981
		}while(!existingFile);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1982
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1983
		TUint32 aSize, aOrdinal, aNewValue, aOffset;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1984
		TLinAddr aDataAddr;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1985
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1986
		aOrdinal = (TUint32)-1;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1987
		aDataAddr = (TUint32)-1;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1988
		aOffset = 0;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1989
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1990
		string symbolSize=strVector.at(3);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1991
		Val(aSize,symbolSize.c_str());
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1992
		string aValue=strVector.at(4);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1993
		Val(aNewValue,aValue.c_str());		
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1994
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1995
		DllDataEntry *dataEntry = new DllDataEntry(aSize, aNewValue);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1996
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1997
		// Set the address of the data or the ordinal number specified in OBY statement.
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1998
		string keyword=strVector.at(1);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  1999
		string keywordValue=strVector.at(2);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  2000
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  2001
		/* Check for +OFFSET at the end of the ordinal number or address */
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  2002
		TUint plus = keywordValue.find("+",0);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  2003
		if (plus != string::npos) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  2004
			/* Get the offset that we found after the + sign */
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  2005
			string offset = keywordValue.substr(plus+1);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  2006
			Val(aOffset,offset.c_str());
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  2007
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  2008
			keywordValue.resize(plus);		
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  2009
		}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  2010
		if(stricmp (keyword.c_str(), "addr") == 0)
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  2011
			Val(aDataAddr,keywordValue.c_str());
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  2012
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  2013
		else 
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  2014
			Val(aOrdinal,keywordValue.c_str());
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  2015
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  2016
		dataEntry->iDataAddress = aDataAddr;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  2017
		dataEntry->iOrdinal = aOrdinal;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  2018
		dataEntry->iOffset = aOffset;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  2019
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  2020
		existingFile->SetDllData();
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  2021
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  2022
		DllDataEntry *aDllDataEntry= existingFile->iEntry->GetFirstDllDataEntry();
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  2023
		if (aDllDataEntry == NULL) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  2024
			// Set the first node of the patchdata linked list
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  2025
			aDllDataEntry=dataEntry;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  2026
			existingFile->iEntry->SetFirstDllDataEntry(aDllDataEntry);
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  2027
		}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  2028
		else {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  2029
			// Goto the last node
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  2030
			while((aDllDataEntry->NextDllDataEntry()) != NULL) {
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  2031
				aDllDataEntry = aDllDataEntry->NextDllDataEntry();
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  2032
			}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  2033
			// Add the new node at the end of linked list
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  2034
			aDllDataEntry->AddDllDataEntry(dataEntry);			
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  2035
		}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  2036
	}
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  2037
	return ETrue;
360bd6b35136 buildrom v3.24.0, rombuild v2.17.3, rofsbuild v2.10.4, resource compiler v8.4.001, image check v1.4.0, elftools v2.3, elf2e32 v2.3
jjkang
parents: 0
diff changeset
  2038
}