xref: /aoo41x/main/idl/source/prj/svidl.cxx (revision cdf0e10c)
1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir 
28*cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
29*cdf0e10cSrcweir #include "precompiled_idl.hxx"
30*cdf0e10cSrcweir 
31*cdf0e10cSrcweir #include <stdlib.h>
32*cdf0e10cSrcweir #include <stdio.h>
33*cdf0e10cSrcweir #include <database.hxx>
34*cdf0e10cSrcweir #include <globals.hxx>
35*cdf0e10cSrcweir #include <command.hxx>
36*cdf0e10cSrcweir #include <tools/fsys.hxx>
37*cdf0e10cSrcweir #include <tools/string.hxx>
38*cdf0e10cSrcweir 
39*cdf0e10cSrcweir #define BR 0x8000
40*cdf0e10cSrcweir sal_Bool FileMove_Impl( const String & rFile1, const String & rFile2, sal_Bool bImmerVerschieben )
41*cdf0e10cSrcweir {
42*cdf0e10cSrcweir 	//printf( "Move from %s to %s\n", rFile2.GetStr(), rFile1.GetStr() );
43*cdf0e10cSrcweir 	sal_uLong nC1 = 0;
44*cdf0e10cSrcweir 	sal_uLong nC2 = 1;
45*cdf0e10cSrcweir 	if( !bImmerVerschieben )
46*cdf0e10cSrcweir 	{
47*cdf0e10cSrcweir 		SvFileStream aOutStm1( rFile1, STREAM_STD_READ );
48*cdf0e10cSrcweir 		SvFileStream aOutStm2( rFile2, STREAM_STD_READ );
49*cdf0e10cSrcweir 		if( aOutStm1.GetError() == SVSTREAM_OK )
50*cdf0e10cSrcweir 		{
51*cdf0e10cSrcweir 			sal_uInt8 * pBuf1 = new sal_uInt8[ BR ];
52*cdf0e10cSrcweir 			sal_uInt8 * pBuf2 = new sal_uInt8[ BR ];
53*cdf0e10cSrcweir 			nC1 = aOutStm1.Read( pBuf1, BR );
54*cdf0e10cSrcweir 			nC2 = aOutStm2.Read( pBuf2, BR );
55*cdf0e10cSrcweir 			while( nC1 == nC2 )
56*cdf0e10cSrcweir 			{
57*cdf0e10cSrcweir 				if( memcmp( pBuf1, pBuf2, nC1 ) )
58*cdf0e10cSrcweir 				{
59*cdf0e10cSrcweir 					nC1++;
60*cdf0e10cSrcweir 					break;
61*cdf0e10cSrcweir 				}
62*cdf0e10cSrcweir 				else
63*cdf0e10cSrcweir 				{
64*cdf0e10cSrcweir 					if( 0x8000 != nC1 )
65*cdf0e10cSrcweir 						break;
66*cdf0e10cSrcweir 					nC1 = aOutStm1.Read( pBuf1, BR );
67*cdf0e10cSrcweir 					nC2 = aOutStm2.Read( pBuf2, BR );
68*cdf0e10cSrcweir 				}
69*cdf0e10cSrcweir 			}
70*cdf0e10cSrcweir 			delete[] pBuf1;
71*cdf0e10cSrcweir 			delete[] pBuf2;
72*cdf0e10cSrcweir 		}
73*cdf0e10cSrcweir 	}
74*cdf0e10cSrcweir 	DirEntry aF2( rFile2 );
75*cdf0e10cSrcweir 	if( nC1 != nC2 )
76*cdf0e10cSrcweir 	{// es hat sich etwas geaendert
77*cdf0e10cSrcweir 		DirEntry aF1( rFile1 );
78*cdf0e10cSrcweir 		aF1.Kill();
79*cdf0e10cSrcweir 		// Datei verschieben
80*cdf0e10cSrcweir 		if( aF2.MoveTo( aF1 ) )
81*cdf0e10cSrcweir 		{
82*cdf0e10cSrcweir 			// Beide Dateien loeschen
83*cdf0e10cSrcweir 			aF1.Kill();
84*cdf0e10cSrcweir 			aF2.Kill();
85*cdf0e10cSrcweir 			return sal_False;
86*cdf0e10cSrcweir 		}
87*cdf0e10cSrcweir /*
88*cdf0e10cSrcweir 		else
89*cdf0e10cSrcweir 		{
90*cdf0e10cSrcweir 			printf( "%s to %s moved\n",
91*cdf0e10cSrcweir 					 rFile2.GetStr(), rFile1.GetStr() );
92*cdf0e10cSrcweir 		}
93*cdf0e10cSrcweir */
94*cdf0e10cSrcweir 		return sal_True;
95*cdf0e10cSrcweir 	}
96*cdf0e10cSrcweir 	return 0 == aF2.Kill();
97*cdf0e10cSrcweir }
98*cdf0e10cSrcweir 
99*cdf0e10cSrcweir /*************************************************************************
100*cdf0e10cSrcweir |*	  main()
101*cdf0e10cSrcweir |*
102*cdf0e10cSrcweir |*	  Beschreibung
103*cdf0e10cSrcweir *************************************************************************/
104*cdf0e10cSrcweir #if defined( UNX ) || (defined( PM2 ) && defined( CSET )) || defined (WTC) || defined (MTW) || defined (__MINGW32__) || defined( OS2 )
105*cdf0e10cSrcweir int main ( int argc, char ** argv)
106*cdf0e10cSrcweir {
107*cdf0e10cSrcweir #else
108*cdf0e10cSrcweir int cdecl main ( int argc, char ** argv)
109*cdf0e10cSrcweir {
110*cdf0e10cSrcweir #endif
111*cdf0e10cSrcweir 
112*cdf0e10cSrcweir /*
113*cdf0e10cSrcweir     pStr = ::ResponseFile( &aCmdLine, argv, argc );
114*cdf0e10cSrcweir 	if( pStr )
115*cdf0e10cSrcweir 	{
116*cdf0e10cSrcweir 		printf( "Cannot open response file <%s>\n", pStr );
117*cdf0e10cSrcweir 		return( 1 );
118*cdf0e10cSrcweir 	};
119*cdf0e10cSrcweir */
120*cdf0e10cSrcweir 
121*cdf0e10cSrcweir     String aTmpListFile;
122*cdf0e10cSrcweir     String aTmpSlotMapFile;
123*cdf0e10cSrcweir     String aTmpSfxItemFile;
124*cdf0e10cSrcweir     String aTmpDataBaseFile;
125*cdf0e10cSrcweir     String aTmpCallingFile;
126*cdf0e10cSrcweir     String aTmpSrcFile;
127*cdf0e10cSrcweir     String aTmpCxxFile;
128*cdf0e10cSrcweir     String aTmpHxxFile;
129*cdf0e10cSrcweir     String aTmpHelpIdFile;
130*cdf0e10cSrcweir     String aTmpCSVFile;
131*cdf0e10cSrcweir     String aTmpDocuFile;
132*cdf0e10cSrcweir 
133*cdf0e10cSrcweir 	SvCommand aCommand( argc, argv );
134*cdf0e10cSrcweir 
135*cdf0e10cSrcweir     if( aCommand.nVerbosity != 0 )
136*cdf0e10cSrcweir         printf( "StarView Interface Definition Language (IDL) Compiler 3.0\n" );
137*cdf0e10cSrcweir 
138*cdf0e10cSrcweir 	Init();
139*cdf0e10cSrcweir 	SvIdlWorkingBase * pDataBase = new SvIdlWorkingBase(aCommand);
140*cdf0e10cSrcweir 
141*cdf0e10cSrcweir 	int nExit = 0;
142*cdf0e10cSrcweir 	if( aCommand.aExportFile.Len() )
143*cdf0e10cSrcweir 	{
144*cdf0e10cSrcweir 		DirEntry aDE( aCommand.aExportFile );
145*cdf0e10cSrcweir 		pDataBase->SetExportFile( aDE.GetName() );
146*cdf0e10cSrcweir 	}
147*cdf0e10cSrcweir 
148*cdf0e10cSrcweir 	if( ReadIdl( pDataBase, aCommand ) )
149*cdf0e10cSrcweir 	{
150*cdf0e10cSrcweir 		if( nExit == 0 && aCommand.aDocuFile.Len() )
151*cdf0e10cSrcweir 		{
152*cdf0e10cSrcweir 			DirEntry aDE( aCommand.aDocuFile );
153*cdf0e10cSrcweir 			aDE.ToAbs();
154*cdf0e10cSrcweir 			aTmpDocuFile = aDE.GetPath().TempName().GetFull();
155*cdf0e10cSrcweir 			SvFileStream aOutStm( aTmpDocuFile, STREAM_READWRITE | STREAM_TRUNC );
156*cdf0e10cSrcweir 			if( !pDataBase->WriteDocumentation( aOutStm ) )
157*cdf0e10cSrcweir 			{
158*cdf0e10cSrcweir 				nExit = -1;
159*cdf0e10cSrcweir 				ByteString aStr = "cannot write documentation file: ";
160*cdf0e10cSrcweir                 aStr += ByteString( aCommand.aDocuFile, RTL_TEXTENCODING_UTF8 );
161*cdf0e10cSrcweir                 fprintf( stderr, "%s\n", aStr.GetBuffer() );
162*cdf0e10cSrcweir 			}
163*cdf0e10cSrcweir 		}
164*cdf0e10cSrcweir 		if( nExit == 0 && aCommand.aListFile.Len() )
165*cdf0e10cSrcweir 		{
166*cdf0e10cSrcweir 			DirEntry aDE( aCommand.aListFile );
167*cdf0e10cSrcweir 			aDE.ToAbs();
168*cdf0e10cSrcweir 			aTmpListFile = aDE.GetPath().TempName().GetFull();
169*cdf0e10cSrcweir 			SvFileStream aOutStm( aTmpListFile, STREAM_READWRITE | STREAM_TRUNC );
170*cdf0e10cSrcweir 			if( !pDataBase->WriteSvIdl( aOutStm ) )
171*cdf0e10cSrcweir 			{
172*cdf0e10cSrcweir 				nExit = -1;
173*cdf0e10cSrcweir 				ByteString aStr = "cannot write list file: ";
174*cdf0e10cSrcweir                 aStr += ByteString( aCommand.aListFile, RTL_TEXTENCODING_UTF8 );
175*cdf0e10cSrcweir                 fprintf( stderr, "%s\n", aStr.GetBuffer() );
176*cdf0e10cSrcweir 			}
177*cdf0e10cSrcweir 		}
178*cdf0e10cSrcweir 		if( nExit == 0 && aCommand.aSlotMapFile.Len() )
179*cdf0e10cSrcweir 		{
180*cdf0e10cSrcweir 			DirEntry aDE( aCommand.aSlotMapFile );
181*cdf0e10cSrcweir 			aDE.ToAbs();
182*cdf0e10cSrcweir 			aTmpSlotMapFile = aDE.GetPath().TempName().GetFull();
183*cdf0e10cSrcweir 			SvFileStream aOutStm( aTmpSlotMapFile, STREAM_READWRITE | STREAM_TRUNC );
184*cdf0e10cSrcweir 			if( !pDataBase->WriteSfx( aOutStm ) )
185*cdf0e10cSrcweir 			{
186*cdf0e10cSrcweir 				nExit = -1;
187*cdf0e10cSrcweir 				ByteString aStr = "cannot write slotmap file: ";
188*cdf0e10cSrcweir                 aStr += ByteString( aCommand.aSlotMapFile, RTL_TEXTENCODING_UTF8 );
189*cdf0e10cSrcweir                 fprintf( stderr, "%s\n", aStr.GetBuffer() );
190*cdf0e10cSrcweir 			}
191*cdf0e10cSrcweir 		}
192*cdf0e10cSrcweir 		if( nExit == 0 && aCommand.aHelpIdFile.Len() )
193*cdf0e10cSrcweir 		{
194*cdf0e10cSrcweir 			DirEntry aDE( aCommand.aHelpIdFile );
195*cdf0e10cSrcweir 			aDE.ToAbs();
196*cdf0e10cSrcweir 			aTmpHelpIdFile = aDE.GetPath().TempName().GetFull();
197*cdf0e10cSrcweir 			SvFileStream aStm( aTmpHelpIdFile, STREAM_READWRITE | STREAM_TRUNC );
198*cdf0e10cSrcweir 			if (!pDataBase->WriteHelpIds( aStm ) )
199*cdf0e10cSrcweir 			{
200*cdf0e10cSrcweir 				nExit = -1;
201*cdf0e10cSrcweir 				ByteString aStr = "cannot write help ID file: ";
202*cdf0e10cSrcweir                 aStr += ByteString( aCommand.aHelpIdFile, RTL_TEXTENCODING_UTF8 );
203*cdf0e10cSrcweir                 fprintf( stderr, "%s\n", aStr.GetBuffer() );
204*cdf0e10cSrcweir 			}
205*cdf0e10cSrcweir 		}
206*cdf0e10cSrcweir 		if( nExit == 0 && aCommand.aCSVFile.Len() )
207*cdf0e10cSrcweir 		{
208*cdf0e10cSrcweir 			DirEntry aDE( aCommand.aCSVFile );
209*cdf0e10cSrcweir 			aDE.ToAbs();
210*cdf0e10cSrcweir 			aTmpCSVFile = aDE.GetPath().TempName().GetFull();
211*cdf0e10cSrcweir 			SvFileStream aStm( aTmpCSVFile, STREAM_READWRITE | STREAM_TRUNC );
212*cdf0e10cSrcweir 			if (!pDataBase->WriteCSV( aStm ) )
213*cdf0e10cSrcweir 			{
214*cdf0e10cSrcweir 				nExit = -1;
215*cdf0e10cSrcweir 				ByteString aStr = "cannot write CSV file: ";
216*cdf0e10cSrcweir                 aStr += ByteString( aCommand.aCSVFile, RTL_TEXTENCODING_UTF8 );
217*cdf0e10cSrcweir                 fprintf( stderr, "%s\n", aStr.GetBuffer() );
218*cdf0e10cSrcweir 			}
219*cdf0e10cSrcweir 		}
220*cdf0e10cSrcweir 		if( nExit == 0 && aCommand.aSfxItemFile.Len() )
221*cdf0e10cSrcweir 		{
222*cdf0e10cSrcweir 			DirEntry aDE( aCommand.aSfxItemFile );
223*cdf0e10cSrcweir 			aDE.ToAbs();
224*cdf0e10cSrcweir 			aTmpSfxItemFile = aDE.GetPath().TempName().GetFull();
225*cdf0e10cSrcweir 			SvFileStream aOutStm( aTmpSfxItemFile, STREAM_READWRITE | STREAM_TRUNC );
226*cdf0e10cSrcweir 			if( !pDataBase->WriteSfxItem( aOutStm ) )
227*cdf0e10cSrcweir 			{
228*cdf0e10cSrcweir 				nExit = -1;
229*cdf0e10cSrcweir 				ByteString aStr = "cannot write item file: ";
230*cdf0e10cSrcweir                 aStr += ByteString( aCommand.aSfxItemFile, RTL_TEXTENCODING_UTF8 );
231*cdf0e10cSrcweir                 fprintf( stderr, "%s\n", aStr.GetBuffer() );
232*cdf0e10cSrcweir 			}
233*cdf0e10cSrcweir 		}
234*cdf0e10cSrcweir 		if( nExit == 0 && aCommand.aDataBaseFile.Len() )
235*cdf0e10cSrcweir 		{
236*cdf0e10cSrcweir 			DirEntry aDE( aCommand.aDataBaseFile );
237*cdf0e10cSrcweir 			aDE.ToAbs();
238*cdf0e10cSrcweir 			aTmpDataBaseFile = aDE.GetPath().TempName().GetFull();
239*cdf0e10cSrcweir 			SvFileStream aOutStm( aTmpDataBaseFile, STREAM_READWRITE | STREAM_TRUNC );
240*cdf0e10cSrcweir 			pDataBase->Save( aOutStm, aCommand.nFlags );
241*cdf0e10cSrcweir 			if( aOutStm.GetError() != SVSTREAM_OK )
242*cdf0e10cSrcweir 			{
243*cdf0e10cSrcweir 				nExit = -1;
244*cdf0e10cSrcweir 				ByteString aStr = "cannot write database file: ";
245*cdf0e10cSrcweir                 aStr += ByteString( aCommand.aDataBaseFile, RTL_TEXTENCODING_UTF8 );
246*cdf0e10cSrcweir                 fprintf( stderr, "%s\n", aStr.GetBuffer() );
247*cdf0e10cSrcweir 			}
248*cdf0e10cSrcweir 		}
249*cdf0e10cSrcweir /*
250*cdf0e10cSrcweir 		if( nExit == 0 && aCommand.aCallingFile.Len() )
251*cdf0e10cSrcweir 		{
252*cdf0e10cSrcweir 			DirEntry aDE( aCommand.aCallingFile );
253*cdf0e10cSrcweir 			aDE.ToAbs();
254*cdf0e10cSrcweir 			aTmpCallingFile = aDE.GetPath().TempName().GetFull();
255*cdf0e10cSrcweir 			SvFileStream aOutStm( aTmpCallingFile, STREAM_READWRITE | STREAM_TRUNC );
256*cdf0e10cSrcweir 			pDataBase->WriteSbx( aOutStm );
257*cdf0e10cSrcweir 			//pDataBase->Save( aOutStm, aCommand.nFlags | IDL_WRITE_CALLING );
258*cdf0e10cSrcweir 			if( aOutStm.GetError() != SVSTREAM_OK )
259*cdf0e10cSrcweir 			{
260*cdf0e10cSrcweir 				nExit = -1;
261*cdf0e10cSrcweir 				ByteString aStr = "cannot write calling file: ";
262*cdf0e10cSrcweir 				aStr += aCommand.aCallingFile;
263*cdf0e10cSrcweir 				fprintf( stderr, "%s\n", aStr.GetStr() );
264*cdf0e10cSrcweir 			}
265*cdf0e10cSrcweir 		}
266*cdf0e10cSrcweir 		if( nExit == 0 && aCommand.aCxxFile.Len() )
267*cdf0e10cSrcweir 		{
268*cdf0e10cSrcweir 			DirEntry aDE( aCommand.aCxxFile );
269*cdf0e10cSrcweir 			aDE.ToAbs();
270*cdf0e10cSrcweir 			aTmpCxxFile = aDE.GetPath().TempName().GetFull();
271*cdf0e10cSrcweir 			SvFileStream aOutStm( aTmpCxxFile, STREAM_READWRITE | STREAM_TRUNC );
272*cdf0e10cSrcweir 
273*cdf0e10cSrcweir 			aOutStm << "#pragma hdrstop" << endl;
274*cdf0e10cSrcweir 			aOutStm << "#include <";
275*cdf0e10cSrcweir 			if( aCommand.aHxxFile.Len() )
276*cdf0e10cSrcweir                 aOutStm << DirEntry(aCommand.aHxxFile).GetName().GetBuffer();
277*cdf0e10cSrcweir 			else
278*cdf0e10cSrcweir 			{
279*cdf0e10cSrcweir 				DirEntry aDE( aCommand.aCxxFile );
280*cdf0e10cSrcweir 				aDE.SetExtension( "hxx" );
281*cdf0e10cSrcweir                 aOutStm << aDE.GetName().GetBuffer);
282*cdf0e10cSrcweir 			}
283*cdf0e10cSrcweir 			aOutStm << '>' << endl;
284*cdf0e10cSrcweir 			if( !pDataBase->WriteCxx( aOutStm ) )
285*cdf0e10cSrcweir 			{
286*cdf0e10cSrcweir 				nExit = -1;
287*cdf0e10cSrcweir 				ByteString aStr = "cannot write cxx file: ";
288*cdf0e10cSrcweir                 aStr += ByteString( aCommand.aCxxFile, RTL_TEXTENCODING_UTF8 );
289*cdf0e10cSrcweir                 fprintf( stderr, "%s\n", aStr.GetBuffer() );
290*cdf0e10cSrcweir 			}
291*cdf0e10cSrcweir 		}
292*cdf0e10cSrcweir 		if( nExit == 0 && aCommand.aHxxFile.Len() )
293*cdf0e10cSrcweir 		{
294*cdf0e10cSrcweir 			DirEntry aDE( aCommand.aHxxFile );
295*cdf0e10cSrcweir 			aDE.ToAbs();
296*cdf0e10cSrcweir 			aTmpHxxFile = aDE.GetPath().TempName().GetFull();
297*cdf0e10cSrcweir 			SvFileStream aOutStm( aTmpHxxFile, STREAM_READWRITE | STREAM_TRUNC );
298*cdf0e10cSrcweir 
299*cdf0e10cSrcweir 			aOutStm << "#include <somisc.hxx>" << endl;
300*cdf0e10cSrcweir 			if( !pDataBase->WriteHxx( aOutStm ) )
301*cdf0e10cSrcweir 			{
302*cdf0e10cSrcweir 				nExit = -1;
303*cdf0e10cSrcweir 				ByteString aStr = "cannot write cxx file: ";
304*cdf0e10cSrcweir                 aStr += ByteString( aCommand.aHxxFile, RTL_TEXTENCODING_UTF8 );
305*cdf0e10cSrcweir                 fprintf( stderr, "%s\n", aStr.GetBuffer() );
306*cdf0e10cSrcweir 			}
307*cdf0e10cSrcweir 		}
308*cdf0e10cSrcweir  */
309*cdf0e10cSrcweir 	}
310*cdf0e10cSrcweir 	else
311*cdf0e10cSrcweir 		nExit = -1;
312*cdf0e10cSrcweir 
313*cdf0e10cSrcweir 	if( nExit == 0 )
314*cdf0e10cSrcweir 	{
315*cdf0e10cSrcweir 		sal_Bool bErr = sal_False;
316*cdf0e10cSrcweir 		sal_Bool bDoMove = aCommand.aTargetFile.Len() == 0;
317*cdf0e10cSrcweir 		String aErrFile, aErrFile2;
318*cdf0e10cSrcweir 		if( !bErr && aCommand.aListFile.Len() )
319*cdf0e10cSrcweir 		{
320*cdf0e10cSrcweir 			bErr |= !FileMove_Impl( aCommand.aListFile, aTmpListFile, bDoMove );
321*cdf0e10cSrcweir 			if( bErr ) {
322*cdf0e10cSrcweir 				aErrFile = aCommand.aListFile;
323*cdf0e10cSrcweir 				aErrFile2 = aTmpListFile;
324*cdf0e10cSrcweir 			}
325*cdf0e10cSrcweir 		}
326*cdf0e10cSrcweir 		if( !bErr && aCommand.aSlotMapFile.Len() )
327*cdf0e10cSrcweir 		{
328*cdf0e10cSrcweir 			bErr |= !FileMove_Impl( aCommand.aSlotMapFile, aTmpSlotMapFile, bDoMove );
329*cdf0e10cSrcweir 			if( bErr ) {
330*cdf0e10cSrcweir 				aErrFile = aCommand.aSlotMapFile;
331*cdf0e10cSrcweir 				aErrFile2 = aTmpSlotMapFile;
332*cdf0e10cSrcweir 			}
333*cdf0e10cSrcweir 		}
334*cdf0e10cSrcweir 		if( !bErr && aCommand.aSfxItemFile.Len() )
335*cdf0e10cSrcweir 		{
336*cdf0e10cSrcweir 			bErr |= !FileMove_Impl( aCommand.aSfxItemFile, aTmpSfxItemFile, bDoMove );
337*cdf0e10cSrcweir 			if( bErr ) {
338*cdf0e10cSrcweir 				aErrFile = aCommand.aSfxItemFile;
339*cdf0e10cSrcweir 				aErrFile2 = aTmpSfxItemFile;
340*cdf0e10cSrcweir 			}
341*cdf0e10cSrcweir 		}
342*cdf0e10cSrcweir 		if( !bErr && aCommand.aDataBaseFile.Len() )
343*cdf0e10cSrcweir 		{
344*cdf0e10cSrcweir 			bErr |= !FileMove_Impl( aCommand.aDataBaseFile, aTmpDataBaseFile, bDoMove );
345*cdf0e10cSrcweir 			if( bErr ) {
346*cdf0e10cSrcweir 				aErrFile = aCommand.aDataBaseFile;
347*cdf0e10cSrcweir 				aErrFile2 = aTmpDataBaseFile;
348*cdf0e10cSrcweir 			}
349*cdf0e10cSrcweir 		}
350*cdf0e10cSrcweir 		if( !bErr && aCommand.aCallingFile.Len() )
351*cdf0e10cSrcweir 		{
352*cdf0e10cSrcweir 			bErr |= !FileMove_Impl( aCommand.aCallingFile, aTmpCallingFile, bDoMove );
353*cdf0e10cSrcweir 			if( bErr ) {
354*cdf0e10cSrcweir 				aErrFile = aCommand.aCallingFile;
355*cdf0e10cSrcweir 				aErrFile2 = aTmpCallingFile;
356*cdf0e10cSrcweir 			}
357*cdf0e10cSrcweir 		}
358*cdf0e10cSrcweir 		if( !bErr && aCommand.aCxxFile.Len() )
359*cdf0e10cSrcweir 		{
360*cdf0e10cSrcweir 			bErr |= !FileMove_Impl( aCommand.aCxxFile, aTmpCxxFile, bDoMove );
361*cdf0e10cSrcweir 			if( bErr ) {
362*cdf0e10cSrcweir 				aErrFile = aCommand.aCxxFile;
363*cdf0e10cSrcweir 				aErrFile2 = aTmpCxxFile;
364*cdf0e10cSrcweir 			}
365*cdf0e10cSrcweir 		}
366*cdf0e10cSrcweir 		if( !bErr && aCommand.aHxxFile.Len() )
367*cdf0e10cSrcweir 		{
368*cdf0e10cSrcweir 			bErr |= !FileMove_Impl( aCommand.aHxxFile, aTmpHxxFile, bDoMove );
369*cdf0e10cSrcweir 			if( bErr ) {
370*cdf0e10cSrcweir 				aErrFile = aCommand.aHxxFile;
371*cdf0e10cSrcweir 				aErrFile2 = aTmpHxxFile;
372*cdf0e10cSrcweir 			}
373*cdf0e10cSrcweir 		}
374*cdf0e10cSrcweir 		if( !bErr && aCommand.aHelpIdFile.Len() )
375*cdf0e10cSrcweir 		{
376*cdf0e10cSrcweir 			bErr |= !FileMove_Impl( aCommand.aHelpIdFile, aTmpHelpIdFile, bDoMove );
377*cdf0e10cSrcweir 			if( bErr ) {
378*cdf0e10cSrcweir 				aErrFile = aCommand.aHelpIdFile;
379*cdf0e10cSrcweir 				aErrFile2 = aTmpHelpIdFile;
380*cdf0e10cSrcweir 			}
381*cdf0e10cSrcweir 		}
382*cdf0e10cSrcweir 		if( !bErr && aCommand.aCSVFile.Len() )
383*cdf0e10cSrcweir 		{
384*cdf0e10cSrcweir 			bErr |= !FileMove_Impl( aCommand.aCSVFile, aTmpCSVFile, bDoMove );
385*cdf0e10cSrcweir 			if( bErr ) {
386*cdf0e10cSrcweir 				aErrFile = aCommand.aCSVFile;
387*cdf0e10cSrcweir 				aErrFile2 = aTmpCSVFile;
388*cdf0e10cSrcweir 			}
389*cdf0e10cSrcweir 		}
390*cdf0e10cSrcweir 		if( !bErr && aCommand.aDocuFile.Len() )
391*cdf0e10cSrcweir 		{
392*cdf0e10cSrcweir 			bErr |= !FileMove_Impl( aCommand.aDocuFile, aTmpDocuFile, bDoMove );
393*cdf0e10cSrcweir 			if( bErr ) {
394*cdf0e10cSrcweir 				aErrFile = aCommand.aDocuFile;
395*cdf0e10cSrcweir 				aErrFile2 = aTmpDocuFile;
396*cdf0e10cSrcweir 			}
397*cdf0e10cSrcweir 		}
398*cdf0e10cSrcweir 
399*cdf0e10cSrcweir 		if( bErr )
400*cdf0e10cSrcweir 		{
401*cdf0e10cSrcweir 			nExit = -1;
402*cdf0e10cSrcweir 			ByteString aStr = "cannot move file from: ";
403*cdf0e10cSrcweir             aStr += ByteString( aErrFile2, RTL_TEXTENCODING_UTF8 );
404*cdf0e10cSrcweir             aStr += "\n              to file: ";
405*cdf0e10cSrcweir             aStr += ByteString( aErrFile, RTL_TEXTENCODING_UTF8 );
406*cdf0e10cSrcweir             fprintf( stderr, "%s\n", aStr.GetBuffer() );
407*cdf0e10cSrcweir 		}
408*cdf0e10cSrcweir 		else
409*cdf0e10cSrcweir 		{
410*cdf0e10cSrcweir 			if( aCommand.aTargetFile.Len() )
411*cdf0e10cSrcweir 			{
412*cdf0e10cSrcweir #ifdef ICC
413*cdf0e10cSrcweir 				DirEntry aT(aCommand.aTargetFile);
414*cdf0e10cSrcweir 				aT.Kill();
415*cdf0e10cSrcweir #endif
416*cdf0e10cSrcweir 				// Datei stempeln, da idl korrekt durchlaufen wurde
417*cdf0e10cSrcweir 				SvFileStream aOutStm( aCommand.aTargetFile,
418*cdf0e10cSrcweir 								STREAM_READWRITE | STREAM_TRUNC );
419*cdf0e10cSrcweir 			}
420*cdf0e10cSrcweir 		}
421*cdf0e10cSrcweir 	}
422*cdf0e10cSrcweir 
423*cdf0e10cSrcweir 	if( nExit != 0 )
424*cdf0e10cSrcweir 	{
425*cdf0e10cSrcweir 		if( aCommand.aListFile.Len() )
426*cdf0e10cSrcweir 			DirEntry( aTmpListFile ).Kill();
427*cdf0e10cSrcweir 		if( aCommand.aSlotMapFile.Len() )
428*cdf0e10cSrcweir 			DirEntry( aTmpSlotMapFile ).Kill();
429*cdf0e10cSrcweir 		if( aCommand.aSfxItemFile.Len() )
430*cdf0e10cSrcweir 			DirEntry( aTmpSfxItemFile ).Kill();
431*cdf0e10cSrcweir 		if( aCommand.aDataBaseFile.Len() )
432*cdf0e10cSrcweir 			DirEntry( aTmpDataBaseFile ).Kill();
433*cdf0e10cSrcweir 		if( aCommand.aCallingFile.Len() )
434*cdf0e10cSrcweir 			DirEntry( aTmpCallingFile ).Kill();
435*cdf0e10cSrcweir 		if( aCommand.aCxxFile.Len() )
436*cdf0e10cSrcweir 			DirEntry( aTmpCxxFile ).Kill();
437*cdf0e10cSrcweir 		if( aCommand.aHxxFile.Len() )
438*cdf0e10cSrcweir 			DirEntry( aTmpHxxFile ).Kill();
439*cdf0e10cSrcweir 	}
440*cdf0e10cSrcweir 
441*cdf0e10cSrcweir 	delete pDataBase;
442*cdf0e10cSrcweir 	DeInit();
443*cdf0e10cSrcweir 	if( nExit != 0 )
444*cdf0e10cSrcweir 		fprintf( stderr, "svidl terminated with errors\n" );
445*cdf0e10cSrcweir 	return nExit;
446*cdf0e10cSrcweir }
447*cdf0e10cSrcweir 
448