Files
bara-lang/experiments/native-lib/test_client/main.c
T
dimgigov ba0b300917 feat: add fullscreen TUI and project updates
- New TUI screens: Main Menu, Compile, Run, REPL, AI Generator, AI Settings, Help
- AI configuration persisted in ~/.config/cljnim/config.json
- Added illwill dependency for terminal UI
- Updated experiments, examples, docs, and core modules
2026-05-09 01:53:23 +03:00

25 lines
626 B
C

#include <stdio.h>
// Declarations from the shared library
extern int c_square(int x);
extern int c_factorial(int n);
extern int c_add(int a, int b);
extern const char* c_greet(const char* name);
// Nim runtime init
extern void NimMain(void);
int main(void) {
NimMain();
printf("=== Clojure/Nim Native Library Test ===\n\n");
printf("c_square(7) = %d\n", c_square(7));
printf("c_add(10, 20) = %d\n", c_add(10, 20));
printf("c_factorial(5) = %d\n", c_factorial(5));
printf("c_greet(\"World\") = %s\n", c_greet("World"));
printf("\nAll tests passed! Clojure in a .so file.\n");
return 0;
}