aboutsummaryrefslogtreecommitdiff
path: root/src/gemma_api.cpp
diff options
context:
space:
mode:
authorPjotr Prins2025-06-27 11:12:56 +0200
committerPjotr Prins2025-06-27 11:12:56 +0200
commitf380f7aaf66d0fc39b9d47b93bd9ba3f69eef26e (patch)
tree5bc549d8e52f9f187c4ff7d6911a2ba4c3336070 /src/gemma_api.cpp
parentd7972ab1179cb051de99d67a5c907f201458cef6 (diff)
downloadpangemma-f380f7aaf66d0fc39b9d47b93bd9ba3f69eef26e.tar.gz
Create gemmalib and get ready with a guile test
Diffstat (limited to 'src/gemma_api.cpp')
-rw-r--r--src/gemma_api.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/gemma_api.cpp b/src/gemma_api.cpp
new file mode 100644
index 0000000..618f283
--- /dev/null
+++ b/src/gemma_api.cpp
@@ -0,0 +1,21 @@
+// Testing bindings, see README.md and
+// https://www.gnu.org/savannah-checkouts/gnu/guile/docs/docs-2.0/guile-ref/Dynamic-Types.html
+
+#include <stdio.h>
+#include <libguile.h>
+#include <libguile/boolean.h>
+#include <libguile/numbers.h>
+
+extern SCM my_incrementing_zig_function (SCM a, SCM flag);
+
+SCM my_incrementing_function (SCM a, SCM flag)
+{
+ SCM result;
+
+ if (scm_is_true (flag))
+ result = scm_sum (a, scm_from_int (1));
+ else
+ result = a;
+
+ return result;
+}