koffi 2.12.1 → 2.12.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 +11 -0
- package/LICENSE.txt +2 -2
- 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_armhf/koffi.node +0 -0
- package/build/koffi/linux_ia32/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/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_arm64/koffi.exp +0 -0
- package/build/koffi/win32_arm64/koffi.node +0 -0
- package/build/koffi/win32_ia32/koffi.exp +0 -0
- package/build/koffi/win32_ia32/koffi.node +0 -0
- package/build/koffi/win32_x64/koffi.exp +0 -0
- package/build/koffi/win32_x64/koffi.node +0 -0
- package/doc/assets.ini +3 -3
- package/doc/develop.sh +4 -3
- package/doc/pages/platforms.md +1 -1
- package/doc/static/highlight.js +1 -1
- package/doc/static/koffi.css +3 -2
- package/doc/static/print.css +1 -1
- package/doc/templates/code.html +5 -5
- package/doc/templates/page.html +4 -4
- package/index.d.ts +2 -2
- package/index.js +32 -32
- package/indirect.js +32 -12
- package/package.json +2 -2
- package/src/cnoke/LICENSE.txt +2 -2
- package/src/cnoke/README.md +2 -0
- package/src/cnoke/assets/FindCNoke.cmake +12 -2
- package/src/cnoke/assets/win_delay_hook.c +4 -4
- package/src/cnoke/cnoke.js +4 -2
- package/src/cnoke/package.json +1 -1
- package/src/cnoke/src/builder.js +11 -14
- package/src/cnoke/src/index.js +2 -2
- package/src/cnoke/src/tools.js +34 -2
- package/src/core/{libcc/libcc.cc → base/base.cc} +3092 -1674
- package/src/core/{libcc/libcc.hh → base/base.hh} +3059 -2432
- package/src/core/{libcc → base}/mimetypes.inc +42 -4
- package/src/core/{libcc → base}/mimetypes_gen.py +3 -3
- package/src/core/unicode/generate.py +124 -0
- package/src/core/unicode/xid.cc +52 -0
- package/src/core/unicode/xid.hh +29 -0
- package/src/core/unicode/xid.inc +465 -0
- package/src/koffi/CMakeLists.txt +8 -5
- package/src/koffi/cmake/raylib.cmake +6 -2
- package/src/koffi/cmake/{sqlite.cmake → sqlite3.cmake} +3 -3
- package/src/koffi/examples/electron-forge/forge.config.js +23 -3
- package/src/koffi/examples/electron-forge/package.json +18 -16
- package/src/koffi/src/abi_arm32.cc +7 -7
- package/src/koffi/src/abi_arm32_asm.S +2 -2
- package/src/koffi/src/abi_arm64.cc +45 -45
- package/src/koffi/src/abi_arm64_asm.S +4 -4
- package/src/koffi/src/abi_arm64_asm.asm +2 -2
- package/src/koffi/src/abi_loong64_asm.S +2 -2
- package/src/koffi/src/abi_riscv64.cc +5 -5
- package/src/koffi/src/abi_riscv64_asm.S +2 -2
- package/src/koffi/src/abi_x64_sysv.cc +3 -3
- package/src/koffi/src/abi_x64_sysv_asm.S +5 -5
- package/src/koffi/src/abi_x64_win.cc +3 -3
- package/src/koffi/src/abi_x64_win_asm.asm +2 -2
- package/src/koffi/src/abi_x86.cc +8 -8
- package/src/koffi/src/abi_x86_asm.S +2 -2
- package/src/koffi/src/abi_x86_asm.asm +2 -2
- package/src/koffi/src/call.cc +12 -12
- package/src/koffi/src/call.hh +8 -8
- package/src/koffi/src/errno.inc +152 -152
- package/src/koffi/src/ffi.cc +45 -39
- package/src/koffi/src/ffi.hh +6 -6
- package/src/koffi/src/init.js +1 -1
- package/src/koffi/src/parser.cc +6 -5
- package/src/koffi/src/parser.hh +3 -3
- package/src/koffi/src/trampolines/armasm.inc +2 -2
- package/src/koffi/src/trampolines/gnu.inc +2 -2
- package/src/koffi/src/trampolines/masm32.inc +2 -2
- package/src/koffi/src/trampolines/masm64.inc +2 -2
- package/src/koffi/src/trampolines/prototypes.inc +2 -2
- package/src/koffi/src/util.cc +9 -9
- package/src/koffi/src/util.hh +3 -3
- package/src/koffi/src/win32.cc +5 -5
- package/src/koffi/src/win32.hh +9 -9
- package/vendor/node-addon-api/CHANGELOG.md +97 -2
- package/vendor/node-addon-api/CONTRIBUTING.md +117 -7
- package/vendor/node-addon-api/README.md +25 -249
- package/vendor/node-addon-api/common.gypi +1 -0
- package/vendor/node-addon-api/doc/README.md +145 -0
- package/vendor/node-addon-api/doc/array_buffer.md +15 -15
- package/vendor/node-addon-api/doc/basic_env.md +200 -0
- package/vendor/node-addon-api/doc/buffer.md +24 -26
- package/vendor/node-addon-api/doc/cmake-js.md +19 -0
- package/vendor/node-addon-api/doc/{creating_a_release.md → contributing/creating_a_release.md} +16 -4
- package/vendor/node-addon-api/doc/env.md +11 -131
- package/vendor/node-addon-api/doc/error_handling.md +12 -0
- package/vendor/node-addon-api/doc/external.md +13 -4
- package/vendor/node-addon-api/doc/finalization.md +153 -0
- package/vendor/node-addon-api/doc/memory_management.md +1 -1
- package/vendor/node-addon-api/doc/object_wrap.md +19 -3
- package/vendor/node-addon-api/doc/promises.md +51 -0
- package/vendor/node-addon-api/doc/setup.md +29 -6
- package/vendor/node-addon-api/doc/value.md +13 -0
- package/vendor/node-addon-api/doc/version_management.md +2 -2
- package/vendor/node-addon-api/eslint.config.js +5 -0
- package/vendor/node-addon-api/index.js +2 -0
- package/vendor/node-addon-api/napi-inl.h +592 -166
- package/vendor/node-addon-api/napi.h +167 -59
- package/vendor/node-addon-api/node_addon_api.gyp +10 -0
- package/vendor/node-addon-api/noexcept.gypi +1 -1
- package/vendor/node-addon-api/package.json +10 -13
- package/vendor/node-addon-api/release-please-config.json +15 -0
- package/vendor/node-addon-api/test/addon_build/tpl/binding.gyp +2 -1
- package/vendor/node-addon-api/test/array_buffer.js +1 -1
- package/vendor/node-addon-api/test/async_context.js +2 -2
- package/vendor/node-addon-api/test/async_progress_queue_worker.js +3 -3
- package/vendor/node-addon-api/test/async_progress_worker.js +3 -3
- package/vendor/node-addon-api/test/async_worker.cc +15 -13
- package/vendor/node-addon-api/test/async_worker.js +5 -5
- package/vendor/node-addon-api/test/basic_types/value.cc +6 -0
- package/vendor/node-addon-api/test/basic_types/value.js +17 -0
- package/vendor/node-addon-api/test/binding.cc +8 -0
- package/vendor/node-addon-api/test/binding.gyp +23 -1
- package/vendor/node-addon-api/test/buffer.js +1 -2
- package/vendor/node-addon-api/test/common/index.js +1 -1
- package/vendor/node-addon-api/test/except_all.cc +22 -0
- package/vendor/node-addon-api/test/except_all.js +14 -0
- package/vendor/node-addon-api/test/exports.js +19 -0
- package/vendor/node-addon-api/test/finalizer_order.cc +152 -0
- package/vendor/node-addon-api/test/finalizer_order.js +98 -0
- package/vendor/node-addon-api/test/function.js +2 -2
- package/vendor/node-addon-api/test/function_reference.js +2 -2
- package/vendor/node-addon-api/test/globalObject/global_object_delete_property.cc +4 -4
- package/vendor/node-addon-api/test/globalObject/global_object_get_property.cc +4 -4
- package/vendor/node-addon-api/test/globalObject/global_object_has_own_property.cc +3 -3
- package/vendor/node-addon-api/test/globalObject/global_object_set_property.cc +5 -5
- package/vendor/node-addon-api/test/name.cc +10 -8
- package/vendor/node-addon-api/test/object/delete_property.cc +5 -5
- package/vendor/node-addon-api/test/object/get_property.cc +5 -5
- package/vendor/node-addon-api/test/object/has_own_property.cc +4 -4
- package/vendor/node-addon-api/test/object/has_property.cc +5 -5
- package/vendor/node-addon-api/test/object/object.cc +1 -1
- package/vendor/node-addon-api/test/object/set_property.cc +5 -5
- package/vendor/node-addon-api/test/object/subscript_operator.cc +3 -3
- package/vendor/node-addon-api/test/object_reference.cc +18 -18
- package/vendor/node-addon-api/test/promise.cc +75 -0
- package/vendor/node-addon-api/test/promise.js +23 -0
- package/vendor/node-addon-api/test/require_basic_finalizers/index.js +38 -0
- package/vendor/node-addon-api/test/require_basic_finalizers/tpl/addon.cc +12 -0
- package/vendor/node-addon-api/test/require_basic_finalizers/tpl/binding.gyp +48 -0
- package/vendor/node-addon-api/test/require_basic_finalizers/tpl/index.js +3 -0
- package/vendor/node-addon-api/test/require_basic_finalizers/tpl/package.json +11 -0
- package/vendor/node-addon-api/test/run_script.cc +1 -1
- package/vendor/node-addon-api/test/type_taggable.cc +1 -1
- package/vendor/node-addon-api/test/type_taggable.js +3 -4
- package/vendor/node-addon-api/test/typedarray.cc +28 -24
- package/vendor/node-addon-api/tools/conversion.js +1 -1
- package/vendor/node-api-headers/CHANGELOG.md +29 -0
- package/vendor/node-api-headers/CREATING_A_RELEASE.md +12 -2
- package/vendor/node-api-headers/def/js_native_api.def +6 -1
- package/vendor/node-api-headers/def/node_api.def +7 -1
- package/vendor/node-api-headers/include/js_native_api.h +56 -24
- package/vendor/node-api-headers/include/js_native_api_types.h +27 -0
- package/vendor/node-api-headers/include/node_api.h +38 -29
- package/vendor/node-api-headers/lib/parse-utils.js +92 -0
- package/vendor/node-api-headers/package.json +7 -7
- package/vendor/node-api-headers/release-please-config.json +12 -0
- package/vendor/node-api-headers/scripts/update-headers.js +63 -12
- package/vendor/node-api-headers/scripts/write-symbols.js +1 -1
- package/vendor/node-api-headers/symbols.js +17 -1
- package/vendor/node-api-headers/test/parse-utils.js +21 -0
- package/doc/flat/flat.css +0 -27
- package/doc/flat/normal.css +0 -429
- package/doc/flat/print.css +0 -29
- package/doc/flat/reset.css +0 -41
- package/doc/flat/small.css +0 -104
- package/doc/flat/static.js +0 -161
- package/src/core/libcc/brotli.cc +0 -186
- package/src/core/libcc/lz4.cc +0 -197
- package/src/core/libcc/miniz.cc +0 -353
- package/vendor/node-addon-api/tools/eslint-format.js +0 -79
- /package/vendor/node-api-headers/{scripts → lib}/clang-utils.js +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,17 @@
|
|
|
7
7
|
|
|
8
8
|
### Koffi 2.12
|
|
9
9
|
|
|
10
|
+
#### Koffi 2.12.2
|
|
11
|
+
|
|
12
|
+
*Released on 2025-07-16*
|
|
13
|
+
|
|
14
|
+
- Validate identifiers against Unicode XID table
|
|
15
|
+
- Skip struct and union members with placeholder name '\_'
|
|
16
|
+
- Add Koffi prebuild for Linux (musl) ARM64
|
|
17
|
+
|
|
18
|
+
> [!NOTE]
|
|
19
|
+
> The Koffi 3 codebase has been put aside, and some of it will be progressively integrated into Koffi 2 over the following months.
|
|
20
|
+
|
|
10
21
|
#### Koffi 2.12.1
|
|
11
22
|
|
|
12
23
|
*Released on 2025-07-05*
|
package/LICENSE.txt
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright
|
|
3
|
+
Copyright (C) 2025 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
|
-
this software and associated documentation files (the “Software”), to deal in
|
|
6
|
+
this software and associated documentation files (the “Software”), to deal in
|
|
7
7
|
the Software without restriction, including without limitation the rights to use,
|
|
8
8
|
copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
|
|
9
9
|
Software, and to permit persons to whom the Software is furnished to do so,
|
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
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/doc/assets.ini
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
EsbuildPath = ../../vendor/esbuild/
|
|
1
|
+
EsbuildPath = ../../vendor/esbuild/native/node_modules/@esbuild
|
|
2
2
|
|
|
3
3
|
[favicon.png]
|
|
4
4
|
Type = Copy
|
|
@@ -11,7 +11,7 @@ Ignore = favicon.png *.js *.css
|
|
|
11
11
|
|
|
12
12
|
[static/site.min.js]
|
|
13
13
|
Type = Bundle
|
|
14
|
-
Source = flat/static.js
|
|
14
|
+
Source = ../../src/web/flat/static.js
|
|
15
15
|
|
|
16
16
|
[static/highlight.min.js]
|
|
17
17
|
Type = Bundle
|
|
@@ -20,4 +20,4 @@ Source = static/highlight.js
|
|
|
20
20
|
[static/site.min.css]
|
|
21
21
|
Type = Bundle
|
|
22
22
|
Source = static/koffi.css
|
|
23
|
-
Options = --loader:.
|
|
23
|
+
Options = --loader:.woff2=file --loader:.png=file --loader:.webp=file
|
package/doc/develop.sh
CHANGED
|
@@ -3,12 +3,13 @@
|
|
|
3
3
|
cd "$(dirname $0)"
|
|
4
4
|
|
|
5
5
|
../../bootstrap.sh
|
|
6
|
-
../../felix -pFast
|
|
6
|
+
../../felix -pFast nestor hodler
|
|
7
7
|
|
|
8
8
|
trap 'kill $(jobs -p) 2>/dev/null' EXIT
|
|
9
9
|
trap 'kill $(jobs -p) 2>/dev/null' SIGINT
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
../../bin/Fast/
|
|
11
|
+
mkdir -p dist
|
|
12
|
+
../../bin/Fast/nestor dist/ &
|
|
13
|
+
../../bin/Fast/hodler . -O dist --loop --sourcemap &
|
|
13
14
|
|
|
14
15
|
wait $(jobs -p)
|
package/doc/pages/platforms.md
CHANGED
|
@@ -19,7 +19,7 @@ ISA / OS | Windows | Linux (glibc) | Linux (musl)
|
|
|
19
19
|
x86 (IA32) [^1] | ✅ | ✅ | 🟨
|
|
20
20
|
x86_64 (AMD64) | ✅ | ✅ | ✅
|
|
21
21
|
ARM32 LE [^2] | ⬜️ | ✅ | 🟨
|
|
22
|
-
ARM64 (AArch64) LE | ✅ | ✅ |
|
|
22
|
+
ARM64 (AArch64) LE | ✅ | ✅ | ✅
|
|
23
23
|
RISC-V 64 [^3] | ⬜️ | ✅ | 🟨
|
|
24
24
|
LoongArch64 | ⬜️ | ✅ | 🟨
|
|
25
25
|
|
package/doc/static/highlight.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright (C)
|
|
1
|
+
// Copyright (C) 2025 Niels Martignène <niels.martignene@protonmail.com>
|
|
2
2
|
//
|
|
3
3
|
// This program is free software: you can redistribute it and/or modify
|
|
4
4
|
// it under the terms of the GNU General Public License as published by
|
package/doc/static/koffi.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* Copyright (C)
|
|
1
|
+
/* Copyright (C) 2025 Niels Martignène <niels.martignene@protonmail.com>
|
|
2
2
|
|
|
3
3
|
This program is free software: you can redistribute it and/or modify
|
|
4
4
|
it under the terms of the GNU General Public License as published by
|
|
@@ -13,10 +13,11 @@
|
|
|
13
13
|
You should have received a copy of the GNU General Public License
|
|
14
14
|
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
|
15
15
|
|
|
16
|
-
@import url('
|
|
16
|
+
@import url('../../../src/web/flat/flat.css');
|
|
17
17
|
@import url('../../../vendor/highlight.js/styles/base16/tomorrow.css');
|
|
18
18
|
|
|
19
19
|
html {
|
|
20
20
|
--top_color: #ec7400;
|
|
21
|
+
--button_color: #ec7400;
|
|
21
22
|
--anchor_color: #ec7400;
|
|
22
23
|
}
|
package/doc/static/print.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* Copyright (C)
|
|
1
|
+
/* Copyright (C) 2025 Niels Martignène <niels.martignene@protonmail.com>
|
|
2
2
|
|
|
3
3
|
This program is free software: you can redistribute it and/or modify
|
|
4
4
|
it under the terms of the GNU General Public License as published by
|
package/doc/templates/code.html
CHANGED
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
<meta name="theme-color" content="#6aa051">
|
|
13
13
|
<link rel="stylesheet" href="{{ ASSET static/site.min.css }}">
|
|
14
14
|
|
|
15
|
-
<script type="text/javascript" src="{{ ASSET static/site.min.js }}"
|
|
16
|
-
<script type="text/javascript" src="{{ ASSET static/highlight.min.js }}"
|
|
15
|
+
<script type="text/javascript" src="{{ ASSET static/site.min.js }}"></script>
|
|
16
|
+
<script type="text/javascript" src="{{ ASSET static/highlight.min.js }}"></script>
|
|
17
17
|
</head>
|
|
18
18
|
|
|
19
19
|
<body>
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
|
|
22
22
|
<nav id="top">
|
|
23
23
|
<menu>
|
|
24
|
-
<a id="logo" href="/"><img src="{{ ASSET static/logo.webp }}"
|
|
24
|
+
<a id="logo" href="/"><img src="{{ ASSET static/logo.webp }}" width="370" height="198" alt="" /></a>
|
|
25
25
|
|
|
26
26
|
{{ LINKS }}
|
|
27
27
|
|
|
@@ -39,9 +39,9 @@
|
|
|
39
39
|
</main>
|
|
40
40
|
|
|
41
41
|
<footer>
|
|
42
|
-
<div>Koffi ©
|
|
42
|
+
<div>Koffi © 2025</div>
|
|
43
43
|
<div style="font-size: 0.8em;">
|
|
44
|
-
Niels Martignène (<a href="https://
|
|
44
|
+
Niels Martignène (<a href="https://koromix.dev/" target="_blank">Koromix</a>)<br>
|
|
45
45
|
<a href="mailto:niels.martignene@protonmail.com" style="font-weight: bold; color: inherit;">niels.martignene@protonmail.com</a>
|
|
46
46
|
</div>
|
|
47
47
|
</footer>
|
package/doc/templates/page.html
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
<meta name="theme-color" content="#6aa051">
|
|
13
13
|
<link rel="stylesheet" href="{{ ASSET static/site.min.css }}">
|
|
14
14
|
|
|
15
|
-
<script type="text/javascript" src="{{ ASSET static/site.min.js }}"
|
|
15
|
+
<script type="text/javascript" src="{{ ASSET static/site.min.js }}"></script>
|
|
16
16
|
</head>
|
|
17
17
|
|
|
18
18
|
<body>
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
|
|
21
21
|
<nav id="top">
|
|
22
22
|
<menu>
|
|
23
|
-
<a id="logo" href="/"><img src="{{ ASSET static/logo.webp }}"
|
|
23
|
+
<a id="logo" href="/"><img src="{{ ASSET static/logo.webp }}" width="370" height="198" alt="" /></a>
|
|
24
24
|
|
|
25
25
|
{{ LINKS }}
|
|
26
26
|
|
|
@@ -38,9 +38,9 @@
|
|
|
38
38
|
</main>
|
|
39
39
|
|
|
40
40
|
<footer>
|
|
41
|
-
<div>Koffi ©
|
|
41
|
+
<div>Koffi © 2025</div>
|
|
42
42
|
<div style="font-size: 0.8em;">
|
|
43
|
-
Niels Martignène (<a href="https://
|
|
43
|
+
Niels Martignène (<a href="https://koromix.dev/" target="_blank">Koromix</a>)<br>
|
|
44
44
|
<a href="mailto:niels.martignene@protonmail.com" style="font-weight: bold; color: inherit;">niels.martignene@protonmail.com</a>
|
|
45
45
|
</div>
|
|
46
46
|
</footer>
|
package/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright (C) 2025 Niels Martignène <niels.martignene@protonmail.com>
|
|
2
2
|
//
|
|
3
3
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
4
|
-
// this software and associated documentation files (the “Software”), to deal in
|
|
4
|
+
// this software and associated documentation files (the “Software”), to deal in
|
|
5
5
|
// the Software without restriction, including without limitation the rights to use,
|
|
6
6
|
// copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
|
|
7
7
|
// Software, and to permit persons to whom the Software is furnished to do so,
|
package/index.js
CHANGED
|
@@ -4,9 +4,9 @@ var __commonJS = (cb, mod3) => function __require() {
|
|
|
4
4
|
return mod3 || (0, cb[__getOwnPropNames(cb)[0]])((mod3 = { exports: {} }).exports, mod3), mod3.exports;
|
|
5
5
|
};
|
|
6
6
|
|
|
7
|
-
//
|
|
7
|
+
// package/src/cnoke/src/tools.js
|
|
8
8
|
var require_tools = __commonJS({
|
|
9
|
-
"
|
|
9
|
+
"package/src/cnoke/src/tools.js"(exports2, module2) {
|
|
10
10
|
"use strict";
|
|
11
11
|
var crypto = require("crypto");
|
|
12
12
|
var fs2 = require("fs");
|
|
@@ -178,6 +178,28 @@ var require_tools = __commonJS({
|
|
|
178
178
|
return true;
|
|
179
179
|
return false;
|
|
180
180
|
}
|
|
181
|
+
function sync_files(src_dir, dest_dir) {
|
|
182
|
+
let keep = /* @__PURE__ */ new Set();
|
|
183
|
+
{
|
|
184
|
+
let entries = fs2.readdirSync(src_dir, { withFileTypes: true });
|
|
185
|
+
for (let entry of entries) {
|
|
186
|
+
if (!entry.isFile())
|
|
187
|
+
continue;
|
|
188
|
+
keep.add(entry.name);
|
|
189
|
+
fs2.copyFileSync(src_dir + `/${entry.name}`, dest_dir + `/${entry.name}`);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
{
|
|
193
|
+
let entries = fs2.readdirSync(dest_dir, { withFileTypes: true });
|
|
194
|
+
for (let entry of entries) {
|
|
195
|
+
if (!entry.isFile())
|
|
196
|
+
continue;
|
|
197
|
+
if (keep.has(entry.name))
|
|
198
|
+
continue;
|
|
199
|
+
fs2.unlinkSync(dest_dir + `/${entry.name}`);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
181
203
|
function determine_arch2() {
|
|
182
204
|
let arch = process.arch;
|
|
183
205
|
if (arch == "riscv32" || arch == "riscv64") {
|
|
@@ -366,6 +388,7 @@ var require_tools = __commonJS({
|
|
|
366
388
|
extract_targz,
|
|
367
389
|
path_is_absolute,
|
|
368
390
|
path_has_dotdot,
|
|
391
|
+
sync_files,
|
|
369
392
|
determine_arch: determine_arch2,
|
|
370
393
|
unlink_recursive,
|
|
371
394
|
get_napi_version: get_napi_version2,
|
|
@@ -374,13 +397,13 @@ var require_tools = __commonJS({
|
|
|
374
397
|
}
|
|
375
398
|
});
|
|
376
399
|
|
|
377
|
-
//
|
|
400
|
+
// package/src/koffi/package.json
|
|
378
401
|
var require_package = __commonJS({
|
|
379
|
-
"
|
|
402
|
+
"package/src/koffi/package.json"(exports2, module2) {
|
|
380
403
|
module2.exports = {
|
|
381
404
|
name: "koffi",
|
|
382
|
-
version: "2.12.
|
|
383
|
-
stable: "2.12.
|
|
405
|
+
version: "2.12.2",
|
|
406
|
+
stable: "2.12.2",
|
|
384
407
|
description: "Fast and simple C FFI (foreign function interface) for Node.js",
|
|
385
408
|
keywords: [
|
|
386
409
|
"foreign",
|
|
@@ -410,9 +433,6 @@ var require_package = __commonJS({
|
|
|
410
433
|
package: "node tools/koffi.js build"
|
|
411
434
|
},
|
|
412
435
|
license: "MIT",
|
|
413
|
-
devDependencies: {
|
|
414
|
-
esbuild: "^0.19.2"
|
|
415
|
-
},
|
|
416
436
|
cnoke: {
|
|
417
437
|
api: "../../vendor/node-api-headers",
|
|
418
438
|
output: "../../bin/Koffi/{{ platform }}_{{ arch }}",
|
|
@@ -424,9 +444,9 @@ var require_package = __commonJS({
|
|
|
424
444
|
}
|
|
425
445
|
});
|
|
426
446
|
|
|
427
|
-
//
|
|
447
|
+
// package/src/koffi/src/init.js
|
|
428
448
|
var require_init = __commonJS({
|
|
429
|
-
"
|
|
449
|
+
"package/src/koffi/src/init.js"(exports, module) {
|
|
430
450
|
var fs = require("fs");
|
|
431
451
|
var path = require("path");
|
|
432
452
|
var util = require("util");
|
|
@@ -509,7 +529,7 @@ var require_init = __commonJS({
|
|
|
509
529
|
}
|
|
510
530
|
});
|
|
511
531
|
|
|
512
|
-
//
|
|
532
|
+
// package/src/koffi/index.js
|
|
513
533
|
var { detect: detect2, init: init2 } = require_init();
|
|
514
534
|
var triplet2 = detect2();
|
|
515
535
|
var native2 = null;
|
|
@@ -599,31 +619,11 @@ try {
|
|
|
599
619
|
} catch {
|
|
600
620
|
try {
|
|
601
621
|
switch (triplet2) {
|
|
602
|
-
case "linux_armhf":
|
|
603
|
-
{
|
|
604
|
-
native2 = require("./build/koffi/musl_armhf/koffi.node");
|
|
605
|
-
}
|
|
606
|
-
break;
|
|
607
622
|
case "linux_arm64":
|
|
608
623
|
{
|
|
609
624
|
native2 = require("./build/koffi/musl_arm64/koffi.node");
|
|
610
625
|
}
|
|
611
626
|
break;
|
|
612
|
-
case "linux_ia32":
|
|
613
|
-
{
|
|
614
|
-
native2 = require("./build/koffi/musl_ia32/koffi.node");
|
|
615
|
-
}
|
|
616
|
-
break;
|
|
617
|
-
case "linux_loong64":
|
|
618
|
-
{
|
|
619
|
-
native2 = require("./build/koffi/musl_loong64/koffi.node");
|
|
620
|
-
}
|
|
621
|
-
break;
|
|
622
|
-
case "linux_riscv64d":
|
|
623
|
-
{
|
|
624
|
-
native2 = require("./build/koffi/musl_riscv64d/koffi.node");
|
|
625
|
-
}
|
|
626
|
-
break;
|
|
627
627
|
case "linux_x64":
|
|
628
628
|
{
|
|
629
629
|
native2 = require("./build/koffi/musl_x64/koffi.node");
|
package/indirect.js
CHANGED
|
@@ -4,9 +4,9 @@ var __commonJS = (cb, mod3) => function __require() {
|
|
|
4
4
|
return mod3 || (0, cb[__getOwnPropNames(cb)[0]])((mod3 = { exports: {} }).exports, mod3), mod3.exports;
|
|
5
5
|
};
|
|
6
6
|
|
|
7
|
-
//
|
|
7
|
+
// package/src/cnoke/src/tools.js
|
|
8
8
|
var require_tools = __commonJS({
|
|
9
|
-
"
|
|
9
|
+
"package/src/cnoke/src/tools.js"(exports2, module2) {
|
|
10
10
|
"use strict";
|
|
11
11
|
var crypto = require("crypto");
|
|
12
12
|
var fs2 = require("fs");
|
|
@@ -178,6 +178,28 @@ var require_tools = __commonJS({
|
|
|
178
178
|
return true;
|
|
179
179
|
return false;
|
|
180
180
|
}
|
|
181
|
+
function sync_files(src_dir, dest_dir) {
|
|
182
|
+
let keep = /* @__PURE__ */ new Set();
|
|
183
|
+
{
|
|
184
|
+
let entries = fs2.readdirSync(src_dir, { withFileTypes: true });
|
|
185
|
+
for (let entry of entries) {
|
|
186
|
+
if (!entry.isFile())
|
|
187
|
+
continue;
|
|
188
|
+
keep.add(entry.name);
|
|
189
|
+
fs2.copyFileSync(src_dir + `/${entry.name}`, dest_dir + `/${entry.name}`);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
{
|
|
193
|
+
let entries = fs2.readdirSync(dest_dir, { withFileTypes: true });
|
|
194
|
+
for (let entry of entries) {
|
|
195
|
+
if (!entry.isFile())
|
|
196
|
+
continue;
|
|
197
|
+
if (keep.has(entry.name))
|
|
198
|
+
continue;
|
|
199
|
+
fs2.unlinkSync(dest_dir + `/${entry.name}`);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
181
203
|
function determine_arch2() {
|
|
182
204
|
let arch = process.arch;
|
|
183
205
|
if (arch == "riscv32" || arch == "riscv64") {
|
|
@@ -366,6 +388,7 @@ var require_tools = __commonJS({
|
|
|
366
388
|
extract_targz,
|
|
367
389
|
path_is_absolute,
|
|
368
390
|
path_has_dotdot,
|
|
391
|
+
sync_files,
|
|
369
392
|
determine_arch: determine_arch2,
|
|
370
393
|
unlink_recursive,
|
|
371
394
|
get_napi_version: get_napi_version2,
|
|
@@ -374,13 +397,13 @@ var require_tools = __commonJS({
|
|
|
374
397
|
}
|
|
375
398
|
});
|
|
376
399
|
|
|
377
|
-
//
|
|
400
|
+
// package/src/koffi/package.json
|
|
378
401
|
var require_package = __commonJS({
|
|
379
|
-
"
|
|
402
|
+
"package/src/koffi/package.json"(exports2, module2) {
|
|
380
403
|
module2.exports = {
|
|
381
404
|
name: "koffi",
|
|
382
|
-
version: "2.12.
|
|
383
|
-
stable: "2.12.
|
|
405
|
+
version: "2.12.2",
|
|
406
|
+
stable: "2.12.2",
|
|
384
407
|
description: "Fast and simple C FFI (foreign function interface) for Node.js",
|
|
385
408
|
keywords: [
|
|
386
409
|
"foreign",
|
|
@@ -410,9 +433,6 @@ var require_package = __commonJS({
|
|
|
410
433
|
package: "node tools/koffi.js build"
|
|
411
434
|
},
|
|
412
435
|
license: "MIT",
|
|
413
|
-
devDependencies: {
|
|
414
|
-
esbuild: "^0.19.2"
|
|
415
|
-
},
|
|
416
436
|
cnoke: {
|
|
417
437
|
api: "../../vendor/node-api-headers",
|
|
418
438
|
output: "../../bin/Koffi/{{ platform }}_{{ arch }}",
|
|
@@ -424,9 +444,9 @@ var require_package = __commonJS({
|
|
|
424
444
|
}
|
|
425
445
|
});
|
|
426
446
|
|
|
427
|
-
//
|
|
447
|
+
// package/src/koffi/src/init.js
|
|
428
448
|
var require_init = __commonJS({
|
|
429
|
-
"
|
|
449
|
+
"package/src/koffi/src/init.js"(exports, module) {
|
|
430
450
|
var fs = require("fs");
|
|
431
451
|
var path = require("path");
|
|
432
452
|
var util = require("util");
|
|
@@ -509,7 +529,7 @@ var require_init = __commonJS({
|
|
|
509
529
|
}
|
|
510
530
|
});
|
|
511
531
|
|
|
512
|
-
//
|
|
532
|
+
// package/src/koffi/indirect.js
|
|
513
533
|
var { detect: detect2, init: init2 } = require_init();
|
|
514
534
|
var triplet2 = detect2();
|
|
515
535
|
var mod2 = init2(triplet2, null);
|
package/package.json
CHANGED
package/src/cnoke/LICENSE.txt
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright
|
|
3
|
+
Copyright (C) 2025 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
|
-
this software and associated documentation files (the “Software”), to deal in
|
|
6
|
+
this software and associated documentation files (the “Software”), to deal in
|
|
7
7
|
the Software without restriction, including without limitation the rights to use,
|
|
8
8
|
copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
|
|
9
9
|
Software, and to permit persons to whom the Software is furnished to do so,
|
package/src/cnoke/README.md
CHANGED
|
@@ -65,11 +65,13 @@ You can find the same help text by running `cnoke --help`:
|
|
|
65
65
|
Usage: cnoke [command] [options...] [targets...]
|
|
66
66
|
|
|
67
67
|
Commands:
|
|
68
|
+
|
|
68
69
|
configure Configure CMake build
|
|
69
70
|
build Build project (configure if needed)
|
|
70
71
|
clean Clean build files
|
|
71
72
|
|
|
72
73
|
Options:
|
|
74
|
+
|
|
73
75
|
-d, --directory <DIR> Change project directory
|
|
74
76
|
(default: current working directory)
|
|
75
77
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
# Copyright
|
|
1
|
+
# Copyright (C) 2025 Niels Martignène <niels.martignene@protonmail.com>
|
|
2
2
|
#
|
|
3
3
|
# Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
4
|
-
# this software and associated documentation files (the “Software”), to deal in
|
|
4
|
+
# this software and associated documentation files (the “Software”), to deal in
|
|
5
5
|
# the Software without restriction, including without limitation the rights to use,
|
|
6
6
|
# copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
|
|
7
7
|
# Software, and to permit persons to whom the Software is furnished to do so,
|
|
@@ -110,3 +110,13 @@ else()
|
|
|
110
110
|
function(enable_unity_build TARGET)
|
|
111
111
|
endfunction()
|
|
112
112
|
endif()
|
|
113
|
+
|
|
114
|
+
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
|
115
|
+
message(STATUS ${CMAKE_SYSTEM_PROCESSOR})
|
|
116
|
+
if(CMAKE_SYSTEM_PROCESSOR MATCHES "(amd64|x86_64)")
|
|
117
|
+
foreach(lang C CXX)
|
|
118
|
+
set(CMAKE_${lang}_FLAGS_RELEASE "${CMAKE_${lang}_FLAGS_RELEASE} -mpopcnt -msse4.1 -msse4.2 -mssse3 -mcx16")
|
|
119
|
+
set(CMAKE_${lang}_FLAGS_RELWITHDEBINFO "${CMAKE_${lang}_FLAGS_RELWITHDEBINFO} -mpopcnt -msse4.1 -msse4.2 -mssse3 -mcx16")
|
|
120
|
+
endforeach()
|
|
121
|
+
endif()
|
|
122
|
+
endif()
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright (C) 2025 Niels Martignène <niels.martignene@protonmail.com>
|
|
2
2
|
//
|
|
3
3
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
4
|
-
// this software and associated documentation files (the “Software”), to deal in
|
|
4
|
+
// this software and associated documentation files (the “Software”), to deal in
|
|
5
5
|
// the Software without restriction, including without limitation the rights to use,
|
|
6
6
|
// copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
|
|
7
7
|
// Software, and to permit persons to whom the Software is furnished to do so,
|
|
@@ -20,10 +20,10 @@
|
|
|
20
20
|
// OTHER DEALINGS IN THE SOFTWARE.
|
|
21
21
|
|
|
22
22
|
#include <stdlib.h>
|
|
23
|
-
#
|
|
23
|
+
#if !defined(NOMINMAX)
|
|
24
24
|
#define NOMINMAX
|
|
25
25
|
#endif
|
|
26
|
-
#
|
|
26
|
+
#if !defined(WIN32_LEAN_AND_MEAN)
|
|
27
27
|
#define WIN32_LEAN_AND_MEAN
|
|
28
28
|
#endif
|
|
29
29
|
#include <windows.h>
|
package/src/cnoke/cnoke.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
// Copyright
|
|
3
|
+
// Copyright (C) 2025 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
|
-
// this software and associated documentation files (the “Software”), to deal in
|
|
6
|
+
// this software and associated documentation files (the “Software”), to deal in
|
|
7
7
|
// the Software without restriction, including without limitation the rights to use,
|
|
8
8
|
// copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
|
|
9
9
|
// Software, and to permit persons to whom the Software is furnished to do so,
|
|
@@ -153,11 +153,13 @@ function print_usage() {
|
|
|
153
153
|
let help = `Usage: cnoke [command] [options...]
|
|
154
154
|
|
|
155
155
|
Commands:
|
|
156
|
+
|
|
156
157
|
configure Configure CMake build
|
|
157
158
|
build Build project (configure if needed)
|
|
158
159
|
clean Clean build files
|
|
159
160
|
|
|
160
161
|
Options:
|
|
162
|
+
|
|
161
163
|
-d, --directory <DIR> Change source directory
|
|
162
164
|
(default: current working directory)
|
|
163
165
|
-p, --package <DIR> Change package directory
|