1- {{~ Aditionally delete this line and fill out the template below ~ }}
21
3- # {{PROJECT}} ABI/FFI Documentation
2+ # VERISIMDB ABI/FFI Documentation
43
54## Overview
65
@@ -26,7 +25,7 @@ This library follows the **Hyperpolymath RSR Standard** for ABI and FFI design:
2625 ▼
2726┌─────────────────────────────────────────────┐
2827│ C Headers (auto-generated) │
29- │ generated/abi/{{project}} .h │
28+ │ generated/abi/verisimdb .h │
3029└─────────────────┬───────────────────────────┘
3130 │
3231 │ imported by
@@ -39,7 +38,7 @@ This library follows the **Hyperpolymath RSR Standard** for ABI and FFI design:
3938│ - Memory-safe by default │
4039└─────────────────┬───────────────────────────┘
4140 │
42- │ compiled to lib{{project}} .so/.a
41+ │ compiled to libverisimdb .so/.a
4342 ▼
4443┌─────────────────────────────────────────────┐
4544│ Any Language via C ABI │
@@ -50,7 +49,7 @@ This library follows the **Hyperpolymath RSR Standard** for ABI and FFI design:
5049## Directory Structure
5150
5251```
53- {{project}} /
52+ verisimdb /
5453├── src/
5554│ ├── abi/ # ABI definitions (Idris2)
5655│ │ ├── Types.idr # Core type definitions with proofs
@@ -67,11 +66,11 @@ This library follows the **Hyperpolymath RSR Standard** for ABI and FFI design:
6766│ ├── test/
6867│ │ └── integration_test.zig
6968│ └── include/
70- │ └── {{project}} .h # C header (optional, can be generated)
69+ │ └── verisimdb .h # C header (optional, can be generated)
7170│
7271├── generated/ # Auto-generated files
7372│ └── abi/
74- │ └── {{project}} .h # Generated from Idris2 ABI
73+ │ └── verisimdb .h # Generated from Idris2 ABI
7574│
7675└── bindings/ # Language-specific wrappers (optional)
7776 ├── rust/
@@ -199,7 +198,7 @@ zig build test # Run tests
199198
200199``` bash
201200cd src/abi
202- idris2 --cg c-header Types.idr -o ../../generated/abi/{{project}} .h
201+ idris2 --cg c-header Types.idr -o ../../generated/abi/verisimdb .h
203202```
204203
205204### Cross-Compile
@@ -222,32 +221,32 @@ zig build -Dtarget=x86_64-windows
222221### From C
223222
224223``` c
225- #include " {{project}} .h"
224+ #include " verisimdb .h"
226225
227226int main () {
228- void* handle = {{project}}_init ();
227+ void* handle = verisimdb_init ();
229228 if (!handle) return 1;
230229
231- int result = {{project}}_process (handle, 42);
230+ int result = verisimdb_process (handle, 42);
232231 if (result != 0) {
233- const char* err = {{project}}_last_error ();
232+ const char* err = verisimdb_last_error ();
234233 fprintf (stderr, "Error: %s\n", err);
235234 }
236235
237- {{project}}_free (handle);
236+ verisimdb_free (handle);
238237 return 0;
239238}
240239```
241240
242241Compile with:
243242``` bash
244- gcc -o example example.c -l{{project}} -L./zig-out/lib
243+ gcc -o example example.c -lverisimdb -L./zig-out/lib
245244```
246245
247246### From Idris2
248247
249248``` idris
250- import {{PROJECT}} .ABI.Foreign
249+ import VERISIMDB .ABI.Foreign
251250
252251main : IO ()
253252main = do
@@ -264,44 +263,44 @@ main = do
264263### From Rust
265264
266265``` rust
267- #[link(name = " {{project}} " )]
266+ #[link(name = " verisimdb " )]
268267extern " C" {
269- fn {{ project }} _init () -> * mut std :: ffi :: c_void ;
270- fn {{ project }} _free (handle : * mut std :: ffi :: c_void );
271- fn {{ project }} _process (handle : * mut std :: ffi :: c_void , input : u32 ) -> i32 ;
268+ fn verisimdb_init () -> * mut std :: ffi :: c_void ;
269+ fn verisimdb_free (handle : * mut std :: ffi :: c_void );
270+ fn verisimdb_process (handle : * mut std :: ffi :: c_void , input : u32 ) -> i32 ;
272271}
273272
274273fn main () {
275274 unsafe {
276- let handle = {{ project }} _init ();
275+ let handle = verisimdb_init ();
277276 assert! (! handle . is_null ());
278277
279- let result = {{ project }} _process (handle , 42 );
278+ let result = verisimdb_process (handle , 42 );
280279 assert_eq! (result , 0 );
281280
282- {{ project }} _free (handle );
281+ verisimdb_free (handle );
283282 }
284283}
285284```
286285
287286### From Julia
288287
289288``` julia
290- const lib{{project}} = " lib{{project}} "
289+ const libverisimdb = " libverisimdb "
291290
292291function init ()
293- handle = ccall ((:{{project}}_init, lib{{project}} ), Ptr{Cvoid}, ())
292+ handle = ccall ((:verisimdb_init , libverisimdb ), Ptr{Cvoid}, ())
294293 handle == C_NULL && error (" Failed to initialize" )
295294 handle
296295end
297296
298297function process (handle, input)
299- result = ccall ((:{{project}}_process, lib{{project}} ), Cint, (Ptr{Cvoid}, UInt32), handle, input)
298+ result = ccall ((:verisimdb_process , libverisimdb ), Cint, (Ptr{Cvoid}, UInt32), handle, input)
300299 result
301300end
302301
303302function cleanup (handle)
304- ccall ((:{{project}}_free, lib{{project}} ), Cvoid, (Ptr{Cvoid},), handle)
303+ ccall ((:verisimdb_free , libverisimdb ), Cvoid, (Ptr{Cvoid},), handle)
305304end
306305
307306# Usage
@@ -355,7 +354,7 @@ When modifying the ABI/FFI:
355354
3563552 . ** Generate C header**
357356 ``` bash
358- idris2 --cg c-header src/abi/Types.idr -o generated/abi/{{project}} .h
357+ idris2 --cg c-header src/abi/Types.idr -o generated/abi/verisimdb .h
359358 ```
360359
3613603 . ** Update FFI implementation** (` ffi/zig/src/main.zig ` )
0 commit comments