package Parse::Pidl::Samba4::COM::Header;
-use Parse::Pidl::Typelist qw(mapType);
+use Parse::Pidl::Typelist qw(mapTypeName);
use Parse::Pidl::Util qw(has_property is_constant);
use vars qw($VERSION);
foreach my $a (@{$f->{ELEMENTS}}) {
- $res .= ", " . mapType($a->{TYPE}) . " ";
+ $res .= ", " . mapTypeName($a->{TYPE}) . " ";
my $l = $a->{POINTERS};
$l-- if (Parse::Pidl::Typelist::scalar_is_reference($a->{TYPE}));
my $data = $interface->{DATA};
foreach my $d (@{$data}) {
- $res .= "\t" . mapType($d->{RETURN_TYPE}) . " (*$d->{NAME}) (struct $interface->{NAME} *d, TALLOC_CTX *mem_ctx" . GetArgumentProtoList($d) . ");\\\n" if ($d->{TYPE} eq "FUNCTION");
+ $res .= "\t" . mapTypeName($d->{RETURN_TYPE}) . " (*$d->{NAME}) (struct $interface->{NAME} *d, TALLOC_CTX *mem_ctx" . GetArgumentProtoList($d) . ");\\\n" if ($d->{TYPE} eq "FUNCTION");
}
$res .= "\n";
$res .= "struct $interface->{NAME}_vtable {\n";
@ISA = qw(Exporter);
use strict;
+use Parse::Pidl qw(warning fatal);
use Parse::Pidl::Typelist qw(hasType resolveType getType mapTypeName expandAlias);
use Parse::Pidl::Util qw(has_property ParseExpr);
use Parse::Pidl::NDR qw(GetPrevLevel GetNextLevel ContainsDeferred is_charset_array);
return;
}
- if ($actual_ctype->{TYPE} eq "STRUCT") {
+ if ($actual_ctype->{TYPE} eq "STRUCT" or $actual_ctype->{TYPE} eq "INTERFACE") {
$self->pidl("PY_CHECK_TYPE($ctype->{NAME}, $cvar, $fail);");
$self->assign($target, "py_talloc_get_ptr($cvar)");
return;
return;
}
- die("unknown type ".mapTypeName($ctype) . ": $cvar");
+ fatal($ctype, "unknown type $actual_ctype->{TYPE} for ".mapTypeName($ctype) . ": $cvar");
}
} elsif ($actual_ctype->{TYPE} eq "SCALAR") {
return $self->ConvertScalarToPython($actual_ctype->{NAME}, $cvar);
} elsif ($actual_ctype->{TYPE} eq "UNION") {
- # FIXME: Should be fatal() rather than die()
- die("union without discriminant: " . mapTypeName($ctype) . ": $cvar");
+ fatal($ctype, "union without discriminant: " . mapTypeName($ctype) . ": $cvar");
} elsif ($actual_ctype->{TYPE} eq "STRUCT" or $actual_ctype->{TYPE} eq "INTERFACE") {
return "py_talloc_import_ex(&$ctype->{NAME}_Type, $mem_ctx, $cvar)";
}
- die("unknown type ".mapTypeName($ctype) . ": $cvar");
+ fatal($ctype, "unknown type $actual_ctype->{TYPE} for ".mapTypeName($ctype) . ": $cvar");
}
sub fail_on_null($$$)