summaryrefslogtreecommitdiff
path: root/source4/pidl/lib/Parse/Pidl/Samba4/NDR
diff options
context:
space:
mode:
Diffstat (limited to 'source4/pidl/lib/Parse/Pidl/Samba4/NDR')
-rw-r--r--source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm25
-rw-r--r--source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm5
2 files changed, 16 insertions, 14 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++;
}