use strict;
use Parse::Pidl::Typelist;
+use Parse::Pidl::Util qw(has_property property_matches);
sub nonfatal($$)
{
my @length_is = ();
my @size_is = ();
- if (Parse::Pidl::Util::has_property($e, "size_is")) {
- @size_is = split /,/, Parse::Pidl::Util::has_property($e, "size_is");
+ if (has_property($e, "size_is")) {
+ @size_is = split /,/, has_property($e, "size_is");
}
- if (Parse::Pidl::Util::has_property($e, "length_is")) {
- @length_is = split /,/, Parse::Pidl::Util::has_property($e, "length_is");
+ if (has_property($e, "length_is")) {
+ @length_is = split /,/, has_property($e, "length_is");
}
if (defined($e->{ARRAY_LEN})) {
if ($d eq "*") {
$is_conformant = 1;
if ($size = shift @size_is) {
- } elsif ((scalar(@size_is) == 0) and Parse::Pidl::Util::has_property($e, "string")) {
+ } elsif ((scalar(@size_is) == 0) and has_property($e, "string")) {
$is_string = 1;
delete($e->{PROPERTIES}->{string});
} else {
}
}
- if (scalar(@size_is) == 0 and Parse::Pidl::Util::has_property($e, "string")) {
+ if (scalar(@size_is) == 0 and has_property($e, "string")) {
$is_string = 1;
- $is_varying = $is_conformant = Parse::Pidl::Util::has_property($e, "noheader")?0:1;
+ $is_varying = $is_conformant = has_property($e, "noheader")?0:1;
delete($e->{PROPERTIES}->{string});
}
}
}
- if (defined(Parse::Pidl::Util::has_property($e, "subcontext"))) {
- my $hdr_size = Parse::Pidl::Util::has_property($e, "subcontext");
- my $subsize = Parse::Pidl::Util::has_property($e, "subcontext_size");
+ if (defined(has_property($e, "subcontext"))) {
+ my $hdr_size = has_property($e, "subcontext");
+ my $subsize = has_property($e, "subcontext_size");
if (not defined($subsize)) {
$subsize = -1;
}
HEADER_SIZE => $hdr_size,
SUBCONTEXT_SIZE => $subsize,
IS_DEFERRED => $is_deferred,
- COMPRESSION => Parse::Pidl::Util::has_property($e, "compression"),
- OBFUSCATION => Parse::Pidl::Util::has_property($e, "obfuscation")
+ COMPRESSION => has_property($e, "compression"),
+ OBFUSCATION => has_property($e, "obfuscation")
});
}
- if (my $switch = Parse::Pidl::Util::has_property($e, "switch_is")) {
+ if (my $switch = has_property($e, "switch_is")) {
push (@$order, {
TYPE => "SWITCH",
SWITCH_IS => $switch,
nonfatal($e, "length_is() on non-array element");
}
- if (Parse::Pidl::Util::has_property($e, "string")) {
+ if (has_property($e, "string")) {
nonfatal($e, "string() attribute on non-array element");
}
return undef unless $e->{POINTERS};
- return "ref" if (Parse::Pidl::Util::has_property($e, "ref"));
- return "ptr" if (Parse::Pidl::Util::has_property($e, "ptr"));
- return "sptr" if (Parse::Pidl::Util::has_property($e, "sptr"));
- return "unique" if (Parse::Pidl::Util::has_property($e, "unique"));
- return "relative" if (Parse::Pidl::Util::has_property($e, "relative"));
- return "ignore" if (Parse::Pidl::Util::has_property($e, "ignore"));
+ return "ref" if (has_property($e, "ref"));
+ return "ptr" if (has_property($e, "ptr"));
+ return "sptr" if (has_property($e, "sptr"));
+ return "unique" if (has_property($e, "unique"));
+ return "relative" if (has_property($e, "relative"));
+ return "ignore" if (has_property($e, "ignore"));
return undef;
}
}
if (defined $e->{TYPE} && $e->{TYPE} eq "string"
- && Parse::Pidl::Util::property_matches($e, "flag", ".*LIBNDR_FLAG_STR_CONFORMANT.*")) {
+ && property_matches($e, "flag", ".*LIBNDR_FLAG_STR_CONFORMANT.*")) {
$surrounding = $struct->{ELEMENTS}[-1];
}
{
my $e = shift;
my @elements = ();
- my $switch_type = Parse::Pidl::Util::has_property($e, "switch_type");
+ my $switch_type = has_property($e, "switch_type");
unless (defined($switch_type)) { $switch_type = "uint32"; }
- if (Parse::Pidl::Util::has_property($e, "nodiscriminant")) { $switch_type = undef; }
+ if (has_property($e, "nodiscriminant")) { $switch_type = undef; }
foreach my $x (@{$e->{ELEMENTS}})
{
} else {
$t = ParseElement($x);
}
- if (Parse::Pidl::Util::has_property($x, "default")) {
+ if (has_property($x, "default")) {
$t->{CASE} = "default";
} elsif (defined($x->{PROPERTIES}->{case})) {
$t->{CASE} = "case $x->{PROPERTIES}->{case}";
foreach my $x (@{$d->{ELEMENTS}}) {
my $e = ParseElement($x);
- push (@{$e->{DIRECTION}}, "in") if (Parse::Pidl::Util::has_property($x, "in"));
- push (@{$e->{DIRECTION}}, "out") if (Parse::Pidl::Util::has_property($x, "out"));
+ push (@{$e->{DIRECTION}}, "in") if (has_property($x, "in"));
+ push (@{$e->{DIRECTION}}, "out") if (has_property($x, "out"));
push (@elements, $e);
}
my $opnum = 0;
my $version;
- if (not Parse::Pidl::Util::has_property($idl, "pointer_default")) {
+ if (not has_property($idl, "pointer_default")) {
# MIDL defaults to "ptr" in DCE compatible mode (/osf)
# and "unique" in Microsoft Extensions mode (default)
$idl->{PROPERTIES}->{pointer_default} = "unique";
}
- if (not Parse::Pidl::Util::has_property($idl, "pointer_default_top")) {
+ if (not has_property($idl, "pointer_default_top")) {
$idl->{PROPERTIES}->{pointer_default_top} = "ref";
}
return {
NAME => $idl->{NAME},
- UUID => Parse::Pidl::Util::has_property($idl, "uuid"),
+ UUID => has_property($idl, "uuid"),
VERSION => $version,
TYPE => "INTERFACE",
PROPERTIES => $idl->{PROPERTIES},
package Parse::Pidl::ODL;
+use Parse::Pidl::Util qw(has_property);
use strict;
#####################################################################
# Add [in] ORPCTHIS *this, [out] ORPCTHAT *that
# and replace interfacepointers with MInterfacePointer
# for 'object' interfaces
- if (Parse::Pidl::Util::has_property($x, "object")) {
+ if (has_property($x, "object")) {
foreach my $e (@{$x->{DATA}}) {
($e->{TYPE} eq "FUNCTION") && FunctionAddObjArgs($e);
ReplaceInterfacePointers($e);
}
# Object interfaces use ORPC
my @depends = ();
- if(Parse::Pidl::Util::has_property($x, "depends")) {
+ if(has_property($x, "depends")) {
@depends = split /,/, $x->{PROPERTIES}->{depends};
}
push @depends, "orpc";
package Parse::Pidl::Samba::COM::Header;
use Parse::Pidl::Typelist;
+use Parse::Pidl::Util qw(has_property);
use strict;
my $c = shift;
my $res = "";
$res .= "#define CLSID_" . uc($c->{NAME}) . " $c->{PROPERTIES}->{uuid}\n";
- if (Parse::Pidl::Util::has_property($c, "progid")) {
+ if (has_property($c, "progid")) {
$res .= "#define PROGID_" . uc($c->{NAME}) . " $c->{PROPERTIES}->{progid}\n";
}
$res .= "\n";
foreach my $x (@{$idl})
{
- if ($x->{TYPE} eq "INTERFACE" && Parse::Pidl::Util::has_property($x, "object")) {
+ if ($x->{TYPE} eq "INTERFACE" && has_property($x, "object")) {
$res.=ParseInterface($x);
}
package Parse::Pidl::Samba::COM::Proxy;
use Parse::Pidl::Samba::COM::Header;
+use Parse::Pidl::Util qw(has_property);
use strict;
# Put arguments into r
foreach my $a (@{$fn->{ELEMENTS}}) {
- next unless (Parse::Pidl::Util::has_property($a, "in"));
+ next unless (has_property($a, "in"));
if (Parse::Pidl::Typelist::typeIs($a->{TYPE}, "INTERFACE")) {
$res .="\tNDR_CHECK(dcom_OBJREF_from_IUnknown(&r.in.$a->{NAME}.obj, $a->{NAME}));\n";
} else {
# Put r info back into arguments
foreach my $a (@{$fn->{ELEMENTS}}) {
- next unless (Parse::Pidl::Util::has_property($a, "out"));
+ next unless (has_property($a, "out"));
if (Parse::Pidl::Typelist::typeIs($a->{TYPE}, "INTERFACE")) {
$res .="\tNDR_CHECK(dcom_IUnknown_from_OBJREF(d->ctx, &$a->{NAME}, r.out.$a->{NAME}.obj));\n";
$res .="\tNTSTATUS status = NT_STATUS_OK;\n";
foreach my $interface (@{$idl}) {
next if $interface->{TYPE} ne "INTERFACE";
- next if not Parse::Pidl::Util::has_property($interface, "object");
+ next if not has_property($interface, "object");
my $data = $interface->{DATA};
my $count = 0;
foreach my $x (@{$pidl}) {
next if ($x->{TYPE} ne "INTERFACE");
- next if Parse::Pidl::Util::has_property($x, "local");
- next unless Parse::Pidl::Util::has_property($x, "object");
+ next if has_property($x, "local");
+ next unless has_property($x, "object");
$res .= ParseInterface($x);
}
package Parse::Pidl::Samba::COM::Stub;
+use Parse::Pidl::Util qw(has_property);
use strict;
my($res);
{
my($interface) = shift;
- return "" if Parse::Pidl::Util::has_property($interface, "local");
+ return "" if has_property($interface, "local");
my($data) = $interface->{DATA};
my $count = 0;
use strict;
use Parse::Pidl::Typelist;
+use Parse::Pidl::Util qw(has_property);
my($res);
my %constants;
{
my $fn = shift;
- return "" if (Parse::Pidl::Util::has_property($fn, "public"));
+ return "" if (has_property($fn, "public"));
return "static ";
}
{
my ($e, $l, $var, $name, $env) = @_;
- return if (Parse::Pidl::Util::has_property($e, "value"));
+ return if (has_property($e, "value"));
my $pl = Parse::Pidl::NDR::GetPrevLevel($e, $l);
$var = get_pointer_to($var);
sub EjsPullElement($$$$$)
{
my ($e, $l, $var, $name, $env) = @_;
- if (Parse::Pidl::Util::has_property($e, "charset")) {
+ if (has_property($e, "charset")) {
EjsPullString($e, $l, $var, $name, $env);
} elsif ($l->{TYPE} eq "ARRAY") {
EjsPullArray($e, $l, $var, $name, $env);
sub EjsTypedefPull($)
{
my $d = shift;
- return if (Parse::Pidl::Util::has_property($d, "noejs"));
+ return if (has_property($d, "noejs"));
if ($d->{DATA}->{TYPE} eq 'STRUCT') {
EjsStructPull($d->{NAME}, $d->{DATA});
} elsif ($d->{DATA}->{TYPE} eq 'UNION') {
sub EjsPushElement($$$$$)
{
my ($e, $l, $var, $name, $env) = @_;
- if (Parse::Pidl::Util::has_property($e, "charset")) {
+ if (has_property($e, "charset")) {
EjsPushString($e, $l, $var, $name, $env);
} elsif ($l->{TYPE} eq "ARRAY") {
EjsPushArray($e, $l, $var, $name, $env);
sub EjsTypedefPush($)
{
my $d = shift;
- return if (Parse::Pidl::Util::has_property($d, "noejs"));
+ return if (has_property($d, "noejs"));
if ($d->{DATA}->{TYPE} eq 'STRUCT') {
EjsStructPush($d->{NAME}, $d->{DATA});
} elsif ($d->{DATA}->{TYPE} eq 'UNION') {
use strict;
use Parse::Pidl::Typelist;
+use Parse::Pidl::Util qw(has_property);
my($res);
my $d = shift;
my $name = $d->{NAME};
- return unless Parse::Pidl::Util::has_property($d, "public");
+ return unless has_property($d, "public");
my $type_decl = Parse::Pidl::Typelist::mapType($name);
use strict;
use Parse::Pidl::Typelist;
+use Parse::Pidl::Util qw(has_property);
use Parse::Pidl::Samba::NDR::Parser;
my($res);
return;
}
- if (Parse::Pidl::Util::has_property($e, "charset")) {
+ if (has_property($e, "charset")) {
pidl "const char";
} else {
pidl Parse::Pidl::Typelist::mapType($e->{TYPE});
my $tf = Parse::Pidl::Samba::NDR::Parser::get_typefamily($d->{DATA}{TYPE});
- if (Parse::Pidl::Util::has_property($d, "gensize")) {
+ if (has_property($d, "gensize")) {
my $size_args = $tf->{SIZE_FN_ARGS}->($d);
pidl "size_t ndr_size_$d->{NAME}($size_args);\n";
}
- return unless Parse::Pidl::Util::has_property($d, "public");
+ return unless has_property($d, "public");
my $pull_args = $tf->{PULL_FN_ARGS}->($d);
my $push_args = $tf->{PUSH_FN_ARGS}->($d);
my $print_args = $tf->{PRINT_FN_ARGS}->($d);
- unless (Parse::Pidl::Util::has_property($d, "nopush")) {
+ unless (has_property($d, "nopush")) {
pidl "NTSTATUS ndr_push_$d->{NAME}($push_args);\n";
}
- unless (Parse::Pidl::Util::has_property($d, "nopull")) {
+ unless (has_property($d, "nopull")) {
pidl "NTSTATUS ndr_pull_$d->{NAME}($pull_args);\n";
}
- unless (Parse::Pidl::Util::has_property($d, "noprint")) {
+ unless (has_property($d, "noprint")) {
pidl "void ndr_print_$d->{NAME}($print_args);\n";
}
}
my($fn,$prop) = @_;
foreach my $e (@{$fn->{ELEMENTS}}) {
- if (Parse::Pidl::Util::has_property($e, $prop)) {
+ if (has_property($e, $prop)) {
HeaderElement($e);
}
}
}
foreach my $e (@{$fn->{ELEMENTS}}) {
- if (Parse::Pidl::Util::has_property($e, $prop)) {
+ if (has_property($e, $prop)) {
return 1;
}
}
pidl "struct rpc_request *dcerpc_$name\_send(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct $name *r);\n";
}
- return unless Parse::Pidl::Util::has_property($fn, "public");
+ return unless has_property($fn, "public");
pidl "NTSTATUS ndr_push_$name(struct ndr_push *ndr, int flags, const struct $name *r);\n";
pidl "NTSTATUS ndr_pull_$name(struct ndr_pull *ndr, int flags, struct $name *r);\n";
use strict;
use Parse::Pidl::Typelist;
+use Parse::Pidl::Util qw(has_property);
use Parse::Pidl::NDR;
# list of known types
{
my $fn = shift;
- return "" if (Parse::Pidl::Util::has_property($fn, "public"));
+ return "" if (has_property($fn, "public"));
return "static ";
}
sub start_flags($)
{
my $e = shift;
- my $flags = Parse::Pidl::Util::has_property($e, "flag");
+ my $flags = has_property($e, "flag");
if (defined $flags) {
pidl "{";
indent;
sub end_flags($)
{
my $e = shift;
- my $flags = Parse::Pidl::Util::has_property($e, "flag");
+ my $flags = has_property($e, "flag");
if (defined $flags) {
pidl "ndr->flags = _flags_save_$e->{TYPE};";
deindent;
sub ParseObfuscationPushEnd($$)
{
my ($e,$ndr) = @_;
- my $obfuscation = Parse::Pidl::Util::has_property($e, "obfuscation");
+ my $obfuscation = has_property($e, "obfuscation");
pidl "NDR_CHECK(ndr_push_obfuscation($ndr, $obfuscation));";
}
sub ParseObfuscationPullStart($$)
{
my ($e,$ndr) = @_;
- my $obfuscation = Parse::Pidl::Util::has_property($e, "obfuscation");
+ my $obfuscation = has_property($e, "obfuscation");
pidl "NDR_CHECK(ndr_pull_obfuscation($ndr, $obfuscation));";
my $nl = Parse::Pidl::NDR::GetNextLevel($e, $l);
- if (Parse::Pidl::Util::has_property($e, "charset")) {
+ if (has_property($e, "charset")) {
pidl "NDR_CHECK(ndr_push_charset($ndr, $ndr_flags, $var_name, $length, sizeof(" . Parse::Pidl::Typelist::mapType($nl->{DATA_TYPE}) . "), CH_$e->{PROPERTIES}->{charset}));";
} else {
pidl "NDR_CHECK(ndr_push_array_$nl->{DATA_TYPE}($ndr, $ndr_flags, $var_name, $length));";
start_flags($e);
- if (my $value = Parse::Pidl::Util::has_property($e, "value")) {
+ if (my $value = has_property($e, "value")) {
$var_name = Parse::Pidl::Util::ParseExpr($value, $env);
}
my($e,$var_name,$env) = @_;
$var_name = append_prefix($e, $var_name);
- return if (Parse::Pidl::Util::has_property($e, "noprint"));
+ return if (has_property($e, "noprint"));
- if (my $value = Parse::Pidl::Util::has_property($e, "value")) {
+ if (my $value = has_property($e, "value")) {
$var_name = "(ndr->flags & LIBNDR_PRINT_SET_VALUES)?" . Parse::Pidl::Util::ParseExpr($value,$env) . ":$var_name";
}
}
if (is_scalar_array($e, $l)) {
- if (Parse::Pidl::Util::has_property($e, "charset")) {
+ if (has_property($e, "charset")) {
pidl "ndr_print_string(ndr, \"$e->{NAME}\", $var_name);";
} else {
my $nl = Parse::Pidl::NDR::GetNextLevel($e, $l);
pidl "NDR_CHECK(ndr_pull_$l->{DATA_TYPE}($ndr, $ndr_flags, $var_name));";
- if (my $range = Parse::Pidl::Util::has_property($e, "range")) {
+ if (my $range = has_property($e, "range")) {
$var_name = get_value_of($var_name);
my ($low, $high) = split(/ /, $range, 2);
pidl "if ($var_name < $low || $var_name > $high) {";
}
my $nl = Parse::Pidl::NDR::GetNextLevel($e, $l);
- if (Parse::Pidl::Util::has_property($e, "charset")) {
+ if (has_property($e, "charset")) {
pidl "NDR_CHECK(ndr_pull_charset($ndr, $ndr_flags, ".get_pointer_to($var_name).", $length, sizeof(" . Parse::Pidl::Typelist::mapType($nl->{DATA_TYPE}) . "), CH_$e->{PROPERTIES}->{charset}));";
} else {
pidl "NDR_CHECK(ndr_pull_array_$nl->{DATA_TYPE}($ndr, $ndr_flags, $var_name, $length));";
my $t = shift;
my $sizevar;
- if (my $flags = Parse::Pidl::Util::has_property($t, "flag")) {
+ if (my $flags = has_property($t, "flag")) {
pidl "flags |= $flags;";
}
pidl "return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_$t->{NAME});";
my $t = shift;
my $sizevar;
- if (my $flags = Parse::Pidl::Util::has_property($t, "flag")) {
+ if (my $flags = has_property($t, "flag")) {
pidl "flags |= $flags;";
}
{
my($fn) = shift;
- return if Parse::Pidl::Util::has_property($fn, "noprint");
+ return if has_property($fn, "noprint");
pidl "void ndr_print_$fn->{NAME}(struct ndr_print *ndr, const char *name, int flags, const struct $fn->{NAME} *r)";
pidl "{";
{
my($fn) = shift;
- return if Parse::Pidl::Util::has_property($fn, "nopush");
+ return if has_property($fn, "nopush");
pidl fn_prefix($fn) . "NTSTATUS ndr_push_$fn->{NAME}(struct ndr_push *ndr, int flags, const struct $fn->{NAME} *r)";
pidl "{";
{
my ($e,$l,$ndr,$env,$size) = @_;
- return if (Parse::Pidl::Util::has_property($e, "charset"));
+ return if (has_property($e, "charset"));
my $var = Parse::Pidl::Util::ParseExpr($e->{NAME}, $env);
{
my($fn) = shift;
- return if Parse::Pidl::Util::has_property($fn, "nopull");
+ return if has_property($fn, "nopull");
# pull function args
pidl fn_prefix($fn) . "NTSTATUS ndr_pull_$fn->{NAME}(struct ndr_pull *ndr, int flags, struct $fn->{NAME} *r)";
sub NeededTypedef($$)
{
my ($t,$needed) = @_;
- if (Parse::Pidl::Util::has_property($t, "public")) {
- $needed->{"pull_$t->{NAME}"} = not Parse::Pidl::Util::has_property($t, "nopull");
- $needed->{"push_$t->{NAME}"} = not Parse::Pidl::Util::has_property($t, "nopush");
- $needed->{"print_$t->{NAME}"} = not Parse::Pidl::Util::has_property($t, "noprint");
+ if (has_property($t, "public")) {
+ $needed->{"pull_$t->{NAME}"} = not has_property($t, "nopull");
+ $needed->{"push_$t->{NAME}"} = not has_property($t, "nopush");
+ $needed->{"print_$t->{NAME}"} = not has_property($t, "noprint");
}
if ($t->{DATA}->{TYPE} eq "STRUCT" or $t->{DATA}->{TYPE} eq "UNION") {
- if (Parse::Pidl::Util::has_property($t, "gensize")) {
+ if (has_property($t, "gensize")) {
$needed->{"ndr_size_$t->{NAME}"} = 1;
}
package Parse::Pidl::Typelist;
-use Parse::Pidl::Util;
+use Parse::Pidl::Util qw(has_property);
use strict;
my %typedefs = ();
sub enum_type_fn($)
{
my $enum = shift;
- if (Parse::Pidl::Util::has_property($enum->{PARENT}, "enum8bit")) {
+ if (has_property($enum->{PARENT}, "enum8bit")) {
return "uint8";
- } elsif (Parse::Pidl::Util::has_property($enum->{PARENT}, "v1_enum")) {
+ } elsif (has_property($enum->{PARENT}, "v1_enum")) {
return "uint32";
}
return "uint16";
{
my $bitmap = shift;
- if (Parse::Pidl::Util::has_property($bitmap, "bitmap8bit")) {
+ if (has_property($bitmap, "bitmap8bit")) {
return "uint8";
- } elsif (Parse::Pidl::Util::has_property($bitmap, "bitmap16bit")) {
+ } elsif (has_property($bitmap, "bitmap16bit")) {
return "uint16";
- } elsif (Parse::Pidl::Util::has_property($bitmap, "bitmap64bit")) {
+ } elsif (has_property($bitmap, "bitmap64bit")) {
return "hyper";
}
return "uint32";
NAME => $x->{NAME},
TYPE => "TYPEDEF",
DATA => $x
- }) if (Parse::Pidl::Util::has_property($x, "object"));
+ }) if (has_property($x, "object"));
foreach my $y (@{$x->{DATA}}) {
addType($y) if (
# released under the GNU GPL
package Parse::Pidl::Util;
+use Exporter 'import';
+@EXPORT_OK = qw(has_property property_matches);
+
use strict;
#####################################################################
package Parse::Pidl::Validator;
+use Parse::Pidl::Util qw(has_property);
+
use strict;
#####################################################################
ValidProperties($e,"ELEMENT");
- if (Parse::Pidl::Util::has_property($e, "ptr")) {
+ if (has_property($e, "ptr")) {
fatal($e, el_name($e) . " : pidl does not support full NDR pointers yet\n");
}
# Check whether switches are used correctly.
- if (my $switch = Parse::Pidl::Util::has_property($e, "switch_is")) {
+ if (my $switch = has_property($e, "switch_is")) {
my $e2 = find_sibling($e, $switch);
my $type = Parse::Pidl::Typelist::getType($e->{TYPE});
fatal($e, el_name($e) . ": switch_is() used on non-union type $e->{TYPE} which is a $type->{DATA}->{TYPE}");
}
- if (!Parse::Pidl::Util::has_property($type, "nodiscriminant") and defined($e2)) {
- my $discriminator_type = Parse::Pidl::Util::has_property($type, "switch_type");
+ if (!has_property($type, "nodiscriminant") and defined($e2)) {
+ my $discriminator_type = has_property($type, "switch_type");
$discriminator_type = "uint32" unless defined ($discriminator_type);
my $t1 = mapToScalar($discriminator_type);
}
}
- if (defined (Parse::Pidl::Util::has_property($e, "subcontext_size")) and not defined(Parse::Pidl::Util::has_property($e, "subcontext"))) {
+ if (defined (has_property($e, "subcontext_size")) and not defined(has_property($e, "subcontext"))) {
fatal($e, el_name($e) . " : subcontext_size() on non-subcontext element");
}
- if (defined (Parse::Pidl::Util::has_property($e, "compression")) and not defined(Parse::Pidl::Util::has_property($e, "subcontext"))) {
+ if (defined (has_property($e, "compression")) and not defined(has_property($e, "subcontext"))) {
fatal($e, el_name($e) . " : compression() on non-subcontext element");
}
- if (defined (Parse::Pidl::Util::has_property($e, "obfuscation")) and not defined(Parse::Pidl::Util::has_property($e, "subcontext"))) {
+ if (defined (has_property($e, "obfuscation")) and not defined(has_property($e, "subcontext"))) {
fatal($e, el_name($e) . " : obfuscation() on non-subcontext element");
}
if (!$e->{POINTERS} && (
- Parse::Pidl::Util::has_property($e, "ptr") or
- Parse::Pidl::Util::has_property($e, "sptr") or
- Parse::Pidl::Util::has_property($e, "unique") or
- Parse::Pidl::Util::has_property($e, "relative") or
- Parse::Pidl::Util::has_property($e, "ref"))) {
+ has_property($e, "ptr") or
+ has_property($e, "sptr") or
+ has_property($e, "unique") or
+ has_property($e, "relative") or
+ has_property($e, "ref"))) {
fatal($e, el_name($e) . " : pointer properties on non-pointer element\n");
}
}
ValidProperties($union,"UNION");
- if (Parse::Pidl::Util::has_property($union->{PARENT}, "nodiscriminant") and Parse::Pidl::Util::has_property($union->{PARENT}, "switch_type")) {
+ if (has_property($union->{PARENT}, "nodiscriminant") and has_property($union->{PARENT}, "switch_type")) {
fatal($union->{PARENT}, $union->{PARENT}->{NAME} . ": switch_type() on union without discriminant");
}
fatal $e, "Union member $e->{NAME} must have default or case property\n";
}
- if (Parse::Pidl::Util::has_property($e, "ref")) {
+ if (has_property($e, "ref")) {
fatal($e, el_name($e) . " : embedded ref pointers are not supported yet\n");
}
foreach my $e (@{$fn->{ELEMENTS}}) {
$e->{PARENT} = $fn;
- if (Parse::Pidl::Util::has_property($e, "ref") && !$e->{POINTERS}) {
+ if (has_property($e, "ref") && !$e->{POINTERS}) {
fatal $e, "[ref] variables must be pointers ($fn->{NAME}/$e->{NAME})\n";
}
ValidElement($e);
ValidProperties($interface,"INTERFACE");
- if (Parse::Pidl::Util::has_property($interface, "pointer_default") &&
+ if (has_property($interface, "pointer_default") &&
$interface->{PROPERTIES}->{pointer_default} eq "ptr") {
fatal $interface, "Full pointers are not supported yet\n";
}
- if (Parse::Pidl::Util::has_property($interface, "object")) {
- if (Parse::Pidl::Util::has_property($interface, "version") &&
+ if (has_property($interface, "object")) {
+ if (has_property($interface, "version") &&
$interface->{PROPERTIES}->{version} != 0) {
fatal $interface, "Object interfaces must have version 0.0 ($interface->{NAME})\n";
}