From 94e5cafff2f9eae90b4218c04eb554e0eff30316 Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Fri, 5 Aug 2005 15:54:11 +0000 Subject: r9124: Handle more types pointers to simple types. (This used to be commit acd34c1cac151e16f5cecae8c80a01b36ccd3fc0) --- source4/script/build_smb_interfaces.pl | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'source4/script/build_smb_interfaces.pl') diff --git a/source4/script/build_smb_interfaces.pl b/source4/script/build_smb_interfaces.pl index 7c9bd3d365..3aacc6df55 100755 --- a/source4/script/build_smb_interfaces.pl +++ b/source4/script/build_smb_interfaces.pl @@ -77,7 +77,7 @@ sub print_field($$) { my $f = shift; my $suffix = shift; - my $type = "UNKNOWN"; + my $type = $f->{TYPE}; if ($f->{TYPE} eq "char" and $f->{POINTERS} == 1) { $type = "string"; @@ -88,8 +88,16 @@ sub print_field($$) { $type =~ s/_t$//; } + my $deref = "&"; + if ($f->{POINTERS} == 1 && $type ne "string") { + $deref = ""; + } + foreach my $x (@{$f->{NAME}}) { - print FILE "\tNDR_CHECK(ejs_pull_$type(ejs, v, \"$x\", &r->$suffix.$x));\n"; + if ($f->{POINTERS} > 0) { + print FILE "\t// alloc $x?\n"; + } + print FILE "\tNDR_CHECK(ejs_pull_$type(ejs, v, \"$x\", ${deref}r->$suffix.$x));\n"; } } -- cgit