diff options
Diffstat (limited to 'source4/scripting/ejs/ejsrpc.c')
-rw-r--r-- | source4/scripting/ejs/ejsrpc.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/source4/scripting/ejs/ejsrpc.c b/source4/scripting/ejs/ejsrpc.c index 94987d69e1..992defe8bb 100644 --- a/source4/scripting/ejs/ejsrpc.c +++ b/source4/scripting/ejs/ejsrpc.c @@ -406,3 +406,20 @@ NTSTATUS ejs_push_GUID(struct ejs_rpc *ejs, NT_STATUS_HAVE_NO_MEMORY(guid); return mprSetVar(v, name, mprCreateStringVar(guid, True)); } + +NTSTATUS ejs_push_null(struct ejs_rpc *ejs, struct MprVar *v, const char *name) +{ + return mprSetVar(v, name, mprCreatePtrVar(NULL, name)); +} + +BOOL ejs_pull_null(struct ejs_rpc *ejs, struct MprVar *v, const char *name) +{ + v = mprGetVar(v, name); + if (v == NULL) { + return True; + } + if (v->type == MPR_TYPE_PTR && v->ptr == NULL) { + return True; + } + return False; +} |