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/Parser.pm31
1 files changed, 25 insertions, 6 deletions
diff --git a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm
index 972368195b..f4672e93e9 100644
--- a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm
+++ b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm
@@ -11,6 +11,7 @@ use strict;
use Parse::Pidl::Typelist qw(hasType getType mapType);
use Parse::Pidl::Util qw(has_property ParseExpr print_uuid);
use Parse::Pidl::NDR qw(GetPrevLevel GetNextLevel ContainsDeferred);
+use Parse::Pidl::Samba4 qw(is_intree choose_header);
use vars qw($VERSION);
$VERSION = '0.01';
@@ -2237,16 +2238,16 @@ sub HeaderInterface($)
my $count = 0;
- pidl_hdr "#include \"librpc/ndr/libndr.h\"";
+ pidl_hdr choose_header("librpc/ndr/libndr.h", "ndr.h");
if (has_property($interface, "object")) {
- pidl "#include \"librpc/gen_ndr/ndr_orpc.h\"";
+ pidl choose_header("librpc/gen_ndr/ndr_orpc.h", "ndr/orpc.h");
}
if (defined $interface->{PROPERTIES}->{depends}) {
my @d = split / /, $interface->{PROPERTIES}->{depends};
foreach my $i (@d) {
- pidl "#include \"librpc/gen_ndr/ndr_$i\.h\"";
+ pidl choose_header("librpc/gen_ndr/ndr_$i\.h", "gen_ndr/ndr_$i.h");
}
}
@@ -2311,7 +2312,7 @@ sub ParseInterface($$)
pidl_hdr "";
if ($needed->{"compression"}) {
- pidl "#include \"librpc/ndr/ndr_compression.h\"";
+ pidl choose_header("librpc/ndr/ndr_compression.h", "ndr/compression.h");
}
HeaderInterface($interface);
@@ -2347,9 +2348,9 @@ sub ParseInterface($$)
#####################################################################
# parse a parsed IDL structure back into an IDL file
-sub Parse($$)
+sub Parse($$$)
{
- my($ndr,$basename) = @_;
+ my($ndr,$gen_header,$ndr_header) = @_;
$tabs = "";
$res = "";
@@ -2357,9 +2358,27 @@ sub Parse($$)
$res_hdr = "";
pidl_hdr "/* header auto-generated by pidl */";
pidl_hdr "";
+ pidl_hdr "#include \"$gen_header\"";
+ pidl_hdr "";
pidl "/* parser auto-generated by pidl */";
pidl "";
+ if (is_intree()) {
+ pidl "#include \"includes.h\"";
+ } else {
+ pidl "#define _GNU_SOURCE";
+ pidl "#include <stdint.h>";
+ pidl "#include <stdlib.h>";
+ pidl "#include <stdio.h>";
+ pidl "#include <stdarg.h>";
+ pidl "#include <string.h>";
+ }
+ pidl choose_header("libcli/util/nterr.h", "core/nterr.h");
+ pidl choose_header("librpc/gen_ndr/ndr_misc.h", "gen_ndr/ndr_misc.h");
+ pidl choose_header("librpc/gen_ndr/ndr_dcerpc.h", "gen_ndr/ndr_dcerpc.h");
+ pidl "#include \"$ndr_header\"";
+ pidl choose_header("librpc/rpc/dcerpc.h", "dcerpc.h"); #FIXME: This shouldn't be here!
+ pidl "";
my %needed = ();