@finogeeks2026/finshield-opencode 0.0.0-stage → 0.11.50

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.
Files changed (143) hide show
  1. package/DESIGN.md +593 -0
  2. package/LICENSE.rtf +28 -0
  3. package/README.md +132 -2
  4. package/THIRD-PARTY-NOTICES.md +3131 -0
  5. package/bin/node.exe +4 -0
  6. package/dist/gui-experimental.cjs +96 -0
  7. package/dist/updater/server.js +1046 -0
  8. package/install/download-source.json +3 -0
  9. package/install/runtime.js +60 -0
  10. package/node_modules/@finogeeks2026/finsafe-sdk/LICENSE.rtf +28 -0
  11. package/node_modules/@finogeeks2026/finsafe-sdk/README.md +116 -0
  12. package/node_modules/@finogeeks2026/finsafe-sdk/bin/finsafe_native.dll +0 -0
  13. package/node_modules/@finogeeks2026/finsafe-sdk/native-build.json +5 -0
  14. package/node_modules/@finogeeks2026/finsafe-sdk/node_modules/@koromix/koffi-win32-x64/README.md +6 -0
  15. package/node_modules/@finogeeks2026/finsafe-sdk/node_modules/@koromix/koffi-win32-x64/index.js +12 -0
  16. package/node_modules/@finogeeks2026/finsafe-sdk/node_modules/@koromix/koffi-win32-x64/package.json +24 -0
  17. package/node_modules/@finogeeks2026/finsafe-sdk/node_modules/@koromix/koffi-win32-x64/win32_x64/koffi.lib +0 -0
  18. package/node_modules/@finogeeks2026/finsafe-sdk/node_modules/@koromix/koffi-win32-x64/win32_x64/koffi.node +0 -0
  19. package/node_modules/@finogeeks2026/finsafe-sdk/node_modules/koffi/CHANGELOG.md +1183 -0
  20. package/node_modules/@finogeeks2026/finsafe-sdk/node_modules/koffi/LICENSE.txt +22 -0
  21. package/node_modules/@finogeeks2026/finsafe-sdk/node_modules/koffi/README.md +42 -0
  22. package/node_modules/@finogeeks2026/finsafe-sdk/node_modules/koffi/cnoke.cjs +816 -0
  23. package/node_modules/@finogeeks2026/finsafe-sdk/node_modules/koffi/doc/benchmarks.md +80 -0
  24. package/node_modules/@finogeeks2026/finsafe-sdk/node_modules/koffi/doc/callbacks.md +182 -0
  25. package/node_modules/@finogeeks2026/finsafe-sdk/node_modules/koffi/doc/composites.md +549 -0
  26. package/node_modules/@finogeeks2026/finsafe-sdk/node_modules/koffi/doc/contribute.md +163 -0
  27. package/node_modules/@finogeeks2026/finsafe-sdk/node_modules/koffi/doc/index.md +46 -0
  28. package/node_modules/@finogeeks2026/finsafe-sdk/node_modules/koffi/doc/load.md +191 -0
  29. package/node_modules/@finogeeks2026/finsafe-sdk/node_modules/koffi/doc/migration.md +256 -0
  30. package/node_modules/@finogeeks2026/finsafe-sdk/node_modules/koffi/doc/misc.md +76 -0
  31. package/node_modules/@finogeeks2026/finsafe-sdk/node_modules/koffi/doc/output.md +299 -0
  32. package/node_modules/@finogeeks2026/finsafe-sdk/node_modules/koffi/doc/pointers.md +385 -0
  33. package/node_modules/@finogeeks2026/finsafe-sdk/node_modules/koffi/doc/primitives.md +151 -0
  34. package/node_modules/@finogeeks2026/finsafe-sdk/node_modules/koffi/doc/start.md +110 -0
  35. package/node_modules/@finogeeks2026/finsafe-sdk/node_modules/koffi/doc/types.md +88 -0
  36. package/node_modules/@finogeeks2026/finsafe-sdk/node_modules/koffi/doc/unions.md +0 -0
  37. package/node_modules/@finogeeks2026/finsafe-sdk/node_modules/koffi/doc/values.md +134 -0
  38. package/node_modules/@finogeeks2026/finsafe-sdk/node_modules/koffi/index.cjs +1 -0
  39. package/node_modules/@finogeeks2026/finsafe-sdk/node_modules/koffi/index.d.ts +389 -0
  40. package/node_modules/@finogeeks2026/finsafe-sdk/node_modules/koffi/index.js +2 -0
  41. package/node_modules/@finogeeks2026/finsafe-sdk/node_modules/koffi/indirect.cjs +1 -0
  42. package/node_modules/@finogeeks2026/finsafe-sdk/node_modules/koffi/indirect.js +2 -0
  43. package/node_modules/@finogeeks2026/finsafe-sdk/node_modules/koffi/lib/native/base/base.cc +11064 -0
  44. package/node_modules/@finogeeks2026/finsafe-sdk/node_modules/koffi/lib/native/base/base.hh +5951 -0
  45. package/node_modules/@finogeeks2026/finsafe-sdk/node_modules/koffi/lib/native/base/unicode.inc +408 -0
  46. package/node_modules/@finogeeks2026/finsafe-sdk/node_modules/koffi/package.json +68 -0
  47. package/node_modules/@finogeeks2026/finsafe-sdk/node_modules/koffi/src/koffi/CMakeLists.txt +249 -0
  48. package/node_modules/@finogeeks2026/finsafe-sdk/node_modules/koffi/src/koffi/index.cjs +296 -0
  49. package/node_modules/@finogeeks2026/finsafe-sdk/node_modules/koffi/src/koffi/index.js +281 -0
  50. package/node_modules/@finogeeks2026/finsafe-sdk/node_modules/koffi/src/koffi/indirect.cjs +295 -0
  51. package/node_modules/@finogeeks2026/finsafe-sdk/node_modules/koffi/src/koffi/indirect.js +280 -0
  52. package/node_modules/@finogeeks2026/finsafe-sdk/node_modules/koffi/src/koffi/src/abi/arm64.cc +1408 -0
  53. package/node_modules/@finogeeks2026/finsafe-sdk/node_modules/koffi/src/koffi/src/abi/arm64_asm.S +216 -0
  54. package/node_modules/@finogeeks2026/finsafe-sdk/node_modules/koffi/src/koffi/src/abi/arm64_asm.asm +181 -0
  55. package/node_modules/@finogeeks2026/finsafe-sdk/node_modules/koffi/src/koffi/src/abi/loong64.cc +5 -0
  56. package/node_modules/@finogeeks2026/finsafe-sdk/node_modules/koffi/src/koffi/src/abi/loong64_asm.S +200 -0
  57. package/node_modules/@finogeeks2026/finsafe-sdk/node_modules/koffi/src/koffi/src/abi/riscv64.cc +1345 -0
  58. package/node_modules/@finogeeks2026/finsafe-sdk/node_modules/koffi/src/koffi/src/abi/riscv64_asm.S +200 -0
  59. package/node_modules/@finogeeks2026/finsafe-sdk/node_modules/koffi/src/koffi/src/abi/x64sysv.cc +1434 -0
  60. package/node_modules/@finogeeks2026/finsafe-sdk/node_modules/koffi/src/koffi/src/abi/x64sysv_asm.S +224 -0
  61. package/node_modules/@finogeeks2026/finsafe-sdk/node_modules/koffi/src/koffi/src/abi/x64win.cc +1086 -0
  62. package/node_modules/@finogeeks2026/finsafe-sdk/node_modules/koffi/src/koffi/src/abi/x64win_asm.S +162 -0
  63. package/node_modules/@finogeeks2026/finsafe-sdk/node_modules/koffi/src/koffi/src/abi/x64win_asm.asm +189 -0
  64. package/node_modules/@finogeeks2026/finsafe-sdk/node_modules/koffi/src/koffi/src/abi/x86.cc +1185 -0
  65. package/node_modules/@finogeeks2026/finsafe-sdk/node_modules/koffi/src/koffi/src/abi/x86_asm.S +217 -0
  66. package/node_modules/@finogeeks2026/finsafe-sdk/node_modules/koffi/src/koffi/src/abi/x86_asm.asm +174 -0
  67. package/node_modules/@finogeeks2026/finsafe-sdk/node_modules/koffi/src/koffi/src/call.cc +2094 -0
  68. package/node_modules/@finogeeks2026/finsafe-sdk/node_modules/koffi/src/koffi/src/call.hh +179 -0
  69. package/node_modules/@finogeeks2026/finsafe-sdk/node_modules/koffi/src/koffi/src/errno.inc +462 -0
  70. package/node_modules/@finogeeks2026/finsafe-sdk/node_modules/koffi/src/koffi/src/ffi.cc +3009 -0
  71. package/node_modules/@finogeeks2026/finsafe-sdk/node_modules/koffi/src/koffi/src/ffi.hh +461 -0
  72. package/node_modules/@finogeeks2026/finsafe-sdk/node_modules/koffi/src/koffi/src/parser.cc +218 -0
  73. package/node_modules/@finogeeks2026/finsafe-sdk/node_modules/koffi/src/koffi/src/parser.hh +54 -0
  74. package/node_modules/@finogeeks2026/finsafe-sdk/node_modules/koffi/src/koffi/src/primitives.inc +36 -0
  75. package/node_modules/@finogeeks2026/finsafe-sdk/node_modules/koffi/src/koffi/src/static.cjs +130 -0
  76. package/node_modules/@finogeeks2026/finsafe-sdk/node_modules/koffi/src/koffi/src/static.js +133 -0
  77. package/node_modules/@finogeeks2026/finsafe-sdk/node_modules/koffi/src/koffi/src/trampolines.cjs +77 -0
  78. package/node_modules/@finogeeks2026/finsafe-sdk/node_modules/koffi/src/koffi/src/type.cc +725 -0
  79. package/node_modules/@finogeeks2026/finsafe-sdk/node_modules/koffi/src/koffi/src/type.hh +71 -0
  80. package/node_modules/@finogeeks2026/finsafe-sdk/node_modules/koffi/src/koffi/src/util.cc +1040 -0
  81. package/node_modules/@finogeeks2026/finsafe-sdk/node_modules/koffi/src/koffi/src/util.hh +493 -0
  82. package/node_modules/@finogeeks2026/finsafe-sdk/node_modules/koffi/src/koffi/src/uv.cc +214 -0
  83. package/node_modules/@finogeeks2026/finsafe-sdk/node_modules/koffi/src/koffi/src/uv.def +11 -0
  84. package/node_modules/@finogeeks2026/finsafe-sdk/node_modules/koffi/src/koffi/src/uv.hh +112 -0
  85. package/node_modules/@finogeeks2026/finsafe-sdk/node_modules/koffi/src/koffi/src/win32.cc +198 -0
  86. package/node_modules/@finogeeks2026/finsafe-sdk/node_modules/koffi/src/koffi/src/win32.hh +148 -0
  87. package/node_modules/@finogeeks2026/finsafe-sdk/node_modules/koffi/vendor/node-addon-api/LICENSE.md +9 -0
  88. package/node_modules/@finogeeks2026/finsafe-sdk/node_modules/koffi/vendor/node-addon-api/README.md +95 -0
  89. package/node_modules/@finogeeks2026/finsafe-sdk/node_modules/koffi/vendor/node-addon-api/napi-inl.deprecated.h +186 -0
  90. package/node_modules/@finogeeks2026/finsafe-sdk/node_modules/koffi/vendor/node-addon-api/napi-inl.h +7211 -0
  91. package/node_modules/@finogeeks2026/finsafe-sdk/node_modules/koffi/vendor/node-addon-api/napi.h +3421 -0
  92. package/node_modules/@finogeeks2026/finsafe-sdk/node_modules/koffi/vendor/node-api-headers/LICENSE +21 -0
  93. package/node_modules/@finogeeks2026/finsafe-sdk/node_modules/koffi/vendor/node-api-headers/README.md +95 -0
  94. package/node_modules/@finogeeks2026/finsafe-sdk/node_modules/koffi/vendor/node-api-headers/def/js_native_api.def +125 -0
  95. package/node_modules/@finogeeks2026/finsafe-sdk/node_modules/koffi/vendor/node-api-headers/def/node_api.def +157 -0
  96. package/node_modules/@finogeeks2026/finsafe-sdk/node_modules/koffi/vendor/node-api-headers/include/js_native_api.h +591 -0
  97. package/node_modules/@finogeeks2026/finsafe-sdk/node_modules/koffi/vendor/node-api-headers/include/js_native_api_types.h +210 -0
  98. package/node_modules/@finogeeks2026/finsafe-sdk/node_modules/koffi/vendor/node-api-headers/include/node_api.h +265 -0
  99. package/node_modules/@finogeeks2026/finsafe-sdk/node_modules/koffi/vendor/node-api-headers/include/node_api_types.h +58 -0
  100. package/node_modules/@finogeeks2026/finsafe-sdk/package.json +36 -0
  101. package/node_modules/@finogeeks2026/finsafe-sdk/release.json +4 -0
  102. package/node_modules/@finogeeks2026/finsafe-sdk/src/native.js +85 -0
  103. package/node_modules/@finogeeks2026/finsafe-sdk/src/shell.js +20 -0
  104. package/node_modules/@finogeeks2026/finsafe-sdk/src/status.js +57 -0
  105. package/package.json +47 -4
  106. package/policy/candidate.yaml +347 -0
  107. package/release.json +4 -0
  108. package/src/activation.js +2 -0
  109. package/src/attachment.js +34 -0
  110. package/src/connector.js +91 -0
  111. package/src/contract.js +8 -0
  112. package/src/desktop-contract.js +4 -0
  113. package/src/desktop.js +25 -0
  114. package/src/gui.tsx +58 -0
  115. package/src/host.js +38 -0
  116. package/src/index.js +12 -0
  117. package/src/instance-settings.js +27 -0
  118. package/src/known-folders.js +22 -0
  119. package/src/management.js +17 -0
  120. package/src/preparation.js +18 -0
  121. package/src/presentation.js +153 -0
  122. package/src/settings.js +18 -0
  123. package/ui/feedback.cjs +45 -0
  124. package/ui/page.cjs +225 -0
  125. package/ui/state.cjs +44 -0
  126. package/updater/bootstrap.js +41 -0
  127. package/updater/common/activation.js +81 -0
  128. package/updater/common/coordinator.js +329 -0
  129. package/updater/common/download.js +57 -0
  130. package/updater/common/index.js +12 -0
  131. package/updater/common/package.js +53 -0
  132. package/updater/common/protocol.js +38 -0
  133. package/updater/common/transport.js +65 -0
  134. package/updater/coordinator.js +2 -0
  135. package/updater/launch.js +40 -0
  136. package/updater/management.js +9 -0
  137. package/updater/native.js +18 -0
  138. package/updater/operations.js +45 -0
  139. package/updater/protocol.js +1 -0
  140. package/updater/server.js +100 -0
  141. package/updater/transport.js +10 -0
  142. package/updater/windows-launch-reader.js +40 -0
  143. package/updater/windows-launch.js +96 -0
