aboutsummaryrefslogtreecommitdiff
path: root/tests/i/extern-c-object/lib.c
diff options
context:
space:
mode:
author_ov4 <ov4@ov4.org>2026-10-17 15:56:41 +0000
committer_ov4 <ov4@ov4.org>2026-10-17 15:56:41 +0000
commit567d1c932284bdd53c60937ff6f4ce4a63d104bf (patch)
tree7d303ca345ba9de3398275830b22a25b37f81337 /tests/i/extern-c-object/lib.c
parentd953e2acec913027c49520f2db5aa6d8b55e9fba (diff)
test(extern): call functions from a user C object
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Diffstat (limited to 'tests/i/extern-c-object/lib.c')
-rw-r--r--tests/i/extern-c-object/lib.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/i/extern-c-object/lib.c b/tests/i/extern-c-object/lib.c
new file mode 100644
index 0000000..568133d
--- /dev/null
+++ b/tests/i/extern-c-object/lib.c
@@ -0,0 +1,10 @@
+#include <stdio.h>
+#include <string.h>
+
+static int calls;
+
+int add3(int a, int b, int c) { return a + b + c; }
+double scale(double x, int k) { return x * k; }
+int name_length(const char *s) { return (int)strlen(s); }
+int next_call(void) { return ++calls; }
+void say(const char *s) { puts(s); }