1 ###################################################
2 # IDL Compatibility checker
3 # Copyright jelmer@samba.org 2005
4 # released under the GNU GPL
6 package Parse::Pidl::Compat;
8 use Parse::Pidl qw(warning);
9 use Parse::Pidl::Util qw(has_property);
13 use vars qw($VERSION);
16 my %supported_properties = (
18 "helpstring" => ["INTERFACE", "FUNCTION"],
19 "version" => ["INTERFACE"],
20 "uuid" => ["INTERFACE"],
21 "endpoint" => ["INTERFACE"],
22 "pointer_default" => ["INTERFACE"],
23 "no_srv_register" => ["INTERFACE"],
26 "object" => ["INTERFACE"],
27 "local" => ["INTERFACE", "FUNCTION"],
28 "iid_is" => ["ELEMENT"],
29 "call_as" => ["FUNCTION"],
30 "idempotent" => ["FUNCTION"],
39 "unique" => ["ELEMENT"],
40 "ignore" => ["ELEMENT"],
42 "value" => ["ELEMENT"],
45 "public" => ["FUNCTION", "TYPEDEF"],
46 "nopush" => ["FUNCTION", "TYPEDEF"],
47 "nopull" => ["FUNCTION", "TYPEDEF"],
48 "noprint" => ["FUNCTION", "TYPEDEF"],
49 "nopython" => ["FUNCTION", "TYPEDEF"],
52 "switch_is" => ["ELEMENT"],
53 "switch_type" => ["ELEMENT", "TYPEDEF"],
54 "case" => ["ELEMENT"],
55 "default" => ["ELEMENT"],
58 "subcontext" => ["ELEMENT"],
59 "subcontext_size" => ["ELEMENT"],
62 "enum16bit" => ["TYPEDEF"],
63 "v1_enum" => ["TYPEDEF"],
66 "bitmap8bit" => ["TYPEDEF"],
67 "bitmap16bit" => ["TYPEDEF"],
68 "bitmap32bit" => ["TYPEDEF"],
69 "bitmap64bit" => ["TYPEDEF"],
72 "range" => ["ELEMENT"],
73 "size_is" => ["ELEMENT"],
74 "string" => ["ELEMENT"],
75 "noheader" => ["ELEMENT"],
76 "charset" => ["ELEMENT"],
77 "length_is" => ["ELEMENT"],
84 if (has_property($td, "nodiscriminant")) {
85 warning($td, "nodiscriminant property not supported");
88 if ($td->{TYPE} eq "BITMAP") {
89 warning($td, "converting bitmap to scalar");
93 if (has_property($td, "gensize")) {
94 warning($td, "ignoring gensize() property. ");
97 if (has_property($td, "enum8bit") and has_property($td, "enum16bit")) {
98 warning($td, "8 and 16 bit enums not supported, converting to scalar");
102 StripProperties($td);
109 if (has_property($e, "noheader")) {
110 warning($e, "noheader property not supported");
114 if (has_property($e, "subcontext")) {
115 warning($e, "converting subcontext to byte array");
119 if (has_property($e, "compression")) {
120 warning($e, "compression() property not supported");
123 if (has_property($e, "sptr")) {
124 warning($e, "sptr() pointer property not supported");
127 if (has_property($e, "relative")) {
128 warning($e, "relative() pointer property not supported");
131 if (has_property($e, "relative_short")) {
132 warning($e, "relative_short() pointer property not supported");
135 if (has_property($e, "flag")) {
136 warning($e, "ignoring flag() property");
139 if (has_property($e, "value")) {
140 warning($e, "ignoring value() property");
148 if (has_property($fn, "noopnum")) {
149 warning($fn, "noopnum not converted. Opcodes will be out of sync.");
153 sub CheckInterface($)
165 push (@$nidl, CheckInterface($_)) if ($_->{TYPE} eq "INTERFACE");