Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adds function to wrap the codes genarated from emscripten
- Loading branch information
Showing
11 changed files
with
264 additions
and
192 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
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 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,81 +1,57 @@ | ||
declare var HEAP8: Int8Array; | ||
declare var HEAP16: Int16Array; | ||
declare var HEAP32: Int32Array; | ||
declare var HEAPU8: Uint8Array; | ||
declare var HEAPU16: Uint16Array; | ||
declare var HEAPU32: Uint32Array; | ||
declare var HEAPF32: Float32Array; | ||
declare var HEAPF64: Float64Array; | ||
declare var STACKTOP: number; | ||
|
||
declare function ccall(ident: string, | ||
returnType: string, | ||
argTypes: string[], | ||
args: any[]): any; | ||
declare function cwrap(ident: string, | ||
returnType: string, | ||
argTypes: string[]): (...args: any[]) => any; | ||
declare function setValue(ptr: number, value: number, type: string): void; | ||
declare function getValue(ptr: number, type: string): number; | ||
declare function Pointer_stringify(ptr: number): string; | ||
|
||
declare module FS { | ||
interface Object {} | ||
function deleteFile(path: string): void; | ||
function createFolder(parent: string, name: string, | ||
canRead: boolean, canWrite: boolean): Object | ||
function createFolder(parent: Object, name: string, | ||
canRead: boolean, canWrite: boolean): Object | ||
function createPath(parent: string, name: string, | ||
canRead: boolean, canWrite: boolean): Object; | ||
function createPath(parent: Object, name: string, | ||
canRead: boolean, canWrite: boolean): Object; | ||
function createDataFile(parent: string, name: string, data: any, | ||
canRead: boolean, canWrite: boolean): Object; | ||
function createDataFile(parent: Object, name: string, data: any, | ||
canRead: boolean, canWrite: boolean): Object; | ||
function createLazyFile(parent: string, name: string, url: string, | ||
canRead: boolean, canWrite: boolean): Object; | ||
function createLazyFile(parent: Object, name: string, url: string, | ||
canRead: boolean, canWrite: boolean): Object; | ||
function createPreloadedFile(parent: string, name: string, url: string, | ||
canRead: boolean, canWrite: boolean): Object; | ||
function createPreloadedFile(parent: Object, name: string, url: string, | ||
canRead: boolean, canWrite: boolean): Object; | ||
function createLink(parent: string, name: string, target: string, | ||
canRead: boolean, canWrite: boolean): Object; | ||
function createLink(parent: Object, name: string, target: string, | ||
canRead: boolean, canWrite: boolean): Object; | ||
function createDevice(parent: string, name: string, | ||
input?: () => number, | ||
output?: (arg: number) => void): Object; | ||
function createDevice(parent: Object, name: string, | ||
input?: () => number, | ||
output?: (arg: number) => void): Object; | ||
} | ||
|
||
declare module Module { | ||
var ccall: typeof ccall; | ||
var cwrap: typeof cwrap; | ||
var setValue: typeof setValue; | ||
var getValue: typeof getValue; | ||
var Pointer_stringify: typeof Pointer_stringify; | ||
var HEAP8: Int8Array; | ||
var HEAP16: Int16Array; | ||
var HEAP32: Int32Array; | ||
var HEAPU8: Uint8Array; | ||
var HEAPU16: Uint16Array; | ||
var HEAPU32: Uint32Array; | ||
var HEAPF32: Float32Array; | ||
var HEAPF64: Float64Array; | ||
var STACKTOP: number; | ||
|
||
var FS: typeof FS; | ||
var FS_createFolder: typeof FS.createFolder; | ||
var FS_createPath: typeof FS.createPath; | ||
var FS_createDataFile: typeof FS.createDataFile; | ||
var FS_createPreloadedFile: typeof FS.createPreloadedFile; | ||
var FS_createLazyFile: typeof FS.createLazyFile; | ||
var FS_createLink: typeof FS.createLink; | ||
var FS_createDevice: typeof FS.createDevice; | ||
function ccall(ident: string, | ||
returnType: string, | ||
argTypes: string[], | ||
args: any[]): any; | ||
function cwrap(ident: string, | ||
returnType: string, | ||
argTypes: string[]): (...args: any[]) => any; | ||
function setValue(ptr: number, value: number, type: string): void; | ||
function getValue(ptr: number, type: string): number; | ||
function Pointer_stringify(ptr: number): string; | ||
|
||
var HEAP8: typeof HEAP8; | ||
var HEAP16: typeof HEAP16; | ||
var HEAP32: typeof HEAP32 | ||
var HEAPU8: typeof HEAPU8; | ||
var HEAPU16: typeof HEAPU16; | ||
var HEAPU32: typeof HEAPU32; | ||
var HEAPF32: typeof HEAPF32; | ||
var HEAPF64: typeof HEAPF64; | ||
module FS { | ||
interface Object {} | ||
function deleteFile(path: string): void; | ||
function createFolder(parent: string, name: string, | ||
canRead: boolean, canWrite: boolean): Object | ||
function createFolder(parent: Object, name: string, | ||
canRead: boolean, canWrite: boolean): Object | ||
function createPath(parent: string, name: string, | ||
canRead: boolean, canWrite: boolean): Object; | ||
function createPath(parent: Object, name: string, | ||
canRead: boolean, canWrite: boolean): Object; | ||
function createDataFile(parent: string, name: string, data: any, | ||
canRead: boolean, canWrite: boolean): Object; | ||
function createDataFile(parent: Object, name: string, data: any, | ||
canRead: boolean, canWrite: boolean): Object; | ||
function createLazyFile(parent: string, name: string, url: string, | ||
canRead: boolean, canWrite: boolean): Object; | ||
function createLazyFile(parent: Object, name: string, url: string, | ||
canRead: boolean, canWrite: boolean): Object; | ||
function createPreloadedFile(parent: string, name: string, url: string, | ||
canRead: boolean, canWrite: boolean): Object; | ||
function createPreloadedFile(parent: Object, name: string, url: string, | ||
canRead: boolean, canWrite: boolean): Object; | ||
function createLink(parent: string, name: string, target: string, | ||
canRead: boolean, canWrite: boolean): Object; | ||
function createLink(parent: Object, name: string, target: string, | ||
canRead: boolean, canWrite: boolean): Object; | ||
function createDevice(parent: string, name: string, | ||
input?: () => number, | ||
output?: (arg: number) => void): Object; | ||
function createDevice(parent: Object, name: string, | ||
input?: () => number, | ||
output?: (arg: number) => void): Object; | ||
} | ||
} |
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,2 @@ | ||
return Module; | ||
}; |
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,5 @@ | ||
var loadModule = function (options) { | ||
var Module = {}; | ||
if ('TOTAL_MEMORY' in options) { | ||
Module['TOTAL_MEMORY'] = options['TOTAL_MEMORY']; | ||
} |
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
Oops, something went wrong.