Changeset 10437 for trunk/psphot/src/psphotArguments.c
- Timestamp:
- Dec 4, 2006, 11:45:37 AM (20 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/psphotArguments.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotArguments.c
r10427 r10437 13 13 14 14 // load config data from default locations 15 pmConfig *config = pmConfigRead(&argc, argv, "PSPHOT");15 pmConfig *config = pmConfigRead(&argc, argv, PSPHOT_RECIPE); 16 16 if (config == NULL) { 17 17 psError(PSPHOT_ERR_CONFIG, false, "Can't read site configuration"); … … 21 21 // save the following additional recipe values based on command-line options 22 22 // these options override the PSPHOT recipe values loaded from recipe files 23 24 // if the recipe is already defined in config->arguments, supplement 25 // save the recipe options onto config->arguments:RECIPES 26 psMetadata *recipes = psMetadataLookupMetadata(NULL, config->arguments, "RECIPES"); 27 if (!recipes) { 28 recipes = psMetadataAlloc (); 29 psMetadataAddPtr (config->arguments, PS_LIST_TAIL, "RECIPES", PS_DATA_METADATA, "", recipes); 30 } else { 31 psMemIncrRefCounter (recipes); // so we can free options below if not allocated here 32 } 33 // look for the recipe defined in recipes 34 psMetadata *options = psMetadataLookupMetadata(NULL, recipes, "PSPHOT"); 35 if (!options) { 36 options = psMetadataAlloc (); 37 psMetadataAddPtr (recipes, PS_LIST_TAIL, "PSPHOT", PS_DATA_METADATA, "", options); 38 } else { 39 psMemIncrRefCounter (options); // so we can free options below if not allocated here 40 } 23 psMetadata *options = pmConfigRecipeOptions (config, PSPHOT_RECIPE); 41 24 42 25 // run the test model (requires X,Y coordinate) … … 100 83 // drop the local view on the options (saved in config->arguments) 101 84 psFree (options); 102 psFree (recipes);103 85 104 86 // the input file is a required argument; if not found, we will exit
Note:
See TracChangeset
for help on using the changeset viewer.
