2 ### Class MacroLP: Create a LP-style macro file ###############################
11 my $class = ref($proto) || $proto;
12 my $self = $class->SUPER::new
( @_ );
13 bless ($self, $class);
15 $self->{macros_h
} = "inline/macros.h";
22 my $sfd = $self->{SFD
};
24 $self->SUPER::header
(@_);
26 print "#ifndef __INLINE_MACROS_H\n";
27 print "#include <$self->{macros_h}>\n";
28 print "#endif /* !__INLINE_MACROS_H */\n";
31 if ($$sfd{'base'} ne '') {
32 print "#ifndef $self->{BASE}\n";
33 print "#define $self->{BASE} $$sfd{'base'}\n";
34 print "#endif /* !$self->{BASE} */\n";
42 my $prototype = $params{'prototype'};
43 my $sfd = $self->{SFD
};
45 if ($$prototype{'type'} eq 'function') {
47 $self->{FUNCARGTYPE
} = '';
48 for my $argtype (@
{$$prototype{'argtypes'}}) {
49 if ($argtype =~ /\(\*\)/) {
50 $self->{FUNCARGTYPE
} = $argtype;
55 printf " LP%d%s%s%s(0x%x, ", $$prototype{'numargs'},
56 $prototype->{nr
} ?
"NR" : "",
57 $prototype->{nb
} ?
"NB" : "",
58 $self->{FUNCARGTYPE
} ne '' ?
"FP" : "",
61 if (!$prototype->{nr
}) {
62 print "$$prototype{'return'}, ";
65 print "$$prototype{'funcname'}";
68 $self->SUPER::function_start
(@_);
75 my $prototype = $params{'prototype'};
76 my $argtype = $params{'argtype'};
77 my $argname = $params{'argname'};
78 my $argreg = $params{'argreg'};
79 my $argnum = $params{'argnum'};
80 my $sfd = $self->{SFD
};
82 if ($$prototype{'type'} eq 'function') {
83 if ($argtype =~ /\(\*\)/) {
84 print ", __fpt, $argname, $argreg";
87 print ", $argtype, $argname, $argreg";
91 $self->SUPER::function_arg
(@_);
98 my $prototype = $params{'prototype'};
99 my $sfd = $self->{SFD
};
101 if ($$prototype{'type'} eq 'function') {
102 if (!$prototype->{nb
}) {
103 print ", ,(___base)\\\n";
106 if ($self->{FUNCARGTYPE
} ne '') {
107 my $fa = $self->{FUNCARGTYPE
};
109 $fa =~ s/\(\*\)/(*__fpt)/;
117 $self->SUPER::function_end
(@_);