/trunk/Examples/guile/matrix/main.c
C | 24 lines | 16 code | 7 blank | 1 comment | 3 complexity | b5d4a70ac11e322bcca4ddfef0e0c1b5 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
- #include <tcl.h>
- extern int matrix_init(Tcl_Interp *); /* Init function from matrix.i */
- int main() {
- int code;
- char input[1024];
- Tcl_Interp *interp;
-
- interp = Tcl_CreateInterp();
- /* Initialize the wrappers */
- if (matrix_init(interp) == TCL_ERROR)
- exit(0);
-
- fprintf(stdout,"matrix > ");
- while(fgets(input, 1024, stdin) != NULL) {
- code = Tcl_Eval(interp, input);
- fprintf(stdout,"%s\n",interp->result);
- fprintf(stdout,"matrix > ");
- }
- }