diff options
author | Stefan Metzmacher <metze@samba.org> | 2010-10-11 08:03:18 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2011-03-10 14:31:18 +0100 |
commit | f383497436dbbadfdcb1062fee0c111eca50df7d (patch) | |
tree | e12efbd091dd5ff6fe41fe9f1e92db7e8af2f8dd /pidl/lib/Parse/Pidl/Samba4 | |
parent | 7537f9c9bb78992850a641973a8df818d2fcaf25 (diff) | |
download | samba-f383497436dbbadfdcb1062fee0c111eca50df7d.tar.gz samba-f383497436dbbadfdcb1062fee0c111eca50df7d.tar.bz2 samba-f383497436dbbadfdcb1062fee0c111eca50df7d.zip |
pidl:NDR/Client: skip sync functions if pipe elements are used
metze
Diffstat (limited to 'pidl/lib/Parse/Pidl/Samba4')
-rw-r--r-- | pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm b/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm index 2397f1a17d..82dcc1dbec 100644 --- a/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm +++ b/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm @@ -12,6 +12,7 @@ use Exporter; use Parse::Pidl qw(fatal warning error); use Parse::Pidl::Util qw(has_property ParseExpr); +use Parse::Pidl::NDR qw(ContainsPipe); use Parse::Pidl::Typelist qw(mapTypeName); use Parse::Pidl::Samba4 qw(choose_header is_intree DeclLong); use Parse::Pidl::Samba4::Header qw(GenerateFunctionInEnv GenerateFunctionOutEnv); @@ -44,6 +45,17 @@ sub new($) bless($self, $class); } +sub ParseFunctionHasPipes($$) +{ + my ($self, $fn) = @_; + + foreach my $e (@{$fn->{ELEMENTS}}) { + return 1 if ContainsPipe($e, $e->{LEVELS}[0]); + } + + return 0; +} + sub ParseFunction_r_State($$$$) { my ($self, $if, $fn, $name) = @_; @@ -200,6 +212,17 @@ sub ParseFunction_r_Sync($$$$) my ($self, $if, $fn, $name) = @_; my $uname = uc $name; + if ($self->ParseFunctionHasPipes($fn)) { + $self->pidl_both("/*"); + $self->pidl_both(" * The following function is skipped because"); + $self->pidl_both(" * it uses pipes:"); + $self->pidl_both(" *"); + $self->pidl_both(" * dcerpc_$name\_r()"); + $self->pidl_both(" */"); + $self->pidl_both(""); + return; + } + my $proto = "NTSTATUS dcerpc_$name\_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct $name *r)"; $self->fn_declare($proto); @@ -622,6 +645,17 @@ sub ParseFunction_Sync($$$$) { my ($self, $if, $fn, $name) = @_; + if ($self->ParseFunctionHasPipes($fn)) { + $self->pidl_both("/*"); + $self->pidl_both(" * The following function is skipped because"); + $self->pidl_both(" * it uses pipes:"); + $self->pidl_both(" *"); + $self->pidl_both(" * dcerpc_$name()"); + $self->pidl_both(" */"); + $self->pidl_both(""); + return; + } + my $uname = uc $name; my $fn_args = ""; my $fn_str = "NTSTATUS dcerpc_$name"; |