IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 2, 2008, 6:24:28 PM (18 years ago)
Author:
eugene
Message:

fixes for interger-type vectors; finish imextract upgrade

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branch_20081124/Ohana/src/opihi/dvo/mmextract.c

    r20857 r20873  
    1313  Catalog catalog;
    1414  SkyList *skylist;
    15   PhotCode *code;
    1615  Vector **vec;
    1716  dbField *fields;
     
    2120
    2221  /* defaults */
    23   skylist = NULL;
    24   code = NULL;
    25   fields = NULL;
     22  vec = NULL;
    2623  stack1 = NULL;
    2724  stack2 = NULL;
     25  fields = NULL;
     26  values = NULL;
     27  skylist = NULL;
     28  selection = NULL;
    2829
    2930  if ((N = get_argument (argc, argv, "-h"))) goto help;
     
    5758  // parse the fields to be extracted and returned : last points to end, or first 'where' or 'matched'
    5859  fields = dbCmdlineFields (argc, argv, DVO_TABLE_MEASURE, &last, &Nfields);
    59   if (fields == NULL) return (FALSE);
     60  if (fields == NULL) goto escape;
     61  if (Nfields == 0) {
     62    FreeSkyRegionSelection (selection);
     63    dbFreeFields (fields, Nfields);
     64    dvo_catalog_free (&catalog);
     65    goto help;
     66  }
    6067
    6168  // examine line for 'where' and 'match to'.  neither is required, but order is fixed
     
    298305
    299306escape:
     307  if (vec) free (vec);
     308  if (values) free (values);
    300309  dbFreeFields (fields, Nfields);
    301310  dbFreeStack (stack1, Nstack1);
     
    310319
    311320 help:
    312   gprint (GP_ERR, "USAGE: mextract field[,field,field...] where (expression)\n");
     321  gprint (GP_ERR, "USAGE: mmextract field[,field,field...] where (expression) match to (expression)\n");
     322  gprint (GP_ERR, "  pairs of fields are returned: the first set are restricted by the 'where' expression, the second by the 'match to' expression\n");
    313323
    314324  if ((argc > N + 1) && !strcasecmp (argv[N+1], "fields")) {
     
    362372    return (FALSE);
    363373  }
    364   gprint (GP_ERR, " mextract --help fields : for a complete listing of allowed fields\n");
     374  gprint (GP_ERR, " mmextract --help fields : for a complete listing of allowed fields\n");
    365375  return (FALSE);
    366376}
Note: See TracChangeset for help on using the changeset viewer.