koffi 2.16.2 → 3.0.0-alpha.10
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 +42 -2
- package/LICENSE.txt +1 -1
- package/README.md +8 -8
- 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_arm64/koffi.node +0 -0
- package/build/koffi/linux_ia32/koffi.node +0 -0
- package/build/koffi/linux_x64/koffi.node +0 -0
- package/build/koffi/musl_arm64/koffi.node +0 -0
- package/build/koffi/musl_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_ia32/koffi.node +0 -0
- package/build/koffi/win32_x64/koffi.node +0 -0
- package/cnoke.cjs +816 -0
- package/doc/benchmarks.md +33 -33
- package/doc/callbacks.md +9 -9
- package/doc/contribute.md +41 -27
- package/doc/functions.md +6 -6
- package/doc/index.md +8 -8
- package/doc/input.md +70 -6
- package/doc/misc.md +14 -15
- package/doc/output.md +10 -10
- package/doc/packaging.md +7 -7
- package/doc/pointers.md +14 -16
- package/doc/start.md +4 -4
- package/doc/unions.md +2 -2
- package/doc/variables.md +5 -5
- package/index.cjs +1 -0
- package/index.d.ts +111 -104
- package/index.js +1 -634
- package/indirect.cjs +1 -0
- package/indirect.js +1 -533
- package/lib/native/base/base.cc +86 -92
- package/lib/native/base/base.hh +203 -159
- package/lib/native/base/unicode.inc +1 -1
- package/package.json +18 -7
- package/src/koffi/CMakeLists.txt +98 -35
- package/src/koffi/index.cjs +333 -0
- package/src/koffi/index.js +271 -0
- package/src/koffi/indirect.cjs +332 -0
- package/src/koffi/indirect.js +182 -0
- package/src/koffi/src/{abi_arm32.cc → abi/arm32.cc} +280 -276
- package/src/koffi/src/{abi_arm32_asm.S → abi/arm32_asm.S} +3 -6
- package/src/koffi/src/abi/arm64.cc +1516 -0
- package/src/koffi/src/{abi_arm64_asm.S → abi/arm64_asm.S} +45 -24
- package/src/koffi/src/{abi_arm64_asm.asm → abi/arm64_asm.asm} +33 -26
- package/src/koffi/src/{abi_loong64.cc → abi/loong64.cc} +1 -1
- package/src/koffi/src/{abi_loong64_asm.S → abi/loong64_asm.S} +2 -6
- package/src/koffi/src/{abi_riscv64.cc → abi/riscv64.cc} +280 -274
- package/src/koffi/src/{abi_riscv64_asm.S → abi/riscv64_asm.S} +2 -5
- package/src/koffi/src/abi/x64sysv.cc +1456 -0
- package/src/koffi/src/{abi_x64_sysv_asm.S → abi/x64sysv_asm.S} +31 -34
- package/src/koffi/src/abi/x64win.cc +1124 -0
- package/src/koffi/src/{abi_x64_win_asm.S → abi/x64win_asm.S} +9 -13
- package/src/koffi/src/{abi_x64_win_asm.asm → abi/x64win_asm.asm} +12 -15
- package/src/koffi/src/abi/x86.cc +1236 -0
- package/src/koffi/src/{abi_x86_asm.S → abi/x86_asm.S} +50 -26
- package/src/koffi/src/{abi_x86_asm.asm → abi/x86_asm.asm} +12 -15
- package/src/koffi/src/call.cc +534 -628
- package/src/koffi/src/call.hh +62 -83
- package/src/koffi/src/errno.inc +1 -1
- package/src/koffi/src/ffi.cc +787 -532
- package/src/koffi/src/ffi.hh +149 -99
- package/src/koffi/src/parser.cc +1 -5
- package/src/koffi/src/parser.hh +1 -1
- package/src/koffi/src/primitives.inc +39 -0
- package/src/koffi/{tools/write_trampolines.js → src/trampolines.cjs} +4 -4
- package/src/koffi/src/util.cc +745 -491
- package/src/koffi/src/util.hh +332 -60
- package/src/koffi/src/uv.cc +37 -22
- package/src/koffi/src/uv.def +1 -0
- package/src/koffi/src/uv.hh +74 -3
- package/src/koffi/src/win32.cc +1 -1
- package/src/koffi/src/win32.hh +31 -2
- package/vendor/node-addon-api/napi-inl.h +32 -32
- package/vendor/node-addon-api/napi.h +1 -0
- package/build/koffi/linux_armhf/koffi.node +0 -0
- package/build/koffi/linux_loong64/koffi.node +0 -0
- package/build/koffi/linux_riscv64d/koffi.node +0 -0
- package/build/koffi/win32_arm64/koffi.exp +0 -0
- package/build/koffi/win32_arm64/koffi.lib +0 -0
- package/build/koffi/win32_arm64/koffi.node +0 -0
- package/doc/platforms.md +0 -36
- package/lib/native/base/crc.inc +0 -2214
- package/lib/native/base/crc_gen.py +0 -72
- package/lib/native/base/mimetypes.inc +0 -1248
- package/lib/native/base/mimetypes_gen.py +0 -58
- package/lib/native/base/tower.cc +0 -821
- package/lib/native/base/tower.hh +0 -81
- package/lib/native/base/unicode_gen.py +0 -152
- package/src/cnoke/LICENSE.txt +0 -22
- package/src/cnoke/README.md +0 -99
- package/src/cnoke/assets/FindCNoke.cmake +0 -127
- package/src/cnoke/assets/toolchains.json +0 -126
- package/src/cnoke/assets/win_delay_hook.c +0 -36
- package/src/cnoke/cnoke.js +0 -170
- package/src/cnoke/package.json +0 -24
- package/src/cnoke/src/builder.js +0 -511
- package/src/cnoke/src/index.js +0 -10
- package/src/cnoke/src/tools.js +0 -407
- package/src/koffi/src/abi_arm64.cc +0 -1295
- package/src/koffi/src/abi_x64_sysv.cc +0 -939
- package/src/koffi/src/abi_x64_win.cc +0 -715
- package/src/koffi/src/abi_x86.cc +0 -860
- package/src/koffi/src/init.js +0 -105
- package/vendor/node-api-headers/include/uv/aix.h +0 -32
- package/vendor/node-api-headers/include/uv/bsd.h +0 -34
- package/vendor/node-api-headers/include/uv/darwin.h +0 -61
- package/vendor/node-api-headers/include/uv/errno.h +0 -483
- package/vendor/node-api-headers/include/uv/linux.h +0 -34
- package/vendor/node-api-headers/include/uv/os390.h +0 -33
- package/vendor/node-api-headers/include/uv/posix.h +0 -31
- package/vendor/node-api-headers/include/uv/sunos.h +0 -44
- package/vendor/node-api-headers/include/uv/threadpool.h +0 -37
- package/vendor/node-api-headers/include/uv/tree.h +0 -521
- package/vendor/node-api-headers/include/uv/unix.h +0 -512
- package/vendor/node-api-headers/include/uv/version.h +0 -43
- package/vendor/node-api-headers/include/uv/win.h +0 -698
- package/vendor/node-api-headers/include/uv.h +0 -1990
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,46 @@
|
|
|
3
3
|
> [!NOTE]
|
|
4
4
|
> Consult the [migration guide](migration) to migrate between major Koffi versions.
|
|
5
5
|
|
|
6
|
+
## Koffi 3
|
|
7
|
+
|
|
8
|
+
### Koffi 3.0
|
|
9
|
+
|
|
10
|
+
#### Koffi 3.0.0 (WIP)
|
|
11
|
+
|
|
12
|
+
*Not yet released*
|
|
13
|
+
|
|
14
|
+
**Main changes:**
|
|
15
|
+
|
|
16
|
+
- Replace use of externals with type objects:
|
|
17
|
+
* Use `koffi.type()` to resolve type specifiers (strings or objects) to type objects
|
|
18
|
+
* Access type information directly on type objects without `koffi.introspect()`
|
|
19
|
+
- Replace use of externals with BigInt pointers
|
|
20
|
+
- Support ESM and CJS module types
|
|
21
|
+
- Rewrite call preparation and execution for vastly improved performance
|
|
22
|
+
|
|
23
|
+
**Other changes:**
|
|
24
|
+
|
|
25
|
+
- Add `koffi.enumeration()` to create [enum types](input#enum-types)
|
|
26
|
+
- Use proper types for various objects and handles:
|
|
27
|
+
* Use *LibraryHandle* objects for loaded libraries
|
|
28
|
+
* Use *CallbackHandle* objects for registered callbacks
|
|
29
|
+
* Use *PollHandle* for socket poll handles
|
|
30
|
+
- Add `Symbol.dispose` on library objects and registered callbacks
|
|
31
|
+
- Prefer types to interfaces in TypeScript declaration file
|
|
32
|
+
- Fix various bugs and small leaks (such as library handles)
|
|
33
|
+
|
|
34
|
+
**Newly deprecated functions:**
|
|
35
|
+
|
|
36
|
+
- Deprecate `koffi.resolve()` function, replace with `koffi.type()`
|
|
37
|
+
- Deprecate `koffi.introspect()` function, replace with `koffi.type()`
|
|
38
|
+
|
|
39
|
+
**Removed deprecated functions:**
|
|
40
|
+
|
|
41
|
+
- Remove `koffi.callback()` long replaced with `koffi.proto()`
|
|
42
|
+
- Remove `koffi.handle()` long replaced with `koffi.opaque()`
|
|
43
|
+
|
|
44
|
+
Consult the [migration guide](migration) for more information.
|
|
45
|
+
|
|
6
46
|
## Koffi 2
|
|
7
47
|
|
|
8
48
|
### Koffi 2.16
|
|
@@ -65,7 +105,7 @@
|
|
|
65
105
|
|
|
66
106
|
*Released on 2026-04-03*
|
|
67
107
|
|
|
68
|
-
- Fix
|
|
108
|
+
- Fix "IsOnCentralStack()" assertion/crash when using callbacks in recent Node versions
|
|
69
109
|
- Support SetUnhandledExceptionFilter on Windows x64 and x86 ([@longhun12346](https://github.com/longhun12346))
|
|
70
110
|
- Fix incorrect stack alignment when relaying callbacks on 32-bit x86 platforms
|
|
71
111
|
|
|
@@ -81,7 +121,7 @@
|
|
|
81
121
|
|
|
82
122
|
#### Koffi 2.15.1
|
|
83
123
|
|
|
84
|
-
*Released on
|
|
124
|
+
*Released on 2026-01-24*
|
|
85
125
|
|
|
86
126
|
- Fix possible union-related crashes
|
|
87
127
|
- Support MinGW-w64 x64 builds on Windows
|
package/LICENSE.txt
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (C)
|
|
3
|
+
Copyright (C) 2026 Niels Martignène <niels.martignene@protonmail.com>
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
6
6
|
this software and associated documentation files (the “Software”), to deal in
|
package/README.md
CHANGED
|
@@ -9,14 +9,14 @@ Koffi is a fast and easy-to-use C FFI module for Node.js, featuring:
|
|
|
9
9
|
|
|
10
10
|
The following combinations of OS and architectures __are officially supported and tested__ at the moment:
|
|
11
11
|
|
|
12
|
-
ISA / OS | Windows | Linux
|
|
13
|
-
------------------ | ----------- |
|
|
14
|
-
x86 (IA32) [^1] | ✅ Yes | ✅ Yes
|
|
15
|
-
x86_64 (AMD64) | ✅ Yes | ✅ Yes
|
|
16
|
-
ARM32 LE [^2] | ⬜️ *N/A* | ✅ Yes
|
|
17
|
-
ARM64 (AArch64) LE | ✅ Yes | ✅ Yes
|
|
18
|
-
RISC-V 64 [^3] | ⬜️ *N/A* | ✅ Yes
|
|
19
|
-
LoongArch64 | ⬜️ *N/A* | ✅ Yes
|
|
12
|
+
ISA / OS | Windows | Linux/glibc | Linux/musl | macOS | FreeBSD | OpenBSD
|
|
13
|
+
------------------ | ----------- | ----------- | ----------- | ----------- | ----------- | --------
|
|
14
|
+
x86 (IA32) [^1] | ✅ Yes | ✅ Yes | 🟨 Probably | ⬜️ *N/A* | ✅ Yes | ✅ Yes
|
|
15
|
+
x86_64 (AMD64) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes
|
|
16
|
+
ARM32 LE [^2] | ⬜️ *N/A* | ✅ Yes | 🟨 Probably | ⬜️ *N/A* | 🟨 Probably | 🟨 Probably
|
|
17
|
+
ARM64 (AArch64) LE | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | 🟨 Probably
|
|
18
|
+
RISC-V 64 [^3] | ⬜️ *N/A* | ✅ Yes | 🟨 Probably | ⬜️ *N/A* | 🟨 Probably | 🟨 Probably
|
|
19
|
+
LoongArch64 | ⬜️ *N/A* | ✅ Yes | 🟨 Probably | ⬜️ *N/A* | 🟨 Probably | 🟨 Probably
|
|
20
20
|
|
|
21
21
|
[^1]: The following call conventions are supported: cdecl, stdcall, MS fastcall, thiscall.
|
|
22
22
|
[^2]: The prebuilt binary uses the hard float ABI and expects a VFP coprocessor. Build from source to use Koffi with a different ABI (softfp, soft).
|
|
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
|