summaryrefslogtreecommitdiff
path: root/source4/pidl/lib/Parse/Pidl/Samba3/Types.pm
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2005-10-14 16:40:47 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:44:43 -0500
commit6f3caf73e13f32e5482d09b3fd2fbcf61ac88bc1 (patch)
tree01bc12b328a3dc538dec5d5d4e2add672d84d820 /source4/pidl/lib/Parse/Pidl/Samba3/Types.pm
parentebe6f9ea490b686cef393c9b31c2c975dfac0be8 (diff)
downloadsamba-6f3caf73e13f32e5482d09b3fd2fbcf61ac88bc1.tar.gz
samba-6f3caf73e13f32e5482d09b3fd2fbcf61ac88bc1.tar.bz2
samba-6f3caf73e13f32e5482d09b3fd2fbcf61ac88bc1.zip
r11061: Samba3 parser generator fixes:
* Add (limited) support for [string] * Don't generate (and set) header elements for top level ref pointers as they don't appear on the wire (This used to be commit 765adaf19be264e2d23a22eaed3027faededf8b6)
Diffstat (limited to 'source4/pidl/lib/Parse/Pidl/Samba3/Types.pm')
-rw-r--r--source4/pidl/lib/Parse/Pidl/Samba3/Types.pm16
1 files changed, 15 insertions, 1 deletions
diff --git a/source4/pidl/lib/Parse/Pidl/Samba3/Types.pm b/source4/pidl/lib/Parse/Pidl/Samba3/Types.pm
index 135b02f1e3..db20372bba 100644
--- a/source4/pidl/lib/Parse/Pidl/Samba3/Types.pm
+++ b/source4/pidl/lib/Parse/Pidl/Samba3/Types.pm
@@ -7,7 +7,7 @@ package Parse::Pidl::Samba3::Types;
require Exporter;
@ISA = qw(Exporter);
-@EXPORT_OK = qw(DeclShort DeclLong InitType DissectType AddType);
+@EXPORT_OK = qw(DeclShort DeclLong InitType DissectType AddType StringType);
use strict;
use Parse::Pidl::Util qw(has_property ParseExpr property_matches);
@@ -104,6 +104,20 @@ sub dissect_string($$$$$)
return "smb_io_$t(\"$e->{NAME}\", &$n, 1, ps, depth)";
}
+sub StringType($$)
+{
+ my ($e,$l) = @_;
+ my $nl = GetNextLevel($e,$l);
+
+ if ($l->{IS_VARYING} and $l->{IS_CONFORMANT} and $nl->{DATA_TYPE} eq "uint16") {
+ return ("unistr2", 0);
+ } elsif ($l->{IS_CONFORMANT} and $l->{IS_VARYING} and $nl->{DATA_TYPE} eq "uint8") {
+ return ("string2", 0);
+ } else {
+ fatal($e, "[string] non-varying string not supported for Samba3 yet");
+ }
+}
+
my $known_types =
{
uint8 =>