diff options
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', |