2 ### Class FD: Create an old-style FD file #####################################
10 my $class = ref($proto) || $proto;
12 $self->{SFD
} = $params{'sfd'};
14 $self->{PRIVATE
} = -1;
16 bless ($self, $class);
22 my $sfd = $self->{SFD
};
24 print "* \"$$sfd{'libname'}\"\n";
25 print "* Automatically generated FD! Do not edit!\n";
26 print "##base _$$sfd{'base'}\n";
28 $self->{PRIVATE
} = -1;
35 my $prototype = $params{'prototype'};
36 my $sfd = $self->{SFD
};
38 if ($prototype->{type
} eq 'function' ||
39 $prototype->{type
} eq 'cfunction') {
40 if ($self->{BIAS
} != $$prototype{'bias'}) {
41 $self->{BIAS
} = $$prototype{'bias'};
42 print "##bias $self->{BIAS}\n";
45 if ($self->{PRIVATE
} != $$prototype{'private'}) {
46 $self->{PRIVATE
} = $$prototype{'private'};
47 print $self->{PRIVATE
} == 1 ?
"##private\n" : "##public\n";
50 if ($self->{VERSION
} != $$prototype{'version'}) {
51 $self->{VERSION
} = $$prototype{'version'};
53 print "*--- functions in V$self->{VERSION} or higher ---\n";
56 if ($$prototype{'comment'} ne '') {
57 my $comment = $$prototype{'comment'};
64 print "$$prototype{'funcname'}(";
65 print join (',', @
{$$prototype{'argnames'}});
68 if ($prototype->{type
} eq 'function') {
69 print join (',', @
{$$prototype{'regs'}});
71 elsif ($prototype->{type
} eq 'cfunction') {
72 print "base," unless $prototype->{nb
};
73 print "$prototype->{subtype}";