diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2005-07-09 15:32:08 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:19:27 -0500 |
commit | fa1445f4bc962efb3e639d3a4e345b1db14155b7 (patch) | |
tree | 8799d04bc9ec022569fedd636e899bcc29a57935 /source4/build/pidl/Parse/Pidl/Compat.pm | |
parent | c222331d6d3785075bb0c961315aae9380101e47 (diff) | |
download | samba-fa1445f4bc962efb3e639d3a4e345b1db14155b7.tar.gz samba-fa1445f4bc962efb3e639d3a4e345b1db14155b7.tar.bz2 samba-fa1445f4bc962efb3e639d3a4e345b1db14155b7.zip |
r8264: - Use standard perl package structure for pidl.
- Only "use" pidl modules in the main executable when necessary
Try 'make install' in build/pidl to install the package (should work stand-alone).
(This used to be commit c620095692122a65ae1c5d85ca20468d4de93c54)
Diffstat (limited to 'source4/build/pidl/Parse/Pidl/Compat.pm')
-rw-r--r-- | source4/build/pidl/Parse/Pidl/Compat.pm | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/source4/build/pidl/Parse/Pidl/Compat.pm b/source4/build/pidl/Parse/Pidl/Compat.pm new file mode 100644 index 0000000000..f81d73f36a --- /dev/null +++ b/source4/build/pidl/Parse/Pidl/Compat.pm @@ -0,0 +1,55 @@ +################################################### +# IDL Compatibility checker +# Copyright jelmer@samba.org 2005 +# released under the GNU GPL + +package Parse::Pidl::Compat; + +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; |