summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-09-14 15:40:19 +0200
committerJelmer Vernooij <jelmer@samba.org>2008-09-15 17:40:22 +0200
commit138095470e75a245f62395d74ce1fd08fe4c6439 (patch)
tree817f8567d1815407adc73437ae96dab9f7f1dc62 /source4
parentb1b97e39ad1e8fabf42a14d5b268844f10115993 (diff)
downloadsamba-138095470e75a245f62395d74ce1fd08fe4c6439.tar.gz
samba-138095470e75a245f62395d74ce1fd08fe4c6439.tar.bz2
samba-138095470e75a245f62395d74ce1fd08fe4c6439.zip
Avoid writing structs for inherited functions.
Diffstat (limited to 'source4')
-rw-r--r--source4/pidl/lib/Parse/Pidl/ODL.pm3
-rw-r--r--source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm29
2 files changed, 19 insertions, 13 deletions
diff --git a/source4/pidl/lib/Parse/Pidl/ODL.pm b/source4/pidl/lib/Parse/Pidl/ODL.pm
index 95c4ee1672..f6df34afa8 100644
--- a/source4/pidl/lib/Parse/Pidl/ODL.pm
+++ b/source4/pidl/lib/Parse/Pidl/ODL.pm
@@ -96,8 +96,7 @@ sub ODL2IDL
} else {
foreach my $fn (reverse @{$base->{DATA}}) {
next unless ($fn->{TYPE} eq "FUNCTION");
- unshift (@{$x->{DATA}}, $fn);
- push (@{$x->{INHERITED_FUNCTIONS}}, $fn->{NAME});
+ push (@{$x->{INHERITED_FUNCTIONS}}, $fn);
}
}
}
diff --git a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm
index 7b4234e7d7..0a6360f8ac 100644
--- a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm
+++ b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm
@@ -2225,6 +2225,20 @@ sub AuthServiceStruct($$$)
$self->pidl("");
}
+sub FunctionCallEntry($$)
+{
+ my ($self, $d) = @_;
+ next if not defined($d->{OPNUM});
+ $self->pidl("\t{");
+ $self->pidl("\t\t\"$d->{NAME}\",");
+ $self->pidl("\t\tsizeof(struct $d->{NAME}),");
+ $self->pidl("\t\t(ndr_push_flags_fn_t) ndr_push_$d->{NAME},");
+ $self->pidl("\t\t(ndr_pull_flags_fn_t) ndr_pull_$d->{NAME},");
+ $self->pidl("\t\t(ndr_print_function_t) ndr_print_$d->{NAME},");
+ $self->pidl("\t\t".($d->{ASYNC}?"true":"false").",");
+ $self->pidl("\t},");
+}
+
#####################################################################
# produce a function call table
sub FunctionTable($$)
@@ -2237,16 +2251,9 @@ sub FunctionTable($$)
return unless defined ($interface->{PROPERTIES}->{uuid});
$self->pidl("static const struct ndr_interface_call $interface->{NAME}\_calls[] = {");
- foreach my $d (@{$interface->{FUNCTIONS}}) {
- next if not defined($d->{OPNUM});
- $self->pidl("\t{");
- $self->pidl("\t\t\"$d->{NAME}\",");
- $self->pidl("\t\tsizeof(struct $d->{NAME}),");
- $self->pidl("\t\t(ndr_push_flags_fn_t) ndr_push_$d->{NAME},");
- $self->pidl("\t\t(ndr_pull_flags_fn_t) ndr_pull_$d->{NAME},");
- $self->pidl("\t\t(ndr_print_function_t) ndr_print_$d->{NAME},");
- $self->pidl("\t\t".($d->{ASYNC}?"true":"false").",");
- $self->pidl("\t},");
+
+ foreach my $d (@{$interface->{INHERITED_FUNCTIONS}},@{$interface->{FUNCTIONS}}) {
+ $self->FunctionCallEntry($d);
$count++;
}
$self->pidl("\t{ NULL, 0, NULL, NULL, NULL, false }");
@@ -2355,7 +2362,7 @@ sub HeaderInterface($$$)
foreach (@{$interface->{FUNCTIONS}}) {
next if has_property($_, "noopnum");
- next if grep(/$_->{NAME}/,@{$interface->{INHERITED_FUNCTIONS}});
+ next if grep(/^$_->{NAME}$/,@{$interface->{INHERITED_FUNCTIONS}});
my $u_name = uc $_->{NAME};
my $val = sprintf("0x%02x", $count);