python-exercises/test-swig/test_swig.c
2020-01-10 14:27:43 +01:00

20 lines
279 B
C

/* Example from the SWIG tutorial */
#include <time.h>
double My_variable = 3.0;
int fact(int n) {
if (n <= 1) return 1;
else return n*fact(n-1);
}
int my_mod(int x, int y) {
return (x%y);
}
char *get_time() {
time_t ltime;
time(&ltime);
return ctime(&ltime);
}