X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/2909586ede1934c36e43e176909c36998279b2a2..c5d77e9659bb40db09376beb31ba9d23396ae601:/support/extern-squish diff --git a/support/extern-squish b/support/extern-squish new file mode 100755 index 00000000..eb8b32e1 --- /dev/null +++ b/support/extern-squish @@ -0,0 +1,18 @@ +#!/usr/bin/perl +# This script finds extraneous "extern" variables in the *.c files. +# Run it from inside the main rsync directory. + +use strict; + +my @files = glob('*.c'); + +foreach my $fn (@files) { + open(IN, '<', $fn) or die; + undef $/; $_ = ; $/ = "\n"; + close IN; + my @externs = /^extern .*?([^[\s(*;&.]+)(?:\[.*?\])?;/mg; + foreach my $find (@externs) { + my @matches = /(?