diff options
author | Andrew Tridgell <tridge@samba.org> | 2005-07-15 11:23:17 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:23:09 -0500 |
commit | 84e3efd8ea1cdb48e20f2f42c32f3ffa7b822352 (patch) | |
tree | fb0222c46d9a6db77cc8ae275045d11fc8ad4d79 /source4/scripting/ejs/mprutil.c | |
parent | 94d99612b9093ca83da3b6b66f875915eeabb389 (diff) | |
download | samba-84e3efd8ea1cdb48e20f2f42c32f3ffa7b822352.tar.gz samba-84e3efd8ea1cdb48e20f2f42c32f3ffa7b822352.tar.xz samba-84e3efd8ea1cdb48e20f2f42c32f3ffa7b822352.zip |
r8489: neaten up the object handling
(This used to be commit ccf20b2b13b11ac07b59988809b6c5160388a616)
Diffstat (limited to 'source4/scripting/ejs/mprutil.c')
-rw-r--r-- | source4/scripting/ejs/mprutil.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/source4/scripting/ejs/mprutil.c b/source4/scripting/ejs/mprutil.c index f25064f245..f9813f2597 100644 --- a/source4/scripting/ejs/mprutil.c +++ b/source4/scripting/ejs/mprutil.c @@ -385,3 +385,21 @@ void mpr_ReturnString(int eid, const char *s) { mprSetVar(obj, name, mprCreateStringCFunctionVar(fn, obj, MPR_VAR_SCRIPT_HANDLE)); } + +/* + get a poiner in the current object +*/ +void *mprGetThisPtr(int eid, const char *name) +{ + struct MprVar *this = mprGetProperty(ejsGetLocalObject(eid), "this", 0); + return mprGetPtr(this, name); +} + +/* + set a pointer as a child of the local object +*/ +void mprSetThisPtr(int eid, const char *name, void *ptr) +{ + struct MprVar *this = mprGetProperty(ejsGetLocalObject(eid), "this", 0); + mprSetPtrChild(this, name, ptr); +} |