3 my $mapfile = "../src/ctsim-map.h";
4 my $hhcfile = "ctsim.hhc";
5 my $newhhc = "ctsim-new.hhc";
8 open (MAP, $mapfile) || print "Unable to open map file $mapfile";
10 m|^\W*#define\W+IDH_(\w+)\W+(\w+)|;
11 $map{$1} = $2 if ($1 && $2);
15 open(HHC,$hhcfile) || print "Unable to open existing hhc file $hhcfile";
16 open(NEWHHC,"> $newhhc") || print "Unable to open new hhc file $newhhc";
19 if ($line =~ m|(.*)\#IDH_([A-Za-z_]+)(.*)|) {
21 print NEWHHC $1 . $3 . "\n";
23 print NEWHHC "<param name=\"ID\" value=\"$map{$2}\">\n";
25 print "Warning: unable to find IDH_$varname in $mapfile";
37 rename($newhhc,$hhcfile);