summaryrefslogtreecommitdiff
path: root/source4/build/pidl/header.pm
diff options
context:
space:
mode:
Diffstat (limited to 'source4/build/pidl/header.pm')
-rw-r--r--source4/build/pidl/header.pm41
1 files changed, 32 insertions, 9 deletions
diff --git a/source4/build/pidl/header.pm b/source4/build/pidl/header.pm
index cb64fe0ea3..60605fb619 100644
--- a/source4/build/pidl/header.pm
+++ b/source4/build/pidl/header.pm
@@ -8,6 +8,8 @@ use Data::Dumper;
my($res);
my($tab_depth);
+my $if_uuid;
+my $if_version;
sub tabs()
{
@@ -190,18 +192,16 @@ sub HeaderInterface($)
{
my($interface) = shift;
my($data) = $interface->{DATA};
- foreach my $d (@{$data}) {
- if (!defined $d->{TYPE}) {
- print Dumper $d;
- }
- ($d->{TYPE} eq "TYPEDEF") &&
- HeaderTypedef($d);
- ($d->{TYPE} eq "FUNCTION") &&
- HeaderFunction($d);
- }
my $count = 0;
+ if (defined $if_uuid) {
+ my $name = uc $interface->{NAME};
+ $res .= "#define DCERPC_$name\_UUID \"$if_uuid\"\n";
+ $res .= "#define DCERPC_$name\_VERSION $if_version\n";
+ $res .= "#define DCERPC_$name\_NAME \"$interface->{NAME}\"\n\n";
+ }
+
foreach my $d (@{$data}) {
if ($d->{TYPE} eq "FUNCTION") {
$u_name = uc $d->{NAME};
@@ -209,6 +209,26 @@ sub HeaderInterface($)
$count++;
}
}
+
+ $res .= "\n\n";
+
+ foreach my $d (@{$data}) {
+ ($d->{TYPE} eq "TYPEDEF") &&
+ HeaderTypedef($d);
+ ($d->{TYPE} eq "FUNCTION") &&
+ HeaderFunction($d);
+ }
+
+}
+
+#####################################################################
+# parse the interface definitions
+sub ModuleHeader($)
+{
+ my($h) = shift;
+
+ $if_uuid = $h->{PROPERTIES}->{uuid};
+ $if_version = $h->{PROPERTIES}->{version};
}
@@ -221,6 +241,9 @@ sub Parse($)
$res = "/* header auto-generated by pidl */\n\n";
foreach my $x (@{$idl}) {
+ ($x->{TYPE} eq "MODULEHEADER") &&
+ ModuleHeader($x);
+
($x->{TYPE} eq "INTERFACE") &&
HeaderInterface($x);
}