Index: /branches/rel10_ifa/psModules/src/config/pmConfig.c
===================================================================
--- /branches/rel10_ifa/psModules/src/config/pmConfig.c	(revision 6568)
+++ /branches/rel10_ifa/psModules/src/config/pmConfig.c	(revision 6569)
@@ -3,6 +3,6 @@
  *  @author PAP, IfA
  *
- *  @version $Revision: 1.7.4.3 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-03-09 03:09:28 $
+ *  @version $Revision: 1.7.4.4 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-03-10 02:05:06 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -23,5 +23,5 @@
     psFree(config->site);
     psFree(config->camera);
-    psFree(config->recipe);
+    psFree(config->recipes);
     psFree(config->arguments);
     psFree(config->database);
@@ -36,5 +36,5 @@
     config->site = NULL;
     config->camera = NULL;
-    config->recipe = NULL;
+    config->recipes = NULL;
     config->arguments = NULL;
     config->database = NULL;
@@ -85,11 +85,10 @@
 pmConfig *pmConfigRead(
     int *argc,
-    char **argv,
-    const char *recipeName)
+    char **argv)
 {
     PS_ASSERT_INT_POSITIVE(*argc, false);
     PS_ASSERT_PTR_NON_NULL(argv, false);
 
-    pmConfig *config = pmConfigAlloc(); // The configuration, containing site, camera and recipe
+    pmConfig *config = pmConfigAlloc(); // The configuration, containing site, camera and recipes
 
     //
@@ -164,23 +163,7 @@
     }
 
-    //
-    // Next, we do a similar thing for the recipe configuration file.  The
-    // file is read and parsed into psMetadata struct "recipe".
-    //
-    //
-    argNum = psArgumentGet(*argc, argv, "-recipe");
-    if (argNum > 0) {
-        psArgumentRemove(argNum, argc, argv);
-        if (argNum >= *argc) {
-            psLogMsg(__func__, PS_LOG_WARN,
-                     "-recipe command-line switch provided without the required filename --- ignored.\n");
-        } else {
-            psArgumentRemove(argNum, argc, argv);
-            readConfig(&config->recipe, argv[argNum], "recipe");
-        }
-    }
-    // Or, load the recipe from the camera file, if appropriate
-    if (! config->recipe && config->camera && recipeName) {
-        pmConfigRecipeFromCamera(config, recipeName);
+    // Load the recipes from the camera file, if appropriate
+    if (! config->recipes && config->camera) {
+        pmConfigReadRecipes(config);
     }
 
@@ -470,4 +453,9 @@
         }
 
+        // Now we have the camera, we can read the recipes
+        if (!config->recipes) {
+            pmConfigReadRecipes(config);
+        }
+
         return format;
     }
@@ -482,11 +470,10 @@
 }
 
-bool pmConfigRecipeFromCamera(
-    pmConfig *config,
-    const char *recipeName)
+bool pmConfigReadRecipes(
+    pmConfig *config
+)
 {
     PS_ASSERT_PTR_NON_NULL(config, false);
     PS_ASSERT_PTR_NON_NULL(config->camera, false);
-    PS_ASSERT_PTR_NON_NULL(recipeName, false);
 
     bool mdok = true;                   // Status of MD lookup
@@ -496,6 +483,22 @@
         return false;
     }
-    psString recipeFileName = psMetadataLookupStr(&mdok, recipes, recipeName);
-    (void)readConfig(&config->recipe, recipeFileName, "recipe");
+    // Go through the recipes and load each one
+    psMetadataIterator *recipesIter = psMetadataIteratorAlloc(recipes, PS_LIST_HEAD, NULL); // Iterator
+    psMetadataItem *recipesItem = NULL; // Item from iteration
+    while ((recipesItem = psMetadataGetAndIncrement(recipesIter))) {
+        if (recipesItem->type != PS_DATA_STRING) {
+            psLogMsg(__func__, PS_LOG_WARN, "Filename for recipe %s isn't of type STR --- ignored.\n",
+                     recipesItem->name);
+            continue;
+        }
+
+        psMetadata *recipe = NULL;      // Recipe from file
+        if (readConfig(&recipe, recipesItem->data.V, "recipe")) {
+            psMetadataAdd(config->recipes, PS_LIST_TAIL, recipesItem->name,
+                          PS_DATA_METADATA | PS_META_REPLACE, recipesItem->comment, recipe);
+        }
+        psFree(recipe);                 // Drop reference
+    }
+    psFree(recipesIter);
 
     return true;
Index: /branches/rel10_ifa/psModules/src/config/pmConfig.h
===================================================================
--- /branches/rel10_ifa/psModules/src/config/pmConfig.h	(revision 6568)
+++ /branches/rel10_ifa/psModules/src/config/pmConfig.h	(revision 6569)
@@ -3,6 +3,6 @@
  *  @author PAP, IfA
  *
- *  @version $Revision: 1.3.4.1 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-03-09 03:09:28 $
+ *  @version $Revision: 1.3.4.2 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-03-10 02:05:10 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -20,5 +20,5 @@
     psMetadata *site;                   // Site configuration
     psMetadata *camera;                 // Camera specification
-    psMetadata *recipe;                 // Recipe for processing
+    psMetadata *recipes;                // Recipes for processing
     psMetadata *arguments;              // Command-line arguments
     psDB *database;                     // Database handle
@@ -46,7 +46,5 @@
 pmConfig *pmConfigRead(
     int *argc,
-    char **argv,
-    const char *recipeName);
-
+    char **argv);
 
 /** pmConfigValidateCamera
@@ -78,12 +76,10 @@
 /** pmConfigRecipeFromCamera
  *
- * pmConfigRecipeFromCamera shall load the recipe configuration based on the
- * recipeName and the list of known recipes contained in the camera
+ * pmConfigRecipeFromCamera shall load the recipes from the list of known recipes contained in the camera
  * configuration.
  *
  */
-bool pmConfigRecipeFromCamera(
-    pmConfig *config,
-    const char *recipeName
+bool pmConfigReadRecipes(
+    pmConfig *config
 );
 
