summaryrefslogtreecommitdiff
path: root/source4/scripting/ejs/ejsrpc.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-07-08 03:10:30 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:19:20 -0500
commitceb277ced9ccd13936384e94c567b37c5db2c46e (patch)
tree8d5df4dbc86b7b21f323c15f5ff529059ad62f82 /source4/scripting/ejs/ejsrpc.c
parente296c8de6e57a321116f01135c5c6fcf215245a8 (diff)
downloadsamba-ceb277ced9ccd13936384e94c567b37c5db2c46e.tar.gz
samba-ceb277ced9ccd13936384e94c567b37c5db2c46e.tar.bz2
samba-ceb277ced9ccd13936384e94c567b37c5db2c46e.zip
r8213: I've started to understand the LEVELS stuff in pidl much better now,
and have re-coded the push side of the ejs generator to use it properly. It ends up being very neat and small, and should handle much more complex structures (like arrays of pointers to unions etc). Also added push side support for unions. This should get more of the echo pipe working via ejs. (This used to be commit 2e306be1d83f722c259c4a63233e77d8bb1d5a72)
Diffstat (limited to 'source4/scripting/ejs/ejsrpc.c')
-rw-r--r--source4/scripting/ejs/ejsrpc.c33
1 files changed, 8 insertions, 25 deletions
diff --git a/source4/scripting/ejs/ejsrpc.c b/source4/scripting/ejs/ejsrpc.c
index 75f748f146..965fd8d447 100644
--- a/source4/scripting/ejs/ejsrpc.c
+++ b/source4/scripting/ejs/ejsrpc.c
@@ -45,6 +45,13 @@ NTSTATUS ejs_push_rpc(int eid, const char *callname,
return ejs_push(ejs, v, ptr);
}
+/*
+ set the switch var to be used by the next union switch
+*/
+void ejs_set_switch(struct ejs_rpc *ejs, uint32_t switch_var)
+{
+ ejs->switch_var = switch_var;
+}
/*
panic in the ejs wrapper code
@@ -274,34 +281,10 @@ NTSTATUS ejs_pull_array(struct ejs_rpc *ejs,
/*
- push an array of elements
-*/
-NTSTATUS ejs_push_array(struct ejs_rpc *ejs,
- struct MprVar *v, const char *name, uint32_t length,
- size_t elsize, void *r, ejs_push_t ejs_push)
-{
- int i;
- char *data;
-
- NDR_CHECK(ejs_push_struct_start(ejs, &v, name));
-
- data = r;
-
- for (i=0;i<length;i++) {
- char *id = talloc_asprintf(ejs, "%u", i);
- NT_STATUS_HAVE_NO_MEMORY(id);
- NDR_CHECK(ejs_push(ejs, v, id, (i*elsize)+data));
- talloc_free(id);
- }
- return mprSetVar(v, "length", mprCreateIntegerVar(i));
-}
-
-
-/*
pull a string
*/
NTSTATUS ejs_pull_string(struct ejs_rpc *ejs,
- struct MprVar *v, const char *name, const char **s)
+ struct MprVar *v, const char *name, char **s)
{
struct MprVar *var;
var = mprGetVar(v, name);