diff options
author | Alon Zakai <azakai@mozilla.com> | 2010-12-11 13:22:09 -0800 |
---|---|---|
committer | Alon Zakai <azakai@mozilla.com> | 2010-12-11 13:22:09 -0800 |
commit | 965d44dc699c22669b0fb4800e15e010f0bf48c0 (patch) | |
tree | c4a052a70f84c1dfb22d9ce2e416ecdc7140338f /src/library.js | |
parent | b74419d19e6e718cc966d4a610167a1029a1e064 (diff) |
python fixes and test
Diffstat (limited to 'src/library.js')
-rw-r--r-- | src/library.js | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/library.js b/src/library.js index 166806ba..9a979ade 100644 --- a/src/library.js +++ b/src/library.js @@ -29,6 +29,10 @@ var Library = { __print__(Pointer_stringify(p) + '\n'); }, + fputc: function(chr, stream) { + __print__(String.fromCharCode(chr)); + }, + putchar: function(p) { __print__(String.fromCharCode(p)); }, @@ -55,8 +59,8 @@ var Library = { }, fwrite: function(ptr, size, count, stream) { - print('[fwrite] ' + Pointer_stringify(ptr).slice(0,count)); - return count; // or 0? + __print__(intArrayToString(Array_copy(ptr, count))); + return count; }, fclose: function(stream) { @@ -85,6 +89,9 @@ var Library = { return 0; // XXX }, + clearerr: function(stream) { + }, + // stdlib.h abs: 'Math.abs', |