Index: trunk/psModules/src/camera/pmFPAfileDefine.c
===================================================================
--- trunk/psModules/src/camera/pmFPAfileDefine.c	(revision 15183)
+++ trunk/psModules/src/camera/pmFPAfileDefine.c	(revision 15217)
@@ -20,62 +20,4 @@
 #include "pmFPAConstruct.h"
 
-
-// Get the file rule of interest
-// Look up the name of the set of file rules to use, get that set from the site configuration, and return the
-// appropriate rule from the set.
-static psMetadata *getFileRule(const pmConfig *config, // Configuration
-                               const psMetadata *camera, // Camera configuration of interest
-                               const char *name // Name of rule to read
-    )
-{
-    assert(config);
-    assert(config->site);
-
-    psMetadataItem *item = psMetadataLookup(camera, "FILERULES"); // Item with the file rule of interest
-    if (!item) {
-        psError(PS_ERR_UNEXPECTED_NULL, false, "Unable to find FILERULES in the camera configuration.");
-        return NULL;
-    }
-
-    psMetadata *filerules = NULL;       // File rules from the site configuration
-    switch (item->type) {
-      case PS_DATA_METADATA:
-        // It's what we're after
-        filerules = item->data.md;
-        break;
-      case PS_DATA_STRING: {
-          // It's the name of a file --- read the file, and store it for future use
-          if (!pmConfigFileRead(&filerules, item->data.str, "filerules")) {
-              psError(PM_ERR_CONFIG, false, "Trouble reading reading file rules from %s  --- "
-                      "ignored.\n", item->data.str);
-              psFree(filerules);
-              return NULL;
-          }
-
-          // Muck around under the hood to replace the filename with the metadata; don't try this at home,
-          // kids
-          item->type = PS_DATA_METADATA;
-          psFree(item->data.str);
-          item->data.md = filerules;
-          break;
-      }
-      default:
-        psError(PS_ERR_BAD_PARAMETER_TYPE, true,
-                "Unexpected type for %s (%x) in FILERULES in SITE configuration.",
-                name, item->type);
-        return NULL;
-    }
-
-    // select the name from the FILERULES
-    // check for alias name (type == STR, name is aliased name)
-    bool mdok;                          // Status of MD lookup
-    const char *realname = psMetadataLookupStr(&mdok, filerules, name); // Name of file rule to look up
-    if (!realname || strlen(realname) == 0) {
-        realname = name;
-    }
-
-    return psMetadataLookupMetadata(NULL, filerules, realname);
-}
-
 // Parse an option from a metadata, returning the appropriate integer value
 static int parseOptionInt(const psMetadata *md, // Metadata containing the option
@@ -107,5 +49,5 @@
 
     const psMetadata *camera = (fpa ? fpa->camera : config->camera); // Camera configuration for this file
-    psMetadata *data = getFileRule(config, camera, name); // File rule
+    psMetadata *data = pmConfigFileRule(config, camera, name); // File rule
     if (!data) {
         psError(PS_ERR_IO, true, "Can't find file rule %s!", name);
@@ -198,5 +140,5 @@
     }
 
-    psMetadata *data = getFileRule(config, camera, name); // File rule
+    psMetadata *data = pmConfigFileRule(config, camera, name); // File rule
     if (!data) {
         psError(PS_ERR_IO, true, "Can't find file rule %s!", name);
