IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 20, 2006, 5:36:41 PM (20 years ago)
Author:
eugene
Message:

updated to the new DVO APIs; minor cleanups (unused variables, etc)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/dvo/cmd.c

    r7917 r8427  
    5757    /* lock, load, unlock catalog */
    5858    catalog.filename = skylist[0].filename[j];
    59     switch (lock_catalog (&catalog, LCK_SOFT)) {
    60     case 2:
    61       unlock_catalog (&catalog);
    62     case 0:
    63       continue;
     59    catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_SECF;
     60
     61    // an error exit status here is a significant error
     62    if (!dvo_catalog_open (&catalog, NULL, FALSE, "r")) {
     63      fprintf (stderr, "ERROR: failure to open catalog file %s\n", catalog.filename);
     64      exit (2);
    6465    }
    65     catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_SECF;
    66     if (!load_catalog (&catalog, FALSE)) {
    67       unlock_catalog (&catalog);
    68       continue;
    69     }
    70     unlock_catalog (&catalog);
     66    dvo_catalog_unlock (&catalog);
    7167   
    7268    /* get correct mags, convert to X,Y */
     
    107103      if (M3 != NULL) free (M3);
    108104    }
    109     if (catalog.average != NULL) free (catalog.average);
    110     if (catalog.secfilt != NULL) free (catalog.secfilt);
    111     if (catalog.measure != NULL) free (catalog.measure);
    112     catalog.average = (Average *) NULL;
    113     catalog.secfilt = (SecFilt *) NULL;
    114     catalog.measure = (Measure *) NULL;
     105    dvo_catalog_free (&catalog);
    115106  }
    116107  SkyListFree (skylist, ((RegionName != NULL) || (RegionList != NULL)));
     
    124115escape:
    125116  SkyListFree (skylist, ((RegionName != NULL) || (RegionList != NULL)));
    126   if (catalog.average != NULL) free (catalog.average);
    127   if (catalog.secfilt != NULL) free (catalog.secfilt);
    128   if (catalog.measure != NULL) free (catalog.measure);
     117  dvo_catalog_free (&catalog);
    129118  if (RegionName != NULL) free (RegionName);
    130119  if (RegionList != NULL) free (RegionList);
Note: See TracChangeset for help on using the changeset viewer.