diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2006-03-14 23:35:30 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:57:19 -0500 |
commit | 1060f6b3f621cb70b075a879f129e57f10fdbf8a (patch) | |
tree | b35328595ebe669a55b975249511511b9c9209f3 /source4/pidl | |
parent | 45933a982804af9277b4980852ba65699d0f493d (diff) | |
download | samba-1060f6b3f621cb70b075a879f129e57f10fdbf8a.tar.gz samba-1060f6b3f621cb70b075a879f129e57f10fdbf8a.tar.bz2 samba-1060f6b3f621cb70b075a879f129e57f10fdbf8a.zip |
r14402: Generate seperate headers for RPC client functions.
(This used to be commit 7054ebf0249930843a2baf4d023ae8f62cedb109)
Diffstat (limited to 'source4/pidl')
-rw-r--r-- | source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm | 25 | ||||
-rw-r--r-- | source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm | 5 | ||||
-rwxr-xr-x | source4/pidl/pidl | 10 |
3 files changed, 24 insertions, 16 deletions
diff --git a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm index 1da765303c..60faa78df3 100644 --- a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm +++ b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm @@ -10,7 +10,7 @@ $VERSION = '0.01'; use strict; -my($res); +my($res,$res_hdr); ##################################################################### # parse a function @@ -20,6 +20,10 @@ sub ParseFunction($$) my $name = $fn->{NAME}; my $uname = uc $name; + $res_hdr .= "\nstruct rpc_request *dcerpc_$name\_send(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct $name *r); +NTSTATUS dcerpc_$name(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct $name *r); +"; + $res .= " struct rpc_request *dcerpc_$name\_send(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct $name *r) { @@ -74,29 +78,28 @@ sub ParseInterface($) return $res; } -sub Parse($$) +sub Parse($$$$) { - my($ndr) = shift; - my($filename) = shift; + my($ndr,$header,$ndr_header,$client_header) = @_; - my $h_filename = $filename; $res = ""; - - if ($h_filename =~ /(.*)\.c/) { - $h_filename = "$1.h"; - } + $res_hdr = ""; $res .= "/* client functions auto-generated by pidl */\n"; $res .= "\n"; $res .= "#include \"includes.h\"\n"; - $res .= "#include \"$h_filename\"\n"; + $res .= "#include \"$ndr_header\"\n"; + $res .= "#include \"$client_header\"\n"; $res .= "\n"; + $res_hdr .= "#include \"librpc/rpc/dcerpc.h\"\n"; + $res_hdr .= "#include \"$header\"\n"; + foreach my $x (@{$ndr}) { ($x->{TYPE} eq "INTERFACE") && ParseInterface($x); } - return $res; + return ($res,$res_hdr); } 1; diff --git a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm index 4a1f8a9c14..249a1ae194 100644 --- a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm +++ b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm @@ -2237,6 +2237,8 @@ sub HeaderInterface($) my $count = 0; + pidl_hdr "#include \"librpc/ndr/libndr.h\""; + if (defined $interface->{PROPERTIES}->{depends}) { my @d = split / /, $interface->{PROPERTIES}->{depends}; foreach my $i (@d) { @@ -2279,9 +2281,6 @@ sub HeaderInterface($) pidl_hdr "#define DCERPC_$u_name ($val)"; - pidl_hdr "NTSTATUS dcerpc_$_->{NAME}(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct $_->{NAME} *r);"; - pidl_hdr "struct rpc_request *dcerpc_$_->{NAME}\_send(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct $_->{NAME} *r);"; - pidl_hdr ""; $count++; } diff --git a/source4/pidl/pidl b/source4/pidl/pidl index 1c70b35e02..1cfc005c2f 100755 --- a/source4/pidl/pidl +++ b/source4/pidl/pidl @@ -668,9 +668,15 @@ sub process_file($) my $h_filename = "$outputdir/ndr_$basename.h"; if (defined($opt_client)) { require Parse::Pidl::Samba4::NDR::Client; - my ($client) = ($opt_client or "$outputdir/ndr_$basename\_c.c"); + my ($c_client) = ($opt_client or "$outputdir/ndr_$basename\_c.c"); + my ($c_header) = $c_client; + $c_header =~ s/\.c$/.h/; - FileSave($client, Parse::Pidl::Samba4::NDR::Client::Parse($ndr,$h_filename)); + my ($srcd,$hdrd) = Parse::Pidl::Samba4::NDR::Client::Parse( + $ndr,$gen_header,$h_filename,$c_header); + + FileSave($c_client, $srcd); + FileSave($c_header, $hdrd); } if (defined($opt_ejs)) { |