Changeset 14390


Ignore:
Timestamp:
2022-04-10T23:12:59Z (4 months ago)
Author:
marios
Message:

Create file to hold unused header files

list_headers.pl creates a file that shows all files that use each header
file. It takes some parsing to find if there are files not being used.

The new file contains all unused header files.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/c17_branch/source/list_headers.pl

    r14389 r14390  
    88$result='listfiles.list';
    99
     10# List of unused header files
     11$unused='headers_unused.txt';
     12
    1013print "A list of header files will be placed in ", $hfiles , "\n";
    11 print "All source files using each header will be placed in ", $result , "\n" ;
     14print "All source files using each header will be placed in ", $result , "\n";
     15print "Unused header files will be placed in ", $unused , "\n";
    1216print "This will take a while...\n\n";
    1317
     
    1620open(ioHEADERS,">$hfiles"); #ioHEADERS-Output file
    1721open(LFILE,">$result");
     22open(UFILE,">$unused");
    1823
    1924while(defined($header=glob("*.h")))
     
    2833  $header=$_;
    2934  print LFILE "$header";
    30   $header=~s/\n//; 
     35  $header=~s/\n//;
     36  $nuses = 0;
    3137  while(defined($input=glob("*.h *.cpp")))  #Scanning through the C++ files
    3238  {
     
    3844       {
    3945         print LFILE "\t$input";
     46         $nuses++;
    4047       }     
    4148     }
    4249  }
    4350  print LFILE "\n\n";
     51  print UFILE "$header\n"
     52    if $nuses == 0;
    4453}
    4554close(IHFILE);
    4655close(LFILE);
     56close(UFILE);
    4757#End of program
    48 
    49        
Note: See TracChangeset for help on using the changeset viewer.