Index: trunk/PS-IPP-Config/lib/PS/IPP/Config.pm
===================================================================
--- trunk/PS-IPP-Config/lib/PS/IPP/Config.pm	(revision 12830)
+++ trunk/PS-IPP-Config/lib/PS/IPP/Config.pm	(revision 12836)
@@ -1,5 +1,5 @@
 # Copyright (c) 2006  Paul Price, Joshua Hoblitt
 #
-# $Id: Config.pm,v 1.35 2007-04-13 03:15:04 price Exp $
+# $Id: Config.pm,v 1.36 2007-04-17 01:25:44 eugene Exp $
 
 package PS::IPP::Config;
@@ -380,43 +380,43 @@
 
 # Return an EXTNAME From the EXTNAME.RULE table in the camera configuration
-##  sub extname_rule
-##  {
-##      my $self = shift;		# Configuration object
-##      my $name = shift;		# Name of the EXTNAME to build
-##      my $component = shift;	# For replacing {CHIP.NAME}
-##  
-##      unless (defined $self and defined $name) {
-##  	carp "Programming error";
-##  	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 $extname_rules = metadataLookupMD($camera, 'EXTNAME.RULES');	# File rules
-##      unless (defined $extname_fules) {
-##  	carp "Can't find EXTNAME.RULES in camera configuration.\n";
-##  	return undef;
-##      }
-##  
-##      my $extname = metadataLookupStr($file, $name); # File name
-##      unless (defined $extname) {
-##  	carp "Can't find $name within EXTNAME.RULES in camera configuration.\n";
-##  	return undef;
-##      }
-##  
-##      if ($extname =~ /\{CHIP\.NAME\}/) {
-##  	unless (defined $component) {
-##  	    carp "Programming error";
-##  	    exit($PS_EXIT_PROG_ERROR);
-##  	}
-##  	$extname =~ s/\{CHIP\.NAME\}/$component/;
-##      }
-##  
-##      return $extname;
-##  }   
+sub extname_rule
+{
+    my $self = shift;		# Configuration object
+    my $name = shift;		# Name of the EXTNAME to build
+    my $component = shift;	# For replacing {CHIP.NAME}
+
+    unless (defined $self and defined $name) {
+	carp "Programming error";
+	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 $extname_rules = _mdLookupMD($camera, 'EXTNAME.RULES');	# File rules
+    unless (defined $extname_rules) {
+	carp "Can't find EXTNAME.RULES in camera configuration.\n";
+	return undef;
+    }
+
+    my $extname = _mdLookupStr($extname_rules, $name); # File name
+    unless (defined $extname) {
+	carp "Can't find $name within EXTNAME.RULES in camera configuration.\n";
+	return undef;
+    }
+
+    if ($extname =~ /\{CHIP\.NAME\}/) {
+	unless (defined $component) {
+	    carp "Programming error";
+	    exit($PS_EXIT_PROG_ERROR);
+	}
+	$extname =~ s/\{CHIP\.NAME\}/$component/;
+    }
+
+    return $extname;
+}   
 
 # Return the DVO.CAMERADIR in the camera configuration
