return ($t->{NAME} eq "uint8");
}
+sub is_public_struct
+{
+ my ($d) = @_;
+ if (!has_property($d, "public")) {
+ return 0;
+ }
+ my $t = $d;
+ if ($d->{TYPE} eq "TYPEDEF") {
+ $t = $d->{DATA};
+ }
+ return $t->{TYPE} eq "STRUCT";
+}
####################################
# defer() is like pidl(), but adds to
my $uname = uc $interface->{NAME};
foreach my $d (@{$interface->{TYPES}}) {
- next unless (has_property($d, "public"));
+ next unless (is_public_struct($d));
$count_public_structs += 1;
}
return if ($#{$interface->{FUNCTIONS}}+1 == 0 and
$self->pidl("static const struct ndr_interface_public_struct $interface->{NAME}\_public_structs[] = {");
foreach my $d (@{$interface->{TYPES}}) {
- next unless (has_property($d, "public"));
- $self->StructEntry($d)
+ next unless (is_public_struct($d));
+ $self->StructEntry($d);
}
$self->pidl("\t{ .name = NULL }");
$self->pidl("};");
$self->pidl_hdr("void ".TypeFunctionName("ndr_print", $e)."(struct ndr_print *ndr, const char *name, $args);");
- if (has_property($e, "public")) {
+ if (is_public_struct($e)) {
$self->pidl("static void ".TypeFunctionName("ndr_print_flags", $e).
"(struct ndr_print *$ndr, const char *name, int unused, $args)"
);