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);
12 use vars
qw($VERSION);
15 my %supported_properties = (
17 "helpstring" => ["INTERFACE", "FUNCTION"],
18 "version" => ["INTERFACE"],
19 "uuid" => ["INTERFACE"],
20 "endpoint" => ["INTERFACE"],
21 "pointer_default" => ["INTERFACE"],
24 "object" => ["INTERFACE"],
25 "local" => ["INTERFACE", "FUNCTION"],
26 "iid_is" => ["ELEMENT"],
27 "call_as" => ["FUNCTION"],
28 "idempotent" => ["FUNCTION"],
37 "unique" => ["ELEMENT"],
38 "ignore" => ["ELEMENT"],
40 "value" => ["ELEMENT"],
43 "public" => ["FUNCTION", "TYPEDEF"],
44 "nopush" => ["FUNCTION", "TYPEDEF"],
45 "nopull" => ["FUNCTION", "TYPEDEF"],
46 "noprint" => ["FUNCTION", "TYPEDEF"],
49 "switch_is" => ["ELEMENT"],
50 "switch_type" => ["ELEMENT", "TYPEDEF"],
51 "case" => ["ELEMENT"],
52 "default" => ["ELEMENT"],
55 "subcontext" => ["ELEMENT"],
56 "subcontext_size" => ["ELEMENT"],
59 "enum16bit" => ["TYPEDEF"],
60 "v1_enum" => ["TYPEDEF"],
63 "bitmap8bit" => ["TYPEDEF"],
64 "bitmap16bit" => ["TYPEDEF"],
65 "bitmap32bit" => ["TYPEDEF"],
66 "bitmap64bit" => ["TYPEDEF"],
69 "range" => ["ELEMENT"],
70 "size_is" => ["ELEMENT"],
71 "string" => ["ELEMENT"],
72 "noheader" => ["ELEMENT"],
73 "charset" => ["ELEMENT"],
74 "length_is" => ["ELEMENT"],
81 if (has_property($td, "nodiscriminant")) {
82 warning($td, "nodiscriminant property not supported");
85 if ($td->{TYPE} eq "BITMAP") {
86 warning($td, "converting bitmap to scalar");
90 if (has_property($td, "gensize")) {
91 warning($td, "ignoring gensize() property. ");
94 if (has_property($td, "enum8bit") and has_property($td, "enum16bit")) {
95 warning($td, "8 and 16 bit enums not supported, converting to scalar");
106 if (has_property($e, "noheader")) {
107 warning($e, "noheader property not supported");
111 if (has_property($e, "subcontext")) {
112 warning($e, "converting subcontext to byte array");
116 if (has_property($e, "compression")) {
117 warning($e, "compression() property not supported");
120 if (has_property($e, "sptr")) {
121 warning($e, "sptr() pointer property not supported");
124 if (has_property($e, "relative")) {
125 warning($e, "relative() pointer property not supported");
128 if (has_property($e, "relative_short")) {
129 warning($e, "relative_short() pointer property not supported");
132 if (has_property($e, "flag")) {
133 warning($e, "ignoring flag() property");
136 if (has_property($e, "value")) {
137 warning($e, "ignoring value() property");
145 if (has_property($fn, "noopnum")) {
146 warning($fn, "noopnum not converted. Opcodes will be out of sync.");
150 sub CheckInterface($)
162 push (@$nidl, CheckInterface($_)) if ($_->{TYPE} eq "INTERFACE");