aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-12-20 14:43:16 -0800
committerAlon Zakai <alonzakai@gmail.com>2012-12-20 14:43:16 -0800
commit1a4c4fd9f3354aa06f885b3c843bc143ad534e1f (patch)
tree710d3f87da3bd534d5a24c5a557ebbf8d17c8c25 /src
parent1c05b7a56995b8b6f91d67731a3e2d0c082c517c (diff)
timeb
Diffstat (limited to 'src')
-rw-r--r--src/library.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/library.js b/src/library.js
index 1bdd840d..93d54d68 100644
--- a/src/library.js
+++ b/src/library.js
@@ -5886,6 +5886,26 @@ LibraryManager.library = {
},
// ==========================================================================
+ // sys/timeb.h
+ // ==========================================================================
+
+ __timeb_struct_layout: Runtime.generateStructInfo([
+ ['i32', 'time'],
+ ['i16', 'millitm'],
+ ['i16', 'timezone'],
+ ['i16', 'dstflag']
+ ]),
+ ftime__deps: ['__timeb_struct_layout'],
+ ftime: function(p) {
+ var millis = Date.now();
+ {{{ makeSetValue('p', '___timeb_struct_layout.time', 'Math.floor(millis/1000)', 'i32') }}};
+ {{{ makeSetValue('p', '___timeb_struct_layout.millitm', 'millis % 1000', 'i16') }}};
+ {{{ makeSetValue('p', '___timeb_struct_layout.timezone', '0', 'i16') }}}; // TODO
+ {{{ makeSetValue('p', '___timeb_struct_layout.dstflag', '0', 'i16') }}}; // TODO
+ return 0;
+ },
+
+ // ==========================================================================
// sys/times.h
// ==========================================================================