Index: trunk/psModules/src/config/Makefile.am
===================================================================
--- trunk/psModules/src/config/Makefile.am	(revision 13420)
+++ trunk/psModules/src/config/Makefile.am	(revision 13591)
@@ -8,4 +8,5 @@
     pmConfigCamera.c \
     pmConfigCommand.c \
+    pmConfigMask.c \
     pmVersion.c \
     pmErrorCodes.c
@@ -16,4 +17,5 @@
     pmConfigCamera.h \
     pmConfigCommand.h \
+    pmConfigMask.h \
     pmVersion.h \
     pmErrorCodes.h
Index: trunk/psModules/src/config/pmConfigMask.c
===================================================================
--- trunk/psModules/src/config/pmConfigMask.c	(revision 13591)
+++ trunk/psModules/src/config/pmConfigMask.c	(revision 13591)
@@ -0,0 +1,40 @@
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <stdio.h>
+#include <string.h>
+#include <pslib.h>
+
+#include "pmConfigMask.h"
+
+
+psMaskType pmConfigMask(const char *masks, const pmConfig *config)
+{
+    PS_ASSERT_STRING_NON_EMPTY(masks, 0);
+
+    psMetadata *recipe = psMetadataLookupMetadata(NULL, config->recipes, "MASKS"); // The recipe
+    if (!recipe) {
+        psError(PS_ERR_UNEXPECTED_NULL, false, "Unable to find MASKS recipe.");
+        return 0;
+    }
+
+    psMaskType mask = 0;                // Mask value, to return
+
+    psArray *names = psStringSplitArray(masks, " ,;", false); // Array of symbolic names
+    for (int i = 0; i < names->n; i++) {
+        const char *name = names->data[i]; // Symbolic name of interest
+        bool mdok;                      // Status of MD lookup
+        psMaskType value = psMetadataLookupU8(&mdok, recipe, name);
+        if (!mdok) {
+            psError(PS_ERR_BAD_PARAMETER_VALUE, false,
+                    "Unable to find mask value for %s in MASK recipe", name);
+            psFree(names);
+            return 0;
+        }
+        mask |= value;
+    }
+    psFree(names);
+
+    return mask;
+}
Index: trunk/psModules/src/config/pmConfigMask.h
===================================================================
--- trunk/psModules/src/config/pmConfigMask.h	(revision 13591)
+++ trunk/psModules/src/config/pmConfigMask.h	(revision 13591)
@@ -0,0 +1,30 @@
+/*  @file pmConfigMask.h
+ *  @brief Mask configuration functions
+ *
+ *  @author Paul Price, IfA
+ *
+ *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2007-06-02 03:51:03 $
+ *  Copyright 2007 Institute for Astronomy, University of Hawaii
+ */
+
+#ifndef PM_CONFIG_MASK_H
+#define PM_CONFIG_MASK_H
+
+#include <pslib.h>
+#include <pmConfig.h>
+
+#define PM_MASKS_RECIPE "MASKS"
+
+/// @addtogroup Config Configuration System
+/// @{
+
+/// Return a mask value given a list of symbolic names
+///
+/// The mask values are derived from the MASKS recipe
+psMaskType pmConfigMask(const char *masks, ///< List of symbolic names, space/comma delimited
+                        const pmConfig *config ///< Configuration
+                        );
+
+
+#endif
