toolsandutils/e32tools/elf2e32/source/pl_common.h
changeset 0 83f4b4db085c
child 1 d4b442d23379
equal deleted inserted replaced
-1:000000000000 0:83f4b4db085c
       
     1 // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // Implementation of the Class SymbolAttrib for the elf2e32 tool
       
    15 // @internalComponent
       
    16 // @released
       
    17 // 
       
    18 //
       
    19 
       
    20 #if !defined _PL_COMMON_H_
       
    21 #define _PL_COMMON_H_
       
    22 
       
    23 #ifdef _MSC_VER 
       
    24 	#pragma warning(disable: 4786) // identifier was truncated to '255' characters in the debug information
       
    25 	#pragma warning(disable: 4514) // unreferenced inline function has been removed
       
    26 	#pragma warning(disable: 4702) // unreachable code
       
    27 	#pragma warning(disable: 4710) // function not inlined
       
    28 #endif
       
    29 
       
    30 #include <tools/elfdefs.h>
       
    31 
       
    32 typedef unsigned long	PLULONG;
       
    33 typedef unsigned int	PLUINT32;
       
    34 typedef unsigned short	PLUINT16;
       
    35 typedef unsigned char	PLUCHAR;
       
    36 typedef	int				PLINT32;
       
    37 typedef short			PLINT16;
       
    38 typedef unsigned char	PLUINT8;
       
    39 typedef char			PLCHAR;
       
    40 typedef unsigned int	PLMemAddr32;
       
    41 typedef unsigned int	PLOffset32;
       
    42 typedef unsigned short	PLOffset16;
       
    43 
       
    44 #define DELETE_PTR(aPtr) delete aPtr; aPtr = NULL;
       
    45 #define DELETE_PTR_ARRAY(aPtr) delete[] aPtr; aPtr = NULL;
       
    46 
       
    47 #define ELF_ENTRY_PTR(ptype, base, offset) \
       
    48 	((ptype*)((char*)base + offset))
       
    49 
       
    50 //enum for version category
       
    51 enum VER_CATEGORY{
       
    52 	VER_CAT_NONE = 0,
       
    53 	VER_CAT_DEFINED,
       
    54 	VER_CAT_NEEDED
       
    55 
       
    56 };
       
    57 
       
    58 /**
       
    59 Class for general utility
       
    60 @internalComponent
       
    61 @released
       
    62 */class Util {
       
    63 public:
       
    64 	static unsigned long elf_hash(const unsigned char *name);
       
    65 };
       
    66 
       
    67 /**
       
    68 class for Version info
       
    69 @internalComponent
       
    70 @released
       
    71 */
       
    72 class VersionInfo {
       
    73 public:
       
    74 	VersionInfo();
       
    75 	~VersionInfo();
       
    76 
       
    77 	char*	iSOName;
       
    78 	char*	iLinkAs;
       
    79 	char	iVerCategory;
       
    80 };
       
    81 
       
    82 //enum for e32 dump flag and dumping asm file flag
       
    83 enum TDumpFlags
       
    84 {
       
    85 	EDumpHeader = 1<<0,
       
    86 	EDumpSecurityInfo = 1<<1,
       
    87 	EDumpCode = 1<<2,
       
    88 	EDumpData = 1<<3,
       
    89 	EDumpExports = 1<<4,
       
    90 	EDumpImports = 1<<5,
       
    91 	EDumpAsm = 1<<6, //Added (Only)option for generating assembly code for deffile input.//DumpAsm
       
    92 	EDumpSymbols = 1<<7,//Not added as a default option.
       
    93 	EDumpDefaults = EDumpHeader|EDumpCode|EDumpData|EDumpExports|EDumpImports
       
    94 };
       
    95 
       
    96 #endif //_PL_COMMON_H_
       
    97