scanclrmake/src/main.cxx
// ===========================================================================
// Read the named ClearCase config record file,
// identifying source files and their command line options.
//
Read the named ClearCase config record file,
identifying source files and their command line options.
Read the named ClearCase config record file identifying source files and their command line options .
static bool process_file(const char *file_name,
			 const char *compiler_list,
			 const char *output_file,
			 bool verbose,
			 bool allow_any_extension,
			 bool allow_any_flags) {
    ifstream f(file_name, ios::in);
#ifdef ISO_CPP_HEADERS
    bool ok = f.is_open();
#else
    bool ok = f.rdbuf()->is_open();
#endif
    if (!ok) {
	msg("Could not open config record file $1.", catastrophe_sev)
		<< file_name << eoarg << eom;
    }
    ofstream *ofstrm = NULL;
#ifdef hp10
    ostream &ostrm = static_cast<ostream &>(*ofstrm);
    ostream_withassign &os = static_cast<ostream_withassign &>(ostrm);
#endif
    if (output_file != NULL) {
	ofstrm = new ofstream(output_file, ios::out);
#ifdef ISO_CPP_HEADERS
        if (ofstrm == NULL || !ofstrm->is_open()) {
#else
        if (ofstrm == NULL || !ofstrm->rdbuf()->is_open()) {
#endif
	    ok = false;
	    ofstrm = NULL;
	    msg("Could not open output file $1.", catastrophe_sev)
		<< output_file << eoarg << eom;
	}
    }
#ifndef hp10
    ostream &os = (ofstrm != NULL)
		    ? static_cast<ostream &>(*ofstrm)
		    : cout;
#else
    if (NULL == ofstrm)
	os = cout;
    else
	os = *ofstrm;
#endif
    if (ok) {
	ok = CRParser::parseCR(f, file_name, compiler_list, os, verbose,
			       allow_any_extension, allow_any_flags);
    }
    return ok;
}
static bool process_file ( const char * file_name , const char * compiler_list , const char * output_file , bool verbose , bool allow_any_extension , bool allow_any_flags ) { ifstream f ( file_name , ios :: in ) ; #ifdef ISO_CPP_HEADERS bool ok = f . is_open ( ) ; #else bool ok = f . rdbuf ( ) -> is_open ( ) ; #endif if ( ! ok ) { msg ( " " , catastrophe_sev ) << file_name << eoarg << eom ; } ofstream * ofstrm = NULL ; #ifdef hp10 ostream & ostrm = static_cast < ostream & > ( * ofstrm ) ; ostream_withassign & os = static_cast < ostream_withassign & > ( ostrm ) ; #endif if ( output_file != NULL ) { ofstrm = new ofstream ( output_file , ios :: out ) ; #ifdef ISO_CPP_HEADERS if ( ofstrm == NULL || ! ofstrm -> is_open ( ) ) { #else 
        if (ofstrm == NULL || !ofstrm->rdbuf()->is_open()) { #endif 
	    ok = false; ofstrm = NULL ; msg ( " " , catastrophe_sev ) << output_file << eoarg << eom ; } } #ifndef hp10 ostream & os = ( ofstrm != NULL ) ? static_cast < ostream & > ( * ofstrm ) : cout ; #else if ( NULL == ofstrm ) os = cout ; else os = * ofstrm ; #endif if ( ok ) { ok = CRParser :: parseCR ( f , file_name , compiler_list , os , verbose , allow_any_extension , allow_any_flags ) ; } return ok ; }
Read the named ClearCase config record file,
identifying source files and their command line options.
Read the named ClearCase config record file identifying source files and their command line options .
/*
     * Ok, the aCC compiler doesn't like our standard code, so I
     * introduced this hack to get the ofstream assigned to the ostream
     * Either way, os is assigned some kind of output stream below.
     */