ifext/src/ifext.cxx
//
// Returns true on success, false on failure
//
Returns true on success, false on failure
Returns true on success false on failure
static bool process_job(iffParser* parser, const char* job)
{
  char src_name[MAX_BUF_SIZE+1], out_name[MAX_BUF_SIZE+1];
  FILE* f = fopen(job, "r");
  if(!f){
    msg("cannot open file $1", catastrophe_sev) << job << eoarg << eom;
    return false;
  }
  int count = 0;
  for(;;){
    int len = read_line(f, src_name);
    if(len==0)
      break;
    len = read_line(f, out_name);
    if(len==0){
      msg("odd number of lines in file $1 (should be even)", catastrophe_sev) << job << eoarg << eom;
      return false;
    }
    ++count;
    parser->add_file(src_name, out_name, iffParser::INPUT);
  }
  if (count == 0) {
    msg("empty job file $1", catastrophe_sev) << job << eoarg << eom;
    return false;
  } else {
    return true;
  }
}
static bool process_job ( iffParser * parser , const char * job ) { char src_name [ MAX_BUF_SIZE + 1 ] , out_name [ MAX_BUF_SIZE + 1 ] ; FILE * f = fopen ( job , " " ) ; if ( ! f ) { msg ( " " , catastrophe_sev ) << job << eoarg << eom ; return false ; } int count = 0 ; for ( ; ; ) { int len = read_line ( f , src_name ) ; if ( len == 0 ) break ; len = read_line ( f , out_name ) ; if ( len == 0 ) { msg ( " " , catastrophe_sev ) << job << eoarg << eom ; return false ; } ++ count ; parser -> add_file ( src_name , out_name , iffParser :: INPUT ) ; } if ( count == 0 ) { msg ( " " , catastrophe_sev ) << job << eoarg << eom ; return false ; } else { return true ; } }
Returns true on success, false on failure
Returns true on success false on failure