ba0b300917
- 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
25 lines
626 B
C
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;
|
|
}
|