summaryrefslogtreecommitdiff
path: root/regress/style/check_pcb.pl
blob: 5a66a4de1cd89e58093d3fe21002981b67979338 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/env perl
#
# $FML: check_pcb.pl,v 1.1 2003/10/29 14:50:55 fukachan Exp $
#

use strict;
use Carp;
use FileHandle;

my $wh     = new FileHandle "|rev|sort|rev";
my $fn     = '';
my $format = "%23s %30s %3s %s\n";

$| = 1;

printf $format, "module", "function", "", "category";
printf $format, "", "", "<--", "(get value)";
printf $format, "", "", "-->", "(set value)";
print "-" x 80;
print "\n";

while (<>) {
    if (/^sub (\S+)/) {
	$fn = $1;
    }

    if (/pcb->set\("(\S+)",/) {
	printf $wh $format, cleanup($ARGV), $fn, "-->", $1;
    }

    if (/pcb->get\("(\S+)",/) {
	printf $wh $format, cleanup($ARGV), $fn, "<--", $1;
    }
}

exit 0;

sub cleanup
{
    my ($s) = @_;

    $s =~ s@.pm$@@;
    $s =~ s@//@/@g;

    return $s;
}