summaryrefslogtreecommitdiff
path: root/source4/pidl/lib/Parse/Pidl/Samba4/Header.pm
diff options
context:
space:
mode:
Diffstat (limited to 'source4/pidl/lib/Parse/Pidl/Samba4/Header.pm')
-rw-r--r--source4/pidl/lib/Parse/Pidl/Samba4/Header.pm45
1 files changed, 22 insertions, 23 deletions
diff --git a/source4/pidl/lib/Parse/Pidl/Samba4/Header.pm b/source4/pidl/lib/Parse/Pidl/Samba4/Header.pm
index b2d5126d1d..14f472340c 100644
--- a/source4/pidl/lib/Parse/Pidl/Samba4/Header.pm
+++ b/source4/pidl/lib/Parse/Pidl/Samba4/Header.pm
@@ -82,9 +82,9 @@ sub HeaderElement($)
#####################################################################
# parse a struct
-sub HeaderStruct($$)
+sub HeaderStruct($$;$)
{
- my($struct,$name) = @_;
+ my($struct,$name,$tail) = @_;
pidl "struct $name";
return if (not defined($struct->{ELEMENTS}));
pidl " {\n";
@@ -103,13 +103,14 @@ sub HeaderStruct($$)
if (defined $struct->{PROPERTIES}) {
HeaderProperties($struct->{PROPERTIES}, []);
}
+ pidl $tail if defined($tail);
}
#####################################################################
# parse a enum
-sub HeaderEnum($$)
+sub HeaderEnum($$;$)
{
- my($enum,$name) = @_;
+ my($enum,$name,$tail) = @_;
my $first = 1;
pidl "enum $name";
@@ -153,6 +154,7 @@ sub HeaderEnum($$)
}
pidl "#endif\n";
}
+ pidl $tail if defined($tail);
}
#####################################################################
@@ -170,9 +172,9 @@ sub HeaderBitmap($$)
#####################################################################
# parse a union
-sub HeaderUnion($$)
+sub HeaderUnion($$;$)
{
- my($union,$name) = @_;
+ my($union,$name,$tail) = @_;
my %done = ();
pidl "union $name";
@@ -193,18 +195,19 @@ sub HeaderUnion($$)
if (defined $union->{PROPERTIES}) {
HeaderProperties($union->{PROPERTIES}, []);
}
+ pidl $tail if defined($tail);
}
#####################################################################
# parse a type
-sub HeaderType($$$)
+sub HeaderType($$$;$)
{
- my($e,$data,$name) = @_;
+ my($e,$data,$name,$tail) = @_;
if (ref($data) eq "HASH") {
- ($data->{TYPE} eq "ENUM") && HeaderEnum($data, $name);
+ ($data->{TYPE} eq "ENUM") && HeaderEnum($data, $name, $tail);
($data->{TYPE} eq "BITMAP") && HeaderBitmap($data, $name);
- ($data->{TYPE} eq "STRUCT") && HeaderStruct($data, $name);
- ($data->{TYPE} eq "UNION") && HeaderUnion($data, $name);
+ ($data->{TYPE} eq "STRUCT") && HeaderStruct($data, $name, $tail);
+ ($data->{TYPE} eq "UNION") && HeaderUnion($data, $name, $tail);
return;
}
@@ -213,14 +216,15 @@ sub HeaderType($$$)
} else {
pidl mapTypeName($e->{TYPE});
}
+ pidl $tail if defined($tail);
}
#####################################################################
# parse a typedef
-sub HeaderTypedef($)
+sub HeaderTypedef($;$)
{
- my($typedef) = shift;
- HeaderType($typedef, $typedef->{DATA}, $typedef->{NAME}) if defined ($typedef->{DATA});
+ my($typedef,$tail) = @_;
+ HeaderType($typedef, $typedef->{DATA}, $typedef->{NAME}, $tail) if defined ($typedef->{DATA});
}
#####################################################################
@@ -357,16 +361,11 @@ sub HeaderInterface($)
}
foreach my $t (@{$interface->{TYPES}}) {
- HeaderTypedef($t) if ($t->{TYPE} eq "TYPEDEF");
- HeaderStruct($t, $t->{NAME}) if ($t->{TYPE} eq "STRUCT");
- HeaderUnion($t, $t->{NAME}) if ($t->{TYPE} eq "UNION");
- HeaderEnum($t, $t->{NAME}) if ($t->{TYPE} eq "ENUM");
+ HeaderTypedef($t, ";\n\n") if ($t->{TYPE} eq "TYPEDEF");
+ HeaderStruct($t, $t->{NAME}, ";\n\n") if ($t->{TYPE} eq "STRUCT");
+ HeaderUnion($t, $t->{NAME}, ";\n\n") if ($t->{TYPE} eq "UNION");
+ HeaderEnum($t, $t->{NAME}, ";\n\n") if ($t->{TYPE} eq "ENUM");
HeaderBitmap($t, $t->{NAME}) if ($t->{TYPE} eq "BITMAP");
- pidl ";\n\n" if ($t->{TYPE} eq "BITMAP" or
- $t->{TYPE} eq "STRUCT" or
- $t->{TYPE} eq "TYPEDEF" or
- $t->{TYPE} eq "UNION" or
- $t->{TYPE} eq "ENUM");
}
foreach my $fn (@{$interface->{FUNCTIONS}}) {