diff -r c7c26511138f -r 360bd6b35136 imgtools/romtools/readimage/inc/common.h --- a/imgtools/romtools/readimage/inc/common.h Wed Jun 16 16:51:40 2010 +0300 +++ b/imgtools/romtools/readimage/inc/common.h Wed Jun 23 16:56:47 2010 +0800 @@ -1,104 +1,110 @@ -/* -* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of the License "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* @internalComponent -* @released -* -*/ - - -#ifndef __IMAGE_READER_COMMON_H_ -#define __IMAGE_READER_COMMON_H_ - -#include -#include -#include -#ifdef __MSVCDOTNET__ -#include -#endif - -using namespace std ; - -#include -#include -#include -#include -#include - -#include "e32image.h" - -#define EXIT_SUCCESS 0 -#define EXIT_FAILURE 1 - -extern ostream *out; - -#define DLL_UID1 10000079 -#define EXE_UID1 1000007a - -typedef enum EImageType -{ - EUNKNOWN_IMAGE, - EROM_IMAGE, - EROMX_IMAGE, - EROFS_IMAGE, - EROFX_IMAGE, - //more here... - EE32_IMAGE, - //EBAREROM_IMAGE is introduced for handling bare ROM image (an image without loader header) - EBAREROM_IMAGE -}; - -#define DIR_SEPARATOR "/" -#define DUMP_HDR_FLAG 0x1 -#define DUMP_VERBOSE_FLAG 0x2 -#define DUMP_DIR_ENTRIES_FLAG 0x4 -#define DUMP_E32_IMG_FLAG 0x8 - -#define LOG_IMAGE_CONTENTS_FLAG 0x10 -#define EXTRACT_FILES_FLAG 0x20 -#define MODE_SIS2IBY 0x40 -#define RECURSIVE_FLAG 0x80 -#define EXTRACT_FILE_SET_FLAG 0x100 - -// maximum buffer size. -#define _MAX_BUFFER_SIZE_ 128 - -class ReaderUtil -{ -public: - static bool IsExecutable(TUint8* Uids1); -}; - -class ImageReaderException -{ -public: - ImageReaderException(const char* aFile, const char* aErrMessage); - virtual ~ImageReaderException(){} - virtual void Report(); - - string iImgFileName; - string iErrMessage; -}; - -class ImageReaderUsageException : public ImageReaderException -{ -public: - ImageReaderUsageException(const char* aFile, const char* aErrMessage); - void Report(); -}; - -ostream& DumpInHex(char* aDesc, TUint32 aData, bool aContinue = false,TUint aDataWidth=8,\ - char aFiller='0', TUint aMaxDescWidth=28); - -#endif //__IMAGE_READER_COMMON_H_ +/* +* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* @internalComponent +* @released +* +*/ + + +#ifndef __IMAGE_READER_COMMON_H_ +#define __IMAGE_READER_COMMON_H_ + +#include +#include +#include +#ifdef __MSVCDOTNET__ +#include +#endif + + +#include +#include +#include +#include +#include + +#include "e32image.h" + +#define EXIT_SUCCESS 0 +#define EXIT_FAILURE 1 + +extern ostream *out; + +#define DLL_UID1 10000079 +#define EXE_UID1 1000007a + +typedef enum EImageType +{ + EUNKNOWN_IMAGE, + EROM_IMAGE, + EROMX_IMAGE, + EROFS_IMAGE, + EROFX_IMAGE, + //more here... + EE32_IMAGE, + //EBAREROM_IMAGE is introduced for handling bare ROM image (an image without loader header) + EBAREROM_IMAGE +}; +#ifdef __LINUX__ +const char SLASH_CHAR1 = '/' ; +const char SLASH_CHAR2 = '\\' ; +#define MKDIR(a) mkdir(a,0777) +#else +const char SLASH_CHAR1 = '\\' ; +const char SLASH_CHAR2 = '/' ; +#define MKDIR(a) mkdir(a) +#endif +#define DUMP_HDR_FLAG 0x1 +#define DUMP_VERBOSE_FLAG 0x2 +#define DUMP_DIR_ENTRIES_FLAG 0x4 +#define DUMP_E32_IMG_FLAG 0x8 + +#define LOG_IMAGE_CONTENTS_FLAG 0x10 +#define EXTRACT_FILES_FLAG 0x20 +#define MODE_SIS2IBY 0x40 +#define RECURSIVE_FLAG 0x80 +#define EXTRACT_FILE_SET_FLAG 0x100 + +// maximum buffer size. +#define _MAX_BUFFER_SIZE_ 256 + +class ReaderUtil +{ +public: + static bool IsExecutable(TUint8* Uids1); +}; + +class ImageReaderException +{ +public: + ImageReaderException(const char* aFile, const char* aErrMessage); + virtual ~ImageReaderException(){} + virtual void Report(); + + string iImgFileName; + string iErrMessage; +}; + +class ImageReaderUsageException : public ImageReaderException +{ +public: + ImageReaderUsageException(const char* aFile, const char* aErrMessage); + void Report(); +}; + +ostream& DumpInHex(char* aDesc, TUint32 aData, bool aContinue = false,TUint aDataWidth=8,\ + char aFiller='0', TUint aMaxDescWidth=28); + +#endif //__IMAGE_READER_COMMON_H_