bintools/rcomp/inc/main.h
changeset 0 044383f39525
child 590 360bd6b35136
equal deleted inserted replaced
-1:000000000000 0:044383f39525
       
     1 /*
       
     2 * Copyright (c) 2000-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 * VT fix here
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef __MAIN_H__
       
    21 #define __MAIN_H__
       
    22 
       
    23 #ifdef __VC32__ 
       
    24 #pragma warning( disable : 4786 )	// identifier truncated in debugging information.
       
    25 #pragma warning( push, 1 )	// MS STL libraries do not compile cleanly, temporarily set warning level to 1
       
    26 #pragma warning( disable : 4530 )	// and disable this one as well.
       
    27 #pragma warning(disable : 4710 )
       
    28 #endif
       
    29 #include <vector>
       
    30 #include <map>
       
    31 #ifdef __VC32__
       
    32 #pragma warning( pop )
       
    33 #endif
       
    34 
       
    35 // VT fix for Linux
       
    36 #ifdef __LINUX__
       
    37    #include <stdio.h>
       
    38 #endif // LINUX
       
    39 // end VT
       
    40 
       
    41 #include "STRUCTST.H"
       
    42 #include "RCSTACK.H" 
       
    43 #include "INDEXTAB.H"
       
    44 #include "FILELINE.H"
       
    45 #include "Parser.h"
       
    46 #include "qualifar.h"
       
    47 #include "messages.h"
       
    48 
       
    49 struct RlsValue
       
    50 {
       
    51 	RlsValue(const String* aFileName, int aLineNo,
       
    52 		const char*a, TRlsType aType, TRlsCardinality aCard)
       
    53 		: iValue(a), iType(aType), iCardinality(aCard), iCitationCount(0),
       
    54 		iMaximumLength(0xFFFFFFF),
       
    55 		iLineNumber(aLineNo), iFileName(aFileName) { }
       
    56 	RlsValue(const String* aFileName, int aLineNo,
       
    57 		const char*a, TRlsType aType, TRlsCardinality aCard,
       
    58 		unsigned long aMaximumLength)
       
    59 		: iValue(a), iType(aType), iCardinality(aCard), iCitationCount(0),
       
    60 		iMaximumLength(aMaximumLength),
       
    61 		iLineNumber(aLineNo), iFileName(aFileName) { }
       
    62 
       
    63 	String iValue;
       
    64 	TRlsType iType;
       
    65 	TRlsCardinality iCardinality;
       
    66 	int iCitationCount;
       
    67 	unsigned long iMaximumLength;
       
    68 	int iLineNumber;
       
    69 	const String* iFileName;
       
    70 };
       
    71 
       
    72 typedef std::map<String, int, StringLess> TNameIndex;
       
    73 typedef TNameIndex::iterator TNameIndexIterator;
       
    74 
       
    75 
       
    76 // Global data is held in a structure allocated in main(). This is in order for the memory leakage
       
    77 // mechanism to be able see the allocation of this data.
       
    78 struct GlobalData
       
    79 {
       
    80     StructHeaderArray          SHA;
       
    81     ResourceItemArrayStack     RIAStack;
       
    82     StructResourceItemStack    SRIStack;
       
    83     IndexTable                 Index;
       
    84     NameIdMap                  ResourceNameIds;
       
    85     FileLineManager            FileLineHandler;
       
    86     NameIdMap                  EnumValues;
       
    87     std::vector<RlsValue>      RlsValues;
       
    88     TNameIndex                 RlsNameIndex; // index from Label -> RlsValues[]
       
    89     bool                       WarningMultiExplained;
       
    90     StringArray                AllIdentifiers;
       
    91     QualifiedStringArray       UsedIdentifiers;
       
    92     MessageArray               Messages;
       
    93 };
       
    94 
       
    95 extern GlobalData *pG;
       
    96 extern int verbose;
       
    97 extern unsigned short logmemorysetting;		// remove this
       
    98 
       
    99 
       
   100 
       
   101 extern int ParseSourceFile(FILE* aFile, unsigned short aYYDebug);
       
   102 
       
   103 #endif // end VT __MAIN_H__