summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorDerrell Lipman <derrell@samba.org>2006-12-27 21:22:01 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:30:16 -0500
commit2d132edbab902c59ca6ca39b0bb42ab12693cee5 (patch)
tree5f772da013e701926684b3c91499710b889381a9 /source4
parentb5aa81635d8eaf200d88fd37ee11c31dc9042659 (diff)
downloadsamba-2d132edbab902c59ca6ca39b0bb42ab12693cee5.tar.gz
samba-2d132edbab902c59ca6ca39b0bb42ab12693cee5.tar.bz2
samba-2d132edbab902c59ca6ca39b0bb42ab12693cee5.zip
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)
Diffstat (limited to 'source4')
-rw-r--r--source4/scripting/ejs/smbcalls_sys.c18
1 files changed, 18 insertions, 0 deletions
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
@@ -166,6 +166,23 @@ static int ejs_sys_gmtime(MprVarHandle eid, int argc, struct MprVar **argv)
}
/*
+ 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
*/
static int ejs_sys_ntgmtime(MprVarHandle eid, int argc, struct MprVar **argv)
@@ -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);