diff options
author | Andrew Tridgell <tridge@samba.org> | 2005-07-15 07:18:23 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:23:08 -0500 |
commit | a0bc4da1a307753e3b28a11863f50d66b0894190 (patch) | |
tree | d16430b5a02dd01188c7aa1722181eb947ec9442 /source4/build/pidl | |
parent | 7b8332369f3664af13bd7760561765a35c312b9e (diff) | |
download | samba-a0bc4da1a307753e3b28a11863f50d66b0894190.tar.gz samba-a0bc4da1a307753e3b28a11863f50d66b0894190.tar.bz2 samba-a0bc4da1a307753e3b28a11863f50d66b0894190.zip |
r8483: switched our generated ejs rpc code over to the new OO interface. This
means we don't pollute the name space, and also makes for faster
startup times as we only create variables for the pipes that we use,
not all pipes
(This used to be commit 57d7a585e8162d21c7152952aa0cc7471968784f)
Diffstat (limited to 'source4/build/pidl')
-rw-r--r-- | source4/build/pidl/Parse/Pidl/Samba/EJS.pm | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/source4/build/pidl/Parse/Pidl/Samba/EJS.pm b/source4/build/pidl/Parse/Pidl/Samba/EJS.pm index d2d8b41507..0aa8de7c93 100644 --- a/source4/build/pidl/Parse/Pidl/Samba/EJS.pm +++ b/source4/build/pidl/Parse/Pidl/Samba/EJS.pm @@ -689,33 +689,30 @@ sub EjsInterface($$) EjsConst($d); } - pidl "void setup_ejs_$name(void)"; + pidl "static int ejs_$name\_init(int eid, int argc, struct MprVar **argv)"; pidl "{"; indent; + pidl "struct MprVar obj = mprObject(\"$name\");"; foreach (@fns) { - pidl "ejsDefineCFunction(-1, \"dcerpc_$_\", ejs_$_, NULL, MPR_VAR_SCRIPT_HANDLE);"; + pidl "mprSetCFunction(&obj, \"$_\", ejs_$_);"; } - deindent; - pidl "}\n"; - - pidl "void setup_ejs_constants_$name(int eid)"; - pidl "{"; - indent; foreach my $v (keys %constants) { my $value = $constants{$v}; if (substr($value, 0, 1) eq "\"") { - pidl "ejs_set_constant_string(eid, \"$v\", $value);"; + pidl "mprSetVar(&obj, \"$v\", mprString($value));"; } else { - pidl "ejs_set_constant_int(eid, \"$v\", $value);"; + pidl "mprSetVar(&obj, \"$v\", mprCreateNumberVar($value));"; } } + pidl "mpr_Return(eid, obj);"; + pidl "return 0;"; deindent; pidl "}\n"; pidl "NTSTATUS ejs_init_$name(void)"; pidl "{"; indent; - pidl "return smbcalls_register_ejs(\"$name\", setup_ejs_$name, setup_ejs_constants_$name);"; + pidl "return smbcalls_register_ejs(\"$name\_init\", ejs_$name\_init);"; deindent; pidl "}"; } @@ -734,6 +731,7 @@ sub Parse($$) #include \"includes.h\" #include \"lib/appweb/ejs/ejs.h\" #include \"scripting/ejs/ejsrpc.h\" +#include \"scripting/ejs/smbcalls.h\" #include \"librpc/gen_ndr/ndr_misc_ejs.h\" #include \"$hdr\" #include \"$ejs_hdr\" |