summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2003-11-18 04:59:29 +0000
committerAndrew Tridgell <tridge@samba.org>2003-11-18 04:59:29 +0000
commit3425f1bfe4b74d88fe63735e60d4a43c6c678d7f (patch)
tree2ba07c81a3769bd0249ce9119d9a8cd36704eacd
parentec7a2944cdaf9255df965ed33e791eb2ee67d29d (diff)
downloadsamba-3425f1bfe4b74d88fe63735e60d4a43c6c678d7f.tar.gz
samba-3425f1bfe4b74d88fe63735e60d4a43c6c678d7f.tar.bz2
samba-3425f1bfe4b74d88fe63735e60d4a43c6c678d7f.zip
auto-generate the pipe UUID version and name
(This used to be commit cdba426e62a5b30263b75f53f97b191da224a55f)
-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?>