koffi 2.5.1 → 2.5.3
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 +13 -0
- package/build/2.5.3/koffi_darwin_arm64/koffi.node +0 -0
- package/build/{2.5.1 → 2.5.3}/koffi_darwin_x64/koffi.node +0 -0
- package/build/{2.5.1 → 2.5.3}/koffi_freebsd_arm64/koffi.node +0 -0
- package/build/{2.5.1 → 2.5.3}/koffi_freebsd_ia32/koffi.node +0 -0
- package/build/{2.5.1 → 2.5.3}/koffi_freebsd_x64/koffi.node +0 -0
- package/build/{2.5.1 → 2.5.3}/koffi_linux_arm32hf/koffi.node +0 -0
- package/build/{2.5.1 → 2.5.3}/koffi_linux_arm64/koffi.node +0 -0
- package/build/{2.5.1 → 2.5.3}/koffi_linux_ia32/koffi.node +0 -0
- package/build/{2.5.1 → 2.5.3}/koffi_linux_riscv64hf64/koffi.node +0 -0
- package/build/{2.5.1 → 2.5.3}/koffi_linux_x64/koffi.node +0 -0
- package/build/{2.5.1 → 2.5.3}/koffi_openbsd_ia32/koffi.node +0 -0
- package/build/{2.5.1 → 2.5.3}/koffi_openbsd_x64/koffi.node +0 -0
- package/build/2.5.3/koffi_win32_arm64/koffi.node +0 -0
- package/build/{2.5.1 → 2.5.3}/koffi_win32_ia32/koffi.node +0 -0
- package/build/{2.5.1 → 2.5.3}/koffi_win32_x64/koffi.node +0 -0
- package/package.json +2 -2
- package/src/index.d.ts +12 -7
- package/src/koffi/src/call.cc +4 -4
- package/build/2.5.1/koffi_darwin_arm64/koffi.node +0 -0
- package/build/2.5.1/koffi_win32_arm64/koffi.node +0 -0
- /package/build/{2.5.1 → 2.5.3}/koffi_win32_arm64/koffi.exp +0 -0
- /package/build/{2.5.1 → 2.5.3}/koffi_win32_arm64/koffi.lib +0 -0
- /package/build/{2.5.1 → 2.5.3}/koffi_win32_ia32/koffi.exp +0 -0
- /package/build/{2.5.1 → 2.5.3}/koffi_win32_ia32/koffi.lib +0 -0
- /package/build/{2.5.1 → 2.5.3}/koffi_win32_x64/koffi.exp +0 -0
- /package/build/{2.5.1 → 2.5.3}/koffi_win32_x64/koffi.lib +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,19 @@
|
|
|
4
4
|
|
|
5
5
|
### Koffi 2.5
|
|
6
6
|
|
|
7
|
+
#### Koffi 2.5.3
|
|
8
|
+
|
|
9
|
+
**Main changes:**
|
|
10
|
+
|
|
11
|
+
- Add missing union exports in TS definition file
|
|
12
|
+
- Fix some parameter names in TS definition file
|
|
13
|
+
|
|
14
|
+
#### Koffi 2.5.2
|
|
15
|
+
|
|
16
|
+
**Main changes:**
|
|
17
|
+
|
|
18
|
+
- Default initialize unset object/struct members
|
|
19
|
+
|
|
7
20
|
#### Koffi 2.5.1
|
|
8
21
|
|
|
9
22
|
**Main changes:**
|
|
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/package.json
CHANGED
package/src/index.d.ts
CHANGED
|
@@ -86,8 +86,13 @@ declare module 'koffi' {
|
|
|
86
86
|
export function pack(name: string, def: Record<string, TypeSpecWithAlignment>): IKoffiCType;
|
|
87
87
|
export function pack(def: Record<string, TypeSpecWithAlignment>): IKoffiCType;
|
|
88
88
|
|
|
89
|
-
|
|
90
|
-
|
|
89
|
+
export function union(name: string, def: Record<string, TypeSpecWithAlignment>): IKoffiCType;
|
|
90
|
+
export function union(def: Record<string, TypeSpecWithAlignment>): IKoffiCType;
|
|
91
|
+
|
|
92
|
+
export class Union {
|
|
93
|
+
constructor(type: TypeSpec);
|
|
94
|
+
[s: string]: any;
|
|
95
|
+
}
|
|
91
96
|
|
|
92
97
|
export function array(ref: TypeSpec, len: number, hint?: ArrayHint | null): IKoffiCType;
|
|
93
98
|
|
|
@@ -96,12 +101,12 @@ declare module 'koffi' {
|
|
|
96
101
|
/** @deprecated */ export function handle(name: string): IKoffiCType;
|
|
97
102
|
/** @deprecated */ export function handle(): IKoffiCType;
|
|
98
103
|
|
|
99
|
-
export function pointer(
|
|
100
|
-
export function pointer(
|
|
101
|
-
export function pointer(name: string,
|
|
104
|
+
export function pointer(ref: TypeSpec): IKoffiCType;
|
|
105
|
+
export function pointer(ref: TypeSpec, asteriskCount: number): IKoffiCType;
|
|
106
|
+
export function pointer(name: string, ref: TypeSpec, asteriskCount: number): IKoffiCType;
|
|
102
107
|
|
|
103
|
-
export function out(
|
|
104
|
-
export function inout(
|
|
108
|
+
export function out(type: TypeSpec): IKoffiCType;
|
|
109
|
+
export function inout(type: TypeSpec): IKoffiCType;
|
|
105
110
|
|
|
106
111
|
export function disposable(type: TypeSpec): IKoffiCType;
|
|
107
112
|
export function disposable(name: string, type: TypeSpec): IKoffiCType;
|
package/src/koffi/src/call.cc
CHANGED
|
@@ -405,14 +405,14 @@ bool CallData::PushObject(Napi::Object obj, const TypeInfo *type, uint8_t *origi
|
|
|
405
405
|
RG_UNREACHABLE();
|
|
406
406
|
}
|
|
407
407
|
|
|
408
|
+
memset(origin, 0, type->size);
|
|
409
|
+
|
|
408
410
|
for (Size i = 0; i < members.len; i++) {
|
|
409
411
|
const RecordMember &member = members[i];
|
|
410
412
|
Napi::Value value = obj.Get(member.name);
|
|
411
413
|
|
|
412
|
-
if (value.IsUndefined())
|
|
413
|
-
|
|
414
|
-
return false;
|
|
415
|
-
}
|
|
414
|
+
if (value.IsUndefined())
|
|
415
|
+
continue;
|
|
416
416
|
|
|
417
417
|
uint8_t *dest = origin + member.offset;
|
|
418
418
|
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|