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