~ubuntu-branches/ubuntu/maverick/swig1.3/maverick

« back to all changes in this revision

Viewing changes to Examples/guile/matrix/main.c

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Landschoff
  • Date: 2002-03-29 01:56:07 UTC
  • Revision ID: james.westby@ubuntu.com-20020329015607-c0wt03xu8oy9ioj7
Tags: upstream-1.3.11
ImportĀ upstreamĀ versionĀ 1.3.11

Show diffs side-by-side

added added

removed removed

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