2004-10-22 20:06:05 +04:00
|
|
|
#!/usr/bin/perl
|
2004-11-22 03:37:56 +03:00
|
|
|
#
|
2005-11-05 22:57:48 +03:00
|
|
|
# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
|
|
|
# University Research and Technology
|
|
|
|
# Corporation. All rights reserved.
|
|
|
|
# Copyright (c) 2004-2005 The University of Tennessee and The University
|
|
|
|
# of Tennessee Research Foundation. All rights
|
|
|
|
# reserved.
|
2015-06-24 06:59:57 +03:00
|
|
|
# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
2004-11-28 23:09:25 +03:00
|
|
|
# University of Stuttgart. All rights reserved.
|
2005-03-24 15:43:37 +03:00
|
|
|
# Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
# All rights reserved.
|
2004-11-22 04:38:40 +03:00
|
|
|
# $COPYRIGHT$
|
2015-06-24 06:59:57 +03:00
|
|
|
#
|
2004-11-22 04:38:40 +03:00
|
|
|
# Additional copyrights may follow
|
2015-06-24 06:59:57 +03:00
|
|
|
#
|
2004-11-22 03:37:56 +03:00
|
|
|
# $HEADER$
|
|
|
|
#
|
2004-10-22 20:06:05 +04:00
|
|
|
#To keep brian happy
|
|
|
|
|
|
|
|
if (scalar(@ARGV) != 1) {
|
|
|
|
print "We need a source tree path\n";
|
|
|
|
exit(3);
|
|
|
|
}
|
|
|
|
|
|
|
|
$source_path = @ARGV[0];
|
|
|
|
|
|
|
|
open(HEADERS, "find $source_path -name *.h |");
|
|
|
|
while(<HEADERS>) {
|
|
|
|
open(TEMP, ">temp.txt");
|
|
|
|
$file_name = $_;
|
|
|
|
print $file_name;
|
|
|
|
open(FILE, "$file_name");
|
|
|
|
while(<FILE>) {
|
|
|
|
s/^(#)([\s|\t]*)(\w)/$1$3/;
|
|
|
|
print TEMP;
|
|
|
|
}
|
|
|
|
close(TEMP);
|
|
|
|
close(FILE);
|
|
|
|
system("mv temp.txt $file_name");
|
|
|
|
}
|
|
|
|
close(HEADERS);
|
|
|
|
|
|
|
|
open(SOURCES, "find $source_path -name *.c |");
|
|
|
|
while(<SOURCES>) {
|
|
|
|
open(TEMP, ">temp.txt");
|
|
|
|
$file_name = $_;
|
|
|
|
print $file_name;
|
|
|
|
open(FILE, "$file_name");
|
|
|
|
while(<FILE>) {
|
|
|
|
s/^(#)([\s|\t]*)(\w)/$1$3/;
|
|
|
|
print TEMP;
|
|
|
|
}
|
|
|
|
close(TEMP);
|
|
|
|
close(FILE);
|
|
|
|
system("mv temp.txt $file_name");
|
|
|
|
}
|
|
|
|
close(SOURCES);
|