pidl: parse idl 'pipe' typedefs, but print out a not supported message for now
[ira/wip.git] / pidl / lib / Parse / Pidl / NDR.pm
index 5ee26d16b68c76f611c4fedc832aab5671f513e1..a36f6380924977dd1285e0099e7ae16e988fc0c0 100644 (file)
@@ -53,6 +53,7 @@ my $scalar_alignment = {
        'int32' => 4,
        'uint32' => 4,
        'hyper' => 8,
+       'double' => 8,
        'pointer' => 8,
        'dlong' => 4,
        'udlong' => 4,
@@ -141,6 +142,13 @@ sub GetElementLevelTable($$)
                $is_fixed = 1 if (not $is_conformant and Parse::Pidl::Util::is_constant($size));
                $is_inline = 1 if (not $is_conformant and not Parse::Pidl::Util::is_constant($size));
 
+               if ($i == 0 and $is_fixed and has_property($e, "string")) {
+                       $is_fixed = 0;
+                       $is_varying = 1;
+                       $is_string = 1;
+                       delete($e->{PROPERTIES}->{string});
+               }
+
                push (@$order, {
                        TYPE => "ARRAY",
                        SIZE_IS => $size,
@@ -920,7 +928,7 @@ my %property_list = (
        "bitmap64bit"           => ["BITMAP"],
 
        # array
-       "range"                 => ["ELEMENT"],
+       "range"                 => ["ELEMENT", "PIPE"],
        "size_is"               => ["ELEMENT"],
        "string"                => ["ELEMENT"],
        "noheader"              => ["ELEMENT"],
@@ -1111,6 +1119,18 @@ sub ValidUnion($)
        }
 }
 
+#####################################################################
+# validate a pipe
+sub ValidPipe($)
+{
+       my ($pipe) = @_;
+       my $data = $pipe->{DATA};
+
+       ValidProperties($pipe, "PIPE");
+
+       fatal($pipe, $pipe->{NAME} . ": 'pipe' is not yet supported by pidl");
+}
+
 #####################################################################
 # parse a typedef
 sub ValidTypedef($)
@@ -1156,7 +1176,8 @@ sub ValidType($)
                STRUCT => \&ValidStruct,
                UNION => \&ValidUnion,
                ENUM => \&ValidEnum,
-               BITMAP => \&ValidBitmap
+               BITMAP => \&ValidBitmap,
+               PIPE => \&ValidPipe
        }->{$t->{TYPE}}->($t);
 }
 
@@ -1198,7 +1219,8 @@ sub ValidInterface($)
                 $d->{TYPE} eq "STRUCT" or
                 $d->{TYPE} eq "UNION" or 
                 $d->{TYPE} eq "ENUM" or
-                $d->{TYPE} eq "BITMAP") && ValidType($d);
+                $d->{TYPE} eq "BITMAP" or
+                $d->{TYPE} eq "PIPE") && ValidType($d);
        }
 
 }