diff options
author | Jörg Mayer <jmayer@loplof.de> | 2006-04-25 13:40:04 +0000 |
---|---|---|
committer | Jörg Mayer <jmayer@loplof.de> | 2006-04-25 13:40:04 +0000 |
commit | 6b70d6d9f8872f9ba3ac0faeef89c177580ee96b (patch) | |
tree | 3b1477b29c05953e9a9e19116bb4745e2e5ea5ee /tools/pidl/lib/Parse/Pidl | |
parent | e198ded29798600fd8f1a2a4c38e3449b2ee67e2 (diff) |
Update from samba tree revision 14805 to 15243
============================ Samba log start ============
svn: When specifying working copy paths, only one target may be given
============================ Samba log end ==============
svn path=/trunk/; revision=17994
Diffstat (limited to 'tools/pidl/lib/Parse/Pidl')
-rw-r--r-- | tools/pidl/lib/Parse/Pidl/Samba4.pm | 32 | ||||
-rw-r--r-- | tools/pidl/lib/Parse/Pidl/Samba4/EJS.pm | 12 | ||||
-rw-r--r-- | tools/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm | 1 | ||||
-rw-r--r-- | tools/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm | 1 | ||||
-rw-r--r-- | tools/pidl/lib/Parse/Pidl/Samba4/TDR.pm | 1 |
5 files changed, 45 insertions, 2 deletions
diff --git a/tools/pidl/lib/Parse/Pidl/Samba4.pm b/tools/pidl/lib/Parse/Pidl/Samba4.pm new file mode 100644 index 0000000000..0a284aa85b --- /dev/null +++ b/tools/pidl/lib/Parse/Pidl/Samba4.pm @@ -0,0 +1,32 @@ +################################################### +# Common Samba4 functions +# Copyright jelmer@samba.org 2006 +# released under the GNU GPL + +package Parse::Pidl::Samba4; + +require Exporter; +@ISA = qw(Exporter); +@EXPORT = qw(is_intree choose_header); + +use Parse::Pidl::Util qw(has_property); +use strict; + +use vars qw($VERSION); +$VERSION = '0.01'; + +sub is_intree() +{ + return -f "include/smb.h"; +} + +# Return an #include line depending on whether this build is an in-tree +# build or not. +sub choose_header($$) +{ + my ($in,$out) = @_; + return "#include \"$in\"" if (is_intree()); + return "#include <$out>"; +} + +1; diff --git a/tools/pidl/lib/Parse/Pidl/Samba4/EJS.pm b/tools/pidl/lib/Parse/Pidl/Samba4/EJS.pm index 41ea1e8eaa..550499a5f3 100644 --- a/tools/pidl/lib/Parse/Pidl/Samba4/EJS.pm +++ b/tools/pidl/lib/Parse/Pidl/Samba4/EJS.pm @@ -154,7 +154,11 @@ sub EjsPullPointer($$$$$) my ($e, $l, $var, $name, $env) = @_; pidl "if (ejs_pull_null(ejs, v, $name)) {"; indent; - pidl "$var = NULL;"; + if ($l->{POINTER_TYPE} eq "ref") { + pidl "return NT_STATUS_INVALID_PARAMETER_MIX;"; + } else { + pidl "$var = NULL;"; + } deindent; pidl "} else {"; indent; @@ -450,7 +454,11 @@ sub EjsPushPointer($$$$$) my ($e, $l, $var, $name, $env) = @_; pidl "if (NULL == $var) {"; indent; - pidl "NDR_CHECK(ejs_push_null(ejs, v, $name));"; + if ($l->{POINTER_TYPE} eq "ref") { + pidl "return NT_STATUS_INVALID_PARAMETER_MIX;"; + } else { + pidl "NDR_CHECK(ejs_push_null(ejs, v, $name));"; + } deindent; pidl "} else {"; indent; diff --git a/tools/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm b/tools/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm index ace1e79672..3b12c8f173 100644 --- a/tools/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm +++ b/tools/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm @@ -105,6 +105,7 @@ sub Parse($$$$) } else { $res .= "#define _GNU_SOURCE\n"; $res .= "#include <stdio.h>\n"; + $res .= "#include <stdbool.h>\n"; $res .= "#include <stdlib.h>\n"; $res .= "#include <stdint.h>\n"; $res .= "#include <stdarg.h>\n"; diff --git a/tools/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm b/tools/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm index 07128568bd..38e3268356 100644 --- a/tools/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm +++ b/tools/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm @@ -2356,6 +2356,7 @@ sub Parse($$$) pidl "#include <stdint.h>"; pidl "#include <stdlib.h>"; pidl "#include <stdio.h>"; + pidl "#include <stdbool.h>"; pidl "#include <stdarg.h>"; pidl "#include <string.h>"; } diff --git a/tools/pidl/lib/Parse/Pidl/Samba4/TDR.pm b/tools/pidl/lib/Parse/Pidl/Samba4/TDR.pm index 7e597dfb34..592961dee2 100644 --- a/tools/pidl/lib/Parse/Pidl/Samba4/TDR.pm +++ b/tools/pidl/lib/Parse/Pidl/Samba4/TDR.pm @@ -242,6 +242,7 @@ sub Parser($$$) pidl "#include \"includes.h\""; } else { pidl "#include <stdio.h>"; + pidl "#include <stdbool.h>"; pidl "#include <stdlib.h>"; pidl "#include <stdint.h>"; pidl "#include <stdarg.h>"; |