1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
28 // MARKER(update_precomp.py): autogen include statement, do not remove
29 #include "precompiled_rsc.hxx"
37 /*************** G l o b a l e V a r i a b l e n **********************/
38 static RscCompiler
* pRscCompiler
= NULL
;
39 /****************************************************************/
41 /* Function : ExitProgram() */
43 /* Description : Gibt die Temporaeren Dateien frei. */
44 /****************************************************************/
45 #if defined( UNX ) || ( defined( OS2 ) && ( defined( TCPP ) || defined ( GCC )) ) || defined (WTC) || defined (MTW) || defined(__MINGW32__)
46 void ExitProgram( void ){
49 void _Optlink
ExitProgram( void ){
51 void cdecl ExitProgram( void ){
58 RscVerbosity
lcl_determineVerbosity( int argc
, char ** argv
)
60 for ( int i
= 0; i
< argc
; ++i
)
62 if ( argv
[i
] == NULL
)
64 if ( rsc_stricmp( argv
[i
], "-verbose" ) == 0 )
65 return RscVerbosityVerbose
;
66 if ( rsc_stricmp( argv
[i
], "-quiet" ) == 0 )
67 return RscVerbositySilent
;
69 return RscVerbosityNormal
;
72 SAL_IMPLEMENT_MAIN_WITH_ARGS(argc
, argv
) {
75 atexit( ExitProgram
);
77 atexit( ExitProgram
);
80 #if OSL_DEBUG_LEVEL > 1
81 fprintf( stderr
, "debugging %s\n", argv
[0] );
87 RscError
* pErrHdl
= new RscError( lcl_determineVerbosity( argc
, argv
) );
89 RscCmdLine
* pCmdLine
= new RscCmdLine( argc
, (char **)argv
, pErrHdl
);
91 RscCmdLine
* pCmdLine
= new RscCmdLine( argc
, argv
, pErrHdl
);
93 RscTypCont
* pTypCont
= new RscTypCont( pErrHdl
,
96 pCmdLine
->nCommands
);
98 if( pErrHdl
->nErrors
)
101 RscCompiler
* pCompiler
= new RscCompiler( pCmdLine
, pTypCont
);
103 pRscCompiler
= pCompiler
;
104 aError
= pCompiler
->Start();
113 delete pHS
; // wird durch InitRscCompiler erzeugt
121 void RscExit( sal_uInt32 nExit
)
124 printf( "Program exit is %ud\n", (unsigned int)nExit
);