From 240ca36cf2a3ceb89e46b73486865a4a57339c89 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 20 Jul 2005 06:20:36 +0000 Subject: r8635: make object inheritance with the builtin objects easy by allowing callers to optionally supply an existing object to add the properties to. So you can do: var rpc = samr_init(); lsa_init(rpc); and you end up with 'rpc' having both the samr and lsa functions and constants available. (This used to be commit 6a1ed328e27769bd52899fc2437a43fc17104eff) --- source4/build/pidl/Parse/Pidl/Samba/EJS.pm | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'source4/build') diff --git a/source4/build/pidl/Parse/Pidl/Samba/EJS.pm b/source4/build/pidl/Parse/Pidl/Samba/EJS.pm index 0aa8de7c93..370db6d0e4 100644 --- a/source4/build/pidl/Parse/Pidl/Samba/EJS.pm +++ b/source4/build/pidl/Parse/Pidl/Samba/EJS.pm @@ -692,19 +692,18 @@ sub EjsInterface($$) pidl "static int ejs_$name\_init(int eid, int argc, struct MprVar **argv)"; pidl "{"; indent; - pidl "struct MprVar obj = mprObject(\"$name\");"; + pidl "struct MprVar *obj = mprInitObject(eid, \"$name\", argc, argv);"; foreach (@fns) { - pidl "mprSetCFunction(&obj, \"$_\", ejs_$_);"; + pidl "mprSetCFunction(obj, \"$_\", ejs_$_);"; } foreach my $v (keys %constants) { my $value = $constants{$v}; if (substr($value, 0, 1) eq "\"") { - pidl "mprSetVar(&obj, \"$v\", mprString($value));"; + pidl "mprSetVar(obj, \"$v\", mprString($value));"; } else { - pidl "mprSetVar(&obj, \"$v\", mprCreateNumberVar($value));"; + pidl "mprSetVar(obj, \"$v\", mprCreateNumberVar($value));"; } } - pidl "mpr_Return(eid, obj);"; pidl "return 0;"; deindent; pidl "}\n"; -- cgit