Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

149 lines
3.7 KiB

  1. open (AddFile, "AddFile.pl");
  2. @AddFileList = <AddFile>;
  3. close AddFile;
  4. @AddFileList = (MakeVariableList(\@AddFileList));
  5. open (CatSrc, "CatSrc.pl");
  6. @CatSrcList = <CatSrc>;
  7. close CatSrc;
  8. @CatSrcList = (MakeVariableList(\@CatSrcList));
  9. open (Defect, "Defect.pl");
  10. @DefectList = <Defect>;
  11. close Defect;
  12. @DefectList = (MakeVariableList(\@DefectList));
  13. open (DelFile, "DelFile.pl");
  14. @DelFileList = <DelFile>;
  15. close DelFile;
  16. @DelFileList = (MakeVariableList(\@DelFileList));
  17. open (Enlist, "Enlist.pl");
  18. @EnlistList = <Enlist>;
  19. close Enlist;
  20. @EnlistList = (MakeVariableList(\@EnlistList));
  21. open (In, "In.pl");
  22. @InList = <In>;
  23. close In;
  24. @InList = (MakeVariableList(\@InList));
  25. open (Log, "Log.pl");
  26. @LogList = <Log>;
  27. close Log;
  28. @LogList = (MakeVariableList(\@LogList));
  29. open (Out, "Out.pl");
  30. @OutList = <Out>;
  31. close Out;
  32. @OutList = (MakeVariableList(\@OutList));
  33. open (ReDub, "ReDub.pl");
  34. @ReDubList = <ReDub>;
  35. close ReDub;
  36. @ReDubList = (MakeVariableList(\@ReDubList));
  37. open (Scomp, "Scomp.pl");
  38. @ScompList = <Scomp>;
  39. close Scomp;
  40. @ScompList = (MakeVariableList(\@ScompList));
  41. open (Ssync, "Ssync.pl");
  42. @SsyncList = <Ssync>;
  43. close Ssync;
  44. @SsyncList = (MakeVariableList(\@SsyncList));
  45. open (Status, "Status.pl");
  46. @StatusList = <Status>;
  47. close Status;
  48. @StatusList = (MakeVariableList(\@StatusList));
  49. open (WinDiff, "WinDiff.pl");
  50. @WinDiffList = <WinDiff>;
  51. close WinDiff;
  52. @WinDiffList = (MakeVariableList(\@WinDiffList));
  53. open (SlmSubs, "SlmSubs.pm");
  54. @SlmSubsList = <SlmSubs>;
  55. close SlmSubs;
  56. @SlmSubsList = (MakeVariableList(\@SlmSubsList));
  57. @AllScriptVariableList = ();
  58. push @AllScriptVariableList, @AddFileList;
  59. push @AllScriptVariableList, @CatSrcList;
  60. push @AllScriptVariableList, @DefectList;
  61. push @AllScriptVariableList, @DelFileList;
  62. push @AllScriptVariableList, @EnlistList;
  63. push @AllScriptVariableList, @InList;
  64. push @AllScriptVariableList, @LogList;
  65. push @AllScriptVariableList, @OutList;
  66. push @AllScriptVariableList, @ReDubList;
  67. push @AllScriptVariableList, @ScompList;
  68. push @AllScriptVariableList, @SsyncList;
  69. push @AllScriptVariableList, @StatusList;
  70. push @AllScriptVariableList, @WinDiffList;
  71. @GlobalVariableHash = ();
  72. @GlobalVariableList = ();
  73. foreach $ScriptVariableListEntry (@AllScriptVariableList)
  74. {
  75. if (!$GlobalVariableHash{ $ScriptVariableListEntry})
  76. {
  77. push @GlobalVariableList, $ScriptVariableListEntry;
  78. $GlobalVariableHash{ $ScriptVariableListEntry}++;
  79. }
  80. }
  81. foreach $SlmSubsEntry (@SlmSubsList)
  82. {
  83. if ($SlmSubsEntry =~ /([\%\$\@])main::(.*)/)
  84. {
  85. if (!$GlobalVariableHash{ "$1$2"})
  86. {
  87. print "$1$2\n";
  88. }
  89. }
  90. }
  91. sub MakeVariableList
  92. # __________________________________________________________________________________
  93. #
  94. # Takes a list of text lines and pulls the variables out of them and stores them
  95. # in a list
  96. #
  97. # Parameters:
  98. # List reference
  99. #
  100. # Output:
  101. # None
  102. # __________________________________________________________________________________
  103. {
  104. #
  105. # Set @List to First Parameter
  106. #
  107. @ScriptList = @{$_[0]};
  108. @ScriptVariableList = ();
  109. %ScriptVariableHash = ();
  110. foreach $ScriptLine (@ScriptList)
  111. {
  112. #
  113. # Split up $ScriptLine into a list of entries.
  114. #
  115. @ScriptLineVariableList = ($ScriptLine =~ /([\$\@\%][a-zA-Z]+[\w|\:]+)/g);
  116. foreach $ScriptLineVariable (@ScriptLineVariableList)
  117. {
  118. if (!$ScriptVariableHash{ $ScriptLineVariable})
  119. {
  120. push @ScriptVariableList, $ScriptLineVariable;
  121. $ScriptVariableHash{ $ScriptLineVariable}++;
  122. }
  123. }
  124. }
  125. return (sort @ScriptVariableList);
  126. }