summaryrefslogtreecommitdiff
path: root/tools/HPMHookGen/HPMDataCheckGen.pl
diff options
context:
space:
mode:
Diffstat (limited to 'tools/HPMHookGen/HPMDataCheckGen.pl')
-rw-r--r--tools/HPMHookGen/HPMDataCheckGen.pl16
1 files changed, 14 insertions, 2 deletions
diff --git a/tools/HPMHookGen/HPMDataCheckGen.pl b/tools/HPMHookGen/HPMDataCheckGen.pl
index 7ec1ba7e4..f950152d1 100644
--- a/tools/HPMHookGen/HPMDataCheckGen.pl
+++ b/tools/HPMHookGen/HPMDataCheckGen.pl
@@ -13,6 +13,8 @@ local $ENV{XML_SIMPLE_PREFERRED_PARSER} = 'XML::Parser'; # 0m4.256s
#local $ENV{XML_SIMPLE_PREFERRED_PARSER} = 'XML::SAX::Expat'; # 0m14.186s
#local $ENV{XML_SIMPLE_PREFERRED_PARSER} = 'XML::LibXML::SAX'; # 0m7.055s
+my $HPMDataCheckAPIVer = 1;
+
my @files = grep { -f } grep { /[^h]\.xml/ } glob 'doxyoutput/xml/struct*.xml';
my %out;
@@ -24,8 +26,15 @@ foreach my $file (@files) {
my @filepath = split(/[\/\\]/, $data->{compounddef}->{location}->{file});
my $foldername = uc($filepath[-2]);
my $filename = uc($filepath[-1]); $filename =~ s/-/_/g; $filename =~ s/\.[^.]*$//;
+ my $plugintypes = 'SERVER_TYPE_UNKNOWN';
+ $plugintypes = 'SERVER_TYPE_ALL' if $foldername eq 'COMMON';
+ $plugintypes = "SERVER_TYPE_${foldername}" if $foldername =~ /^(LOGIN|CHAR|MAP)/;
+ my $symboldata = {
+ name => $data->{compounddef}->{compoundname},
+ type => $plugintypes,
+ };
my $name = "${foldername}_${filename}_H";
- push @{ $out{$name} }, $data->{compounddef}->{compoundname};
+ push @{ $out{$name} }, $symboldata;
}
my $fname = '../../src/common/HPMDataCheck.h';
@@ -49,8 +58,10 @@ foreach my $key (sort keys %out) {
#ifdef $key
EOF
foreach my $entry (@{ $out{$key} }) {
+ my $entryname = $$entry{name};
+ my $entrytype = $$entry{type};
print FH <<"EOF"
- { "$entry", sizeof(struct $entry) },
+ { "$entryname", sizeof(struct $entryname), $entrytype },
EOF
}
print FH <<"EOF"
@@ -62,6 +73,7 @@ EOF
print FH <<"EOF";
};
HPExport unsigned int HPMDataCheckLen = ARRAYLENGTH(HPMDataCheck);
+HPExport int HPMDataCheckVer = $HPMDataCheckAPIVer;
#endif /* HPM_DATA_CHECK_H */
EOF