From d18235cae43500d68210b09514b76506fc831014 Mon Sep 17 00:00:00 2001 From: Haru Date: Tue, 28 Oct 2014 15:52:53 +0100 Subject: Added preliminary support for login and char server in the HPMDataCheck - Special thanks to Ind Signed-off-by: Haru --- tools/HPMHookGen/HPMDataCheckGen.pl | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'tools/HPMHookGen/HPMDataCheckGen.pl') 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 -- cgit v1.2.3-70-g09d2