From 63535f566e2fbe9244fd3e50b9c8d1281b822fc0 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 15 Jul 2005 05:40:34 +0000 Subject: r8481: switched ldb ejs called over to an OO interface, so you do: var ldb = ldb_init(); res = ldb.search(dbfile, "(objectClass=user)"); you can also do: ldbSearch = ldb.search; res = ldbSearch(dbfile, "(objectClass=user)"); if you want the old interface (ie. you can use this to import functions into the global or local namespace). (This used to be commit 3093057d9735cbb62f57e7159264d5a28b85320f) --- source4/scripting/ejs/mprutil.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'source4/scripting/ejs/mprutil.c') diff --git a/source4/scripting/ejs/mprutil.c b/source4/scripting/ejs/mprutil.c index 49c4f74cd6..247cea0b06 100644 --- a/source4/scripting/ejs/mprutil.c +++ b/source4/scripting/ejs/mprutil.c @@ -367,3 +367,18 @@ void mpr_ReturnString(int eid, const char *s) } +/* + set a C function in a variable +*/ + void mprSetCFunction(struct MprVar *obj, const char *name, MprCFunction fn) +{ + mprSetVar(obj, name, mprCreateCFunctionVar(fn, NULL, MPR_VAR_SCRIPT_HANDLE)); +} + +/* + set a string C function in a variable +*/ + void mprSetStringCFunction(struct MprVar *obj, const char *name, MprStringCFunction fn) +{ + mprSetVar(obj, name, mprCreateStringCFunctionVar(fn, NULL, MPR_VAR_SCRIPT_HANDLE)); +} -- cgit