tests/inputs/swig_example.i
raw| 1 | // http://www.swig.org/tutorial.html |
| 2 | /* File : |
| 3 | example.c |
| 4 | */ |
| 5 | |
| 6 | #include <time.h> |
| 7 | double My_variable = 3.0; |
| 8 | |
| 9 | int fact(int n) { |
| 10 | if (n <= 1) return 1; |
| 11 | else return n*fact(n-1); |
| 12 | } |
| 13 | |
| 14 | int my_mod(int x, int y) { |
| 15 | return (x%y); |
| 16 | } |
| 17 | |
| 18 | char *get_time() |
| 19 | { |
| 20 | time_t ltime; |
| 21 | time(<ime); |
| 22 | return ctime(<ime); |
| 23 | } |