-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
56 lines (52 loc) · 1.27 KB
/
Copy pathindex.js
File metadata and controls
56 lines (52 loc) · 1.27 KB
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
54
55
56
'use strict'
const native = require('./native.js')
const {
DynamicLibrary,
dlclose,
dlopen,
dlsym,
kSbInvokeSlow,
kSbArguments,
kSbReturn,
kSbSharedBuffer,
} = require('./lib/internal/ffi-library')
const memory = require('./lib/internal/ffi-memory')
const suffix = native.suffix()
const types = Object.freeze({
__proto__: null,
VOID: 'void',
POINTER: 'pointer',
BUFFER: 'buffer',
ARRAY_BUFFER: 'arraybuffer',
FUNCTION: 'function',
BOOL: 'bool',
CHAR: 'char',
STRING: 'string',
FLOAT: 'float',
DOUBLE: 'double',
INT_8: 'int8',
UINT_8: 'uint8',
INT_16: 'int16',
UINT_16: 'uint16',
INT_32: 'int32',
UINT_32: 'uint32',
INT_64: 'int64',
UINT_64: 'uint64',
FLOAT_32: 'float32',
FLOAT_64: 'float64',
})
module.exports = {
DynamicLibrary,
dlopen,
dlclose,
dlsym,
...memory,
suffix,
types,
}
Object.defineProperties(module.exports, {
kSbInvokeSlow: { value: kSbInvokeSlow, enumerable: false, configurable: false, writable: false },
kSbArguments: { value: kSbArguments, enumerable: false, configurable: false, writable: false },
kSbReturn: { value: kSbReturn, enumerable: false, configurable: false, writable: false },
kSbSharedBuffer: { value: kSbSharedBuffer, enumerable: false, configurable: false, writable: false },
})