diff options
author | Andrew Tridgell <tridge@samba.org> | 2005-07-07 06:25:04 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:19:18 -0500 |
commit | 7c3fc18315645f2f7a31732c0b1505a2bef29cb7 (patch) | |
tree | 8c443965368704a6c56351739f50c73d67cd6f01 /source4/scripting/ejs/smbcalls_rpc.c | |
parent | 93aba2c0871a0991dceba2a580d4b04f196adec3 (diff) | |
download | samba-7c3fc18315645f2f7a31732c0b1505a2bef29cb7.tar.gz samba-7c3fc18315645f2f7a31732c0b1505a2bef29cb7.tar.bz2 samba-7c3fc18315645f2f7a31732c0b1505a2bef29cb7.zip |
r8192: updated the glue code for the generated ejs functions from pidl
only handles a small subset of all IDL files so far
(This used to be commit 14b6436cc51f599572932bef72c49e0da4888073)
Diffstat (limited to 'source4/scripting/ejs/smbcalls_rpc.c')
-rw-r--r-- | source4/scripting/ejs/smbcalls_rpc.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/source4/scripting/ejs/smbcalls_rpc.c b/source4/scripting/ejs/smbcalls_rpc.c index ec47da0e9c..631f1c3a37 100644 --- a/source4/scripting/ejs/smbcalls_rpc.c +++ b/source4/scripting/ejs/smbcalls_rpc.c @@ -81,29 +81,28 @@ done: example: status = rpc_call(conn, "echo_AddOne", io); */ -static int ejs_rpc_call(MprVarHandle eid, int argc, struct MprVar **argv) + int ejs_rpc_call(int eid, int argc, struct MprVar **argv, + const char *callname, + ejs_pull_function_t ejs_pull, ejs_push_function_t ejs_push) { struct MprVar *conn, *io; const struct dcerpc_interface_table *iface; struct dcerpc_pipe *p; - const char *callname; const struct dcerpc_interface_call *call; NTSTATUS status; void *ptr; struct rpc_request *req; int callnum; - if (argc != 3 || + if (argc != 2 || argv[0]->type != MPR_TYPE_OBJECT || - argv[1]->type != MPR_TYPE_STRING || - argv[2]->type != MPR_TYPE_OBJECT) { + argv[1]->type != MPR_TYPE_OBJECT) { ejsSetErrorMsg(eid, "rpc_call invalid arguments"); return -1; } conn = argv[0]; - callname = mprToString(argv[1]); - io = argv[2]; + io = argv[1]; /* get the pipe info */ p = mprGetPtr(conn, "pipe"); @@ -129,7 +128,7 @@ static int ejs_rpc_call(MprVarHandle eid, int argc, struct MprVar **argv) } /* convert the mpr object into a C structure */ - status = ejs_pull_rpc(io, ptr, (ejs_pull_function_t)ejs_pull_echo_AddOne); + status = ejs_pull_rpc(io, ptr, ejs_pull); if (!NT_STATUS_IS_OK(status)) { goto done; } @@ -153,7 +152,7 @@ static int ejs_rpc_call(MprVarHandle eid, int argc, struct MprVar **argv) ndr_print_function_debug(call->ndr_print, call->name, NDR_OUT, ptr); } - status = ejs_push_rpc(io, ptr, (ejs_push_function_t)ejs_push_echo_AddOne); + status = ejs_push_rpc(io, ptr, ejs_push); talloc_free(ptr); done: @@ -161,13 +160,13 @@ done: return 0; } + /* setup C functions that be called from ejs */ void smb_setup_ejs_rpc(void) { + void setup_ejs_rpcecho(void); ejsDefineCFunction(-1, "rpc_connect", ejs_rpc_connect, NULL, MPR_VAR_SCRIPT_HANDLE); - ejsDefineCFunction(-1, "rpc_call", ejs_rpc_call, NULL, MPR_VAR_SCRIPT_HANDLE); + setup_ejs_rpcecho(); } - - |