koffi 2.8.0 → 2.8.1
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/output.md +1 -1
- package/index.js +3 -3
- package/indirect.js +3 -3
- package/package.json +2 -2
- package/src/cnoke/src/tools.js +1 -1
- package/src/koffi/src/ffi.hh +3 -0
- package/src/koffi/src/util.cc +13 -3
- package/src/koffi/src/util.hh +1 -1
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/output.md
CHANGED
|
@@ -30,7 +30,7 @@ const koffi = require('koffi');
|
|
|
30
30
|
const user32 = koffi.load('user32.dll');
|
|
31
31
|
|
|
32
32
|
const DWORD = koffi.alias('DWORD', 'uint32_t');
|
|
33
|
-
const HANDLE = koffi.pointer(koffi.opaque(
|
|
33
|
+
const HANDLE = koffi.pointer('HANDLE', koffi.opaque());
|
|
34
34
|
const HWND = koffi.alias('HWND', HANDLE);
|
|
35
35
|
|
|
36
36
|
const FindWindowEx = user32.func('HWND __stdcall FindWindowExW(HWND hWndParent, HWND hWndChildAfter, const char16_t *lpszClass, const char16_t *lpszWindow)');
|
package/index.js
CHANGED
|
@@ -43,7 +43,7 @@ var require_tools = __commonJS({
|
|
|
43
43
|
try {
|
|
44
44
|
fs2.renameSync(file.path, dest);
|
|
45
45
|
} catch (err) {
|
|
46
|
-
if (
|
|
46
|
+
if (!fs2.existsSync(dest))
|
|
47
47
|
reject(err);
|
|
48
48
|
}
|
|
49
49
|
resolve();
|
|
@@ -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.1",
|
|
382
|
+
stable: "2.8.1",
|
|
383
383
|
description: "Fast and simple C FFI (foreign function interface) for Node.js",
|
|
384
384
|
keywords: [
|
|
385
385
|
"foreign",
|
package/indirect.js
CHANGED
|
@@ -43,7 +43,7 @@ var require_tools = __commonJS({
|
|
|
43
43
|
try {
|
|
44
44
|
fs2.renameSync(file.path, dest);
|
|
45
45
|
} catch (err) {
|
|
46
|
-
if (
|
|
46
|
+
if (!fs2.existsSync(dest))
|
|
47
47
|
reject(err);
|
|
48
48
|
}
|
|
49
49
|
resolve();
|
|
@@ -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.1",
|
|
382
|
+
stable: "2.8.1",
|
|
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/cnoke/src/tools.js
CHANGED
package/src/koffi/src/ffi.hh
CHANGED
|
@@ -272,7 +272,10 @@ struct InstanceData {
|
|
|
272
272
|
Size base_types_len;
|
|
273
273
|
|
|
274
274
|
bool debug;
|
|
275
|
+
|
|
275
276
|
uint64_t tag_lower;
|
|
277
|
+
BucketArray<napi_type_tag> tags;
|
|
278
|
+
HashMap<const void *, napi_type_tag *> tags_map;
|
|
276
279
|
|
|
277
280
|
const TypeInfo *void_type;
|
|
278
281
|
const TypeInfo *char_type;
|
package/src/koffi/src/util.cc
CHANGED
|
@@ -579,12 +579,22 @@ const char *GetValueType(const InstanceData *instance, Napi::Value value)
|
|
|
579
579
|
return "Unknown";
|
|
580
580
|
}
|
|
581
581
|
|
|
582
|
-
void SetValueTag(
|
|
582
|
+
void SetValueTag(InstanceData *instance, Napi::Value value, const void *marker)
|
|
583
583
|
{
|
|
584
584
|
RG_ASSERT(marker);
|
|
585
585
|
|
|
586
|
-
napi_type_tag tag =
|
|
587
|
-
|
|
586
|
+
napi_type_tag *tag = instance->tags_map.FindValue(marker, nullptr);
|
|
587
|
+
|
|
588
|
+
if (!tag) {
|
|
589
|
+
tag = instance->tags.AppendDefault();
|
|
590
|
+
|
|
591
|
+
tag->lower = instance->tag_lower;
|
|
592
|
+
tag->upper = (uint64_t)marker;
|
|
593
|
+
|
|
594
|
+
instance->tags_map.Set(marker, tag);
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
napi_status status = napi_type_tag_object(value.Env(), value, tag);
|
|
588
598
|
RG_ASSERT(status == napi_ok);
|
|
589
599
|
}
|
|
590
600
|
|
package/src/koffi/src/util.hh
CHANGED
|
@@ -102,7 +102,7 @@ bool CanStoreType(const TypeInfo *type);
|
|
|
102
102
|
// Can be slow, only use for error messages
|
|
103
103
|
const char *GetValueType(const InstanceData *instance, Napi::Value value);
|
|
104
104
|
|
|
105
|
-
void SetValueTag(
|
|
105
|
+
void SetValueTag(InstanceData *instance, Napi::Value value, const void *marker);
|
|
106
106
|
bool CheckValueTag(const InstanceData *instance, Napi::Value value, const void *marker);
|
|
107
107
|
|
|
108
108
|
static inline bool IsNullOrUndefined(Napi::Value value)
|