diff options
author | Andrew Tridgell <tridge@samba.org> | 2003-11-16 13:48:05 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2003-11-16 13:48:05 +0000 |
commit | c4b7585288095cb9459feb237a9581ba30b850d0 (patch) | |
tree | b6deb6afcad3981759012e2301633446e081724f /source4/build/pidl/header.pm | |
parent | ea266c0625e04a2dc10d25c2fee7b685965fcd3e (diff) | |
download | samba-c4b7585288095cb9459feb237a9581ba30b850d0.tar.gz samba-c4b7585288095cb9459feb237a9581ba30b850d0.tar.bz2 samba-c4b7585288095cb9459feb237a9581ba30b850d0.zip |
* the beginnings of non-constant fixed arrays
* added relative pointers support
(This used to be commit 4a34a4f29cf8ab79582ce7b503da907df7b4d209)
Diffstat (limited to 'source4/build/pidl/header.pm')
-rw-r--r-- | source4/build/pidl/header.pm | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/source4/build/pidl/header.pm b/source4/build/pidl/header.pm index e5acad2a63..7f7f2db977 100644 --- a/source4/build/pidl/header.pm +++ b/source4/build/pidl/header.pm @@ -59,13 +59,14 @@ sub HeaderElement($) $res .= "*"; } } - if (defined $element->{ARRAY_LEN} && $element->{ARRAY_LEN} eq "*") { + if (defined $element->{ARRAY_LEN} && + !util::is_constant($element->{ARRAY_LEN})) { # conformant arrays are ugly! I choose to implement them with # pointers instead of the [1] method $res .= "*"; } $res .= "$element->{NAME}"; - if (defined $element->{ARRAY_LEN} && $element->{ARRAY_LEN} ne "*") { + if (defined $element->{ARRAY_LEN} && util::is_constant($element->{ARRAY_LEN})) { $res .= "[$element->{ARRAY_LEN}]"; } $res .= ";\n"; @@ -128,7 +129,7 @@ sub HeaderType($$$) } if ($data =~ "unistr") { $res .= "const char"; - } elsif ($data =~ "relstr") { + } elsif ($data =~ "nstring") { $res .= "const char *"; } elsif (util::is_scalar_type($data)) { $res .= "$data"; @@ -198,6 +199,9 @@ sub HeaderInterface($) my($interface) = shift; my($data) = $interface->{DATA}; foreach my $d (@{$data}) { + if (!defined $d->{TYPE}) { + print Dumper $d; + } ($d->{TYPE} eq "TYPEDEF") && HeaderTypedef($d); ($d->{TYPE} eq "FUNCTION") && |