2 # This script finds extraneous "extern" variables in the *.c files.
3 # Run it from inside the main rsync directory.
7 my @files = glob('*.c');
9 foreach my $fn (@files) {
10 open(IN
, '<', $fn) or die;
11 undef $/; $_ = <IN>; $/ = "\n";
13 my @externs = /^extern .*?([^[\s(*;&.]+)(?:\[.*?\])?;/mg;
14 foreach my $find (@externs) {
15 my @matches = /(?<!\sstruct )\b(\Q$find\E)\b/g;
16 print $fn, ': ', $find, "\n" if @matches == 1;