summaryrefslogtreecommitdiff
path: root/support/splint/scripts/cslist.pl
diff options
context:
space:
mode:
Diffstat (limited to 'support/splint/scripts/cslist.pl')
-rwxr-xr-xsupport/splint/scripts/cslist.pl40
1 files changed, 40 insertions, 0 deletions
diff --git a/support/splint/scripts/cslist.pl b/support/splint/scripts/cslist.pl
new file mode 100755
index 0000000000..d1df62bc07
--- /dev/null
+++ b/support/splint/scripts/cslist.pl
@@ -0,0 +1,40 @@
+for ($i = 0; $i <= $#ARGV; $i++) {
+
+ open FILE, "<$ARGV[$i]" or die "Cannot open file $ARGV[$i]!\n";
+ $filename = $ARGV[$i];
+
+ while(<FILE>) {
+
+ $text = $_;
+
+ while( $text =~ /(\\newcount|\\newtoks|\\newdimen|\\newif|\\let|\\([exg]|char|toks|count)*def)\w*(\\[a-zA-Z@]+)/g ) {
+
+ $cs = $3;
+ push @all, $cs;
+
+ if ( defined $secse{$cs}->{$filename} ) { $secse{$cs}->{$filename}++; }
+ else { $secse{$cs}->{$filename} = 1; };
+
+ }
+
+ }
+}
+#print keys %secse;
+@alphsecs = sort keys %secse;
+
+foreach $ocs (@alphsecs) {
+
+ print "$ocs %";
+ @fnames = sort keys $secse{$ocs};
+ foreach $fname (@fnames) {
+ print " $fname ($secse{$ocs}->{$fname} occurence";
+ if ( $secse{$ocs}->{$fname} > 1 ) {print "s";}
+ print ")";
+ }
+ print "\n";
+}
+
+print "\n";
+$i = $#alphsecs;
+$i++;
+print "total sequences: $i\n";