Esempio n. 1
0
extern void AsmFini( void ) {
//***************************

    ObjFini();
    DirFini();
    InsFini();
    SymFini();
}
Esempio n. 2
0
int main( int argc, char **argv )
//*******************************
{
    static char *fname;

#ifndef __WATCOMC__
    _argv = argv;
    _argc = argc;
#endif
    MemInit();
    if( !AsMsgInit() ) {
        return( EXIT_FAILURE );
    }
    if( argc == 1 ) {
        Banner();
        Usage();
    } else if( OptionsInit( --argc, ++argv ) ) {
        Banner();
        if( _IsOption( PRINT_HELP ) ) {
            Usage();
            *argv = NULL;
        } else if( !*argv ) {
            AsOutMessage( stderr, AS_MSG_ERROR );
            AsOutMessage( stderr, NO_FILENAME_SPECIFIED );
            fputc( '\n', stderr );
        }
        while( *argv ) {
            fname = MakeAsmFilename( *argv );
            if( PP_Init( fname, PPFLAG_ASM_COMMENT | PPFLAG_EMIT_LINE, NULL ) != 0 ) {
                AsOutMessage( stderr, UNABLE_TO_OPEN, fname );
                fputc( '\n', stderr );
            } else {
                OptionsPPDefine();
                SymInit();
                InsInit();
                DirInit();
                if( ObjInit( fname ) ) {
                    if( setjmp( AsmParse ) == 0 ) {
                        ErrorCountsReset();
                        DoReport = TRUE;
                        if( !yyparse() ) {
                            CurrLineno--;    // This is the total # of lines
                            ObjRelocsFini(); // Must be done before ErrorReport
                            // and other finis
                        } else {
                            DoReport = FALSE;
                        }
                    } else { // AbortParse() was invoked
                        DoReport = FALSE;
                    }
                    ErrorReport();
                    AsLexerFini();
                    ObjFini();
                }
                DirFini();
                InsFini();
                SymFini();
            }
            PP_Fini();
            ++argv;
        }
    }
    OptionsFini();
    AsMsgFini();
    MemFini();
    return( ExitStatus );
}
Esempio n. 3
0
/*
 * ExitEditor - do just that
 */
void ExitEditor( int rc )
{
#ifdef __WIN__
    WriteProfile();
#endif
#ifdef __IDE__
    IDEFini();
#endif
#ifdef __WIN__
    DDEFini();
#endif
    SaveHistory();
    RestoreInterrupts();
    SwapFileClose();
    WindowSwapFileClose();
    SwapBlockFini();
    ExtendedMemoryFini();
    SelRgnFini();
    LangFiniAll();
    FiniMouse();
    FiniMenu();
    FiniSavebufs();
    FindCmdFini();
    DirFini();
    CurrentWindow = NO_WINDOW;
    FinishWindows();
    ScreenFini();
#ifdef __WIN__
    FiniClrPick();
    FiniFtPick();
    CursorOp( COP_FINI );
    SubclassGenericFini();
    FiniProfile();
#endif
    FiniFileStack();
    DeleteResidentScripts();
    MatchFini();
    FiniKeyMaps();
    ErrorFini();
    FiniCommandLine();
    SSFini();
    HistFini();
    BoundDataFini();
    FTSFini();
    StaticFini();
    VarFini();
    AutoSaveFini();
    FiniConfigFileName();
    miscGlobalsFini();
    ChangeDirectory( HomeDirectory );
#if defined( __NT__ ) && !defined( __WIN__ )
    {
        SetConsoleActiveScreenBuffer( GetStdHandle( STD_OUTPUT_HANDLE ) );
    }
#endif
    MemFree( HomeDirectory );
    MemFree( CurrentDirectory );
#if defined( VI_RCS )
    ViRCSFini();
#endif
    FiniMem();
    exit( rc );

} /* ExitEditor */