@@ -0,0 +1,1183 @@
1
+ # Version history
2
+
3
+ > [!NOTE]
4
+ > Consult the [migration guide](migration) to migrate between major Koffi versions.
5
+
6
+ ## Koffi 3
7
+
8
+ ### Koffi 3.1
9
+
10
+ #### Koffi 3.1.1
11
+
12
+ *Released on 2026-07-10*
13
+
14
+ - Restore missing Windows ARM64 build
15
+ - Slightly optimize memory allocation routines
16
+
17
+ #### Koffi 3.1.0
18
+
19
+ *Released on 2026-06-29*
20
+
21
+ - Add endian-sensitive integer decoding functions
22
+ - Drop useless but required type specifier from `lib.symbol()`
23
+ - Add `wstring` type alias for wide strings
24
+ - Add platform-dependent `koffi.decode.wstring()` function
25
+ - Improve performance of various functions and value conversions
26
+ - Optimize Windows build flags
27
+ - Fix static native loading from the koffi ESM entry point ([@yibe](https://codeberg.org/yibe))
28
+ - Fix minor memory and reference leaks on exit
29
+ - Fix length argument types in TypeScript definition
30
+ - Reorganize documentation
31
+
32
+ ### Koffi 3.0
33
+
34
+ #### Koffi 3.0.2
35
+
36
+ *Released on 2026-05-26*
37
+
38
+ - Fix unexpected type error when passing array of pointers (see [Koromix/koffi#269](https://github.com/Koromix/koffi/issues/269))
39
+ - Search more native addon directories under `process.resourcesPath`
40
+ - Rearrange Koffi loading to use `require()` for static packages
41
+ - Avoid declare module syntax in TypeScript definition file
42
+ - Fix error when using *String* array hint with UTF-32 string types (`const char32_t *`)
43
+ - Add *Buffer* array hint to convert arrays and pointers to Node Buffer objects
44
+ - Reduce overhead of various Koffi functions
45
+
46
+ #### Koffi 3.0.1
47
+
48
+ *Released on 2026-05-20*
49
+
50
+ - Fix error when importing default koffi module from TypeScript
51
+ - Optimize creation of new JS objects for return values
52
+ - Adjust build flags for performance
53
+
54
+ #### Koffi 3.0.0
55
+
56
+ *Released on 2026-05-16*
57
+
58
+ **Highlights:**
59
+
60
+ - Rewrite call preparation and execution for **vastly improved performance**
61
+ - Distribute prebuilt binaries in **separate subpackages**
62
+
63
+ **Breaking changes:**
64
+
65
+ - Replace use of externals with type objects:
66
+ * Use `koffi.type()` to resolve type specifiers (strings or objects) to type objects
67
+ * Access type information directly on type objects without `koffi.introspect()`
68
+ - Replace use of externals with BigInt pointers
69
+
70
+ **Other changes:**
71
+
72
+ - Support ESM and CJS module types
73
+ - Add `koffi.enumeration()` to create [enum types](input#enum-types)
74
+ - Add fast decode functions for integers, floats and strings
75
+ - Use proper types for various objects and handles:
76
+ * Use *LibraryHandle* objects for loaded libraries
77
+ * Use *TypeObject* objects for Koffi types
78
+ * Use *PollHandle* for socket poll handles
79
+ - Add `Symbol.dispose` on library objects and poll handles
80
+ - Prefer types to interfaces in TypeScript declaration file
81
+ - Fix various bugs and small leaks (such as library handles)
82
+ - The ARM32 backend has been temporarily removed
83
+
84
+ **Newly deprecated functions:**
85
+
86
+ - Deprecate `koffi.resolve()` function, replace with `koffi.type()`
87
+ - Deprecate `koffi.introspect()` function, replace with `koffi.type()`
88
+
89
+ **Removed deprecated functions:**
90
+
91
+ - Remove `koffi.callback()` long replaced with `koffi.proto()`
92
+ - Remove `koffi.handle()` long replaced with `koffi.opaque()`
93
+
94
+ Consult the [migration guide](migration) for more information.
95
+
96
+ ## Koffi 2
97
+
98
+ ### Koffi 2.16
99
+
100
+ #### Koffi 2.16.2
101
+
102
+ *Released on 2026-05-06*
103
+
104
+ - Fix string truncation bugs when passing some kinds of long V8 strings (see [Koromix/koffi#266](https://github.com/Koromix/koffi/issues/266))
105
+
106
+ #### Koffi 2.16.1
107
+
108
+ *Released on 2026-04-17*
109
+
110
+ - Fix possible stack check crash when relaying callbacks on Windows
111
+ - Improve exception handling inside callbacks
112
+
113
+ #### Koffi 2.16.0
114
+
115
+ *Released on 2026-04-14*
116
+
117
+ - Support buffers and typed arrays in `koffi.address()`
118
+ - Put x86 SEH record at the top of stack frame
119
+ - Optimize Koffi binaries produced by GCC (with `-fno-semantic-interposition`)
120
+ - Fix nonsensical addresses in Koffi call dumps (when using DUMP_CALLS=1 environment variable)
121
+
122
+ - Reduce Koffi package size even more:
123
+ * Replace table of callback trampoline pointers with simple offset computation
124
+ * Strip out unused data and functions from Koffi binaries
125
+ * Generate repeated trampoline source and macros at build time
126
+ * Remove files not needed to build from source: tests, scripts, etc.
127
+ * Maximize NPM tarball compression with Zopfli
128
+ - This reduces decompressed Koffi package size from 41.4 MB to 28.7 MB
129
+
130
+ ### Koffi 2.15
131
+
132
+ #### Koffi 2.15.6
133
+
134
+ *Released on 2026-04-07*
135
+
136
+ - Fix possible exit crash after using `koffi.reset()` (regression introduced in Koffi 2.15.2)
137
+
138
+ #### Koffi 2.15.5
139
+
140
+ *Released on 2026-04-05*
141
+
142
+ - Reduce repeated trampoline code size:
143
+ * Use single set of trampolines to forward general and floating-point values
144
+ * Minimize trampoline size by jumping early to common handling code
145
+ - This reduces decompressed Koffi package size from 85.9 MB to 41.4 MB
146
+
147
+ #### Koffi 2.15.4
148
+
149
+ *Released on 2026-04-03*
150
+
151
+ - Fix ABI issue with variadic parameters that are passed on the stack on Apple ARM64 platforms
152
+ - Remove erroneous assertion from debug builds
153
+
154
+ #### Koffi 2.15.3
155
+
156
+ *Released on 2026-04-03*
157
+
158
+ - Fix "IsOnCentralStack()" assertion/crash when using callbacks in recent Node versions
159
+ - Support SetUnhandledExceptionFilter on Windows x64 and x86 ([@longhun12346](https://github.com/longhun12346))
160
+ - Fix incorrect stack alignment when relaying callbacks on 32-bit x86 platforms
161
+
162
+ #### Koffi 2.15.2
163
+
164
+ *Released on 2026-03-11*
165
+
166
+ - Fix possible deadlock or crash after a callback has been used when exiting from Node 24.14+
167
+ - Fix build problems on Android/Termux
168
+ - Fix failing indirect loading caused by missing path test
169
+ - Don't force users to set all members when using koffi.config() in TypeScript
170
+ - Use Clang to build Linux ARM64 prebuild
171
+
172
+ #### Koffi 2.15.1
173
+
174
+ *Released on 2026-01-24*
175
+
176
+ - Fix possible union-related crashes
177
+ - Support MinGW-w64 x64 builds on Windows
178
+
179
+ #### Koffi 2.15.0
180
+
181
+ *Released on 2025-12-21*
182
+
183
+ - Fix parsing error with some parameter types that could lead to weird crashes (regression introduced in Koffi 2.14)
184
+ - Fix rare data race in Koffi memory allocation/release
185
+ - Increase default and maximum length of async call queue
186
+ - Decrease default stack and heap size used for async calls
187
+ - Add API to poll sockets with Node libuv event loop ([@mkicherer](https://github.com/mkicherer))
188
+ - Fix erroneous UTF-32 range checks when decoding UTF-32 buffers ([@VastBlast](https://github.com/VastBlast))
189
+ - Fix possible overflow when encoding malformed UTF-16 to UTF-32
190
+ - Throw error when using negative offset in encode and decode functions ([@VastBlast](https://github.com/VastBlast))
191
+ - Use proper Unicode replacement char in UTF-32 routines
192
+
193
+ > [!NOTE]
194
+ > The socket polling/libuv integration API is not yet documented and might change in subsequent releases. You've been warned!
195
+
196
+ ### Koffi 2.14
197
+
198
+ #### Koffi 2.14.1
199
+
200
+ *Released on 2025-09-13*
201
+
202
+ - Recompile Linux (musl) ARM64 prebuild with Alpine 3.20 (instead of Alpine edge)
203
+ - Clean up redundant code paths for handling string arguments
204
+
205
+ #### Koffi 2.14.0
206
+
207
+ *Released on 2025-08-17*
208
+
209
+ - Improve support for structs with [flexible array member](input#flexible-arrays)
210
+ - Automatically encode/decode dynamic arrays pointers when length is known though struct member
211
+ - Fix parser crash when direction qualifier is followed by unknown type
212
+ - Add missing TypeScript types and arguments
213
+
214
+ ### Koffi 2.13
215
+
216
+ #### Koffi 2.13.0
217
+
218
+ *Released on 2025-08-07*
219
+
220
+ - Support anonymous function prototype types (`koffi.proto()`)
221
+ - Accept null or undefined name to define anonymous composite or pointer types
222
+
223
+ ### Koffi 2.12
224
+
225
+ #### Koffi 2.12.4
226
+
227
+ *Released on 2025-08-05*
228
+
229
+ - Fix build with old glibc or musl versions
230
+
231
+ #### Koffi 2.12.3
232
+
233
+ *Released on 2025-07-28*
234
+
235
+ - Add missing TypeScript overloads for struct redefinition
236
+ - Add missing TypeScript member parameter in `koffi.offsetof()`
237
+ - Add missing TypeScript declaration for `koffi.view()`
238
+ - Add primitive type names to TypeScript
239
+ - Simplify TypeScript module declaration
240
+
241
+ #### Koffi 2.12.2
242
+
243
+ *Released on 2025-07-16*
244
+
245
+ - Validate identifiers against Unicode XID table
246
+ - Skip struct and union members with placeholder name '\_'
247
+ - Add Koffi prebuild for Linux (musl) ARM64
248
+
249
+ > [!NOTE]
250
+ > The Koffi 3 codebase has been put aside, and some of it will be progressively integrated into Koffi 2 over the following months.
251
+
252
+ #### Koffi 2.12.1
253
+
254
+ *Released on 2025-07-05*
255
+
256
+ - Fix type errors when casting function pointers
257
+
258
+ #### Koffi 2.12.0
259
+
260
+ *Released on 2025-06-19*
261
+
262
+ - Support LoongArch64 architecture (thanks to [wjh-la](https://github.com/wjh-la))
263
+ - Fix wrong path for RISC-V 64 prebuild
264
+
265
+ ### Koffi 2.11
266
+
267
+ #### Koffi 2.11.0
268
+
269
+ *Released on 2025-04-09*
270
+
271
+ - Add `koffi.view()` to [access memory without copy](pointers#external-buffers-views)
272
+ - Various documentation fixes and improvements
273
+
274
+ ### Koffi 2.10
275
+
276
+ #### Koffi 2.10.1
277
+
278
+ *Released on 2025-01-24*
279
+
280
+ - Fix detection of ARM32 in build script in some cases
281
+ - Fix wrong path for ARM32 prebuild
282
+
283
+ #### Koffi 2.10.0
284
+
285
+ *Released on 2024-12-22*
286
+
287
+ - Allow [redefinition of opaque types](misc#circular-references) to concrete struct or union
288
+ - Clear out executable stack bit from ELF targets (`-z noexecstack`)
289
+ - Update documentation style
290
+
291
+ ### Koffi 2.9
292
+
293
+ #### Koffi 2.9.2
294
+
295
+ *Released on 2024-11-08*
296
+
297
+ - Fix non-aligned pointers when pushing UTF-16 and UTF-32 string parameters
298
+ - Various documentation fixes and improvements
299
+
300
+ #### Koffi 2.9.1
301
+
302
+ *Released on 2024-09-23*
303
+
304
+ - Fix x86 32-bit support regression in 2.9.0
305
+ - Add missing TS definition for `koffi.alloc()`
306
+ - Support `koffi.load(null)` in TS definition file
307
+
308
+ #### Koffi 2.9.0
309
+
310
+ *Released on 2024-07-22*
311
+
312
+ - Add support for char32_t and wchar_t (wide) strings
313
+ - Include Linux/musl x64 prebuild (based on Alpine)
314
+
315
+ ### Koffi 2.8
316
+
317
+ #### Koffi 2.8.11
318
+
319
+ *Released on 2024-06-19*
320
+
321
+ - Work around MSVC compiler bug introduced in Visual Studio 17.10
322
+
323
+ > [!WARNING]
324
+ > Use on platforms without pre-built binaries is broken in Koffi 2.8.10, skip this version.
325
+
326
+ #### Koffi 2.8.9
327
+
328
+ *Released on 2024-05-17*
329
+
330
+ - Fix ABI issue regarding bool return values on x86_64 (and possibly other platforms)
331
+
332
+ #### Koffi 2.8.8
333
+
334
+ *Released on 2024-04-26*
335
+
336
+ - Support use of buffers with mismatched size (truncation or zero-filling)
337
+
338
+ #### Koffi 2.8.7
339
+
340
+ *Released on 2024-04-23*
341
+
342
+ - Improve compatibility with SEHOP on Windows ([@longhun12346](https://github.com/longhun12346))
343
+
344
+ #### Koffi 2.8.6
345
+
346
+ *Released on 2024-04-12*
347
+
348
+ - Support [loading library](functions#loading-options) with RTLD_DEEPBIND where supported
349
+
350
+ #### Koffi 2.8.5
351
+
352
+ *Released on 2024-04-11*
353
+
354
+ - Prevent obviously invalid type and member names
355
+ - Fix possible infinite loop / UB for `koffi.load()` errors on POSIX systems
356
+ - Fix null return value instead of exception for some errors in `koffi.load()` on Windows
357
+
358
+ #### Koffi 2.8.4
359
+
360
+ *Released on 2024-04-09*
361
+
362
+ - Use simpler workaround for Node 20.12+ and 21.6+ to avoid excessive memory use
363
+
364
+ > [!WARNING]
365
+ > Some pre-built binaries are missing in Koffi 2.8.3, skip this version.
366
+
367
+ #### Koffi 2.8.2
368
+
369
+ *Released on 2024-04-07*
370
+
371
+ - Support [loading library](functions#loading-options) with RTLD_GLOBAL on POSIX platforms
372
+
373
+ #### Koffi 2.8.1
374
+
375
+ *Released on 2024-04-04*
376
+
377
+ - Fix incompatibility with Node 20.12+ and 21.6+
378
+
379
+ #### Koffi 2.8.0
380
+
381
+ *Released on 2024-02-12*
382
+
383
+ - Support pushing pointers for string arguments
384
+ - Add `koffi.alloc()` for [stable pointers](output#stable-pointers)
385
+
386
+ ### Koffi 2.7
387
+
388
+ #### Koffi 2.7.4
389
+
390
+ *Released on 2024-02-04*
391
+
392
+ - Support callbacks happening on main thread but outside JS call (such as during event loop)
393
+ - Improve stability after `koffi.reset()`
394
+ - Expose internal Node/NAPI `env` pointer
395
+ - Name main Koffi API functions
396
+
397
+ #### Koffi 2.7.3
398
+
399
+ *Released on 2024-01-26*
400
+
401
+ - Support decoding NULL terminated arrays
402
+
403
+ #### Koffi 2.7.2
404
+
405
+ *Released on 2024-01-15*
406
+
407
+ - Add missing TypeScript declaration for `koffi.free()`
408
+ - Fix TypeScript declaration of `koffi.encode()`
409
+ - Try to improve compatibility with webpack
410
+
411
+ #### Koffi 2.7.1
412
+
413
+ *Released on 2024-01-02*
414
+
415
+ - Support C-like `int[3]` syntax for [fixed array types](input#fixed-size-c-arrays)
416
+ - Refuse type specifiers with invalid tokens at the end (previously ignored)
417
+
418
+ #### Koffi 2.7.0
419
+
420
+ *Released on 2023-12-21*
421
+
422
+ - Support alternative [callback calling convention](callbacks#callback-types) in classic syntax
423
+ - Change syntax for [calling conventions](functions#calling-conventions) with classic syntax
424
+ - Drop unused "internal" property from Koffi
425
+
426
+ ### Koffi 2.6
427
+
428
+ #### Koffi 2.6.12
429
+
430
+ *Released on 2023-12-11*
431
+
432
+ - Fix possible crash introduced in Koffi 2.6.11
433
+
434
+ #### Koffi 2.6.11
435
+
436
+ *Released on 2023-12-05*
437
+
438
+ - Speed up resolving simple and often used type names
439
+ - Fix use of optional length argument with [koffi.encode()](values#encode-to-c-memory)
440
+
441
+ #### Koffi 2.6.10
442
+
443
+ *Released on 2023-11-29*
444
+
445
+ - Protect GetLastError() value from Node.js and V8 on Windows
446
+
447
+ #### Koffi 2.6.9
448
+
449
+ *Released on 2023-11-25*
450
+
451
+ - Search in DLL directory for additional dependencies on Windows
452
+ - Ignore prototype properties when making structs or unions
453
+ - Show detected version of Node when not adequate
454
+ - Minor documentation fixes
455
+
456
+ > [!WARNING]
457
+ > Loading Win32 system libraries can fail in Koffi 2.6.8, skip this version.
458
+
459
+ #### Koffi 2.6.6
460
+
461
+ *Released on 2023-10-28*
462
+
463
+ - Better handle errors while making struct or union types
464
+
465
+ #### Koffi 2.6.5
466
+
467
+ *Released on 2023-10-28*
468
+
469
+ - Allow self-referential structs and unions
470
+ - Fix rare Node.js "FATAL ERROR" with some invalid type specifiers
471
+
472
+ #### Koffi 2.6.4
473
+
474
+ *Released on 2023-10-26*
475
+
476
+ - Fix build issue with recent Visual Studio versions
477
+
478
+ #### Koffi 2.6.3
479
+
480
+ *Released on 2023-10-17*
481
+
482
+ - Add indirect loading script to help some bundlers
483
+
484
+ > [!WARNING]
485
+ > Pre-built binaries don't work correctly in Koffi 2.6.2, skip this version.
486
+
487
+ #### Koffi 2.6.1
488
+
489
+ *Released on 2023-09-18*
490
+
491
+ - Support string direction qualifiers in classic function definitions
492
+ - Fix possible off-by-one array access when parsing type name
493
+
494
+ #### Koffi 2.6.0
495
+
496
+ *Released on 2023-09-13*
497
+
498
+ **New features:**
499
+
500
+ - Use [koffi.symbol()](values#variable-definitions) to make pointers to exported variables (or other symbols)
501
+ - Use [koffi.encode()](values#encode-to-c-memory) to explictly encode data from JS to C memory
502
+ - Use shared library [lazy-loading](functions#loading-options) (RTLD_LAZY) on POSIX platforms
503
+
504
+ **Other changes:**
505
+
506
+ - Print more helpful error for Win32/Win64 DLL mismatches
507
+ - Add missing 'Union' primitive value in TS definition file
508
+
509
+ ### Koffi 2.5
510
+
511
+ #### Koffi 2.5.20
512
+
513
+ *Released on 2023-08-31*
514
+
515
+ - Fix possible crash with async registered callbacks introduced in Koffi 2.5.19
516
+ - Various documentation fixes and improvements
517
+
518
+ #### Koffi 2.5.19
519
+
520
+ *Released on 2023-08-29*
521
+
522
+ - Create thread-safe function broker lazily
523
+ - Add [koffi.reset()](misc#reset-internal-state) for type names and async broker
524
+
525
+ #### Koffi 2.5.18
526
+
527
+ *Released on 2023-08-27*
528
+
529
+ - Fix compatibility with Electron
530
+
531
+ #### Koffi 2.5.16
532
+
533
+ *Released on 2023-08-25*
534
+
535
+ - Run Koffi tests through usual index.js entry point
536
+ - Fix DLL error when using Koffi from NW.js on Windows
537
+ - Simplify NW.js Koffi example
538
+
539
+ > [!WARNING]
540
+ > Pre-built binaries don't work correctly in Koffi 2.5.13 to 2.5.15, skip those versions.
541
+
542
+ #### Koffi 2.5.12
543
+
544
+ *Released on 2023-08-21*
545
+
546
+ - Fix native module bundling for FreeBSD ARM64 and Linux RISC-V 64
547
+ - Increase maximum number of parameters to 64
548
+
549
+ #### Koffi 2.5.11
550
+
551
+ *Released on 2023-08-03*
552
+
553
+ - Support casting function pointers with [koffi.as()](pointers#handling-void-pointers)
554
+ - Build in C++20 mode
555
+
556
+ #### Koffi 2.5.10
557
+
558
+ *Released on 2023-08-01*
559
+
560
+ - Fix CMake regression when client has to build Koffi
561
+
562
+ #### Koffi 2.5.9
563
+
564
+ *Released on 2023-07-28*
565
+
566
+ **Main changes:**
567
+
568
+ - Use bundler-friendly static require calls in Koffi
569
+ - Add packaging examples to documentation
570
+
571
+ **Other changes:**
572
+
573
+ - Add missing unload() export to TS file
574
+ - Add export for koffi.types in TS file
575
+
576
+ #### Koffi 2.5.8
577
+
578
+ *Released on 2023-07-26*
579
+
580
+ - Add more search paths for native Koffi modules
581
+ - Add section [about bundling](start#bundling-koffi) to documentation
582
+
583
+ #### Koffi 2.5.7
584
+
585
+ *Released on 2023-07-19*
586
+
587
+ - Point package to new repository
588
+
589
+ #### Koffi 2.5.6
590
+
591
+ *Released on 2023-07-19*
592
+
593
+ - Increase limit of output parameters from 16 to 32
594
+
595
+ #### Koffi 2.5.5
596
+
597
+ *Released on 2023-07-17*
598
+
599
+ - Support decoding non-char null-terminated arrays
600
+
601
+ #### Koffi 2.5.4
602
+
603
+ *Released on 2023-07-14*
604
+
605
+ - Fix `koffi.pointer()` not accepting disposable types
606
+ - Fix potential issues when making pointers to anonymous types
607
+
608
+ #### Koffi 2.5.3
609
+
610
+ *Released on 2023-07-05*
611
+
612
+ - Add missing union exports in TS definition file
613
+ - Fix some parameter names in TS definition file
614
+
615
+ #### Koffi 2.5.2
616
+
617
+ *Released on 2023-07-04*
618
+
619
+ - Default initialize unset object/struct members
620
+
621
+ #### Koffi 2.5.1
622
+
623
+ *Released on 2023-06-20*
624
+
625
+ - Fix crash with some struct types in System V 64 ABI
626
+ - Always use direct passthrough for buffer arguments
627
+
628
+ #### Koffi 2.5.0
629
+
630
+ *Released on 2023-06-20*
631
+
632
+ **New features:**
633
+
634
+ - Support [union types](unions)
635
+
636
+ **Other fixes:**
637
+
638
+ - Fix ABI for single-float aggregate return on i386 BSD systems
639
+ - Don't mess with Node.js signal handling on POSIX systems
640
+
641
+ ### Koffi 2.4
642
+
643
+ #### Koffi 2.4.2
644
+
645
+ *Released on 2023-06-04*
646
+
647
+ - Support calling variadic function pointers
648
+ - Add documentation for function pointers
649
+
650
+ #### Koffi 2.4.1
651
+
652
+ *Released on 2023-06-03*
653
+
654
+ **Main changes:**
655
+
656
+ - Support [decoding function pointers](functions#decode-pointer-to-function) to callable functions
657
+ - Support calling function pointers with [koffi.call()](functions#call-pointer-directly)
658
+ - Deprecate `koffi.callback` in favor of `koffi.proto`
659
+
660
+ **Other changes:**
661
+
662
+ - Increase maximum number of callbacks to 8192
663
+ - Build Koffi with static CRT on Windows
664
+ - Reorganize Koffi data conversion documentation
665
+ - Add deprecated `koffi.handle` to TS file
666
+
667
+ ### Koffi 2.3
668
+
669
+ #### Koffi 2.3.20
670
+
671
+ *Released on 2023-05-15*
672
+
673
+ - Support explicit library unloading with `lib.unload()`
674
+
675
+ #### Koffi 2.3.19
676
+
677
+ *Released on 2023-04-21*
678
+
679
+ - Actually allow non-ambiguous [string] values for `void *` arguments
680
+
681
+ #### Koffi 2.3.18
682
+
683
+ *Released on 2023-04-21*
684
+
685
+ - Fix possible crash on exit caused by unregistered callbacks
686
+
687
+ #### Koffi 2.3.17
688
+
689
+ *Released on 2023-04-20*
690
+
691
+ - Allow strings for input `void *`, `int8_t *` and `int16_t *` pointer arguments
692
+ - Support using `[string]` (single-element string arrays) for polymorphic input/output arguments
693
+
694
+ #### Koffi 2.3.16
695
+
696
+ *Released on 2023-04-11*
697
+
698
+ - Fix Windows ARM64 build to work with official Node.js version
699
+ - Compile Windows builds with Visual Studio 2022 17.5.3
700
+ - Support null in `koffi.free()` and `koffi.address()`
701
+
702
+ #### Koffi 2.3.15
703
+
704
+ *Released on 2023-04-10*
705
+
706
+ - Improve manual decoding of 0-terminated strings
707
+ - Add checks around array conversion hints
708
+
709
+ #### Koffi 2.3.14
710
+
711
+ *Released on 2023-04-05*
712
+
713
+ - Add `koffi.errno()` function to get and set current errno value
714
+ - Add `koffi.os.errno` object with valid errno codes
715
+
716
+ #### Koffi 2.3.13
717
+
718
+ *Released on 2023-03-30*
719
+
720
+ - Add `koffi.address()` to get the raw value of a wrapper pointer
721
+
722
+ #### Koffi 2.3.12
723
+
724
+ *Released on 2023-03-30*
725
+
726
+ - Fix broken syntax in TS definition file
727
+ - Add missing exported properties in TS file
728
+
729
+ #### Koffi 2.3.11
730
+
731
+ *Released on 2023-03-30*
732
+
733
+ **Main changes:**
734
+
735
+ - Allow numbers and BigInts to be used for pointer arguments
736
+
737
+ **Other changes:**
738
+
739
+ - Use SQLITE_TRANSIENT in SQLite test code
740
+ - Avoid using `statx()` to allow compilation with glibc < 2.28
741
+ - Reorganize NPM package files to be less convoluted
742
+
743
+ #### Koffi 2.3.9
744
+
745
+ *Released on 2023-03-10*
746
+
747
+ - Relicense under MIT license
748
+
749
+ #### Koffi 2.3.8
750
+
751
+ *Released on 2023-02-28*
752
+
753
+ - Disable non-ready union support
754
+ - Simplify Windows stack allocation and drop NOACCESS and GUARD pages
755
+ - Adjust Windows TEB SEH chain and GuaranteedStackBytes for Koffi calls
756
+
757
+ #### Koffi 2.3.7
758
+
759
+ *Released on 2023-02-27*
760
+
761
+ - Fix missing require in index.js ([@gastonFrecceroNapse](https://github.com/gastonFrecceroNapse))
762
+ - Reduce NPM package bloat (from 65 MB to 20 MB) caused by changes in 2.3.6
763
+
764
+ #### Koffi 2.3.6
765
+
766
+ *Released on 2023-02-26*
767
+
768
+ - Fix broken TS definition file
769
+ - Keep all prebuilt binaries and load correct one at runtime
770
+
771
+ #### Koffi 2.3.5
772
+
773
+ *Released on 2023-02-24*
774
+
775
+ **Main fixes:**
776
+
777
+ - Fix rare random crashes with async callbacks
778
+ - Fix some bugs with RISC-V 64 ABI
779
+
780
+ **Other changes:**
781
+
782
+ - Expose array type hint in `koffi.introspect()`
783
+ - Add missing `koffi.array()` export in TS definition
784
+ - Make KoffiFunction more flexible in TS definition ([@insraq](https://github.com/insraq))
785
+ - Add a KoffiFunc<T> helper type in TS typing ([@insraq](https://github.com/insraq))
786
+ - Mark optional properties in TS TypeInfo class
787
+ - Minor performance improvements
788
+
789
+ #### Koffi 2.3.4
790
+
791
+ *Released on 2023-01-31*
792
+
793
+ - Fix error when installing Koffi on Windows (2.3.2)
794
+
795
+ #### Koffi 2.3.2
796
+
797
+ *Released on 2023-01-30*
798
+
799
+ **Main changes:**
800
+
801
+ - Fix type parser issues (such as ignoring some [disposable qualifiers](pointers#disposable-types))
802
+ - Fix crash when using disposable types in output parameters
803
+ - Add basic [koffi.stats()](misc#usage-statistics) interface
804
+
805
+ **Other changes:**
806
+
807
+ - Avoid CNoke dependency
808
+ - Clear out development dependencies from package.json
809
+
810
+ #### Koffi 2.3.1
811
+
812
+ *Released on 2023-01-30*
813
+
814
+ - Error out when trying to use ambiguous `void *` arguments (input and/or output)
815
+ - Adjust TypeScript definitions ([@insraq](https://github.com/insraq))
816
+ - Fix possible crash when parsing invalid prototype
817
+
818
+ #### Koffi 2.3.0
819
+
820
+ *Released on 2023-01-25*
821
+
822
+ **Main changes:**
823
+
824
+ - Allow buffers (TypedArray or ArrayBuffer) values for input and/or output pointer arguments (for polymorphic arguments)
825
+ - Support opaque buffers (TypedArray or ArrayBuffer) values in `koffi.decode()` to [decode output buffers](output#output-buffers)
826
+ - Decode non-string types as arrays when an [explicit length is passed to koffi.decode()](callbacks#decoding-pointer-arguments)
827
+
828
+ **Other changes:**
829
+
830
+ - Drop TypedArray type check for array and pointer values (only the size matters)
831
+ - Allow ArrayBuffer everywhere TypedArray is supported
832
+ - Add TypeScript definition for Koffi ([@insraq](https://github.com/insraq))
833
+ - Improve documentation about opaque and polymorphic structs
834
+ - Improve documentation for `koffi.decode()`
835
+ - Reduce NPM package size (from 100 MB to 25 MB) by removing test code and dependencies
836
+
837
+ ### Koffi 2.2
838
+
839
+ #### Koffi 2.2.5
840
+
841
+ *Released on 2023-01-23*
842
+
843
+ - Relicense Koffi under LGPL 3.0
844
+
845
+ #### Koffi 2.2.4
846
+
847
+ *Released on 2023-01-19*
848
+
849
+ - Fix memory leak on Windows (in Koffi 2.2.3) when running many async calls
850
+ - Reorganize documentation pages
851
+
852
+ #### Koffi 2.2.3
853
+
854
+ *Released on 2023-01-17*
855
+
856
+ - Support native code that uses [Structured Exception Handling (SEH)](https://learn.microsoft.com/en-us/cpp/cpp/structured-exception-handling-c-cpp) on Windows (x86, x64 and ARM64)
857
+ - Try to use ebp/rbp as frame pointer in x86/x64 ASM code
858
+
859
+ #### Koffi 2.2.2
860
+
861
+ *Released on 2023-01-14*
862
+
863
+ **Main fixes:**
864
+
865
+ - Support transparent [asynchronous callbacks](callbacks#asynchronous-callbacks)
866
+ - Expand from a maximum of 16+16 to 1024 callbacks running in parallel
867
+
868
+ **Other fixes:**
869
+
870
+ - Fix bundler support by removing shebang from index.js
871
+ - Fix bugs when loading Koffi multiples times in same process (context aware module)
872
+ - Check N-API version when module is loaded
873
+ - Optimize callback unregistration
874
+
875
+ #### Koffi 2.2.1
876
+
877
+ *Released on 2022-12-21*
878
+
879
+ - Fix crash when [calling callback again after FFI call inside previous callback](https://github.com/Koromix/rygel/issues/15)
880
+
881
+ #### Koffi 2.2.0
882
+
883
+ *Released on 2022-12-20*
884
+
885
+ **New features:**
886
+
887
+ - Add [koffi.decode()](callbacks#decoding-pointer-arguments) for callback pointer arguments
888
+ - Support transparent [output string parameters](output#string-buffer-example)
889
+ - Add `koffi.offsetof()` utility function
890
+ - Support optional *this* binding in `koffi.register()`
891
+
892
+ **Other fixes:**
893
+
894
+ - Correctly validate output parameter types
895
+ - Fix assertion with `void *` parameters
896
+
897
+ ### Koffi 2.1
898
+
899
+ #### Koffi 2.1.5
900
+
901
+ *Released on 2022-11-27*
902
+
903
+ - Add missing README file to NPM package
904
+
905
+ #### Koffi 2.1.4
906
+
907
+ *Released on 2022-11-25*
908
+
909
+ **Main changes:**
910
+
911
+ - Increase maximum type size from 32 kiB to 64 MiB
912
+ - Add configurable option for maximum type size
913
+
914
+ **Other changes:**
915
+
916
+ - Moved Koffi to a new repository: https://codeberg.org/Koromix/rygel/
917
+
918
+ #### Koffi 2.1.3
919
+
920
+ *Released on 2022-10-31*
921
+
922
+ - Support up to 16 output parameters (instead of 8)
923
+
924
+ #### Koffi 2.1.2
925
+
926
+ *Released on 2022-10-31*
927
+
928
+ - Support up to 8 output parameters (instead of 4)
929
+
930
+ #### Koffi 2.1.1
931
+
932
+ *Released on 2022-08-16*
933
+
934
+ - Fix potential memory allocation bugs
935
+
936
+ #### Koffi 2.1.0
937
+
938
+ *Released on 2022-08-13*
939
+
940
+ **Main changes:**
941
+
942
+ - Add [koffi.as()](pointers#handling-void-pointers) to support polymorphic APIs based on `void *` parameters
943
+ - Add [endian-sensitive integer types](input#endian-sensitive-integers): `intX_le_t`, `intX_be_t`, `uintX_le_t`, `uintX_be_t`
944
+ - Accept typed arrays for `void *` parameters
945
+ - Introduce `koffi.opaque()` to replace `koffi.handle()` (which remains supported until Koffi 3.0)
946
+ - Support JS Array and TypedArray to fill struct and array pointer members
947
+
948
+ **Other changes:**
949
+
950
+ - Improve global performance with inlining and unity builds
951
+ - Add `size_t` primitive type
952
+ - Support member-specific alignement values in structs
953
+ - Detect impossible parameter and return types (such as non-pointer opaque types)
954
+ - Various documentation fixes and improvements
955
+
956
+ ### Koffi 2.0
957
+
958
+ #### Koffi 2.0.1
959
+
960
+ *Released on 2022-07-30*
961
+
962
+ - Return `undefined` (instead of null) for `void` functions
963
+
964
+ #### Koffi 2.0.0
965
+
966
+ *Released on 2022-07-29*
967
+
968
+ **Major new features:**
969
+
970
+ - Add [disposable types](pointers#disposable-types) for automatic disposal of C values (such as heap-allocated strings)
971
+ - Add support for [registered callbacks](callbacks#registered-callbacks), that can be called after the initial FFI call
972
+ - Support named pointer types
973
+ - Support complex type specifications outside of prototype parser
974
+
975
+ **Minor new features:**
976
+
977
+ - Support type aliases with `koffi.alias()`
978
+ - Add `koffi.resolve()` to resolve type strings
979
+ - Expose all primitive type aliases in `koffi.types`
980
+ - Correctly pass exceptions thrown in JS callbacks
981
+
982
+ **Breaking API changes:**
983
+
984
+ - Change handling of callback types, which must be used through pointers
985
+ - Change handling of opaque handles, which must be used through pointers
986
+ - Support all types in `koffi.introspect(type)`
987
+
988
+ Consult the [migration guide](migration) for more information.
989
+
990
+ ## Koffi 1
991
+
992
+ ### Koffi 1.3
993
+
994
+ #### Koffi 1.3.12
995
+
996
+ *Released on 2022-07-27*
997
+
998
+ - Fix support for Yarn package manager
999
+
1000
+ #### Koffi 1.3.11
1001
+
1002
+ *Released on 2022-07-26*
1003
+
1004
+ - Fix broken parsing of `void *` when used for first parameter
1005
+
1006
+ #### Koffi 1.3.10
1007
+
1008
+ *Released on 2022-07-25*
1009
+
1010
+ **Main fixes:**
1011
+
1012
+ - Fix support for callbacks with more than 4 parameters on Windows x64
1013
+ - Fix support for callbacks with multiple floating-point arguments on ARM32 platforms
1014
+ - Fix possibly incorrect conversion for uint32_t callback parameters
1015
+
1016
+ **Other changes:**
1017
+
1018
+ - Various documentation fixes and improvements
1019
+
1020
+ #### Koffi 1.3.9
1021
+
1022
+ *Released on 2022-07-15*
1023
+
1024
+ - Fix prebuild compatibility with Electron on Windows x64
1025
+
1026
+ #### Koffi 1.3.8
1027
+
1028
+ *Released on 2022-07-12*
1029
+
1030
+ **Main changes:**
1031
+
1032
+ - Prevent callback reuse beyond FFI call
1033
+ - Add BTI support for AAarch64 platforms (except Windows)
1034
+
1035
+ **Other changes:**
1036
+
1037
+ - Fix and harmonize a few error messages
1038
+
1039
+ #### Koffi 1.3.7
1040
+
1041
+ *Released on 2022-07-07*
1042
+
1043
+ **Main fixes:**
1044
+
1045
+ - Fix crash when using callbacks inside structs
1046
+ - Support for null strings in record members
1047
+
1048
+ **Other changes:**
1049
+
1050
+ - Add intptr_t and uintptr_t primitive types
1051
+ - Add str/str16 type aliases for string/string16
1052
+ - Various documentation fixes and improvements
1053
+
1054
+ #### Koffi 1.3.6
1055
+
1056
+ *Released on 2022-07-01*
1057
+
1058
+ **Main fixes:**
1059
+
1060
+ - Fix install error with Node < 15 on Windows (build system bug)
1061
+
1062
+ **Other changes:**
1063
+
1064
+ - Detect incompatible Node.js versions when installing Koffi
1065
+ - Prebuild with Clang for Windows x64 and Linux x64 binaries
1066
+ - Various documentation improvements
1067
+
1068
+ #### Koffi 1.3.5
1069
+
1070
+ *Released on 2022-06-25*
1071
+
1072
+ **Main changes:**
1073
+
1074
+ - Fix memory leak when many async calls are running
1075
+ - Add configurable limit for maximum number of async calls (max_async_calls)
1076
+
1077
+ **Other changes:**
1078
+
1079
+ - Reduce default async memory stack and heap size
1080
+ - Various documentation improvements
1081
+
1082
+ #### Koffi 1.3.4
1083
+
1084
+ *Released on 2022-06-24*
1085
+
1086
+ - Fix possible OpenBSD i386 crash with `(void)` functions
1087
+
1088
+ #### Koffi 1.3.3
1089
+
1090
+ *Released on 2022-06-24*
1091
+
1092
+ **Main fixes:**
1093
+
1094
+ - Fix misconversion of signed integer return value as unsigned
1095
+
1096
+ **Other changes:**
1097
+
1098
+ - Support `(void)` (empty) function signatures
1099
+ - Disable unsafe compiler optimizations
1100
+ - Various documentation improvements
1101
+
1102
+ #### Koffi 1.3.2
1103
+
1104
+ *Released on 2022-06-23*
1105
+
1106
+ - Support compilation in C++14 mode (graceful degradation)
1107
+ - Support older toolchains on Linux (tested on Debian 9)
1108
+
1109
+ #### Koffi 1.3.1
1110
+
1111
+ *Released on 2022-06-22*
1112
+
1113
+ - The prebuilt binary is tested when Koffi is installed, and a rebuild happens if it fails to load
1114
+
1115
+ #### Koffi 1.3.0
1116
+
1117
+ *Released on 2022-06-22*
1118
+
1119
+ **Major changes:**
1120
+
1121
+ - Expand and move documentation to https://koffi.dev/
1122
+ - Support JS arrays and TypedArrays for pointer arguments (input, output and mixed)
1123
+
1124
+ **Other changes:**
1125
+
1126
+ - Convert NULL string pointers to null instead of crashing (return values, struct and array members, callbacks)
1127
+ - Default to 'string' array hint for char, char16 and char16_t arrays
1128
+ - Fix definition of long types on Windows x64 (LLP64 model)
1129
+ - Restrict automatic string conversion to signed char types
1130
+ - Detect floating-point ABI before using prebuilt binaries (ARM32, RISC-V)
1131
+ - Forbid duplicate member names in struct types
1132
+
1133
+ ### Koffi 1.2
1134
+
1135
+ #### Koffi 1.2.4
1136
+
1137
+ *Released on 2022-06-12*
1138
+
1139
+ - Windows ARM64 is now supported
1140
+
1141
+ #### Koffi 1.2.3
1142
+
1143
+ *Released on 2022-06-11*
1144
+
1145
+ - A prebuilt binary for macOS ARM64 (M1) is now included
1146
+
1147
+ #### Koffi 1.2.1
1148
+
1149
+ *Released on 2022-06-11*
1150
+
1151
+ This entry documents changes since version 1.1.0.
1152
+
1153
+ **New features:**
1154
+
1155
+ - JS functions can be used as C callbacks (cdecl, stdcall) on all platforms
1156
+ - RISC-V 64 LP64D ABI is supported (LP64 is untested)
1157
+ - Expose settings for memory usage of synchronous and asynchronous calls
1158
+ - Transparent conversion between C buffers and strings
1159
+ - Tentative support for Windows ARM64 (untested)
1160
+
1161
+ **Main fixes:**
1162
+
1163
+ - Fix excessive stack alignment of structs on x86 platforms
1164
+ - Fix potential problems with big int64_t/uint64_t values
1165
+ - Fix possible struct layout errors in push/pop code
1166
+ - Fix alignment issues in ARM32 push code
1167
+ - Fix incomplete/buggy support for HFA structs on ARM32 and ARM64
1168
+ - Fix crashes on OpenBSD caused by missing MAP_STACK flag
1169
+ - Fix non-sense "duplicate array type" errors
1170
+ - Fix value `koffi.internal` to false in module (normal) builds
1171
+ - Make sure we have a redzone below the stack for all architectures
1172
+ - Use slower allocation for big objects instead of failing
1173
+
1174
+ # Todo list
1175
+
1176
+ The following features and improvements are planned, not necessarily in that order:
1177
+
1178
+ - Port Koffi to PowerPC (POWER9+) ISA and ABI
1179
+ - Optimize passing of structs and arrays (with auto-generated JS)
1180
+ - Automate Windows/AArch64 (qemu) and macOS/AArch64 (how? ... thanks Apple) tests
1181
+ - Create a real-world example, using several libraries (Raylib, SQLite, libsodium) to illustrate various C API styles
1182
+ - Add simple struct type parser
1183
+ - Fix assembly unwind and CFI directives for better debugging experience