ARM files have from now on relocations of typ RELA and not REL
[AROS.git] / tools / sfdc / Verify.pl
blob0c8f8417f228bd312cdbb7f61483f80bdbe57331
2 ### Class Verify: Verify SFD info #################################################
4 BEGIN {
5 package Verify;
7 sub new {
8 my $proto = shift;
9 my %params = @_;
10 my $class = ref($proto) || $proto;
11 my $self = {};
12 $self->{SFD} = $params{'sfd'};
13 $self->{CNT} = 0;
14 $self->{FUNCS} = {};
15 $self->{ERRORS} = 0;
16 $self->{WARNS} = 0;
17 bless ($self, $class);
18 return $self;
21 sub header {
22 my $self = shift;
23 my $sfd = $self->{SFD};
25 print "Checking SFD for $$sfd{'libname'} ...";
26 $self->{CNT} = 0;
28 if ($#{@{$sfd->{typedefs}}} != -1) {
29 print "\nWarning: SFD uses nonstandard '==typedef' command.";
30 ++$self->{WARNS};
34 sub function {
35 my $self = shift;
36 my %params = @_;
37 my $prototype = $params{'prototype'};
38 my $sfd = $self->{SFD};
40 if ($self->{FUNCS}{$prototype->{funcname}}) {
41 if ($prototype->{private}) {
42 print "\nWarning: Private function $prototype->{funcname}() ".
43 "is defined more than once!";
44 ++$self->{WARNS};
46 else {
47 print "\nError: Public function $prototype->{funcname}() ".
48 "is defined more than once!";
49 ++$self->{ERRORS};
52 else {
53 $self->{FUNCS}{$prototype->{funcname}} = 1;
56 ++$self->{CNT};
59 sub footer {
60 my $self = shift;
61 my $sfd = $self->{SFD};
63 if ($self->{WARNS} != 0 || $self->{ERRORS} != 0) {
64 print "\n$self->{WARNS} warning(s), $self->{ERRORS} error(s); ";
66 die if $self->{ERRORS};
69 printf " $self->{CNT} function%s verified\n", $self->{CNT} == 1 ? "" : "s";