Reject a daemon-excluded destination.
[rsync.git] / support / extern-squish
blobeb8b32e18ff7e78d924f6367b548e3673671299b
1 #!/usr/bin/perl
2 # This script finds extraneous "extern" variables in the *.c files.
3 # Run it from inside the main rsync directory.
5 use strict;
7 my @files = glob('*.c');
9 foreach my $fn (@files) {
10 open(IN, '<', $fn) or die;
11 undef $/; $_ = <IN>; $/ = "\n";
12 close IN;
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;