1 /* main.c - main() and some logging routines for expect
3 Written by: Don Libes, NIST, 2/6/90
5 Design and implementation of this program was paid for by U.S. tax
6 dollars. Therefore it is public domain. However, the author and NIST
7 would appreciate credit if this program or parts of it are used.
10 #include "expect_cf.h"
16 #include "expect_tcl.h"
24 Tcl_Interp *interp = Tcl_CreateInterp();
26 /* need this for [info nameofexecutable] to work */
27 Tcl_FindExecutable (argv[0]);
29 if (Tcl_Init(interp) == TCL_ERROR) {
30 fprintf(stderr,"Tcl_Init failed: %s\n",interp->result);
33 if (Expect_Init(interp) == TCL_ERROR) {
34 fprintf(stderr,"Expect_Init failed: %s\n",interp->result);
39 if (Itcl_Init(interp) == TCL_ERROR) {
40 fprintf(stderr,"Itcl_Init failed: %s\n",interp->result);
44 exp_parse_argv(interp,argc,argv);
46 /* become interactive if requested or "nothing to do" */
48 (void) exp_interpreter(interp);
50 rc = exp_interpret_cmdfile(interp,exp_cmdfile);
51 else if (exp_cmdfilename)
52 rc = exp_interpret_cmdfilename(interp,exp_cmdfilename);
54 /* assert(exp_cmdlinecmds != 0) */
58 return 0; /* Needed only to prevent compiler warning. */