mirror of
https://github.com/samba-team/samba.git
synced 2025-12-09 00:23:50 +03:00
The main difference in this new version is the extra data structure generated
between the IDL data structure and the NDR parser:
IDL -> NDR -> { ndr_parser, ndr_header, eparser, etc }
This makes the ndr_parser.pm internals much more sane.
Other changes include:
- Remove unnecessary calls with NDR_BUFFERS (for example, GUID doesn't have any buffers, just scalars) as well as some (unnecessary) nested setting of flags.
- Parse array loops in the C code rather then calling ndr_pull_array(). This allows us to have, for example, arrays of pointers or arrays of pointers to arrays, etc..
- Use if() {} rather then if () goto foo; everywhere
- NDR_IN no longer implies LIBNDR_FLAG_REF_ALLOC
- By default, top level pointers are now "ref" (as is the default in
most other IDL compilers). This can be overridden using the
default_pointer_top() property.
- initial work on new ethereal parser generators by Alan DeKok and me
- pidl now writes errors in the standard format used by compilers, which
is parsable by most editors
- ability to warn about the fact that pidl extension(s) have been used,
useful for making sure IDL files work with other IDL compilers.
oh, and there's probably some other things I can't think of right now..
56 lines
938 B
Perl
56 lines
938 B
Perl
###################################################
|
|
# 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;
|