koffi 2.8.1 → 2.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/build/koffi/darwin_arm64/koffi.node +0 -0
- package/build/koffi/darwin_x64/koffi.node +0 -0
- package/build/koffi/freebsd_arm64/koffi.node +0 -0
- package/build/koffi/freebsd_ia32/koffi.node +0 -0
- package/build/koffi/freebsd_x64/koffi.node +0 -0
- package/build/koffi/linux_arm32hf/koffi.node +0 -0
- package/build/koffi/linux_arm64/koffi.node +0 -0
- package/build/koffi/linux_ia32/koffi.node +0 -0
- package/build/koffi/linux_riscv64hf64/koffi.node +0 -0
- package/build/koffi/linux_x64/koffi.node +0 -0
- package/build/koffi/openbsd_ia32/koffi.node +0 -0
- package/build/koffi/openbsd_x64/koffi.node +0 -0
- package/build/koffi/win32_arm64/koffi.node +0 -0
- package/build/koffi/win32_ia32/koffi.node +0 -0
- package/build/koffi/win32_x64/koffi.node +0 -0
- package/doc/functions.md +3 -2
- package/index.js +2 -2
- package/indirect.js +2 -2
- package/package.json +2 -2
- package/src/koffi/src/ffi.cc +7 -4
package/CHANGELOG.md
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/doc/functions.md
CHANGED
|
@@ -21,13 +21,14 @@ On some platforms (such as with the [musl C library on Linux](https://wiki.musl-
|
|
|
21
21
|
|
|
22
22
|
## Loading options
|
|
23
23
|
|
|
24
|
-
*New in Koffi 2.6*
|
|
24
|
+
*New in Koffi 2.6 and Koffi 2.8.2*
|
|
25
25
|
|
|
26
26
|
The `load` function can take an optional object argument, with the following options:
|
|
27
27
|
|
|
28
28
|
```js
|
|
29
29
|
const options = {
|
|
30
|
-
lazy: true // Use RTLD_LAZY (lazy-binding) on POSIX platforms (by default, use RTLD_NOW)
|
|
30
|
+
lazy: true, // Use RTLD_LAZY (lazy-binding) on POSIX platforms (by default, use RTLD_NOW)
|
|
31
|
+
global: true // Use RTLD_GLOBAL on POSIX platforms (by default, use RTLD_LOCAL)
|
|
31
32
|
};
|
|
32
33
|
|
|
33
34
|
const lib = koffi.load('/path/to/shared/library.so', options);
|
package/index.js
CHANGED
|
@@ -378,8 +378,8 @@ var require_package = __commonJS({
|
|
|
378
378
|
"build/dist/src/koffi/package.json"(exports2, module2) {
|
|
379
379
|
module2.exports = {
|
|
380
380
|
name: "koffi",
|
|
381
|
-
version: "2.8.
|
|
382
|
-
stable: "2.8.
|
|
381
|
+
version: "2.8.2",
|
|
382
|
+
stable: "2.8.2",
|
|
383
383
|
description: "Fast and simple C FFI (foreign function interface) for Node.js",
|
|
384
384
|
keywords: [
|
|
385
385
|
"foreign",
|
package/indirect.js
CHANGED
|
@@ -378,8 +378,8 @@ var require_package = __commonJS({
|
|
|
378
378
|
"build/dist/src/koffi/package.json"(exports2, module2) {
|
|
379
379
|
module2.exports = {
|
|
380
380
|
name: "koffi",
|
|
381
|
-
version: "2.8.
|
|
382
|
-
stable: "2.8.
|
|
381
|
+
version: "2.8.2",
|
|
382
|
+
stable: "2.8.2",
|
|
383
383
|
description: "Fast and simple C FFI (foreign function interface) for Node.js",
|
|
384
384
|
keywords: [
|
|
385
385
|
"foreign",
|
package/package.json
CHANGED
package/src/koffi/src/ffi.cc
CHANGED
|
@@ -1717,10 +1717,15 @@ static Napi::Value LoadSharedLibrary(const Napi::CallbackInfo &info)
|
|
|
1717
1717
|
}
|
|
1718
1718
|
|
|
1719
1719
|
#ifndef _WIN32
|
|
1720
|
-
|
|
1720
|
+
int flags = 0;
|
|
1721
|
+
|
|
1721
1722
|
if (info.Length() >= 2) {
|
|
1722
1723
|
Napi::Object options = info[1].As<Napi::Object>();
|
|
1723
|
-
|
|
1724
|
+
|
|
1725
|
+
flags |= options.Get("lazy").ToBoolean() ? RTLD_LAZY : RTLD_NOW;
|
|
1726
|
+
flags |= options.Get("global").ToBoolean() ? RTLD_GLOBAL : RTLD_LOCAL;
|
|
1727
|
+
} else {
|
|
1728
|
+
flags = RTLD_NOW | RTLD_LOCAL;
|
|
1724
1729
|
}
|
|
1725
1730
|
#endif
|
|
1726
1731
|
|
|
@@ -1744,8 +1749,6 @@ static Napi::Value LoadSharedLibrary(const Napi::CallbackInfo &info)
|
|
|
1744
1749
|
}
|
|
1745
1750
|
#else
|
|
1746
1751
|
if (info[0].IsString()) {
|
|
1747
|
-
int flags = lazy ? RTLD_LAZY : RTLD_NOW;
|
|
1748
|
-
|
|
1749
1752
|
std::string filename = info[0].As<Napi::String>();
|
|
1750
1753
|
module = dlopen(filename.c_str(), flags);
|
|
1751
1754
|
|