From 7da2e06a368862cdb34b1a366572d939cfd857e9 Mon Sep 17 00:00:00 2001 From: "Jonathan D.A. Jewell" <6759885+hyperpolymath@users.noreply.github.com> Date: Wed, 3 Jun 2026 22:16:44 +0100 Subject: [PATCH 1/2] =?UTF-8?q?feat(ffi):=20add=20missing=20library=20meta?= =?UTF-8?q?data=20and=20free=5Fstring=20exports=20=E2=80=94=20issue=20#88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ffi/zig/src/main.zig | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/ffi/zig/src/main.zig b/ffi/zig/src/main.zig index 5ffd4207..36176825 100644 --- a/ffi/zig/src/main.zig +++ b/ffi/zig/src/main.zig @@ -80,6 +80,22 @@ export fn proven_free(handle: ?*Handle) void { clearError(); } +/// Return the library version triple +export fn proven_version_major() u32 { return 1; } +export fn proven_version_minor() u32 { return 1; } +export fn proven_version_patch() u32 { return 0; } + +/// Return the FFI ABI version +export fn proven_ffi_abi_version() u32 { return 1; } + +/// Free a string allocated by the library +export fn proven_free_string(ptr: ?[*]const u8) void { + const p = ptr orelse return; + // Find the null terminator to determine length for the allocator + const len = std.mem.len(p); + std.heap.c_allocator.free(p[0..len + 1]); +} + //============================================================================== // Core Operations //============================================================================== From 736f8d79779b077f7d688e09258e98c1c16fe349 Mon Sep 17 00:00:00 2001 From: "Jonathan D.A. Jewell" <6759885+hyperpolymath@users.noreply.github.com> Date: Thu, 4 Jun 2026 01:48:11 +0100 Subject: [PATCH 2/2] fix(ffi): remove duplicate proven_free_string export --- ffi/zig/src/main.zig | 8 -------- 1 file changed, 8 deletions(-) diff --git a/ffi/zig/src/main.zig b/ffi/zig/src/main.zig index 36176825..3e669243 100644 --- a/ffi/zig/src/main.zig +++ b/ffi/zig/src/main.zig @@ -88,14 +88,6 @@ export fn proven_version_patch() u32 { return 0; } /// Return the FFI ABI version export fn proven_ffi_abi_version() u32 { return 1; } -/// Free a string allocated by the library -export fn proven_free_string(ptr: ?[*]const u8) void { - const p = ptr orelse return; - // Find the null terminator to determine length for the allocator - const len = std.mem.len(p); - std.heap.c_allocator.free(p[0..len + 1]); -} - //============================================================================== // Core Operations //==============================================================================