diff options
Diffstat (limited to 'tools/HPMHookGen/HPMHookGen.pl')
-rwxr-xr-x | tools/HPMHookGen/HPMHookGen.pl | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/tools/HPMHookGen/HPMHookGen.pl b/tools/HPMHookGen/HPMHookGen.pl index 4fa548e44..a77b50a3b 100755 --- a/tools/HPMHookGen/HPMHookGen.pl +++ b/tools/HPMHookGen/HPMHookGen.pl @@ -21,6 +21,7 @@ sub trim($) { sub parse($$) { my ($p, $d) = @_; + $p =~ s/^.*?\)\((.*)\).*$/$1/; # Clean up extra parentheses )(around the arglist) # Retrieve return type @@ -279,19 +280,20 @@ foreach my $file (@files) { # Loop through the xml files $key = "inter_homunculus"; } elsif ($key =~ /homunculus/) { $key = "homun"; - } elsif ($key =~ /irc_bot/) { + } elsif ($key eq "irc_bot_interface") { $key = "ircbot"; - } elsif ($key =~ /log_interface/) { + } elsif ($key eq "log_interface") { $key = "logs"; - } elsif ($key =~ /pc_groups_interface/) { + } elsif ($key eq "pc_groups_interface") { $key = "pcg"; - } elsif ($key =~ /char_interface/) { + } elsif ($key eq "char_interface") { $key = "chr"; } else { $key =~ s/_interface//; } - foreach my $v ($data->{compounddef}->{$filekey}->{sectiondef}->[0]) { # Loop through the sections + my $sectiondef = $data->{compounddef}->{$filekey}->{sectiondef}; + foreach my $v (@$sectiondef) { # Loop through the sections my $memberdef = $v->{memberdef}; foreach my $f (sort { # Sort the members in declaration order according to what the xml says my $astart = $a->{location}->[0]->{bodystart} || $a->{location}->[0]->{line}; @@ -419,7 +421,7 @@ EOF EOF $idx += 2; - $maxlen = length($key."->".$if->{name}) if( length($key."->".$if->{name}) > $maxlen ) + $maxlen = length($key."->".$if->{name}) if( length($key."->".$if->{name}) > $maxlen ); } } print FH <<"EOF"; @@ -464,7 +466,7 @@ EOF foreach my $key (@$keysref) { print FH <<"EOF"; -if( !($key = GET_SYMBOL("$exportsymbols{$key}") ) ) return false; +if( !($key = GET_SYMBOL("$exportsymbols{$key}") ) ) return "$exportsymbols{$key}"; EOF } close FH; |