Ignore:
Timestamp:
2005-05-31T09:41:19+12:00 (19 years ago)
Author:
kjdon
Message:

added in an exitValue/get_exit_value method to the MGPassesWrapper

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl3/src/packages/mg/src/text/mg_passes_4jni.c

    r7630 r9987  
    8181static char *trace_name = NULL;
    8282
     83int mg_passes_exit_value = 0;
     84
    8385typedef struct pass_data
    8486  {
     
    142144  trace_name = NULL;
    143145 
    144  
     146  mg_passes_exit_value = 0;
    145147}
    146148
     
    283285{
    284286  int pass;
    285   if (!filename || *filename == '\0')
     287  if (!filename || *filename == '\0') {
     288    mg_passes_exit_value = 1;
    286289    FatalError (1, "A document collection name must be specified.");
    287 
    288   if ((Passes & (IVF_PASS_1 | IVF_PASS_2)) == (IVF_PASS_1 | IVF_PASS_2))
     290  }
     291
     292  if ((Passes & (IVF_PASS_1 | IVF_PASS_2)) == (IVF_PASS_1 | IVF_PASS_2)) {
     293    mg_passes_exit_value = 1;
    289294    FatalError (1, "I1 and I2 cannot be done simultaneously.");
    290295
    291   if ((Passes & (TEXT_PASS_1 | TEXT_PASS_2)) == (TEXT_PASS_1 | TEXT_PASS_2))
     296  }
     297  if ((Passes & (TEXT_PASS_1 | TEXT_PASS_2)) == (TEXT_PASS_1 | TEXT_PASS_2)) {
     298    mg_passes_exit_value = 1;
    292299    FatalError (1, "T1 and T2 cannot be done simultaneously.");
    293 
    294   if (!Passes)
     300  }
     301  if (!Passes) {
     302    mg_passes_exit_value = 1;
    295303    FatalError (1, "S, T1, T2, I1 or I2 must be specified.");
    296 
     304  }
    297305  if (trace)
    298306    {
     
    339347      pd->init_time.tv_usec -= ru.ru_utime.tv_usec + ru.ru_stime.tv_usec;
    340348#endif
    341       if (pd->init (filename) == COMPERROR)
     349      if (pd->init (filename) == COMPERROR) {
     350    mg_passes_exit_value = 1;
    342351    FatalError (1, "Error during init of \"%s\"", pd->name);
    343      
     352      }
    344353#ifdef HAVE_TIMES
    345354      times (&tims);
     
    464473    pd->done_time.tv_usec -= ru.ru_utime.tv_usec + ru.ru_stime.tv_usec;
    465474#endif
    466     if (pd->done (filename) == COMPERROR)
     475    if (pd->done (filename) == COMPERROR) {
     476      mg_passes_exit_value = 1;
    467477      FatalError (1, "Error during done of \"%s\"", pd->name);
    468 
     478    }
    469479#ifdef HAVE_TIMES
    470480    times (&tims);
     
    532542}
    533543
     544int get_exit_value() {
     545  return mg_passes_exit_value;
     546}
Note: See TracChangeset for help on using the changeset viewer.