From e9705b2fcb179fd16b60ab35c31bff87a5704743 Mon Sep 17 00:00:00 2001 From: ngld Date: Wed, 25 Sep 2013 16:41:40 +0200 Subject: Add timeb.h to struct_info.json --- src/library.js | 16 ++++------------ src/struct_info.json | 14 +++++++++++++- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/src/library.js b/src/library.js index b45dd8f5..2e2298ec 100644 --- a/src/library.js +++ b/src/library.js @@ -6069,20 +6069,12 @@ LibraryManager.library = { // sys/timeb.h // ========================================================================== - // TODO: Where did this header go? - __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 + {{{ makeSetValue('p', C_STRUCTS.timeb.time, 'Math.floor(millis/1000)', 'i32') }}}; + {{{ makeSetValue('p', C_STRUCTS.timeb.millitm, 'millis % 1000', 'i16') }}}; + {{{ makeSetValue('p', C_STRUCTS.timeb.timezone, '0', 'i16') }}}; // TODO + {{{ makeSetValue('p', C_STRUCTS.timeb.dstflag, '0', 'i16') }}}; // TODO return 0; }, diff --git a/src/struct_info.json b/src/struct_info.json index 2b095a8c..28d24279 100644 --- a/src/struct_info.json +++ b/src/struct_info.json @@ -224,7 +224,19 @@ "tms_cstime" ] } - }, + }, + { + "defines": [], + "file": "compat/sys/timeb.h", + "structs": { + "timeb": [ + "time", + "millitm", + "timezone", + "dstflag" + ] + } + }, { "file": "libc/sys/resource.h", "defines": [], -- cgit v1.2.3-18-g5258