Index: trunk/PS-IPP-Config/lib/PS/IPP/Config.pm
===================================================================
--- trunk/PS-IPP-Config/lib/PS/IPP/Config.pm	(revision 13789)
+++ trunk/PS-IPP-Config/lib/PS/IPP/Config.pm	(revision 13937)
@@ -1,5 +1,5 @@
 # Copyright (c) 2006  Paul Price, Joshua Hoblitt
 #
-# $Id: Config.pm,v 1.61 2007-06-13 19:17:50 eugene Exp $
+# $Id: Config.pm,v 1.62 2007-06-22 00:10:10 price Exp $
 
 package PS::IPP::Config;
@@ -783,4 +783,37 @@
 }
 
+# Given a reduction class name (and a previously defined camera) and a
+# symbolic name for the recipe, return the actual name of the recipe.
+sub reduction
+{
+    my $self = shift;		# Configuration object
+    my $reduction = shift;	# Reduction class
+    my $name = shift;		# Symbolic name of recipe
+
+    unless (defined $self and defined $reduction and defined $name) {
+	carp "Programming error --- inputs undefined";
+	exit($PS_EXIT_PROG_ERROR);
+    }
+
+    my $camera = $self->{camera}; # Camera configuration
+    unless (defined $camera) {
+	carp "Camera has not yet been defined.\n";
+	return undef;
+    }
+    
+    my $classes = metadataLookupMD($camera, "REDUCTION") or # Reduction classes
+	(carp "Can't find REDUCTION in camera configuration.\n" and exit($PS_EXIT_CONFIG_ERROR));
+
+    my $class = metadataLookupMD($classes, $reduction) or # Class of interest
+	(carp "Can't find $reduction in REDUCTION in camera configuration.\n" and
+	 exit($PS_EXIT_CONFIG_ERROR));
+
+    my $actual = metadataLookupStr($class, $name) or # The actual recipe name of interest
+	(carp "Can't find $name in $class in REDUCTION in camera configuration.\n" and
+	 exit($PS_EXIT_CONFIG_ERROR));
+
+    return $actual;
+}
+
 # Interpolate environment variables in a directory (or colon-delimited list of directories)
 sub _interpolate_env
