summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2008-01-24 15:04:58 +0100
committerStefan Metzmacher <metze@samba.org>2008-01-24 15:04:58 +0100
commit43040be5b9c959c2f9c305eec9d66c103edc14af (patch)
tree4183d0269761b9cd50178c9bc0d8614449b75fab /source4
parent4d656cb5a52bb48fb29b8c546bd33f7a446b0fbf (diff)
downloadsamba-43040be5b9c959c2f9c305eec9d66c103edc14af.tar.gz
samba-43040be5b9c959c2f9c305eec9d66c103edc14af.tar.bz2
samba-43040be5b9c959c2f9c305eec9d66c103edc14af.zip
pidl: get rid of stupid ';' char to terminate bitmap defines
metze (This used to be commit dd77fc45eee2dde7bdd31a2e39387e94cec158aa)
Diffstat (limited to 'source4')
-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}}) {