diff options
Diffstat (limited to 'source4/build/pidl/compat.pm')
-rw-r--r-- | source4/build/pidl/compat.pm | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/source4/build/pidl/compat.pm b/source4/build/pidl/compat.pm new file mode 100644 index 0000000000..3ab94b70f3 --- /dev/null +++ b/source4/build/pidl/compat.pm @@ -0,0 +1,55 @@ +################################################### +# IDL Compatibility checker +# Copyright jelmer@samba.org 2005 +# released under the GNU GPL + +package IDLCompat; + +use strict; + +my($res); + +sub warning($$) +{ + my $l = shift; + my $m = shift; + + print "$l->{FILE}:$l->{LINE}:$m\n"; +} + +sub CheckInterface($) +{ + my $if = shift; + if (util::has_property($if, "pointer_default_top")) { + warning($if, "pointer_default_top() is pidl-specific"); + } + + foreach my $x (@{$if->{DATA}}) { + if ($x->{TYPE} eq "DECLARE") { + warning($if, "the declare keyword is pidl-specific"); + next; + } + + if ($x->{TYPE} eq "TYPEDEF") { + if ($x->{DATA}->{TYPE} eq "UNION") { + if (util::has_property($x, "nodiscriminant")) { + warning($x, "nodiscriminant property is pidl-specific"); + } + } + } + } +} + +sub Check($) +{ + my $pidl = shift; + my $res = ""; + + foreach my $x (@{$pidl}) { + CheckInterface($x) if ($x->{TYPE} eq "INTERFACE"); + } + + return $res; +} + +1; |