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"],
22 "no_srv_register" => ["INTERFACE"],
25 "object" => ["INTERFACE"],
26 "local" => ["INTERFACE", "FUNCTION"],
27 "iid_is" => ["ELEMENT"],
28 "call_as" => ["FUNCTION"],
29 "idempotent" => ["FUNCTION"],
38 "unique" => ["ELEMENT"],
39 "ignore" => ["ELEMENT"],
41 "value" => ["ELEMENT"],
44 "public" => ["FUNCTION", "TYPEDEF"],
45 "nopush" => ["FUNCTION", "TYPEDEF"],
46 "nopull" => ["FUNCTION", "TYPEDEF"],
47 "noprint" => ["FUNCTION", "TYPEDEF"],
48 "nopython" => ["FUNCTION", "TYPEDEF"],
51 "switch_is" => ["ELEMENT"],
52 "switch_type" => ["ELEMENT", "TYPEDEF"],
53 "case" => ["ELEMENT"],
54 "default" => ["ELEMENT"],
57 "subcontext" => ["ELEMENT"],
58 "subcontext_size" => ["ELEMENT"],
61 "enum16bit" => ["TYPEDEF"],
62 "v1_enum" => ["TYPEDEF"],
65 "bitmap8bit" => ["TYPEDEF"],
66 "bitmap16bit" => ["TYPEDEF"],
67 "bitmap32bit" => ["TYPEDEF"],
68 "bitmap64bit" => ["TYPEDEF"],
71 "range" => ["ELEMENT"],
72 "size_is" => ["ELEMENT"],
73 "string" => ["ELEMENT"],
74 "noheader" => ["ELEMENT"],
75 "charset" => ["ELEMENT"],
76 "length_is" => ["ELEMENT"],
83 if (has_property($td, "nodiscriminant")) {
84 warning($td, "nodiscriminant property not supported");
87 if ($td->{TYPE} eq "BITMAP") {
88 warning($td, "converting bitmap to scalar");
92 if (has_property($td, "gensize")) {
93 warning($td, "ignoring gensize() property. ");
96 if (has_property($td, "enum8bit") and has_property($td, "enum16bit")) {
97 warning($td, "8 and 16 bit enums not supported, converting to scalar");
101 StripProperties($td);
108 if (has_property($e, "noheader")) {
109 warning($e, "noheader property not supported");
113 if (has_property($e, "subcontext")) {
114 warning($e, "converting subcontext to byte array");
118 if (has_property($e, "compression")) {
119 warning($e, "compression() property not supported");
122 if (has_property($e, "sptr")) {
123 warning($e, "sptr() pointer property not supported");
126 if (has_property($e, "relative")) {
127 warning($e, "relative() pointer property not supported");
130 if (has_property($e, "relative_short")) {
131 warning($e, "relative_short() pointer property not supported");
134 if (has_property($e, "flag")) {
135 warning($e, "ignoring flag() property");
138 if (has_property($e, "value")) {
139 warning($e, "ignoring value() property");
147 if (has_property($fn, "noopnum")) {
148 warning($fn, "noopnum not converted. Opcodes will be out of sync.");
152 sub CheckInterface($)
164 push (@$nidl, CheckInterface($_)) if ($_->{TYPE} eq "INTERFACE");