aboutsummaryrefslogtreecommitdiff
path: root/src/library.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/library.js')
-rw-r--r--src/library.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/library.js b/src/library.js
index 1f2d46aa..0e5919ad 100644
--- a/src/library.js
+++ b/src/library.js
@@ -5867,6 +5867,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
// ==========================================================================