summaryrefslogtreecommitdiff
path: root/regress/style/check_pcb.pl
blob: 13771ff5ae46eec7de557c90cfc07f6409d16c1b (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
47
#!/usr/bin/env perl
#
# $FML: check_pcb.pl,v 1.2 2004/01/04 13:36:52 fukachan Exp $
#

use strict;
use Carp;
use FileHandle;

my $wh     = new FileHandle "|rev|sort|rev";
my $fn     = '';
my $format = "%-10s %-40s %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;
    $s =~ s@FML/Process/@@g;

    return $s;
}