PageRenderTime 40ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

/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
  1. #include <tcl.h>
  2. extern int matrix_init(Tcl_Interp *); /* Init function from matrix.i */
  3. int main() {
  4. int code;
  5. char input[1024];
  6. Tcl_Interp *interp;
  7. interp = Tcl_CreateInterp();
  8. /* Initialize the wrappers */
  9. if (matrix_init(interp) == TCL_ERROR)
  10. exit(0);
  11. fprintf(stdout,"matrix > ");
  12. while(fgets(input, 1024, stdin) != NULL) {
  13. code = Tcl_Eval(interp, input);
  14. fprintf(stdout,"%s\n",interp->result);
  15. fprintf(stdout,"matrix > ");
  16. }
  17. }