1
0
mirror of https://github.com/samba-team/samba.git synced 2025-10-30 08:23:49 +03:00

r8488: after discussions with simo, moved to a full OO interface, so you don't need to keep

a 'db' variable around. The ldb object knows what it is connected to.

Added a simple ldb testsuite in testprogs/ldb.js
This commit is contained in:
Andrew Tridgell
2005-07-15 11:10:38 +00:00
committed by Gerald (Jerry) Carter
parent adae47c829
commit cf35818648
5 changed files with 109 additions and 61 deletions

View File

@@ -202,6 +202,9 @@ struct MprVar mprLdbArray(struct ldb_message **msg, int count, const char *name)
for (i=0;i<count;i++) {
mprAddArray(&res, i, mprLdbMessage(msg[i]));
}
if (i==0) {
mprSetVar(&res, "length", mprCreateIntegerVar(0));
}
return res;
}
@@ -372,7 +375,7 @@ void mpr_ReturnString(int eid, const char *s)
*/
void mprSetCFunction(struct MprVar *obj, const char *name, MprCFunction fn)
{
mprSetVar(obj, name, mprCreateCFunctionVar(fn, NULL, MPR_VAR_SCRIPT_HANDLE));
mprSetVar(obj, name, mprCreateCFunctionVar(fn, obj, MPR_VAR_SCRIPT_HANDLE));
}
/*
@@ -380,5 +383,5 @@ void mpr_ReturnString(int eid, const char *s)
*/
void mprSetStringCFunction(struct MprVar *obj, const char *name, MprStringCFunction fn)
{
mprSetVar(obj, name, mprCreateStringCFunctionVar(fn, NULL, MPR_VAR_SCRIPT_HANDLE));
mprSetVar(obj, name, mprCreateStringCFunctionVar(fn, obj, MPR_VAR_SCRIPT_HANDLE));
}