|
0
|
1 |
/*
|
|
|
2 |
* Copyright (c) 2006-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 "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: Global defines
|
|
|
15 |
*
|
|
|
16 |
*/
|
|
|
17 |
|
|
|
18 |
|
|
|
19 |
#ifndef __CMD_GLOBALS__
|
|
|
20 |
#define __CMD_GLOBALS__
|
|
|
21 |
|
|
|
22 |
// Program parameter defines
|
|
|
23 |
#define BASELINE "baseline"
|
|
|
24 |
#define CURRENT "current"
|
|
|
25 |
#define BASELINEDIR "baselinedir"
|
|
|
26 |
#define CURRENTDIR "currentdir"
|
|
|
27 |
#define REPORTFILE "reportfile"
|
|
|
28 |
#define BASELINEVERSION "baselineversion"
|
|
|
29 |
#define CURRENTVERSION "currentversion"
|
|
|
30 |
#define COMMANDFILE "commandfile"
|
|
|
31 |
#define RECURSIVE "recursive"
|
|
|
32 |
#define EPOCROOT "epocroot"
|
|
|
33 |
#define FNPARENTNODENAME "headerfilenames"
|
|
|
34 |
#define FNNODENAME "headerfile"
|
|
|
35 |
#define FILEREPLACE "replace"
|
|
|
36 |
#define BASELINEPLAT "baseplatformheaders"
|
|
|
37 |
#define CURRENTPLAT "currentplatformheaders"
|
|
|
38 |
#define BUNDLESIZE "bundlesize"
|
|
|
39 |
#define TEMPDIR "temp"
|
|
|
40 |
#define HEADERSET "set"
|
|
|
41 |
#define BASEFORCEDHEADERSFILE "forcebaseinclude"
|
|
|
42 |
#define CURRENTFORCEDHEADERSFILE "forcecurrentinclude"
|
|
|
43 |
#define DOCURL "docurl"
|
|
|
44 |
#define DISCARDDIRS "excludedirs"
|
|
|
45 |
#define BASEPLATFORMDATA "baseplatformdata"
|
|
|
46 |
#define CURRENTPLATFORMDATA "currentplatformdata"
|
|
|
47 |
#define USETHREAD "usethread"
|
|
|
48 |
|
|
|
49 |
#define RH_EXTENSION ".rh"
|
|
|
50 |
#define WILDCARD_DEFAULT "*.h;*.hrh;*.rsg;*.mbg;*.hpp;*.pan;*.rh"
|
|
|
51 |
|
|
|
52 |
#define TRIMXML "trimxml"
|
|
|
53 |
#if defined(_DEBUG) || defined(DEBUG)
|
|
|
54 |
#define COMMANDLINETEST "cmdtest"
|
|
|
55 |
#endif
|
|
|
56 |
|
|
|
57 |
#define MAX_THREAD_COUNT 3
|
|
|
58 |
#define MAX_THREAD_COUNT2 3
|
|
|
59 |
#define PLATFORM_BUNDLESIZE 20
|
|
|
60 |
|
|
|
61 |
#define PREPROCESS_BUFFERSIZE 5000000
|
|
|
62 |
// Maximum bundle size
|
|
|
63 |
#define MAX_BUNDLESIZE 9999
|
|
|
64 |
// Warning size of bundle
|
|
|
65 |
#define BUNDLESIZE_WARNING 100
|
|
|
66 |
#define STR_ATTRIBUTE_STR "__attribute((gccxml(\"exported\")))"
|
|
|
67 |
|
|
12
|
68 |
#define FORCED_SHAI_HDR "forced_shai.h"
|
|
|
69 |
|
|
0
|
70 |
|
|
|
71 |
// uncomment USE_INCLUDED_GCC_DISTRIBUTION if you want to use a GCCXML distribution that
|
|
|
72 |
// is found in the working directory
|
|
|
73 |
//#define USE_INCLUDED_GCC_DISTRIBUTION
|
|
|
74 |
|
|
|
75 |
// uncomment USE_CUSTOM_GCC_DISTRIBUTION if you want to use a GCCXML distribution that
|
|
|
76 |
// is found from PATH environment variable
|
|
|
77 |
#define USE_CUSTOM_GCC_DISTRIBUTION
|
|
|
78 |
|
|
|
79 |
//#define PROCESS_MULTIPLE
|
|
|
80 |
|
|
|
81 |
// Which environment we're compiling for
|
|
|
82 |
#if defined(_WIN32) || defined(WIN32)
|
|
|
83 |
#define __WIN__
|
|
|
84 |
#define DIR_SEPARATOR '\\'
|
|
|
85 |
#define WILDCARD_ALLFILES "*.*"
|
|
|
86 |
#define XMLCHAR XMLCh
|
|
|
87 |
#define XMLLITERAL(a) (const XMLCh*)a
|
|
|
88 |
|
|
|
89 |
#define ANALYSER_REPORT_DIR_SIZE 2
|
|
|
90 |
#define ANALYSER_HEADER_MAX_LENGTH 3
|
|
|
91 |
#define ANALYSER_HEADER_SIZE 2
|
|
|
92 |
|
|
|
93 |
#define ACCESS _access
|
|
|
94 |
#define APPEND_DIR_SEPARATOR '\\\\'
|
|
|
95 |
|
|
|
96 |
#define GET_FULLY_QUALIFIED_NAME ret.second = KXMLClassString
|
|
|
97 |
#define TO_LOWER_CASE ret = strlwr(tempvar)
|
|
|
98 |
#define TO_UPPER_CASE ret = strupr(tempvar)
|
|
|
99 |
#define REMOVE_FILE_FUNCTION success = DeleteFile(file.c_str());\
|
|
|
100 |
if (success == KErrorRemoveFailed){\
|
|
|
101 |
unsigned long int errorcode = GetLastError();\
|
|
|
102 |
if (errorcode != ERROR_FILE_NOT_FOUND){\
|
|
|
103 |
notRemovedFiles.push_back(file);}}
|
|
|
104 |
|
|
|
105 |
#else
|
|
|
106 |
#define __UNIX__
|
|
|
107 |
#define DIR_SEPARATOR '/'
|
|
|
108 |
#define WILDCARD_ALLFILES "*"
|
|
|
109 |
#define XMLCHAR char
|
|
|
110 |
#define XMLLITERAL(a) a
|
|
|
111 |
|
|
|
112 |
#define ANALYSER_REPORT_DIR_SIZE 0
|
|
|
113 |
#define ANALYSER_HEADER_MAX_LENGTH 1
|
|
|
114 |
#define ANALYSER_HEADER_SIZE 0
|
|
|
115 |
|
|
|
116 |
#define ACCESS access
|
|
|
117 |
#define APPEND_DIR_SEPARATOR '/'
|
|
|
118 |
|
|
|
119 |
#define GET_FULLY_QUALIFIED_NAME if (!GClassString)\
|
|
|
120 |
{GClassString = XMLString::transcode(KXMLClassString);}\
|
|
|
121 |
ret.second = GClassString
|
|
|
122 |
|
|
|
123 |
#define TO_LOWER_CASE for(unsigned int i = 0; i < len; i++)\
|
|
|
124 |
{tempvar[i] = std::tolower(tempvar[i]);}\
|
|
|
125 |
ret = tempvar
|
|
|
126 |
|
|
|
127 |
#define TO_UPPER_CASE for(unsigned int i = 0; i < len; i++)\
|
|
|
128 |
{tempvar[i] = std::toupper(tempvar[i]);}\
|
|
|
129 |
ret = tempvar
|
|
|
130 |
#define REMOVE_FILE_FUNCTION success = unlink(file.c_str());\
|
|
|
131 |
if (success == -1){\
|
|
|
132 |
if (errno != ENOENT){\
|
|
|
133 |
notRemovedFiles.push_back(file); }}
|
|
|
134 |
|
|
|
135 |
#define REMOVE_COMPILATION_ERROR_FILE string filename = "rm compilation_error.txt";\
|
|
|
136 |
system(filename.c_str());
|
|
|
137 |
#endif
|
|
|
138 |
|
|
|
139 |
#ifdef __WIN__
|
|
|
140 |
#pragma warning(disable:4786)
|
|
|
141 |
#pragma warning(disable:4503)
|
|
|
142 |
#endif
|
|
|
143 |
|
|
|
144 |
|
|
|
145 |
#define PARSING_ERRORS_LETHAL
|
|
|
146 |
|
|
|
147 |
#define USE_CPP_HACK
|
|
|
148 |
|
|
|
149 |
#define APPEND_DIRECTORIES_TO_FILENAMES
|
|
|
150 |
|
|
|
151 |
enum parserstate
|
|
|
152 |
{
|
|
|
153 |
EStateSearching = 0,
|
|
|
154 |
EStateReplacing,
|
|
|
155 |
EStateReplaceDone
|
|
|
156 |
};
|
|
|
157 |
|
|
|
158 |
// Parameter types
|
|
|
159 |
// How parameters are set
|
|
|
160 |
enum parmtype
|
|
|
161 |
{
|
|
|
162 |
EParmEnvironment = 0,
|
|
|
163 |
EParmCommandFile,
|
|
|
164 |
EParmCommandLine
|
|
|
165 |
};
|
|
|
166 |
|
|
|
167 |
// How to trim strings
|
|
|
168 |
enum trimtype
|
|
|
169 |
{
|
|
|
170 |
ETrimNone = 0,
|
|
|
171 |
ETrimWhitespaces = 1,
|
|
|
172 |
ETrimNewlines = 2
|
|
|
173 |
};
|
|
|
174 |
|
|
|
175 |
#define STR_EXPORT_HACK "__THIS_IS_EXPORTED__"
|
|
|
176 |
|
|
|
177 |
#if (_MSC_VER >= 1300) && (WINVER < 0x0500)
|
|
|
178 |
//VC7 or later, building with pre-VC7 runtime libraries
|
|
|
179 |
extern "C" long _ftol( double ); //defined by VC6 C libs
|
|
|
180 |
extern "C" inline long _ftol2( double dblSource ) { return _ftol( dblSource ); }
|
|
|
181 |
#endif
|
|
|
182 |
|
|
|
183 |
#endif
|