jtageditor is now relatively clean
authorMichael Wiebusch <stratomaster@gmx.net>
Tue, 16 Jul 2013 20:07:58 +0000 (22:07 +0200)
committerMichael Wiebusch <stratomaster@gmx.net>
Tue, 16 Jul 2013 20:07:58 +0000 (22:07 +0200)
tools/jtageditor.pl
tools/xmlOperations.pm

index 3e63c3a93e56f97be8caffc5749f91ab92b15427..3d64e910fb227b947308d30cb0299245665db2a9 100755 (executable)
@@ -2,6 +2,11 @@
 print "Content-type: text/html\n\n";
 
 # TODO
+
+
+
+
+
 # what happens when files are not writable?
 # make sure that error fields are hidden as well!
 
@@ -50,15 +55,7 @@ if ( !keys %cgiHash )
 
 
 
-# some global variables
 
-our $specFile     = "";
-our $configFile      = "";
-our $specFileName = "";
-our $configFileName  = "";
-our $specTree;
-our $configTree;
-our $configMapsType;
 
 
 
@@ -81,9 +78,9 @@ if ( $cgiHash{'print'} eq 'spectree' ) {
   }
   parseConfigAndSpec( $cgiHash{'configFile'} );
   print
-"<div class='ancestorInfo' align='center'>specifications loaded from $specFileName</div>";
+"<div class='ancestorInfo' align='center'>specifications loaded from ".getSpecFileName()."</div>";
 
-  print_registers($specFile);
+  print_registers(getSpecFile());
 }
 
 if ( $cgiHash{'print'} eq 'settree' ) {
@@ -107,7 +104,7 @@ if ( $cgiHash{'print'} eq 'settree' ) {
 
   print_ancestorInfo();
 
-  print_registers($configFile);
+  print_registers(getConfigFile());
 }
 
 if ( defined $cgiHash{'debuginput'} ) {
@@ -259,6 +256,14 @@ sub print_fileSelection {
 }
 
 sub print_registers {
+
+  my $configFile = getConfigFile();
+  my $specFile = getSpecFile();
+  my $configFileName = getConfigFileName();
+  my $specFileName = getSpecFileName();
+  my $configTree = getConfigTree();
+  my $specTree = getSpecTree();
+  
   my $xmlfile = $_[0];
   my $xmltree;
   if ( $xmlfile eq $configFile ) {
@@ -327,6 +332,13 @@ EOF
 
 sub print_fields {
 
+  my $configFile = getConfigFile();
+  my $specFile = getSpecFile();
+  my $configFileName = getConfigFileName();
+  my $specFileName = getSpecFileName();
+  my $configTree = getConfigTree();
+  my $specTree = getSpecTree();
+
   my $register     = $_[1];
   my $xmlfile      = $_[0];
   my $registerName = $register->findvalue("./\@name");
@@ -424,6 +436,12 @@ EOF
 }
 
 sub print_ancestorInfo {
+
+  my $configFile = getConfigFile();
+  my $specFile = getSpecFile();
+  my $configFileName = getConfigFileName();
+  my $specFileName = getSpecFileName();
+  
   print "<div class='ancestorInfo' align='center'>";
 
   #print "my ancestry:<br>";
index 176509cbc7a693468af3e0d1006cae8dfc40ce80..5a6073ec6177b7700291f888bee16855c94e703d 100644 (file)
@@ -7,6 +7,33 @@ my %fileLevelHash;
 my $ancestryTree;
 my @ancestryList;
 
+
+# some global variables
+
+my $specFile     = "";
+my $configFile      = "";
+my $specFileName = "";
+my $configFileName  = "";
+my $specTree;
+my $configTree;
+my $configMapsType;
+
+sub getSpecFile{
+  return $specFile;
+}
+
+sub getConfigFile{
+  return $configFile;
+}
+
+sub getSpecFileName{
+  return $specFileName;
+}
+
+sub getConfigFileName{
+  return $configFileName;
+}
+
 sub getFileLevel{
   return $fileLevelHash{$_[0]};
 }
@@ -15,6 +42,18 @@ sub getAncestryList{
   return @ancestryList;
 }
 
+sub getConfigTree{
+  return $configTree;
+}
+
+sub getSpecTree{
+  return $specTree;
+}
+
+
+
+
+
 ###############################
 ## xml file operations
 ###############################