From ceb277ced9ccd13936384e94c567b37c5db2c46e Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 8 Jul 2005 03:10:30 +0000 Subject: 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) --- source4/scripting/ejs/ejsrpc.c | 33 ++++++++------------------------- source4/scripting/ejs/ejsrpc.h | 9 +++++---- 2 files changed, 13 insertions(+), 29 deletions(-) (limited to 'source4/scripting/ejs') 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 @@ -273,35 +280,11 @@ 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