From 10d264572460c9e4bac22ae73674e478d46f2308 Mon Sep 17 00:00:00 2001 From: Pjotr Prins Date: Fri, 27 Jun 2025 12:27:16 +0200 Subject: First working Guile binding --- src/gemma_api.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'src/gemma_api.cpp') diff --git a/src/gemma_api.cpp b/src/gemma_api.cpp index 618f283..77c1d56 100644 --- a/src/gemma_api.cpp +++ b/src/gemma_api.cpp @@ -3,10 +3,17 @@ #include #include -#include -#include +// #include +// #include + +// extern SCM my_incrementing_function (SCM a, SCM flag); + +// extern "C" SCM my_ping(SCM i); + +static SCM my_ping(SCM i) { + return i; +} -extern SCM my_incrementing_zig_function (SCM a, SCM flag); SCM my_incrementing_function (SCM a, SCM flag) { @@ -19,3 +26,8 @@ SCM my_incrementing_function (SCM a, SCM flag) return result; } + + +extern "C" void init_module() { + scm_c_define_gsubr("my-ping", 1, 0, 0, (scm_t_subr)my_ping); +} -- cgit v1.2.3