summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
Diffstat (limited to 'source4')
-rw-r--r--source4/build/pidl/header.pm41
-rw-r--r--source4/build/pidl/idl.gram4
2 files changed, 34 insertions, 11 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);
}
diff --git a/source4/build/pidl/idl.gram b/source4/build/pidl/idl.gram
index 69a6e2458b..9b265b8cba 100644
--- a/source4/build/pidl/idl.gram
+++ b/source4/build/pidl/idl.gram
@@ -6,10 +6,10 @@ idl: cpp_prefix(s?) module_header interface
{ [$item{module_header}, $item{interface}] }
| <error>
-module_header: '[' <commit> module_param(s /,/) ']'
+module_header: '[' <commit> module_param(s? /,/) ']'
{{
"TYPE" => "MODULEHEADER",
- "DATA" => util::FlattenHash($item[3])
+ "PROPERTIES" => util::FlattenHash($item[3])
}}
| <error?>