IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 21, 2006, 9:17:19 PM (20 years ago)
Author:
jhoblitt
Message:

work around psArg* parsing setting unused options to ""

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTools/src/chiptoolConfig.c

    r6155 r6161  
    77
    88    // Parse the configurations (re-org a la ppImage)
    9     config->site = NULL;            // Site configuration
    10     config->camera = NULL;          // Camera configuration (unused)
    11     config->recipe = NULL;          // Recipe configuration
    12     config->camera_name = NULL;     // Camera name
    13     config->filter = NULL;          // Filter name
     9    config->site    = NULL;             // Site configuration
     10    config->camera  = NULL;             // Camera configuration (unused)
     11    config->recipe  = NULL;             // Recipe configuration
     12    config->camera_name = NULL;         // Camera name
     13    config->filter  = NULL;             // Filter name
     14    config->exp_id  = NULL;             // Exposure ID
     15    config->class   = NULL;             
     16    config->class_id = NULL;           
     17    config->url     = NULL;
    1418
    1519    if (! pmConfigRead(&config->site, &config->camera, &config->recipe, &argc, argv, RECIPE)) {
     
    9498    config->camera_name = psMetadataLookupStr(&status, config->arguments,
    9599        "-inst");
    96     // XXX why is "" being returned when -inst is missing?
    97     if (strcmp(config->camera_name, "") == 0) {
    98         config->camera_name = NULL;
    99     }
    100100    config->exp_id = psMetadataLookupStr(&status, config->arguments, "-exp_id");
    101101    config->class = psMetadataLookupStr(&status, config->arguments, "-class");
     
    103103        "-class_id");
    104104    config->url = psMetadataLookupStr(&status, config->arguments, "-url");
     105
     106    // XXX why is "" being returned when -[foo] isn't specified?
     107#define EMPTY_TO_NULL_STRING(var) \
     108    if (strcmp(var, "") == 0) { \
     109        var = NULL; \
     110    }
     111
     112    EMPTY_TO_NULL_STRING(config->camera_name);
     113    EMPTY_TO_NULL_STRING(config->exp_id);
     114    EMPTY_TO_NULL_STRING(config->class);
     115    EMPTY_TO_NULL_STRING(config->class_id);
     116    EMPTY_TO_NULL_STRING(config->url);
    105117
    106118    // add the input and output images to the arguments list
Note: See TracChangeset for help on using the changeset viewer.