Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sync with narwhal-jsc: binary, file, io, os, and system.
- Loading branch information
Tom Robinson
committed
Oct 7, 2009
1 parent
ed21797
commit b32de1e
Showing
16 changed files
with
1,356 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
#ifndef __BINARY_ENGINE__ | ||
#define __BINARY_ENGINE__ | ||
|
||
typedef struct __BytesPrivate BytesPrivate; | ||
|
||
struct __BytesPrivate { | ||
typedef struct __BytesPrivate { | ||
char *buffer; | ||
size_t length; | ||
}; | ||
} BytesPrivate; | ||
|
||
//JSObjectRef Bytes_new(JSContextRef _context, JSValueRef *_exception, char* buffer, int length); | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#ifndef __IO_ENGINE__ | ||
#define __IO_ENGINE__ | ||
|
||
#include <iconv.h> | ||
|
||
typedef struct __IOPrivate { | ||
int input; | ||
int output; | ||
} IOPrivate; | ||
|
||
typedef struct __TextInputStreamPrivate { | ||
int input; | ||
iconv_t cd; | ||
|
||
char *inBuffer; | ||
size_t inBufferSize; | ||
size_t inBufferUsed; | ||
} TextInputStreamPrivate; | ||
|
||
//extern "C" JSClassRef IO_class(JSContextRef _context); | ||
//extern "C" JSClassRef TextInputStream_class(JSContextRef _context); | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
var file = require("file"); | ||
|
||
exports.mkdirs = function(path) { | ||
var components = file.Path(path).split(); | ||
for (var i = 0; i < components.length; i++) { | ||
var dir = file.join.apply(null, components.slice(0, i+1)); | ||
if (!file.isDirectory(dir)) | ||
file.mkdir(dir); | ||
} | ||
} | ||
|
||
exports.touch = function (path, mtime) { | ||
if (mtime === undefined || mtime === null) | ||
mtime = new Date(); | ||
|
||
if (!file.exists(path)) | ||
file.write(path, ""); | ||
|
||
file.touchImpl(path, mtime.getTime()); | ||
}; |
Oops, something went wrong.