IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 12915


Ignore:
Timestamp:
Apr 18, 2007, 4:10:03 PM (19 years ago)
Author:
rhl
Message:

pmConfig no longer owns arg[cv]; propagate camera.config errors up

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/config/pmConfig.c

    r12906 r12915  
    44 *  @author EAM (IfA)
    55 *
    6  *  @version $Revision: 1.88 $ $Name: not supported by cvs2svn $
    7  *  @date $Date: 2007-04-18 22:42:33 $
     6 *  @version $Revision: 1.89 $ $Name: not supported by cvs2svn $
     7 *  @date $Date: 2007-04-19 02:10:03 $
    88 *
    99 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    246246        }
    247247        if (item->type != PS_DATA_STRING) {
    248             psError(PS_ERR_BAD_PARAMETER_TYPE, true, "Element %s in %s metadata is not of type STR.\n",
    249                     item->name, description);
    250             continue;
     248           psTrace("config", 2, "Element %s in %s metadata is not of type STR.\n",
     249                   item->name, description);
     250           continue;
    251251        }
    252252
     
    254254        psMetadata *new = NULL;         // New metadata
    255255        if (!pmConfigFileRead(&new, item->data.str, item->name)) {
    256             psLogMsg("psModules.config", PS_LOG_WARN, "Trouble reading reading %s %s --- "
    257                      "ignored.\n", description, item->name);
     256            psError(PM_ERR_CONFIG, false, "Trouble reading reading %s %s --- "
     257                    "ignored.\n", description, item->name);
    258258            psFree(new);
    259             psMetadataRemoveKey(source, item->name); // Take it out, so it will not trouble us again
    260             continue;
     259            psFree(iter);
     260            return false;
    261261        }
    262262
     
    294294
    295295
    296 pmConfig *pmConfigRead(int *argc, char **argv, char *defaultRecipe)
     296pmConfig *pmConfigRead(int *argc, char **argv, const char *defaultRecipe)
    297297{
    298298    PS_ASSERT_PTR_NON_NULL(argc, NULL);
     
    514514            }
    515515
    516             pmConfigFileRead(&config->camera, cameraFile, "camera");
     516            if (!pmConfigFileRead(&config->camera, cameraFile, "camera")) {
     517                psError(PM_ERR_CONFIG, false, "Problem reading %s", cameraFile);
     518                psFree(config);
     519                return NULL;
     520            }
     521           
    517522            psArgumentRemove(argNum, argc, argv);
    518523
     
    580585
    581586    // load command-line options of the form -recipe NAME RECIPE
    582     pmConfigLoadRecipeArguments(config);
     587    pmConfigLoadRecipeArguments(argc, argv, config);
    583588
    584589    // read in command-line options to specific recipe values
    585     pmConfigLoadRecipeOptions(config, "-D");
    586     pmConfigLoadRecipeOptions(config, "-Di");
    587     pmConfigLoadRecipeOptions(config, "-Df");
    588     pmConfigLoadRecipeOptions(config, "-Db");
    589 
     590    pmConfigLoadRecipeOptions(argc, argv, config, "-D");
     591    pmConfigLoadRecipeOptions(argc, argv, config, "-Di");
     592    pmConfigLoadRecipeOptions(argc, argv, config, "-Df");
     593    pmConfigLoadRecipeOptions(argc, argv, config, "-Db");
    590594
    591595    // check for values that override DB* keywords
Note: See TracChangeset for help on using the changeset viewer.