1 ###################################################
2 # Common Samba4 functions
3 # Copyright jelmer@samba.org 2006
4 # released under the GNU GPL
6 package Parse::Pidl::Samba4;
10 @EXPORT = qw(is_intree choose_header DeclLong);
12 use Parse::Pidl::Util qw(has_property is_constant);
13 use Parse::Pidl::Typelist qw(mapType scalar_is_reference);
16 use vars qw($VERSION);
21 return -f "kdc/kdc.c";
24 # Return an #include line depending on whether this build is an in-tree
29 return "#include \"$in\"" if (is_intree());
30 return "#include <$out>";
38 if (has_property($element, "represent_as")) {
39 $ret.=mapType($element->{PROPERTIES}->{represent_as})." ";
41 if (has_property($element, "charset")) {
44 $ret.=mapType($element->{TYPE});
48 my $numstar = $element->{ORIGINAL}->{POINTERS};
50 $numstar-- if scalar_is_reference($element->{TYPE});
52 foreach (@{$element->{ORIGINAL}->{ARRAY_LEN}})
54 next if is_constant($_) and
55 not has_property($element, "charset");
58 $ret.="*" foreach (1..$numstar);
60 $ret.=$element->{NAME};
61 foreach (@{$element->{ARRAY_LEN}}) {
62 next unless (is_constant($_) and not has_property($element, "charset"));