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(mapTypeName scalar_is_reference);
16 use vars
qw($VERSION);
21 return 4 if (-f "kdc/kdc.c");
22 return 3 if (-f "include/smb.h");
26 # Return an #include line depending on whether this build is an in-tree
31 return "#include \"$in\"" if (is_intree());
32 return "#include <$out>";
40 if (has_property($element, "represent_as")) {
41 $ret.=mapTypeName($element->{PROPERTIES}->{represent_as})." ";
43 if (has_property($element, "charset")) {
46 $ret.=mapTypeName($element->{TYPE});
50 my $numstar = $element->{ORIGINAL}->{POINTERS};
52 $numstar-- if scalar_is_reference($element->{TYPE});
54 foreach (@{$element->{ORIGINAL}->{ARRAY_LEN}})
56 next if is_constant($_) and
57 not has_property($element, "charset");
60 $ret.="*" foreach (1..$numstar);
62 $ret.=$element->{NAME};
63 foreach (@{$element->{ARRAY_LEN}}) {
64 next unless (is_constant($_) and not has_property($element, "charset"));