Ejemplo n.º 1
0
int     main( int argc, char *argv[] ) {
//======================================

// FORTRAN compiler main line.

    int         ret_code;
    char        *opts[MAX_OPTIONS+1];
    char        *p;
#if !defined( __INCL_ERRMSGS__ )
    char        imageName[_MAX_PATH];
#endif

#if !defined( __WATCOMC__ )
    _argc = argc;
    _argv = argv;
#else
    argc = argc;
    argv = argv;
#endif
#if defined( __INCL_ERRMSGS__ )
    __InitError();
    __ErrorInit( NULL );
#else
    _cmdname( imageName );
    __InitResource();
    __ErrorInit( imageName );
#endif
#if defined( _M_IX86 )
    _real87 = _8087 = 0;
#endif
    p = getenv( _WFC );
    if( p != NULL && *p != '\0' ) {
        strcpy( CmdBuff, p );
        p = &CmdBuff[ strlen( p ) ];
        *p = ' ';
        ++p;
    } else {
        p = CmdBuff;
    }
    getcmd( p );
    ret_code = 0;
    InitCompMain();
    if( MainCmdLine( &SrcName, &CmdPtr, opts, CmdBuff ) ) {
        SrcExtn = SDSrcExtn( SrcName ); // parse the file name in case we get
        ProcOpts( opts );               // an error in ProcOpts() so error
        InitPredefinedMacros();         // file can be created
        ret_code = CompMain( CmdBuff );
    } else {
        ShowUsage();
    }
    FiniCompMain();
    __ErrorFini();
    return( ret_code );
}
Ejemplo n.º 2
0
static  bool    ProcCmd( char *buffer ) {
//=======================================

    char        *opt_array[MAX_OPTIONS+1];

    RetCode = _BADCMDLINE;
    if( ParseCmdLine( &SrcName, &CmdPtr, opt_array, buffer ) != FALSE ) {
        RetCode = ProcName();
        if( RetCode == _SUCCESSFUL ) {
            ProcOpts( opt_array );
        }
    }
    return( RetCode == _SUCCESSFUL );
}