-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbingo.js
53 lines (45 loc) · 1.35 KB
/
bingo.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/* start of file ->*/
ls = __filename.lastIndexOf('/');
rs = __filename.lastIndexOf('\\');
__filename = __filename.substring((((ls >= 0)? ls + 1: 0) | ((rs >= 0)? rs + 1: 0)), __filename.length);
console.log('[' + __filename + ']' + ": starting");
exports.done = false;
/* start of file <- */
/* ----------------------------------------- */
var ffi = require('ffi');
function Bingo(indigo) {
if (!(this instanceof Bingo)) {
return new Bingo(indigo);
}
this._indigo = indigo;
if (indigo.done == true) {
/* module*/
this.indigo = indigo.indigo();
}
else {
/* function */
if (indigo.name == "Indigo") {
this.indigo = indigo();
} else {
/* object */
if (indigo instanceof Object) {
this.indigo = indigo;
}
}
}
var libpath = './indigo-libs/shared/' + process.platform + '/' + process.arch + '/bingo';
this._lib = ffi.Library(libpath, {
"bingoVersion": ["string", []]
});
/* function bingo.vesrion() */
this.version = function () {
this.indigo._setSessionId();
return this._lib.bingoVersion();
}
}
exports.bingo = Bingo;
/* ----------------------------------------- */
/*end of file ->*/
exports.done = true;
console.log('[' + __filename + ']' + ": done.");
/*end of file <-*/