aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorngld <ngld@tproxy.de>2013-09-25 16:41:40 +0200
committerngld <ngld@tproxy.de>2013-09-25 16:41:40 +0200
commite9705b2fcb179fd16b60ab35c31bff87a5704743 (patch)
tree0b27f91984cf181035a29eae7256fdfd008ec1da
parent43ed0e83b8f387eb4ca2eb8e491a4c810d74e56b (diff)
Add timeb.h to struct_info.json
-rw-r--r--src/library.js16
-rw-r--r--src/struct_info.json14
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": [],