summaryrefslogtreecommitdiff
path: root/source4/build
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-07-08 04:07:26 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:19:20 -0500
commit5fa5eb1da002a64d48779d89e2fab0d53e9f15f7 (patch)
tree9af6fdb1d2f8f556171ed5e607bd47dae00aaff6 /source4/build
parent7fded3c856735050e7d72972da8bc2cd19f01cd8 (diff)
downloadsamba-5fa5eb1da002a64d48779d89e2fab0d53e9f15f7.tar.gz
samba-5fa5eb1da002a64d48779d89e2fab0d53e9f15f7.tar.bz2
samba-5fa5eb1da002a64d48779d89e2fab0d53e9f15f7.zip
r8216: - handle union pull in ejs pidl generation
- added debugging calls for missing structure/union elements (This used to be commit f3ff48204cb8edeb9f42afbbefe13f7d49305506)
Diffstat (limited to 'source4/build')
-rw-r--r--source4/build/pidl/ejs.pm21
1 files changed, 19 insertions, 2 deletions
diff --git a/source4/build/pidl/ejs.pm b/source4/build/pidl/ejs.pm
index 1b5c34510c..3fe9579aba 100644
--- a/source4/build/pidl/ejs.pm
+++ b/source4/build/pidl/ejs.pm
@@ -193,10 +193,26 @@ sub EjsUnionPull($$)
{
my $name = shift;
my $d = shift;
+ my $have_default = 0;
my $env = GenerateStructEnv($d);
pidl "\nstatic NTSTATUS ejs_pull_$name(struct ejs_rpc *ejs, struct MprVar *v, const char *name, union $name *r)\n{\n";
- pidl "return ejs_panic(ejs, \"union pull not handled\");\n";
- pidl "}\n\n";
+ pidl "\tNDR_CHECK(ejs_pull_struct_start(ejs, &v, name));\n";
+ pidl "switch (ejs->switch_var) {\n";
+ foreach my $e (@{$d->{ELEMENTS}}) {
+ if ($e->{CASE} eq "default") {
+ $have_default = 1;
+ }
+ pidl "$e->{CASE}:";
+ if ($e->{TYPE} ne "EMPTY") {
+ EjsPullElementTop($e, $env);
+ }
+ pidl "break;\n";
+ }
+ if (! $have_default) {
+ pidl "default:";
+ pidl "\treturn ejs_panic(ejs, \"Bad switch value\");";
+ }
+ pidl "}\nreturn NT_STATUS_OK;\n}\n";
}
###########################
@@ -368,6 +384,7 @@ sub EjsUnionPush($$)
my $have_default = 0;
my $env = GenerateStructEnv($d);
pidl "\nstatic NTSTATUS ejs_push_$name(struct ejs_rpc *ejs, struct MprVar *v, const char *name, const union $name *r)\n{\n";
+ pidl "\tNDR_CHECK(ejs_push_struct_start(ejs, &v, name));\n";
pidl "switch (ejs->switch_var) {\n";
foreach my $e (@{$d->{ELEMENTS}}) {
if ($e->{CASE} eq "default") {