From 2d132edbab902c59ca6ca39b0bb42ab12693cee5 Mon Sep 17 00:00:00 2001 From: Derrell Lipman Date: Wed, 27 Dec 2006 21:22:01 +0000 Subject: r20364: SWAT updates, part 1 These next few check-ins will add a working Statistics module to SWAT, and add an API Documentation module as well. Next step will be to modify the LDB browser to work with this new module and fsm structure. Derrell (This used to be commit 29db71587f1332a9c44d5993a2be389f3a392ce4) --- source4/scripting/ejs/smbcalls_sys.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'source4') diff --git a/source4/scripting/ejs/smbcalls_sys.c b/source4/scripting/ejs/smbcalls_sys.c index 97fcc19cd1..ce3f3f5a98 100644 --- a/source4/scripting/ejs/smbcalls_sys.c +++ b/source4/scripting/ejs/smbcalls_sys.c @@ -165,6 +165,23 @@ static int ejs_sys_gmtime(MprVarHandle eid, int argc, struct MprVar **argv) return 0; } +/* + return the given NT time as a time_t value +*/ +static int ejs_sys_nttime2unix(MprVarHandle eid, int argc, struct MprVar **argv) +{ + time_t t; + struct MprVar v; + if (argc != 1 || !mprVarIsNumber(argv[0]->type)) { + ejsSetErrorMsg(eid, "sys_ntgmtime invalid arguments"); + return -1; + } + t = nt_time_to_unix(mprVarToNumber(argv[0])); + v = mprCreateNumberVar(t); + mpr_Return(eid, v); + return 0; +} + /* return the given NT time as a gmtime structure */ @@ -417,6 +434,7 @@ static int ejs_sys_init(MprVarHandle eid, int argc, struct MprVar **argv) mprSetCFunction(obj, "unix2nttime", ejs_sys_unix2nttime); mprSetCFunction(obj, "gmmktime", ejs_sys_gmmktime); mprSetCFunction(obj, "gmtime", ejs_sys_gmtime); + mprSetCFunction(obj, "nttime2unix", ejs_sys_nttime2unix); mprSetCFunction(obj, "ntgmtime", ejs_sys_ntgmtime); mprSetCFunction(obj, "ldaptime", ejs_sys_ldaptime); mprSetCFunction(obj, "httptime", ejs_sys_httptime); -- cgit