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/scripting/ejs/smbcalls_rpc.c | |
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/scripting/ejs/smbcalls_rpc.c')
-rw-r--r-- | source4/scripting/ejs/smbcalls_rpc.c | 30 |
1 files changed, 4 insertions, 26 deletions
diff --git a/source4/scripting/ejs/smbcalls_rpc.c b/source4/scripting/ejs/smbcalls_rpc.c index ccb2026446..8e7bf57972 100644 --- a/source4/scripting/ejs/smbcalls_rpc.c +++ b/source4/scripting/ejs/smbcalls_rpc.c @@ -361,16 +361,13 @@ done: static struct ejs_register { struct ejs_register *next, *prev; const char *name; - ejs_setup_t setup; - ejs_constants_t constants; + MprCFunction fn; } *ejs_registered; /* register a generated ejs module */ - NTSTATUS smbcalls_register_ejs(const char *name, - ejs_setup_t setup, - ejs_constants_t constants) + NTSTATUS smbcalls_register_ejs(const char *name, MprCFunction fn) { struct ejs_register *r; void *ctx = ejs_registered; @@ -380,8 +377,7 @@ static struct ejs_register { r = talloc(ctx, struct ejs_register); NT_STATUS_HAVE_NO_MEMORY(r); r->name = name; - r->setup = setup; - r->constants = constants; + r->fn = fn; DLIST_ADD(ejs_registered, r); return NT_STATUS_OK; } @@ -396,24 +392,6 @@ void smb_setup_ejs_rpc(void) ejsDefineCFunction(-1, "rpc_connect", ejs_rpc_connect, NULL, MPR_VAR_SCRIPT_HANDLE); ejsDefineCFunction(-1, "irpc_connect", ejs_irpc_connect, NULL, MPR_VAR_SCRIPT_HANDLE); for (r=ejs_registered;r;r=r->next) { - r->setup(); + ejsDefineCFunction(-1, r->name, r->fn, NULL, MPR_VAR_SCRIPT_HANDLE); } } - -/* - setup constants for rpc calls -*/ -void smb_setup_ejs_rpc_constants(int eid) -{ - struct ejs_register *r; - struct MprVar v; - - for (r=ejs_registered;r;r=r->next) { - r->constants(eid); - } - - v = mprCreatePtrVar(NULL); - mprSetProperty(ejsGetGlobalObject(eid), "NULL", &v); -} - - |