summaryrefslogtreecommitdiff
path: root/tools/HPMHookGen/HPMDataCheckGen.pl
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2014-10-28 15:52:53 +0100
committerHaru <haru@dotalux.com>2014-10-28 16:00:06 +0100
commitd18235cae43500d68210b09514b76506fc831014 (patch)
tree8effe205a1d028d97b996f444cc79e348ec6a059 /tools/HPMHookGen/HPMDataCheckGen.pl
parent534921cf6e8c2ca683ca7c940306c373cfb0ad2b (diff)
downloadhercules-d18235cae43500d68210b09514b76506fc831014.tar.gz
hercules-d18235cae43500d68210b09514b76506fc831014.tar.bz2
hercules-d18235cae43500d68210b09514b76506fc831014.tar.xz
hercules-d18235cae43500d68210b09514b76506fc831014.zip
Added preliminary support for login and char server in the HPMDataCheck
- Special thanks to Ind Signed-off-by: Haru <haru@dotalux.com>
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