diff --git a/expect-5.38.0-spawn-43310.patch b/expect-5.38.0-spawn-43310.patch deleted file mode 100644 index af07d61..0000000 --- a/expect-5.38.0-spawn-43310.patch +++ /dev/null @@ -1,209 +0,0 @@ ---- BUILD/expect-5.43/exp_chan.c -+++ BUILD/expect-5.43/exp_chan.c -@@ -640,6 +640,7 @@ - esPtr->buffer = Tcl_NewStringObj("",0); - Tcl_IncrRefCount(esPtr->buffer); - esPtr->umsize = exp_default_match_max; -+ esPtr->umsize_changed = exp_default_match_max_changed; - /* this will reallocate object with an appropriate sized buffer */ - expAdjust(esPtr); - ---- BUILD/expect-5.43/exp_command.h -+++ BUILD/expect-5.43/exp_command.h -@@ -30,6 +30,7 @@ - EXTERN char * exp_get_var _ANSI_ARGS_((Tcl_Interp *,char *)); - - EXTERN int exp_default_match_max; -+EXTERN int exp_default_match_max_changed; - EXTERN int exp_default_parity; - EXTERN int exp_default_rm_nulls; - EXTERN int exp_default_close_on_eof; -@@ -108,6 +109,7 @@ - int msize; /* # of bytes that buffer can hold (max) */ - int umsize; /* # of bytes (min) that is guaranteed to match */ - /* this comes from match_max command */ -+ int umsize_changed; /* is umsize changed by user? */ - int printed; /* # of bytes written to stdout (if logging on) */ - /* but not actually returned via a match yet */ - int echoed; /* additional # of bytes (beyond "printed" above) */ ---- BUILD/expect-5.43/expect.c -+++ BUILD/expect-5.43/expect.c -@@ -41,8 +41,17 @@ - #include "tcldbg.h" - #endif - -+/* The initial length is 2000. We increment it by 2000. The maximum -+ is 8MB (0x800000). */ -+#define EXP_MATCH_MAX 2000 -+#define EXP_MATCH_INC 2000 -+#define EXP_MATCH_STEP_LIMIT 0x700000 -+#define EXP_MATCH_LIMIT 0x800000 -+#define EXP_MATCH_LIMIT_QUOTE "0x800000" -+ - /* initial length of strings that we can guarantee patterns can match */ --int exp_default_match_max = 2000; -+int exp_default_match_max = EXP_MATCH_MAX; -+int exp_default_match_max_changed = 0; - #define INIT_EXPECT_TIMEOUT_LIT "10" /* seconds */ - #define INIT_EXPECT_TIMEOUT 10 /* seconds */ - int exp_default_parity = TRUE; -@@ -1619,6 +1628,76 @@ - return newsize; - } - -+/* returns # of bytes until we see a newline at the end or EOF. */ -+/*ARGSUSED*/ -+static int -+expReadNewLine(interp,esPtr,save_flags) /* INTL */ -+Tcl_Interp *interp; -+ExpState *esPtr; -+int save_flags; -+{ -+ int size; -+ int exp_size; -+ int full_size; -+ int count; -+ char *str; -+ -+ count = 0; -+ for (;;) { -+ exp_size = expSizeGet(esPtr); -+ -+ /* When we reach the limit, we will only read one char at a -+ time. */ -+ if (esPtr->umsize >= EXP_MATCH_STEP_LIMIT) -+ size = TCL_UTF_MAX; -+ else -+ size = exp_size; -+ -+ if (exp_size + TCL_UTF_MAX >= esPtr->msize) { -+ if (esPtr->umsize >= EXP_MATCH_LIMIT) { -+ expDiagLogU("WARNING: interact buffer is full. probably your program\r\n"); -+ expDiagLogU("is not interactive or has a very long output line. The\r\n"); -+ expDiagLogU("current limit is " EXP_MATCH_LIMIT_QUOTE ".\r\n"); -+ expDiagLogU("Dumping first half of buffer in order to continue\r\n"); -+ expDiagLogU("Recommend you enlarge the buffer.\r\n"); -+ exp_buffer_shuffle(interp,esPtr,save_flags,EXPECT_OUT,"expect"); -+ return count; -+ } -+ else { -+ esPtr->umsize += EXP_MATCH_INC; -+ expAdjust(esPtr); -+ } -+ } -+ -+ full_size = esPtr->msize - (size / TCL_UTF_MAX); -+ size = Tcl_ReadChars(esPtr->channel, -+ esPtr->buffer, -+ full_size, -+ 1 /* append */); -+ if (size > 0) { -+ count += size; -+ /* We try again if there are more to read and we haven't -+ seen a newline at the end. */ -+ if (size == full_size) { -+ str = Tcl_GetStringFromObj(esPtr->buffer, &size); -+ if (str[size - 1] != '\n') -+ continue; -+ } -+ } -+ else { -+ /* It is even trickier. We got an error from read. We have -+ to recover from it. Let's make sure the size of -+ buffer is correct. It can be corrupted. */ -+ str = Tcl_GetString(esPtr->buffer); -+ Tcl_SetObjLength(esPtr->buffer, strlen(str)); -+ } -+ -+ break; -+ } -+ -+ return count; -+} -+ - /* returns # of bytes read or (non-positive) error of form EXP_XXX */ - /* returns 0 for end of file */ - /* If timeout is non-zero, set an alarm before doing the read, else assume */ -@@ -1633,6 +1712,8 @@ - { - int cc = EXP_TIMEOUT; - int size = expSizeGet(esPtr); -+ int full_size; -+ int count; - - if (size + TCL_UTF_MAX >= esPtr->msize) - exp_buffer_shuffle(interp,esPtr,save_flags,EXPECT_OUT,"expect"); -@@ -1649,11 +1730,43 @@ - } - #endif - -- -+ /* FIXME: If we ask less than what is available in the tcl buffer -+ when tcl has seen EOF, we will throw away the remaining data -+ since the next read will get EOF. Since expect is line-oriented, -+ we exand our buffer to get EOF or the next newline at the end of -+ the input buffer. I don't know if it is the right fix. H.J. */ -+ count = 0; -+ full_size = esPtr->msize - (size / TCL_UTF_MAX); - cc = Tcl_ReadChars(esPtr->channel, -- esPtr->buffer, -- esPtr->msize - (size / TCL_UTF_MAX), -- 1 /* append */); -+ esPtr->buffer, -+ full_size, -+ 1 /* append */); -+ if (cc > 0) { -+ count += cc; -+ /* It gets very tricky. There are more to read. We will expand -+ our buffer and get EOF or a newline at the end unless the -+ buffer length has been changed. */ -+ if (cc == full_size) { -+ char *str; -+ str = Tcl_GetStringFromObj(esPtr->buffer, &size); -+ if (str[size - 1] != '\n') { -+ if (esPtr->umsize_changed) { -+ char buf[20]; /* big enough for 64bit int in hex. */ -+ snprintf(buf,sizeof(buf),"0x%x", esPtr->umsize); -+ expDiagLogU("WARNING: interact buffer is not large enough to hold\r\n"); -+ expDiagLogU("all output. probably your program is not interactive or\r\n"); -+ expDiagLogU("has a very long output line. The current limit is "); -+ expDiagLogU(buf); -+ expDiagLogU(".\r\n"); -+ } -+ else { -+ cc = expReadNewLine(interp,esPtr,save_flags); -+ if (cc > 0) -+ count += cc; -+ } -+ } -+ } -+ } - i_read_errno = errno; - - #ifdef SIMPLE_EVENT -@@ -1674,7 +1787,7 @@ - } - } - #endif -- return cc; -+ return count > 0 ? count : cc; - } - - /* -@@ -2758,8 +2871,14 @@ - return(TCL_ERROR); - } - -- if (Default) exp_default_match_max = size; -- else esPtr->umsize = size; -+ if (Default) { -+ exp_default_match_max = size; -+ exp_default_match_max_changed = 1; -+ } -+ else { -+ esPtr->umsize = size; -+ esPtr->umsize_changed = 1; -+ } - - return(TCL_OK); - } diff --git a/expect-5.43.0.tar.bz2 b/expect-5.43.0.tar.bz2 deleted file mode 100644 index c59bed3..0000000 --- a/expect-5.43.0.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:76e73a9441700cbfd70560bba9e98cd6c50421346d4e1888a1cb854e51f6dbc8 -size 419691 diff --git a/expect-5.44.1.5.tar.bz2 b/expect-5.44.1.5.tar.bz2 new file mode 100644 index 0000000..4a8442c --- /dev/null +++ b/expect-5.44.1.5.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d89fa6da2342a95d6094f0744cbb5ba085a0d37ad0a7f1383d29555e1e2f2f80 +size 532193 diff --git a/expect-CVS.patch.bz2 b/expect-CVS.patch.bz2 deleted file mode 100644 index 1e76da7..0000000 --- a/expect-CVS.patch.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:58b15504852cb7ff8723daf38ce1d9972b7c6195ac4f002bec92915b9116c548 -size 89099 diff --git a/expect-fixes.patch b/expect-fixes.patch new file mode 100644 index 0000000..b830c8e --- /dev/null +++ b/expect-fixes.patch @@ -0,0 +1,182 @@ +Index: Makefile.in +================================================================================ +--- Dbg.c ++++ Dbg.c +@@ -545,7 +545,7 @@ + ClientData clientData, + Tcl_Interp *interp, + int level, +- char *command, ++ CONST char *command, + Tcl_Command commandInfo, + int objc, + struct Tcl_Obj * CONST * objv)); +@@ -559,7 +559,7 @@ + int level; /* positive number if called by Tcl, -1 if */ + /* called by Dbg_On in which case we don't */ + /* know the level */ +-char *command; ++CONST char *command; + Tcl_Command commandInfo; /* Unused */ + int objc; + struct Tcl_Obj * CONST * objv; +--- Makefile.in ++++ Makefile.in +@@ -23,7 +23,7 @@ + SETUID = @SETUID@ + # SETUID = chmod u+s + +-LIB_RUNTIME_DIR = $(INSTALL_ROOT)@libdir@ ++LIB_RUNTIME_DIR = $(DESTDIR)@libdir@ + + # The following Expect scripts are not necessary to have installed as + # commands, but are very useful. Edit out what you don't want +@@ -238,10 +238,10 @@ + $(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(includedir) ; \ + done; + # install standalone scripts and their man pages, if requested +- @mkdir -p $(INSTALL_ROOT)$(prefix)/bin ++ @mkdir -p $(DESTDIR)$(prefix)/bin + -for i in $(SCRIPT_LIST) ; do \ + if [ -f $$i ] ; then \ +- $(INSTALL_PROGRAM) $$i $(INSTALL_ROOT)$(prefix)/bin/$$i ; \ ++ $(INSTALL_PROGRAM) $$i $(DESTDIR)$(prefix)/bin/$$i ; \ + rm -f $$i ; \ + else true; fi ; \ + done +@@ -256,14 +256,14 @@ + @mkdir -p $(DESTDIR)$(mandir)/man3 + @echo "Installing documentation in $(DESTDIR)$(mandir)" + # install Expectk man page if present +- $(INSTALL_DATA) $(srcdir)/expectk.man $(mandir)/man1/expectk.1 ; \ ++ $(INSTALL_DATA) $(srcdir)/expectk.man $(DESTDIR)$(mandir)/man1/expectk.1 ; \ + # install Expect man page +- $(INSTALL_DATA) $(srcdir)/expect.man $(mandir)/man1/expect.1 ++ $(INSTALL_DATA) $(srcdir)/expect.man $(DESTDIR)$(mandir)/man1/expect.1 + # install man page for Expect and Expectk libraries +- $(INSTALL_DATA) $(srcdir)/libexpect.man $(mandir)/man3/libexpect.3 ++ $(INSTALL_DATA) $(srcdir)/libexpect.man $(DESTDIR)$(mandir)/man3/libexpect.3 + -for i in $(SCRIPT_MANPAGE_LIST) ; do \ + if [ -f $(srcdir)/example/$$i.man ] ; then \ +- $(INSTALL_DATA) $(srcdir)/example/$$i.man $(mandir)/man1/$$i.1 ; \ ++ $(INSTALL_DATA) $(srcdir)/example/$$i.man $(DESTDIR)$(mandir)/man1/$$i.1 ; \ + else true; fi ; \ + done + +--- configure.in ++++ configure.in +@@ -448,7 +448,7 @@ + *-*-irix*) stty_reads_stdout=0 ;; + *-*-sco3.2v[[45]]*) stty_reads_stdout=1 ;; + i[[3456]]86-*-sysv4.2MP) stty_reads_stdout=0 ;; +- i[[3456]]86-*-linux*) stty_reads_stdout=0 ;; ++ *-*-linux*) stty_reads_stdout=0 ;; + # Not sure about old convex but 5.2 definitely reads from stdout + c[[12]]-*-*) stty_reads_stdout=1 ;; + *-*-aix[[34]]*) stty_reads_stdout=0 ;; +@@ -471,8 +471,9 @@ + + # if we still don't know, test + if test x"${stty_reads_stdout}" = x"" ; then +- $STTY_BIN > /dev/null 2> /dev/null +- if test $? -ne 0 ; then ++ $STTY_BIN > /dev/null 2> /dev/null; a=$? ++ $STTY_BIN < /dev/tty > /dev/null 2> /dev/null; b=$? ++ if test $a -ne 0 -a $b -ne 0; then + stty_reads_stdout=1 + else + stty_reads_stdout=0 +--- exp_command.c ++++ exp_command.c +@@ -2940,12 +2940,13 @@ + /* are marked sys_waited already */ + if (!esPtr->sys_waited) { + if (nowait) { ++ Tcl_Pid pid = (Tcl_Pid)esPtr->pid; + /* should probably generate an error */ + /* if SIGCHLD is trapped. */ + + /* pass to Tcl, so it can do wait */ + /* in background */ +- Tcl_DetachPids(1,(Tcl_Pid *)&esPtr->pid); ++ Tcl_DetachPids(1, &pid); + exp_wait_zero(&esPtr->wait); + } else { + while (1) { +@@ -3296,6 +3297,7 @@ + } else { + strcpy (argv[0],Tcl_GetString (objv[0])); + } ++ command = Tcl_GetString (objv[0]); + + signal(SIGINT, SIG_DFL); + signal(SIGQUIT, SIG_DFL); +@@ -3467,7 +3469,8 @@ + if (!leaveopen) { + /* remove from Expect's memory in anticipation of passing to Tcl */ + if (esPtr->pid != EXP_NOPID) { +- Tcl_DetachPids(1,(Tcl_Pid *)&esPtr->pid); ++ Tcl_Pid pid = (Tcl_Pid)esPtr->pid; ++ Tcl_DetachPids(1,&pid); + esPtr->pid = EXP_NOPID; + esPtr->sys_waited = esPtr->user_waited = TRUE; + } +--- exp_inter.c ++++ exp_inter.c +@@ -250,13 +250,13 @@ + return(EXP_MATCH); + } + } else if (!km->re) { +- int slen, kslen; ++ int kslen; + Tcl_UniChar sch, ksch; + + /* fixed string */ + + ks = Tcl_GetString(km->keys); +- for (s = start_search;; s += slen, ks += kslen) { ++ for (s = start_search;; s++, ks += kslen) { + /* if we hit the end of this map, must've matched! */ + if (*ks == 0) { + *skip = start_search-string; +--- expect.c ++++ expect.c +@@ -355,6 +355,7 @@ + ec->pat = 0; + ec->body = 0; + ec->transfer = TRUE; ++ ec->simple_start = 0; + ec->indices = FALSE; + ec->iread = FALSE; + ec->timestamp = FALSE; +--- testsuite/aclocal.m4 ++++ testsuite/aclocal.m4 +@@ -0,0 +1,10 @@ ++# ++# Include the TEA standard macro set ++# ++ ++builtin(include,../tclconfig/tcl.m4) ++builtin(include,../expect.m4) ++ ++# ++# Add here whatever m4 macros you want to define for your package ++# +--- testsuite/configure.in ++++ testsuite/configure.in +@@ -1,8 +1,12 @@ + dnl Process this file with autoconf to produce a configure script. +-AC_INIT(exp_test.c) ++AC_INIT([exp_test],[0.42]) + +-CY_AC_PATH_TCLCONFIG +-CY_AC_LOAD_TCLCONFIG ++TEA_INIT([3.5]) ++ ++AC_CONFIG_AUX_DIR(../tclconfig) ++ ++TEA_PATH_TCLCONFIG ++TEA_LOAD_TCLCONFIG + CC=$TCL_CC + + AC_PROG_CC diff --git a/expect-rpmlintrc b/expect-rpmlintrc new file mode 100644 index 0000000..d23190a --- /dev/null +++ b/expect-rpmlintrc @@ -0,0 +1,3 @@ +addFilter("no-soname") +addFilter("files-duplicate") +addFilter("package-with-huge-docs") diff --git a/expect-warnings.patch b/expect-warnings.patch index fe503e5..da7f043 100644 --- a/expect-warnings.patch +++ b/expect-warnings.patch @@ -1,170 +1,2508 @@ ---- Dbg.c -+++ Dbg.c -@@ -9,6 +9,7 @@ - */ +Index: exp_command.c +=================================================================== +--- exp_command.c.orig ++++ exp_command.c +@@ -29,7 +29,6 @@ would appreciate credit if this program + # include + #endif + #include +-#include "exp_tty.h" - #include -+#include + #include + #include +@@ -66,6 +65,7 @@ would appreciate credit if this program - #include "tcldbgcf.h" - #if 0 ---- exp_chan.c -+++ exp_chan.c -@@ -568,6 +568,8 @@ - return esPtr; - } - } -+ /*NOTREACHED*/ -+ abort(); + #include "tcl.h" + #include "string.h" ++#include "expect.h" + #include "expect_tcl.h" + #include "exp_rename.h" + #include "exp_prog.h" +@@ -73,6 +73,7 @@ would appreciate credit if this program + #include "exp_log.h" + #include "exp_event.h" + #include "exp_pty.h" ++#include "exp_tty_in.h" + #ifdef TCL_DEBUGGER + #include "tcldbg.h" + #endif +@@ -86,8 +87,8 @@ would appreciate credit if this program + + #define SPAWN_ID_VARNAME "spawn_id" + +-int exp_getptymaster(); +-int exp_getptyslave(); ++void exp_ecmd_remove_state_direct_and_indirect(Tcl_Interp *interp, ExpState *esPtr); ++ + + int exp_forked = FALSE; /* whether we are child process */ + +@@ -151,8 +152,7 @@ static Tcl_ThreadDataKey dataKey; + + #ifdef FULLTRAPS + static void +-init_traps(traps) +- RETSIGTYPE (*traps[])(); ++init_traps(RETSIGTYPE (*traps[])()) + { + int i; + +@@ -183,11 +183,11 @@ exp_error TCL_VARARGS_DEF(Tcl_Interp *,a + + /* returns current ExpState or 0. If 0, may be immediately followed by return TCL_ERROR. */ + struct ExpState * +-expStateCurrent(interp,opened,adjust,any) +- Tcl_Interp *interp; +- int opened; +- int adjust; +- int any; ++expStateCurrent( ++ Tcl_Interp *interp, ++ int opened, ++ int adjust, ++ int any) + { + static char *user_spawn_id = "exp0"; + +@@ -198,12 +198,12 @@ expStateCurrent(interp,opened,adjust,any + } + + ExpState * +-expStateCheck(interp,esPtr,open,adjust,msg) +- Tcl_Interp *interp; +- ExpState *esPtr; +- int open; +- int adjust; +- char *msg; ++expStateCheck( ++ Tcl_Interp *interp, ++ ExpState *esPtr, ++ int open, ++ int adjust, ++ char *msg) + { + if (open && !esPtr->open) { + exp_error(interp,"%s: spawn id %s not open",msg,esPtr->name); +@@ -214,12 +214,13 @@ expStateCheck(interp,esPtr,open,adjust,m + } + + ExpState * +-expStateFromChannelName(interp,name,open,adjust,any,msg) +- Tcl_Interp *interp; +- char *name; +- int open; +- int adjust; +- char *msg; ++expStateFromChannelName( ++ Tcl_Interp *interp, ++ char *name, ++ int open, ++ int adjust, ++ int any, ++ char *msg) + { + ExpState *esPtr; + Tcl_Channel channel; +@@ -248,8 +249,7 @@ expStateFromChannelName(interp,name,open + + /* zero out the wait status field */ + static void +-exp_wait_zero(status) +-WAIT_STATUS_TYPE *status; ++exp_wait_zero(WAIT_STATUS_TYPE *status) + { + int i; + +@@ -260,9 +260,9 @@ WAIT_STATUS_TYPE *status; + + /* called just before an ExpState entry is about to be invalidated */ + void +-exp_state_prep_for_invalidation(interp,esPtr) +-Tcl_Interp *interp; +-ExpState *esPtr; ++exp_state_prep_for_invalidation( ++ Tcl_Interp *interp, ++ ExpState *esPtr) + { + exp_ecmd_remove_state_direct_and_indirect(interp,esPtr); + +@@ -275,8 +275,7 @@ ExpState *esPtr; + + /*ARGSUSED*/ + void +-exp_trap_on(master) +-int master; ++exp_trap_on(int master) + { + #ifdef HAVE_PTYTRAP + if (master == -1) return; +@@ -285,8 +284,7 @@ int master; + } + + int +-exp_trap_off(name) +-char *name; ++exp_trap_off(char *name) + { + #ifdef HAVE_PTYTRAP + ExpState *esPtr; +@@ -310,8 +308,7 @@ char *name; + + static + void +-expBusy(esPtr) +- ExpState *esPtr; ++expBusy(ExpState *esPtr) + { + int x = open("/dev/null",0); + if (x != esPtr->fdin) { +@@ -323,9 +320,9 @@ expBusy(esPtr) + } + + int +-exp_close(interp,esPtr) +- Tcl_Interp *interp; +- ExpState *esPtr; ++exp_close( ++ Tcl_Interp *interp, ++ ExpState *esPtr) + { + if (0 == expStateCheck(interp,esPtr,1,0,"close")) return TCL_ERROR; + esPtr->open = FALSE; +@@ -404,8 +401,7 @@ exp_close(interp,esPtr) + /* we need a separate function because spawn_id_any is thread-specific */ + /* and can't be seen outside this file */ + int +-expStateAnyIs(esPtr) +- ExpState *esPtr; ++expStateAnyIs(ExpState *esPtr) + { + ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); + +@@ -413,8 +409,7 @@ expStateAnyIs(esPtr) + } + + int +-expDevttyIs(esPtr) +- ExpState *esPtr; ++expDevttyIs(ExpState *esPtr) + { + ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); + +@@ -422,8 +417,7 @@ expDevttyIs(esPtr) + } + + int +-expStdinoutIs(esPtr) +- ExpState *esPtr; ++expStdinoutIs(ExpState *esPtr) + { + ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); + +@@ -447,8 +441,7 @@ expDevttyGet() } void ---- exp_clib.c -+++ exp_clib.c -@@ -8,6 +8,7 @@ - */ +-exp_init_spawn_id_vars(interp) +- Tcl_Interp *interp; ++exp_init_spawn_id_vars(Tcl_Interp *interp) + { + ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); - #include "expect_cf.h" -+#include - #include - #include - #ifdef HAVE_INTTYPES_H ---- exp_command.c -+++ exp_command.c -@@ -2317,6 +2317,7 @@ +@@ -467,8 +460,7 @@ exp_init_spawn_id_vars(interp) + } - Tcl_Exit(value); - /*NOTREACHED*/ -+ abort(); + void +-exp_init_spawn_ids(interp) +- Tcl_Interp *interp; ++exp_init_spawn_ids(Tcl_Interp *interp) + { + static ExpState any_placeholder; /* can be shared process-wide */ + +@@ -504,8 +496,7 @@ exp_init_spawn_ids(interp) + } + + void +-expCloseOnExec(fd) +- int fd; ++expCloseOnExec(int fd) + { + (void) fcntl(fd,F_SETFD,1); + } +@@ -516,9 +507,9 @@ expCloseOnExec(fd) + /* + * DEBUGGING UTILITIES - DON'T DELETE */ + static void +-show_pgrp(fd,string) +- int fd; +- char *string; ++show_pgrp( ++ int fd, ++ char *string) + { + int pgrp; + +@@ -532,8 +523,7 @@ show_pgrp(fd,string) + } + + static void +-set_pgrp(fd) +- int fd; ++set_pgrp(int fd) + { + int pgrp = getpgrp(0); + if (-1 == ioctl(fd,TIOCSETPGRP,&pgrp)) perror("TIOCSETPGRP"); +@@ -562,9 +552,9 @@ expSetpgrp() + + /*ARGSUSED*/ + static void +-set_slave_name(esPtr,name) +- ExpState *esPtr; +- char *name; ++set_slave_name( ++ ExpState *esPtr, ++ char *name) + { + #ifdef HAVE_PTYTRAP + int newptr; +@@ -582,11 +572,11 @@ set_slave_name(esPtr,name) + /* arguments are passed verbatim to execvp() */ + /*ARGSUSED*/ + static int +-Exp_SpawnObjCmd(clientData,interp,objc,objv) +- ClientData clientData; +- Tcl_Interp *interp; +- int objc; +- Tcl_Obj *CONST objv[]; /* Argument objects. */ ++Exp_SpawnObjCmd( ++ ClientData clientData, ++ Tcl_Interp *interp, ++ int objc, ++ Tcl_Obj *CONST objv[]) /* Argument objects. */ + { + ExpState *esPtr = 0; + int slave; +@@ -910,16 +900,16 @@ Exp_SpawnObjCmd(clientData,interp,objc,o + return TCL_ERROR; + } + if (mode & TCL_READABLE) { +- if (TCL_ERROR == Tcl_GetChannelHandle(channel, TCL_READABLE, (ClientData *) &rfdc)) { ++ if (TCL_ERROR == Tcl_GetChannelHandle(channel, TCL_READABLE, &rfdc)) { + return TCL_ERROR; + } +- rfd = (int) rfdc; ++ rfd = (int)(long) rfdc; + } + if (mode & TCL_WRITABLE) { +- if (TCL_ERROR == Tcl_GetChannelHandle(channel, TCL_WRITABLE, (ClientData *) &wfdc)) { ++ if (TCL_ERROR == Tcl_GetChannelHandle(channel, TCL_WRITABLE, &wfdc)) { + return TCL_ERROR; + } +- wfd = (int) wfdc; ++ wfd = (int)(long) wfdc; + } + master = ((mode & TCL_READABLE)?rfd:wfd); + +@@ -1346,7 +1336,7 @@ Exp_SpawnObjCmd(clientData,interp,objc,o + } + argv[k] = NULL; + +- (void) execvp(command,argv); ++ execvp(command,argv); + + for (k=0,i=cmdIndex;inext = exp_state_list_pool; + exp_state_list_pool = fd; + } + + void +-exp_free_i(interp,i,updateproc) +- Tcl_Interp *interp; +- struct exp_i *i; +- Tcl_VarTraceProc *updateproc; /* proc to invoke if indirect is written */ ++exp_free_i( ++ Tcl_Interp *interp, ++ struct exp_i *i, ++ Tcl_VarTraceProc *updateproc)/* proc to invoke if indirect is written */ + { + if (i->next) exp_free_i(interp,i->next,updateproc); + +@@ -1781,12 +1768,12 @@ exp_free_i(interp,i,updateproc) + /* can only fail on bad direct descriptors */ + /* indirect descriptors always succeed */ + struct exp_i * +-exp_new_i_complex(interp,arg,duration,updateproc) +- Tcl_Interp *interp; +- char *arg; /* spawn id list or a variable containing a list */ +- int duration; /* if we have to copy the args */ ++exp_new_i_complex( ++ Tcl_Interp *interp, ++ char *arg, /* spawn id list or a variable containing a list */ ++ int duration, /* if we have to copy the args */ + /* should only need do this in expect_before/after */ +- Tcl_VarTraceProc *updateproc; /* proc to invoke if indirect is written */ ++ Tcl_VarTraceProc *updateproc) /* proc to invoke if indirect is written */ + { + struct exp_i *i; + char **stringp; +@@ -1829,9 +1816,9 @@ exp_new_i_complex(interp,arg,duration,up + } + + void +-exp_i_add_state(i,esPtr) +- struct exp_i *i; +- ExpState *esPtr; ++exp_i_add_state( ++ struct exp_i *i, ++ ExpState *esPtr) + { + struct exp_state_list *new_state; + +@@ -1844,9 +1831,9 @@ exp_i_add_state(i,esPtr) + /* returns TCL_ERROR only on direct */ + /* indirects always succeed */ + static int +-exp_i_parse_states(interp,i) /* INTL */ +- Tcl_Interp *interp; +- struct exp_i *i; ++exp_i_parse_states( ++ Tcl_Interp *interp, ++ struct exp_i *i) + { + struct ExpState *esPtr; + char *p = i->value; +@@ -1873,9 +1860,9 @@ exp_i_parse_states(interp,i) /* INTL */ + /* return TCL_ERROR only on direct variables */ + /* indirect variables always succeed */ + int +-exp_i_update(interp,i) +- Tcl_Interp *interp; +- struct exp_i *i; ++exp_i_update( ++ Tcl_Interp *interp, ++ struct exp_i *i) + { + char *p; /* string representation of list of spawn ids */ + +@@ -1907,9 +1894,9 @@ exp_i_update(interp,i) + } + + struct exp_i * +-exp_new_i_simple(esPtr,duration) +- ExpState *esPtr; +- int duration; /* if we have to copy the args */ ++exp_new_i_simple( ++ ExpState *esPtr, ++ int duration) /* if we have to copy the args */ + /* should only need do this in expect_before/after */ + { + struct exp_i *i; +@@ -1926,11 +1913,11 @@ exp_new_i_simple(esPtr,duration) + + /*ARGSUSED*/ + static int +-Exp_SendLogObjCmd(clientData, interp, objc, objv) +- ClientData clientData; +- Tcl_Interp *interp; +- int objc; +- Tcl_Obj *CONST objv[]; /* Argument objects. */ ++Exp_SendLogObjCmd( ++ ClientData clientData, ++ Tcl_Interp *interp, ++ int objc, ++ Tcl_Obj *CONST objv[]) /* Argument objects. */ + { + static char* options[] = { "--", NULL }; + enum options { LOG_QUOTE }; +@@ -1970,11 +1957,11 @@ Exp_SendLogObjCmd(clientData, interp, ob + /* you should quote all your send args to make them one single argument. */ + /*ARGSUSED*/ + static int +-Exp_SendObjCmd(clientData, interp, objc, objv) /* INTL */ +- ClientData clientData; +- Tcl_Interp *interp; +- int objc; +- Tcl_Obj *CONST objv[]; ++Exp_SendObjCmd( ++ ClientData clientData, ++ Tcl_Interp *interp, ++ int objc, ++ Tcl_Obj *CONST objv[]) + { + ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); + ExpState *esPtr = 0; +@@ -2168,11 +2155,11 @@ Exp_SendObjCmd(clientData, interp, objc, + + /*ARGSUSED*/ + static int +-Exp_LogFileObjCmd(clientData, interp, objc, objv) +- ClientData clientData; +- Tcl_Interp *interp; +- int objc; +- Tcl_Obj *CONST objv[]; /* Argument objects. */ ++Exp_LogFileObjCmd( ++ ClientData clientData, ++ Tcl_Interp *interp, ++ int objc, ++ Tcl_Obj *CONST objv[]) /* Argument objects. */ + { + static char resultbuf[1000]; + char *chanName = 0; +@@ -2301,11 +2288,11 @@ Exp_LogFileObjCmd(clientData, interp, ob + + /*ARGSUSED*/ + static int +-Exp_LogUserObjCmd(clientData, interp, objc, objv) +- ClientData clientData; +- Tcl_Interp *interp; +- int objc; +- Tcl_Obj *CONST objv[]; /* Argument objects. */ ++Exp_LogUserObjCmd( ++ ClientData clientData, ++ Tcl_Interp *interp, ++ int objc, ++ Tcl_Obj *CONST objv[]) /* Argument objects. */ + { + int old_loguser = expLogUserGet(); + +@@ -2333,11 +2320,11 @@ Exp_LogUserObjCmd(clientData, interp, ob + #ifdef TCL_DEBUGGER + /*ARGSUSED*/ + static int +-Exp_DebugObjCmd(clientData, interp, objc, objv) +- ClientData clientData; +- Tcl_Interp *interp; +- int objc; +- Tcl_Obj *CONST objv[]; /* Argument objects. */ ++Exp_DebugObjCmd( ++ ClientData clientData, ++ Tcl_Interp *interp, ++ int objc, ++ Tcl_Obj *CONST objv[]) /* Argument objects. */ + { + int now = FALSE; /* soon if FALSE, now if TRUE */ + int exp_tcl_debugger_was_available = exp_tcl_debugger_available; +@@ -2403,11 +2390,11 @@ Exp_DebugObjCmd(clientData, interp, objc + + /*ARGSUSED*/ + static int +-Exp_ExpInternalObjCmd(clientData, interp, objc, objv) +- ClientData clientData; +- Tcl_Interp *interp; +- int objc; +- Tcl_Obj *CONST objv[]; /* Argument objects. */ ++Exp_ExpInternalObjCmd( ++ ClientData clientData, ++ Tcl_Interp *interp, ++ int objc, ++ Tcl_Obj *CONST objv[]) /* Argument objects. */ + { + int newChannel = FALSE; + Tcl_Channel oldChannel; +@@ -2483,11 +2470,11 @@ char *exp_onexit_action = 0; + + /*ARGSUSED*/ + static int +-Exp_ExitObjCmd(clientData, interp, objc, objv) +- ClientData clientData; +- Tcl_Interp *interp; +- int objc; +- Tcl_Obj *CONST objv[]; /* Argument objects. */ ++Exp_ExitObjCmd( ++ ClientData clientData, ++ Tcl_Interp *interp, ++ int objc, ++ Tcl_Obj *CONST objv[]) /* Argument objects. */ + { + int value = 0; + +@@ -2534,20 +2521,21 @@ Exp_ExitObjCmd(clientData, interp, objc, + Tcl_Eval(interp, "rename _close.pre_expect close"); + Tcl_Exit(value); + /*NOTREACHED*/ ++ return TCL_ERROR; } /*ARGSUSED*/ ---- exp_glob.c -+++ exp_glob.c -@@ -11,6 +11,7 @@ + static int +-Exp_ConfigureObjCmd(clientData, interp, objc, objv) +- ClientData clientData; +- Tcl_Interp *interp; +- int objc; +- Tcl_Obj *CONST objv[]; /* Argument objects. */ ++Exp_ConfigureObjCmd( ++ ClientData clientData, ++ Tcl_Interp *interp, ++ int objc, ++ Tcl_Obj *CONST objv[]) /* Argument objects. */ + { + /* Magic configuration stuff. */ + int i, opt, val; + +- static CONST char* options [] = { ++ static CONST84 char* options [] = { + "-strictwrite", NULL + }; + enum options { +@@ -2579,11 +2567,11 @@ Exp_ConfigureObjCmd(clientData, interp, + + /*ARGSUSED*/ + static int +-Exp_CloseObjCmd(clientData, interp, objc, objv) +- ClientData clientData; +- Tcl_Interp *interp; +- int objc; +- Tcl_Obj *CONST objv[]; /* Argument objects. */ ++Exp_CloseObjCmd( ++ ClientData clientData, ++ Tcl_Interp *interp, ++ int objc, ++ Tcl_Obj *CONST objv[]) /* Argument objects. */ + { + int onexec_flag = FALSE; /* true if -onexec seen */ + int close_onexec; +@@ -2690,14 +2678,14 @@ Exp_CloseObjCmd(clientData, interp, objc + + /*ARGSUSED*/ + static int +-tcl_tracer(clientData,interp,level,command,cmdInfo,objc,objv) +- ClientData clientData; +- Tcl_Interp *interp; +- int level; +- CONST char *command; +- Tcl_Command cmdInfo; +- int objc; +- Tcl_Obj *CONST objv[]; /* Argument objects. */ ++tcl_tracer( ++ ClientData clientData, ++ Tcl_Interp *interp, ++ int level, ++ CONST char *command, ++ Tcl_Command cmdInfo, ++ int objc, ++ Tcl_Obj *CONST objv[]) /* Argument objects. */ + { + int i; + +@@ -2710,19 +2698,18 @@ tcl_tracer(clientData,interp,level,comma + } + + static void +-tcl_tracer_del(clientData) +- ClientData clientData; ++tcl_tracer_del(ClientData clientData) + { + /* Nothing */ + } + + /*ARGSUSED*/ + static int +-Exp_StraceObjCmd(clientData, interp, objc, objv) +- ClientData clientData; +- Tcl_Interp *interp; +- int objc; +- Tcl_Obj *CONST objv[]; /* Argument objects. */ ++Exp_StraceObjCmd( ++ ClientData clientData, ++ Tcl_Interp *interp, ++ int objc, ++ Tcl_Obj *CONST objv[]) /* Argument objects. */ + { + static int trace_level = 0; + static Tcl_Trace trace_handle; +@@ -2829,9 +2816,9 @@ fork_clear_all() + } + + void +-fork_init(f,pid) +- struct forked_proc *f; +- int pid; ++fork_init( ++ struct forked_proc *f, ++ int pid) + { + f->pid = pid; + f->link_status = wait_not_done; +@@ -2839,8 +2826,7 @@ fork_init(f,pid) + + /* make an entry for a new proc */ + void +-fork_add(pid) +- int pid; ++fork_add(int pid) + { + struct forked_proc *f; + +@@ -2873,11 +2859,11 @@ fork_add(pid) + */ + /*ARGSUSED*/ + static int +-Exp_WaitObjCmd(clientData, interp, objc, objv) +- ClientData clientData; +- Tcl_Interp *interp; +- int objc; +- Tcl_Obj *CONST objv[]; /* Argument objects. */ ++Exp_WaitObjCmd( ++ ClientData clientData, ++ Tcl_Interp *interp, ++ int objc, ++ Tcl_Obj *CONST objv[]) /* Argument objects. */ + { + char *chanName = 0; + struct ExpState *esPtr; +@@ -2940,7 +2926,7 @@ Exp_WaitObjCmd(clientData, interp, objc, + /* are marked sys_waited already */ + if (!esPtr->sys_waited) { + if (nowait) { +- Tcl_Pid pid = (Tcl_Pid)esPtr->pid; ++ Tcl_Pid pid = (Tcl_Pid)(long)esPtr->pid; + /* should probably generate an error */ + /* if SIGCHLD is trapped. */ + +@@ -3086,11 +3072,11 @@ Exp_WaitObjCmd(clientData, interp, objc, + + /*ARGSUSED*/ + static int +-Exp_ForkObjCmd(clientData, interp, objc, objv) +- ClientData clientData; +- Tcl_Interp *interp; +- int objc; +- Tcl_Obj *CONST objv[]; /* Argument objects. */ ++Exp_ForkObjCmd( ++ ClientData clientData, ++ Tcl_Interp *interp, ++ int objc, ++ Tcl_Obj *CONST objv[]) /* Argument objects. */ + { + int rc; + if (objc > 1) { +@@ -3120,11 +3106,11 @@ Exp_ForkObjCmd(clientData, interp, objc, + + /*ARGSUSED*/ + static int +-Exp_DisconnectObjCmd(clientData, interp, objc, objv) +- ClientData clientData; +- Tcl_Interp *interp; +- int objc; +- Tcl_Obj *CONST objv[]; /* Argument objects. */ ++Exp_DisconnectObjCmd( ++ ClientData clientData, ++ Tcl_Interp *interp, ++ int objc, ++ Tcl_Obj *CONST objv[]) /* Argument objects. */ + { + ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); + +@@ -3230,11 +3216,11 @@ Exp_DisconnectObjCmd(clientData, interp, + + /*ARGSUSED*/ + static int +-Exp_OverlayObjCmd(clientData, interp, objc, objv) +- ClientData clientData; +- Tcl_Interp *interp; +- int objc; +- Tcl_Obj *CONST objv[]; /* Argument objects. */ ++Exp_OverlayObjCmd( ++ ClientData clientData, ++ Tcl_Interp *interp, ++ int objc, ++ Tcl_Obj *CONST objv[]) /* Argument objects. */ + { + int newfd, oldfd; + int dash_name = 0; +@@ -3317,11 +3303,11 @@ Exp_OverlayObjCmd(clientData, interp, ob + + /*ARGSUSED*/ + int +-Exp_InterpreterObjCmd(clientData, interp, objc, objv) +- ClientData clientData; +- Tcl_Interp *interp; +- int objc; +- Tcl_Obj *CONST objv[]; /* Argument objects. */ ++Exp_InterpreterObjCmd( ++ ClientData clientData, ++ Tcl_Interp *interp, ++ int objc, ++ Tcl_Obj *CONST objv[]) /* Argument objects. */ + { + Tcl_Obj *eofObj = 0; + int i; +@@ -3365,11 +3351,11 @@ Exp_InterpreterObjCmd(clientData, interp + /* this command supercede's Tcl's builtin CONTINUE command */ + /*ARGSUSED*/ + int +-Exp_ExpContinueObjCmd(clientData, interp, objc, objv) +- ClientData clientData; +- Tcl_Interp *interp; +- int objc; +- Tcl_Obj *CONST objv[]; /* Argument objects. */ ++Exp_ExpContinueObjCmd( ++ ClientData clientData, ++ Tcl_Interp *interp, ++ int objc, ++ Tcl_Obj *CONST objv[]) /* Argument objects. */ + { + if (objc == 1) { + return EXP_CONTINUE; +@@ -3385,11 +3371,11 @@ Exp_ExpContinueObjCmd(clientData, interp + /* most of this is directly from Tcl's definition for return */ + /*ARGSUSED*/ + int +-Exp_InterReturnObjCmd(clientData, interp, objc, objv) +- ClientData clientData; +- Tcl_Interp *interp; +- int objc; +- Tcl_Obj *CONST objv[]; ++Exp_InterReturnObjCmd( ++ ClientData clientData, ++ Tcl_Interp *interp, ++ int objc, ++ Tcl_Obj *CONST objv[]) + { + /* let Tcl's return command worry about args */ + /* if successful (i.e., TCL_RETURN is returned) */ +@@ -3406,11 +3392,11 @@ Exp_InterReturnObjCmd(clientData, interp + + /*ARGSUSED*/ + int +-Exp_OpenObjCmd(clientData, interp, objc, objv) +- ClientData clientData; +- Tcl_Interp *interp; +- int objc; +- Tcl_Obj *CONST objv[]; /* Argument objects. */ ++Exp_OpenObjCmd( ++ ClientData clientData, ++ Tcl_Interp *interp, ++ int objc, ++ Tcl_Obj *CONST objv[]) /* Argument objects. */ + { + ExpState *esPtr; + char *chanName = 0; +@@ -3469,7 +3455,7 @@ Exp_OpenObjCmd(clientData, interp, objc, + if (!leaveopen) { + /* remove from Expect's memory in anticipation of passing to Tcl */ + if (esPtr->pid != EXP_NOPID) { +- Tcl_Pid pid = (Tcl_Pid)esPtr->pid; ++ Tcl_Pid pid = (Tcl_Pid)(long)esPtr->pid; + Tcl_DetachPids(1,&pid); + esPtr->pid = EXP_NOPID; + esPtr->sys_waited = esPtr->user_waited = TRUE; +@@ -3486,7 +3472,7 @@ Exp_OpenObjCmd(clientData, interp, objc, + * Oh, and we're also being rather cavalier with the permissions here, + * but they're likely to be right for the same reasons. + */ +- channel = Tcl_MakeFileChannel((ClientData)newfd,TCL_READABLE|TCL_WRITABLE); ++ channel = Tcl_MakeFileChannel((ClientData)(long)newfd,TCL_READABLE|TCL_WRITABLE); + Tcl_RegisterChannel(interp, channel); + Tcl_AppendResult(interp, Tcl_GetChannelName(channel), (char *) NULL); + return TCL_OK; +@@ -3499,10 +3485,10 @@ Exp_OpenObjCmd(clientData, interp, objc, + /* return 1 if a string is substring of a flag */ + /* this version is the code used by the macro that everyone calls */ + int +-exp_flageq_code(flag,string,minlen) +- char *flag; +- char *string; +- int minlen; /* at least this many chars must match */ ++exp_flageq_code( ++ char *flag, ++ char *string, ++ int minlen) /* at least this many chars must match */ + { + for (;*flag;flag++,string++,minlen--) { + if (*string == '\0') break; +@@ -3579,8 +3565,7 @@ static struct exp_cmd_data cmd_data[] = + {0}}; + + void +-exp_init_most_cmds(interp) +- Tcl_Interp *interp; ++exp_init_most_cmds(Tcl_Interp *interp) + { + exp_create_commands(interp,cmd_data); + +Index: exp_pty.h +=================================================================== +--- exp_pty.h.orig ++++ exp_pty.h +@@ -8,10 +8,12 @@ would appreciate credit if this program */ -+#include - #include "expect_cf.h" - #include "tcl.h" - #include "exp_int.h" ---- exp_main_exp.c -+++ exp_main_exp.c -@@ -12,6 +12,7 @@ +-int exp_pty_test_start(); +-void exp_pty_test_end(); +-int exp_pty_test(); +-void exp_pty_unlock(); +-int exp_pty_lock(); ++int exp_pty_test_start(void); ++void exp_pty_test_end(void); ++int exp_pty_test(char *master_name, char *slave_name, char bank, char *num); ++void exp_pty_unlock(void); ++int exp_pty_lock(char bank, char *num); ++int exp_getptymaster(void); ++int exp_getptyslave(int ttycopy, int ttyinit, CONST char *stty_args); - #include "expect_cf.h" - #include -+#include - #include "tcl.h" - #include "expect_tcl.h" + extern char *exp_pty_slave_name; +Index: exp_tty.c +=================================================================== +--- exp_tty.c.orig ++++ exp_tty.c +@@ -50,21 +50,20 @@ int exp_stdout_is_tty; + #define tty_cooked exp_tty_cooked ---- exp_main_sub.c -+++ exp_main_sub.c -@@ -468,6 +468,7 @@ - Tcl_Eval(interp, buffer); - } - /*NOTREACHED*/ -+ abort(); + int +-exp_israw() ++exp_israw(void) + { + return is_raw; } - static char init_auto_path[] = "\ ---- exp_win.c -+++ exp_win.c -@@ -78,7 +78,7 @@ - static exp_winsize winsize = {0, 0}; - static exp_winsize win2size = {0, 0}; - --int exp_window_size_set(fd) -+void exp_window_size_set(fd) - int fd; + int +-exp_isecho() ++exp_isecho(void) { - #ifdef TIOCSWINSZ -@@ -89,7 +89,7 @@ - #endif + return !is_noecho; } --int exp_window_size_get(fd) -+void exp_window_size_get(fd) - int fd; + /* if set == 1, set it to raw, else unset it */ + void +-exp_tty_raw(set) +-int set; ++exp_tty_raw(int set) { - #ifdef TIOCGWINSZ -@@ -140,7 +140,7 @@ - * separate copy of everything above - used for handling user stty requests + if (set == 1) { + is_raw = TRUE; +@@ -95,8 +94,7 @@ int set; + } + + void +-exp_tty_echo(set) +-int set; ++exp_tty_echo(int set) + { + if (set == 1) { + is_noecho = FALSE; +@@ -114,8 +112,7 @@ int set; + } + + int +-exp_tty_set_simple(tty) +-exp_tty *tty; ++exp_tty_set_simple(exp_tty *tty) + { + #ifdef HAVE_TCSETATTR + return(tcsetattr(exp_dev_tty, TCSADRAIN,tty)); +@@ -125,8 +122,7 @@ exp_tty *tty; + } + + int +-exp_tty_get_simple(tty) +-exp_tty *tty; ++exp_tty_get_simple(exp_tty *tty) + { + #ifdef HAVE_TCSETATTR + return(tcgetattr(exp_dev_tty, tty)); +@@ -138,10 +134,11 @@ exp_tty *tty; + /* returns 0 if nothing changed */ + /* if something changed, the out parameters are changed as well */ + int +-exp_tty_raw_noecho(interp,tty_old,was_raw,was_echo) +-Tcl_Interp *interp; +-exp_tty *tty_old; +-int *was_raw, *was_echo; ++exp_tty_raw_noecho( ++ Tcl_Interp *interp, ++ exp_tty *tty_old, ++ int *was_raw, ++ int *was_echo) + { + if (exp_disconnected) return(0); + if (is_raw && is_noecho) return(0); +@@ -173,10 +170,11 @@ int *was_raw, *was_echo; + /* returns 0 if nothing changed */ + /* if something changed, the out parameters are changed as well */ + int +-exp_tty_cooked_echo(interp,tty_old,was_raw,was_echo) +-Tcl_Interp *interp; +-exp_tty *tty_old; +-int *was_raw, *was_echo; ++exp_tty_cooked_echo( ++ Tcl_Interp *interp, ++ exp_tty *tty_old, ++ int *was_raw, ++ int *was_echo) + { + if (exp_disconnected) return(0); + if (!is_raw && !is_noecho) return(0); +@@ -206,11 +204,11 @@ int *was_raw, *was_echo; + } + + void +-exp_tty_set(interp,tty,raw,echo) +-Tcl_Interp *interp; +-exp_tty *tty; +-int raw; +-int echo; ++exp_tty_set( ++ Tcl_Interp *interp, ++ exp_tty *tty, ++ int raw, ++ int echo) + { + if (exp_tty_set_simple(tty) == -1) { + expErrorLog("ioctl(set): %s\r\n",Tcl_PosixError(interp)); +@@ -258,9 +256,9 @@ exp_init_stdio() + + /*ARGSUSED*/ + void +-exp_tty_break(interp,fd) +-Tcl_Interp *interp; +-int fd; ++exp_tty_break( ++ Tcl_Interp *interp, ++ int fd) + { + #ifdef POSIX + tcsendbreak(fd,0); +@@ -280,9 +278,9 @@ int fd; + /* If len == 0, use strlen to compute it */ + /* NB: if terminal is not in raw mode, nothing is done. */ + char * +-exp_cook(s,len) +-char *s; +-int *len; /* current and new length of s */ ++exp_cook( ++ char *s, ++ int *len) /* current and new length of s */ + { + static int destlen = 0; + static char *dest = 0; +@@ -315,11 +313,11 @@ int *len; /* current and new length of s + } + + static int /* returns TCL_whatever */ +-exec_stty(interp,argc,argv,devtty) +-Tcl_Interp *interp; +-int argc; +-char **argv; +-int devtty; /* if true, redirect to /dev/tty */ ++exec_stty( ++ Tcl_Interp *interp, ++ int argc, ++ char **argv, ++ int devtty) /* if true, redirect to /dev/tty */ + { + int i; + int rc; +@@ -368,11 +366,11 @@ int devtty; /* if true, redirect to /de + + /*ARGSUSED*/ + static int +-Exp_SttyCmd(clientData, interp, argc, argv) +-ClientData clientData; +-Tcl_Interp *interp; +-int argc; +-char **argv; ++Exp_SttyCmd( ++ ClientData clientData, ++ Tcl_Interp *interp, ++ int argc, ++ char **argv) + { + /* redirection symbol is not counted as a stty arg in terms */ + /* of recognition. */ +@@ -567,11 +565,11 @@ char **argv; + + /*ARGSUSED*/ + static int +-Exp_SystemCmd(clientData, interp, argc, argv) +-ClientData clientData; +-Tcl_Interp *interp; +-int argc; +-char **argv; ++Exp_SystemCmd( ++ ClientData clientData, ++ Tcl_Interp *interp, ++ int argc, ++ char **argv) + { + int result = TCL_OK; + RETSIGTYPE (*old)(); /* save old sigalarm handler */ +@@ -799,8 +797,7 @@ cmd_data[] = { + {0}}; + + void +-exp_init_tty_cmds(interp) +-struct Tcl_Interp *interp; ++exp_init_tty_cmds(struct Tcl_Interp *interp) + { + exp_create_commands(interp,cmd_data); + } +Index: exp_tty.h +=================================================================== +--- exp_tty.h.orig ++++ exp_tty.h +@@ -15,15 +15,15 @@ extern int exp_ioctled_devtty; + extern int exp_stdin_is_tty; + extern int exp_stdout_is_tty; + +-void exp_tty_raw(); +-void exp_tty_echo(); +-void exp_tty_break(); +-int exp_tty_raw_noecho(); +-int exp_israw(); +-int exp_isecho(); ++void exp_tty_raw(int set); ++void exp_tty_echo(int set); ++void exp_tty_break(Tcl_Interp *interp, int fd); ++int exp_tty_raw_noecho(Tcl_Interp *interp, exp_tty *tty_old, int *was_raw, int *was_echo); ++int exp_israw(void); ++int exp_isecho(void); + +-void exp_tty_set(); +-int exp_tty_set_simple(); +-int exp_tty_get_simple(); ++void exp_tty_set(Tcl_Interp *interp, exp_tty *tty, int raw, int echo); ++int exp_tty_set_simple(exp_tty *tty); ++int exp_tty_get_simple(exp_tty *tty); + + #endif /* __EXP_TTY_H__ */ +Index: exp_command.h +=================================================================== +--- exp_command.h.orig ++++ exp_command.h +@@ -220,7 +220,7 @@ EXTERN void exp_ecmd_remove_fd_direct_a + EXTERN void exp_trap_on _ANSI_ARGS_((int)); + EXTERN int exp_trap_off _ANSI_ARGS_((char *)); + +-EXTERN void exp_strftime(); ++EXTERN void exp_strftime(char *format, const struct tm *timeptr,Tcl_DString *dstring); + + #define exp_deleteProc (void (*)())0 + #define exp_deleteObjProc (void (*)())0 +Index: exp_inter.c +=================================================================== +--- exp_inter.c.orig ++++ exp_inter.c +@@ -125,9 +125,9 @@ struct input { */ --int exp_win2_size_set(fd) -+void exp_win2_size_set(fd) - int fd; + struct input * +-expStateToInput(hash,esPtr) +- ExpState *esPtr; +- Tcl_HashTable *hash; ++expStateToInput( ++ Tcl_HashTable *hash, ++ ExpState *esPtr) { - #ifdef TIOCSWINSZ -@@ -151,7 +151,7 @@ - #endif + Tcl_HashEntry *entry = Tcl_FindHashEntry(hash,(char *)esPtr); + +@@ -139,10 +139,10 @@ expStateToInput(hash,esPtr) } --int exp_win2_size_get(fd) -+void exp_win2_size_get(fd) - int fd; + void +-expCreateStateToInput(hash,esPtr,inp) +- ExpState *esPtr; +- Tcl_HashTable *hash; +- struct input *inp; ++expCreateStateToInput( ++ Tcl_HashTable *hash, ++ ExpState *esPtr, ++ struct input *inp) { - #ifdef TIOCGWINSZ ---- exp_win.h -+++ exp_win.h -@@ -6,8 +6,8 @@ - would appreciate credit if you use this file or parts of it. + Tcl_HashEntry *entry; + int newPtr; +@@ -151,12 +151,15 @@ expCreateStateToInput(hash,esPtr,inp) + Tcl_SetHashValue(entry,(ClientData)inp); + } + +-static void free_input(); +-static void free_keymap(); +-static void free_output(); +-static void free_action(); +-static struct action *new_action(); +-static int inter_eval(); ++static void free_input(Tcl_Interp *interp, struct input *i); ++static void free_keymap(struct keymap *km); ++static void free_output(Tcl_Interp *interp, struct output *o); ++static void free_action(struct action *a); ++static struct action *new_action(struct action **base); ++static int inter_eval( ++ Tcl_Interp *interp, ++ struct action *action, ++ ExpState *esPtr); + + /* intMatch() accepts user keystrokes and returns one of MATCH, + CANMATCH, or CANTMATCH. These describe whether the keystrokes match a +@@ -187,13 +190,13 @@ we're ready). The other is to return ca */ --int exp_window_size_set(); --int exp_window_size_get(); -+void exp_window_size_set(); -+void exp_window_size_get(); + static int +-intMatch(esPtr,keymap,km_match,matchLen,skip,info) +- ExpState *esPtr; +- struct keymap *keymap; /* linked list of keymaps */ +- struct keymap **km_match; /* keymap that matches or can match */ +- int *matchLen; /* # of bytes that matched */ +- int *skip; /* # of chars to skip */ +- Tcl_RegExpInfo *info; ++intMatch( ++ ExpState *esPtr, ++ struct keymap *keymap, /* linked list of keymaps */ ++ struct keymap **km_match, /* keymap that matches or can match */ ++ int *matchLen, /* # of bytes that matched */ ++ int *skip, /* # of chars to skip */ ++ Tcl_RegExpInfo *info) + { + Tcl_UniChar *string; + struct keymap *km; +@@ -344,12 +347,12 @@ intMatch(esPtr,keymap,km_match,matchLen, - void exp_win_rows_set(); - void exp_win_rows_get(); ---- expect.c -+++ expect.c -@@ -2015,6 +2015,8 @@ - case EXP_CONTINUE_TIMER: return EXP_TCLCNTTIMER; - case EXP_TCL_RETURN: return EXP_TCLRETTCL; - } -+ /*NOTREACHED*/ -+ abort(); + /* put regexp result in variables */ + static void +-intRegExpMatchProcess(interp,esPtr,km,info,offset) +- Tcl_Interp *interp; +- ExpState *esPtr; +- struct keymap *km; /* ptr for above while parsing */ +- Tcl_RegExpInfo *info; +- int offset; ++intRegExpMatchProcess( ++ Tcl_Interp *interp, ++ ExpState *esPtr, ++ struct keymap *km, /* ptr for above while parsing */ ++ Tcl_RegExpInfo *info, ++ int offset) + { + char name[20], value[20]; + int i; +@@ -390,10 +393,10 @@ intRegExpMatchProcess(interp,esPtr,km,in + * echo chars + */ + static void +-intEcho(esPtr,skipBytes,matchBytes) +- ExpState *esPtr; +- int skipBytes; +- int matchBytes; ++intEcho( ++ ExpState *esPtr, ++ int skipBytes, ++ int matchBytes) + { + int seenBytes; /* either printed or echoed */ + int echoBytes; +@@ -421,12 +424,12 @@ intEcho(esPtr,skipBytes,matchBytes) + * Returns # of bytes read or negative number (EXP_XXX) indicating unusual event. + */ + static int +-intRead(interp,esPtr,warnOnBufferFull,interruptible,key) +- Tcl_Interp *interp; +- ExpState *esPtr; +- int warnOnBufferFull; +- int interruptible; +- int key; ++intRead( ++ Tcl_Interp *interp, ++ ExpState *esPtr, ++ int warnOnBufferFull, ++ int interruptible, ++ int key) + { + Tcl_UniChar *eobOld; /* old end of buffer */ + int cc; +@@ -549,11 +552,11 @@ sigchld_handler() + * process or the child (surrogate). + */ + static int +-intIRead(channel,obj,size,flags); +-Tcl_Channel channel; +-Tcl_Obj *obj; +-int size; +-int flags; ++intIRead( ++ Tcl_Channel channel, ++ Tcl_Obj *obj, ++ int size, ++ int flags) + { + int cc = EXP_CHILD_EOF; + +@@ -578,9 +581,9 @@ int flags; + #define SPAWNED_PROCESS_DIED -3 + + static void +-clean_up_after_child(interp,esPtr) +-Tcl_Interp *interp; +-ExpState *esPtr; ++clean_up_after_child( ++ Tcl_Interp *interp, ++ ExpState *esPtr) + { + expWaitOnOne(); /* wait for slave */ + expWaitOnOne(); /* wait for child */ +@@ -593,16 +596,15 @@ ExpState *esPtr; + #endif /*SIMPLE_EVENT*/ + + static int +-update_interact_fds(interp,esPtrCount,esPtrToInput,esPtrs,input_base, +- do_indirect,config_count,real_tty_caller) +-Tcl_Interp *interp; +-int *esPtrCount; +-Tcl_HashTable **esPtrToInput; /* map from ExpStates to "struct inputs" */ +-ExpState ***esPtrs; +-struct input *input_base; +-int do_indirect; /* if true do indirects */ +-int *config_count; +-int *real_tty_caller; ++update_interact_fds( ++ Tcl_Interp *interp, ++ int *esPtrCount, ++ Tcl_HashTable **esPtrToInput, /* map from ExpStates to "struct inputs" */ ++ ExpState ***esPtrs, ++ struct input *input_base, ++ int do_indirect, /* if true do indirects */ ++ int *config_count, ++ int *real_tty_caller) + { + struct input *inp; + struct output *outp; +@@ -686,12 +688,12 @@ int *real_tty_caller; + + /*ARGSUSED*/ + static char * +-inter_updateproc(clientData, interp, name1, name2, flags) +-ClientData clientData; +-Tcl_Interp *interp; /* Interpreter containing variable. */ +-char *name1; /* Name of variable. */ +-char *name2; /* Second part of variable name. */ +-int flags; /* Information about what happened. */ ++inter_updateproc( ++ ClientData clientData, ++ Tcl_Interp *interp, /* Interpreter containing variable. */ ++ char *name1, /* Name of variable. */ ++ char *name2, /* Second part of variable name. */ ++ int flags) /* Information about what happened. */ + { + exp_configure_count++; + return 0; +@@ -704,15 +706,16 @@ static char interpreter_cmd[] = "interpr + + /*ARGSUSED*/ + int +-Exp_InteractObjCmd(clientData, interp, objc, objv) +-ClientData clientData; +-Tcl_Interp *interp; +-int objc; +-Tcl_Obj *CONST objv[]; /* Argument objects. */ ++Exp_InteractObjCmd( ++ ClientData clientData, ++ Tcl_Interp *interp, ++ int objc, ++ Tcl_Obj *CONST initial_objv[]) /* Argument objects. */ + { + ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); + + Tcl_Obj *CONST *objv_copy; /* original, for error messages */ ++ Tcl_Obj **objv = (Tcl_Obj **) initial_objv; + char *string; + Tcl_UniChar *ustring; + +@@ -2146,10 +2149,10 @@ got_action: + + /* version of Tcl_Eval for interact */ + static int +-inter_eval(interp,action,esPtr) +-Tcl_Interp *interp; +-struct action *action; +-ExpState *esPtr; ++inter_eval( ++ Tcl_Interp *interp, ++ struct action *action, ++ ExpState *esPtr) + { + int status; + +@@ -2168,8 +2171,7 @@ ExpState *esPtr; } + static void +-free_keymap(km) +-struct keymap *km; ++free_keymap(struct keymap *km) + { + if (km == 0) return; + free_keymap(km->next); +@@ -2178,8 +2180,7 @@ struct keymap *km; + } + + static void +-free_action(a) +-struct action *a; ++free_action(struct action *a) + { + struct action *next; + +@@ -2191,9 +2192,9 @@ struct action *a; + } + + static void +-free_input(interp,i) +-Tcl_Interp *interp; +-struct input *i; ++free_input( ++ Tcl_Interp *interp, ++ struct input *i) + { + if (i == 0) return; + free_input(interp,i->next); +@@ -2205,8 +2206,7 @@ struct input *i; + } + + static struct action * +-new_action(base) +-struct action **base; ++new_action(struct action **base) + { + struct action *o = new(struct action); + +@@ -2218,9 +2218,9 @@ struct action **base; + } + + static void +-free_output(interp,o) +-Tcl_Interp *interp; +-struct output *o; ++free_output( ++ Tcl_Interp *interp, ++ struct output *o) + { + if (o == 0) return; + free_output(interp,o->next); +@@ -2235,8 +2235,7 @@ static struct exp_cmd_data cmd_data[] = + {0}}; + + void +-exp_init_interact_cmds(interp) +-Tcl_Interp *interp; ++exp_init_interact_cmds(Tcl_Interp *interp) + { + ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); + +Index: expect.c +=================================================================== +--- expect.c.orig ++++ expect.c +@@ -34,7 +34,7 @@ would appreciate credit if this program + #include "exp_command.h" + #include "exp_log.h" + #include "exp_event.h" +-#include "exp_tty.h" ++#include "exp_tty_in.h" + #include "exp_tstamp.h" /* this should disappear when interact */ + /* loses ref's to it */ + #ifdef TCL_DEBUGGER +@@ -134,10 +134,10 @@ struct exp_cmd_descriptor { + */ + + static void +-exp_cmd_init(cmd,cmdtype,duration) +-struct exp_cmd_descriptor *cmd; +-int duration; +-int cmdtype; ++exp_cmd_init( ++ struct exp_cmd_descriptor *cmd, ++ int duration, ++ int cmdtype) + { + cmd->duration = duration; + cmd->cmdtype = cmdtype; +@@ -156,14 +156,21 @@ static int alarm_fired; /* if alarm occu + void exp_background_channelhandlers_run_all(); + + /* exp_indirect_updateX is called by Tcl when an indirect variable is set */ +-static char *exp_indirect_update1(); /* 1-part Tcl variable names */ +-static char *exp_indirect_update2(); /* 2-part Tcl variable names */ ++static char *exp_indirect_update1( /* 1-part Tcl variable names */ ++ Tcl_Interp *interp, ++ struct exp_cmd_descriptor *ecmd, ++ struct exp_i *exp_i); ++static char *exp_indirect_update2( /* 2-part Tcl variable names */ ++ ClientData clientData, ++ Tcl_Interp *interp, /* Interpreter containing variable. */ ++ char *name1, /* Name of variable. */ ++ char *name2, /* Second part of variable name. */ ++ int flags); /* Information about what happened. */ + + #ifdef SIMPLE_EVENT + /*ARGSUSED*/ + static RETSIGTYPE +-sigalarm_handler(n) +-int n; /* unused, for compatibility with STDC */ ++sigalarm_handler(int n) /* unused, for compatibility with STDC */ + { + alarm_fired = TRUE; + } +@@ -171,10 +178,10 @@ int n; /* unused, for compatibi + + /* free up everything in ecase */ + static void +-free_ecase(interp,ec,free_ilist) +-Tcl_Interp *interp; +-struct ecase *ec; +-int free_ilist; /* if we should free ilist */ ++free_ecase( ++ Tcl_Interp *interp, ++ struct ecase *ec, ++ int free_ilist) /* if we should free ilist */ + { + if (ec->i_list->duration == EXP_PERMANENT) { + if (ec->pat) { Tcl_DecrRefCount(ec->pat); } +@@ -194,10 +201,10 @@ int free_ilist; /* if we should free il + + /* free up any argv structures in the ecases */ + static void +-free_ecases(interp,eg,free_ilist) +-Tcl_Interp *interp; +-struct exp_cmd_descriptor *eg; +-int free_ilist; /* if true, free ilists */ ++free_ecases( ++ Tcl_Interp *interp, ++ struct exp_cmd_descriptor *eg, ++ int free_ilist) /* if true, free ilists */ + { + int i; + +@@ -216,8 +223,7 @@ int free_ilist; /* if true, free ilists + #if 0 + /* no standard defn for this, and some systems don't even have it, so avoid */ + /* the whole quagmire by calling it something else */ +-static char *exp_strdup(s) +-char *s; ++static char *exp_strdup(char *s) + { + char *news = ckalloc(strlen(s) + 1); + strcpy(news,s); +@@ -242,8 +248,7 @@ char *s; + Current test is very cheap and almost always right :-) + */ + int +-exp_one_arg_braced(objPtr) /* INTL */ +-Tcl_Obj *objPtr; ++exp_one_arg_braced(Tcl_Obj *objPtr) /* INTL */ + { + int seen_nl = FALSE; + char *p = Tcl_GetString(objPtr); +@@ -268,10 +273,10 @@ Tcl_Obj *objPtr; + * its current argumnts */ + /*ARGSUSED*/ + Tcl_Obj* +-exp_eval_with_one_arg(clientData,interp,objv) /* INTL */ +-ClientData clientData; +-Tcl_Interp *interp; +-Tcl_Obj *CONST objv[]; /* Argument objects. */ ++exp_eval_with_one_arg( ++ ClientData clientData, ++ Tcl_Interp *interp, ++ Tcl_Obj *CONST objv[]) /* Argument objects. */ + { + Tcl_Obj* res = Tcl_NewListObj (1,objv); + +@@ -348,8 +353,7 @@ Tcl_Obj *CONST objv[]; /* Argument obje + } + + static void +-ecase_clear(ec) +-struct ecase *ec; ++ecase_clear(struct ecase *ec) + { + ec->i_list = 0; + ec->pat = 0; +@@ -365,7 +369,7 @@ struct ecase *ec; + } + + static struct ecase * +-ecase_new() ++ecase_new(void) + { + struct ecase *ec = (struct ecase *)ckalloc(sizeof(struct ecase)); + +@@ -400,12 +404,12 @@ The exp_i chain can be broken by the cal + */ + + static int +-parse_expect_args(interp,eg,default_esPtr,objc,objv) +-Tcl_Interp *interp; +-struct exp_cmd_descriptor *eg; +-ExpState *default_esPtr; /* suggested ExpState if called as expect_user or _tty */ +-int objc; +-Tcl_Obj *CONST objv[]; /* Argument objects. */ ++parse_expect_args( ++ Tcl_Interp *interp, ++ struct exp_cmd_descriptor *eg, ++ ExpState *default_esPtr, /* suggested ExpState if called as expect_user or _tty */ ++ int objc, ++ Tcl_Obj *CONST objv[]) /* Argument objects. */ + { + int i; + char *string; +@@ -718,9 +722,9 @@ struct eval_out { + */ + + Tcl_UniChar * +-string_case_first(string,pattern) /* INTL */ +- register Tcl_UniChar *string; /* String (unicode). */ +- register char *pattern; /* Pattern, which may contain ++string_case_first( /* INTL */ ++ register Tcl_UniChar *string, /* String (unicode). */ ++ register char *pattern) /* Pattern, which may contain + * special characters (utf8). */ + { + Tcl_UniChar *s; +@@ -748,9 +752,9 @@ string_case_first(string,pattern) /* INT + } + + Tcl_UniChar * +-string_first(string,pattern) /* INTL */ +- register Tcl_UniChar *string; /* String (unicode). */ +- register char *pattern; /* Pattern, which may contain ++string_first( /* INTL */ ++ register Tcl_UniChar *string, /* String (unicode). */ ++ register char *pattern) /* Pattern, which may contain + * special characters (utf8). */ + { + Tcl_UniChar *s; +@@ -778,9 +782,9 @@ string_first(string,pattern) /* INTL */ + } + + Tcl_UniChar * +-string_first_char(string,pattern) /* INTL */ +- register Tcl_UniChar *string; /* String. */ +- register Tcl_UniChar pattern; ++string_first_char( /* INTL */ ++ register Tcl_UniChar *string, /* String. */ ++ register Tcl_UniChar pattern) + { + /* unicode based Tcl_UtfFindFirst */ + +@@ -803,15 +807,15 @@ string_first_char(string,pattern) /* INT + /* string match */ + /* returns EXP_X where X is MATCH, NOMATCH, FULLBUFFER, TCLERRROR */ + static int +-eval_case_string(interp,e,esPtr,o,last_esPtr,last_case,suffix) +-Tcl_Interp *interp; +-struct ecase *e; +-ExpState *esPtr; +-struct eval_out *o; /* 'output' - i.e., final case of interest */ ++eval_case_string( ++ Tcl_Interp *interp, ++ struct ecase *e, ++ ExpState *esPtr, ++ struct eval_out *o, /* 'output' - i.e., final case of interest */ + /* next two args are for debugging, when they change, reprint buffer */ +-ExpState **last_esPtr; +-int *last_case; +-char *suffix; ++ ExpState **last_esPtr, ++ int *last_case, ++ char *suffix) + { + Tcl_RegExp re; + Tcl_RegExpInfo info; +@@ -977,18 +981,18 @@ char *suffix; + /* sets o.e if successfully finds a matching pattern, eof, timeout or deflt */ + /* returns original status arg or EXP_TCLERROR */ + static int +-eval_cases(interp,eg,esPtr,o,last_esPtr,last_case,status,esPtrs,mcount,suffix) +-Tcl_Interp *interp; +-struct exp_cmd_descriptor *eg; +-ExpState *esPtr; +-struct eval_out *o; /* 'output' - i.e., final case of interest */ ++eval_cases( ++ Tcl_Interp *interp, ++ struct exp_cmd_descriptor *eg, ++ ExpState *esPtr, ++ struct eval_out *o, /* 'output' - i.e., final case of interest */ + /* next two args are for debugging, when they change, reprint buffer */ +-ExpState **last_esPtr; +-int *last_case; +-int status; +-ExpState *(esPtrs[]); +-int mcount; +-char *suffix; ++ ExpState **last_esPtr, ++ int *last_case, ++ int status, ++ ExpState *(esPtrs[]), ++ int mcount, ++ char *suffix) + { + int i; + ExpState *em; /* ExpState of ecase */ +@@ -1061,10 +1065,10 @@ char *suffix; + } + + static void +-ecases_remove_by_expi(interp,ecmd,exp_i) +-Tcl_Interp *interp; +-struct exp_cmd_descriptor *ecmd; +-struct exp_i *exp_i; ++ecases_remove_by_expi( ++ Tcl_Interp *interp, ++ struct exp_cmd_descriptor *ecmd, ++ struct exp_i *exp_i) + { + int i; + +@@ -1095,10 +1099,10 @@ struct exp_i *exp_i; + + /* remove exp_i from list */ + static void +-exp_i_remove(interp,ei,exp_i) +-Tcl_Interp *interp; +-struct exp_i **ei; /* list to remove from */ +-struct exp_i *exp_i; /* element to remove */ ++exp_i_remove( ++ Tcl_Interp *interp, ++ struct exp_i **ei, /* list to remove from */ ++ struct exp_i *exp_i) /* element to remove */ + { + /* since it's in middle of list, free exp_i by hand */ + for (;*ei; ei = &(*ei)->next) { +@@ -1113,10 +1117,10 @@ struct exp_i *exp_i; /* element to remov + + /* remove exp_i from list and remove any dependent ecases */ + static void +-exp_i_remove_with_ecases(interp,ecmd,exp_i) +-Tcl_Interp *interp; +-struct exp_cmd_descriptor *ecmd; +-struct exp_i *exp_i; ++exp_i_remove_with_ecases( ++ Tcl_Interp *interp, ++ struct exp_cmd_descriptor *ecmd, ++ struct exp_i *exp_i) + { + ecases_remove_by_expi(interp,ecmd,exp_i); + exp_i_remove(interp,&ecmd->i_list,exp_i); +@@ -1124,11 +1128,11 @@ struct exp_i *exp_i; + + /* remove ecases tied to a single direct spawn id */ + static void +-ecmd_remove_state(interp,ecmd,esPtr,direct) +-Tcl_Interp *interp; +-struct exp_cmd_descriptor *ecmd; +-ExpState *esPtr; +-int direct; ++ecmd_remove_state( ++ Tcl_Interp *interp, ++ struct exp_cmd_descriptor *ecmd, ++ ExpState *esPtr, ++ int direct) + { + struct exp_i *exp_i, *next; + struct exp_state_list **slPtr; +@@ -1168,9 +1172,9 @@ int direct; + + /* this is called from exp_close to clean up the ExpState */ + void +-exp_ecmd_remove_state_direct_and_indirect(interp,esPtr) +-Tcl_Interp *interp; +-ExpState *esPtr; ++exp_ecmd_remove_state_direct_and_indirect( ++ Tcl_Interp *interp, ++ ExpState *esPtr) + { + ecmd_remove_state(interp,&exp_cmds[EXP_CMD_BEFORE],esPtr,EXP_DIRECT|EXP_INDIRECT); + ecmd_remove_state(interp,&exp_cmds[EXP_CMD_AFTER],esPtr,EXP_DIRECT|EXP_INDIRECT); +@@ -1182,9 +1186,9 @@ ExpState *esPtr; + + /* arm a list of background ExpState's */ + static void +-state_list_arm(interp,slPtr) +-Tcl_Interp *interp; +-struct exp_state_list *slPtr; ++state_list_arm( ++ Tcl_Interp *interp, ++ struct exp_state_list *slPtr) + { + /* for each spawn id in list, arm if necessary */ + for (;slPtr;slPtr=slPtr->next) { +@@ -1201,9 +1205,9 @@ struct exp_state_list *slPtr; + + /* return TRUE if this ecase is used by this fd */ + static int +-exp_i_uses_state(exp_i,esPtr) +-struct exp_i *exp_i; +-ExpState *esPtr; ++exp_i_uses_state( ++ struct exp_i *exp_i, ++ ExpState *esPtr) + { + struct exp_state_list *fdp; + +@@ -1214,9 +1218,9 @@ ExpState *esPtr; + } + + static void +-ecase_append(interp,ec) +-Tcl_Interp *interp; +-struct ecase *ec; ++ecase_append( ++ Tcl_Interp *interp, ++ struct ecase *ec) + { + if (!ec->transfer) Tcl_AppendElement(interp,"-notransfer"); + if (ec->indices) Tcl_AppendElement(interp,"-indices"); +@@ -1231,10 +1235,10 @@ struct ecase *ec; + + /* append all ecases that match this exp_i */ + static void +-ecase_by_exp_i_append(interp,ecmd,exp_i) +-Tcl_Interp *interp; +-struct exp_cmd_descriptor *ecmd; +-struct exp_i *exp_i; ++ecase_by_exp_i_append( ++ Tcl_Interp *interp, ++ struct exp_cmd_descriptor *ecmd, ++ struct exp_i *exp_i) + { + int i; + for (i=0;iecd.count;i++) { +@@ -1245,9 +1249,9 @@ struct exp_i *exp_i; + } + + static void +-exp_i_append(interp,exp_i) +-Tcl_Interp *interp; +-struct exp_i *exp_i; ++exp_i_append( ++ Tcl_Interp *interp, ++ struct exp_i *exp_i) + { + Tcl_AppendElement(interp,"-i"); + if (exp_i->direct == EXP_INDIRECT) { +@@ -1261,8 +1265,8 @@ struct exp_i *exp_i; + } + + for (fdp = exp_i->state_list;fdp;fdp=fdp->next) { +- char buf[10]; /* big enough for a small int */ +- sprintf(buf,"%d",fdp->esPtr); ++ char buf[25]; /* big enough for a small int */ ++ sprintf(buf,"%ld", (long)fdp->esPtr); + Tcl_AppendElement(interp,buf); + } + +@@ -1274,11 +1278,11 @@ struct exp_i *exp_i; + + /* return current setting of the permanent expect_before/after/bg */ + int +-expect_info(interp,ecmd,objc,objv) +-Tcl_Interp *interp; +-struct exp_cmd_descriptor *ecmd; +-int objc; +-Tcl_Obj *CONST objv[]; /* Argument objects. */ ++expect_info( ++ Tcl_Interp *interp, ++ struct exp_cmd_descriptor *ecmd, ++ int objc, ++ Tcl_Obj *CONST objv[]) /* Argument objects. */ + { + struct exp_i *exp_i; + int i; +@@ -1362,11 +1366,11 @@ Tcl_Obj *CONST objv[]; /* Argument obje + /* Exp_ExpectGlobalObjCmd is invoked to process expect_before/after/background */ + /*ARGSUSED*/ + int +-Exp_ExpectGlobalObjCmd(clientData, interp, objc, objv) +-ClientData clientData; +-Tcl_Interp *interp; +-int objc; +-Tcl_Obj *CONST objv[]; /* Argument objects. */ ++Exp_ExpectGlobalObjCmd( ++ ClientData clientData, ++ Tcl_Interp *interp, ++ int objc, ++ Tcl_Obj *CONST objv[]) /* Argument objects. */ + { + int result = TCL_OK; + struct exp_i *exp_i, **eip; +@@ -1574,8 +1578,7 @@ Tcl_Obj *CONST objv[]; /* Argument obje + + /* adjusts file according to user's size request */ + void +-expAdjust(esPtr) +-ExpState *esPtr; ++expAdjust(ExpState *esPtr) + { + int new_msize, excess; + Tcl_UniChar *string; +@@ -1632,9 +1635,9 @@ ExpState *esPtr; + #if OBSOLETE + /* Strip parity */ + static void +-expParityStrip(obj,offsetBytes) +- Tcl_Obj *obj; +- int offsetBytes; ++expParityStrip( ++ Tcl_Obj *obj, ++ int offsetBytes) + { + char *p, ch; + +@@ -1659,9 +1662,9 @@ expParityStrip(obj,offsetBytes) + be at a UTF boundary. + */ + static void +-expValid(obj,offset) +- Tcl_Obj *obj; +- int offset; ++expValid( ++ Tcl_Obj *obj, ++ int offset) + { + char *s, *end; + int len; +@@ -1709,9 +1712,9 @@ expValid(obj,offset) + + /* Strip nulls from object, beginning at offset */ + static int +-expNullStrip(buf,offsetChars) +- ExpUniBuf* buf; +- int offsetChars; ++expNullStrip( ++ ExpUniBuf* buf, ++ int offsetChars) + { + Tcl_UniChar *src, *src2, *dest, *end; + int newsize; /* size of obj after all nulls removed */ +@@ -1737,11 +1740,11 @@ expNullStrip(buf,offsetChars) + /* the read will complete immediately. */ + /*ARGSUSED*/ + static int +-expIRead(interp,esPtr,timeout,save_flags) /* INTL */ +-Tcl_Interp *interp; +-ExpState *esPtr; +-int timeout; +-int save_flags; ++expIRead( /* INTL */ ++ Tcl_Interp *interp, ++ ExpState *esPtr, ++ int timeout, ++ int save_flags) + { + int cc = EXP_TIMEOUT; + int size; +@@ -1812,13 +1815,13 @@ int save_flags; + /* if it returns a non-negative number, it means there is data */ + /* (0 means nothing new was actually read, but it should be looked at again) */ + int +-expRead(interp,esPtrs,esPtrsMax,esPtrOut,timeout,key) +-Tcl_Interp *interp; +-ExpState *(esPtrs[]); /* If 0, then esPtrOut already known and set */ +-int esPtrsMax; /* number of esPtrs */ +-ExpState **esPtrOut; /* Out variable to leave new ExpState. */ +-int timeout; +-int key; ++expRead( ++ Tcl_Interp *interp, ++ ExpState *(esPtrs[]), /* If 0, then esPtrOut already known and set */ ++ int esPtrsMax, /* number of esPtrs */ ++ ExpState **esPtrOut, /* Out variable to leave new ExpState. */ ++ int timeout, ++ int key) + { + ExpState *esPtr; + +@@ -1920,12 +1923,12 @@ int key; + /* when buffer fills, copy second half over first and */ + /* continue, so we can do matches over multiple buffers */ + void +-exp_buffer_shuffle(interp,esPtr,save_flags,array_name,caller_name) /* INTL */ +-Tcl_Interp *interp; +-ExpState *esPtr; +-int save_flags; +-char *array_name; +-char *caller_name; ++exp_buffer_shuffle( /* INTL */ ++ Tcl_Interp *interp, ++ ExpState *esPtr, ++ int save_flags, ++ char *array_name, ++ char *caller_name) + { + Tcl_UniChar *str; + Tcl_UniChar *p; +@@ -1989,8 +1992,7 @@ char *caller_name; + /* map EXP_ style return value to TCL_ style return value */ + /* not defined to work on TCL_OK */ + int +-exp_tcl2_returnvalue(x) +-int x; ++exp_tcl2_returnvalue(int x) + { + switch (x) { + case TCL_ERROR: return EXP_TCLERROR; +@@ -2009,8 +2011,7 @@ int x; + /* map from EXP_ style return value to TCL_ style return values */ -@@ -2031,6 +2033,8 @@ - case EXP_TCLCNTTIMER: return EXP_CONTINUE_TIMER; - case EXP_TCLRETTCL: return EXP_TCL_RETURN; - } -+ /*NOTREACHED*/ -+ abort(); + int +-exp_2tcl_returnvalue(x) +-int x; ++exp_2tcl_returnvalue(int x) + { + switch (x) { + case EXP_TCLERROR: return TCL_ERROR; +@@ -2033,9 +2034,9 @@ This allows the user to localize them if + avoid having to put "global" in procedure definitions. + */ + char * +-exp_get_var(interp,var) +-Tcl_Interp *interp; +-char *var; ++exp_get_var( ++ Tcl_Interp *interp, ++ char *var) + { + char *val; + +@@ -2045,8 +2046,7 @@ char *var; } - /* variables predefined by expect are retrieved using this routine -@@ -2110,6 +2114,8 @@ - #ifdef LINT - return("unknown expect command"); - #endif -+ /*NOTREACHED*/ -+ abort(); + static int +-get_timeout(interp) +-Tcl_Interp *interp; ++get_timeout(Tcl_Interp *interp) + { + ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); + CONST char *t; +@@ -2060,9 +2060,9 @@ Tcl_Interp *interp; + /* make a copy of a linked list (1st arg) and attach to end of another (2nd + arg) */ + static int +-update_expect_states(i_list,i_union) +-struct exp_i *i_list; +-struct exp_state_list **i_union; ++update_expect_states( ++ struct exp_i *i_list, ++ struct exp_state_list **i_union) + { + struct exp_i *p; + +@@ -2092,8 +2092,7 @@ struct exp_state_list **i_union; } - /* exp_indirect_update2 is called back via Tcl's trace handler whenever */ ---- pkgIndex.in -+++ pkgIndex.in -@@ -7,4 +7,4 @@ - # script is sourced, the variable $dir must contain the - # full path name of this file's directory. + char * +-exp_cmdtype_printable(cmdtype) +-int cmdtype; ++exp_cmdtype_printable(int cmdtype) + { + switch (cmdtype) { + case EXP_CMD_FG: return("expect"); +@@ -2110,12 +2109,12 @@ int cmdtype; + /* an indirect spawn id list is changed */ + /*ARGSUSED*/ + static char * +-exp_indirect_update2(clientData, interp, name1, name2, flags) +-ClientData clientData; +-Tcl_Interp *interp; /* Interpreter containing variable. */ +-char *name1; /* Name of variable. */ +-char *name2; /* Second part of variable name. */ +-int flags; /* Information about what happened. */ ++exp_indirect_update2( ++ ClientData clientData, ++ Tcl_Interp *interp, /* Interpreter containing variable. */ ++ char *name1, /* Name of variable. */ ++ char *name2, /* Second part of variable name. */ ++ int flags) /* Information about what happened. */ + { + char *msg; --package ifneeded Expect @EXP_VERSION_FULL@ [list load [file join $dir .. @EXP_SHARED_LIB_FILE@]] -+package ifneeded Expect @EXP_VERSION_FULL@ [list load "@EXP_SHARED_LIB_FILE@"] ---- pty_termios.c -+++ pty_termios.c -@@ -11,6 +11,8 @@ +@@ -2129,10 +2128,10 @@ int flags; /* Information about what ha + } + static char * +-exp_indirect_update1(interp,ecmd,exp_i) +-Tcl_Interp *interp; +-struct exp_cmd_descriptor *ecmd; +-struct exp_i *exp_i; ++exp_indirect_update1( ++ Tcl_Interp *interp, ++ struct exp_cmd_descriptor *ecmd, ++ struct exp_i *exp_i) + { + struct exp_state_list *slPtr; /* temp for interating over state_list */ + +@@ -2205,13 +2204,13 @@ struct exp_i *exp_i; + } + + int +-expMatchProcess(interp, eo, cc, bg, detail) +- Tcl_Interp *interp; +- struct eval_out *eo; /* final case of interest */ +- int cc; /* EOF, TIMEOUT, etc... */ +- int bg; /* 1 if called from background handler, */ ++expMatchProcess( ++ Tcl_Interp *interp, ++ struct eval_out *eo, /* final case of interest */ ++ int cc, /* EOF, TIMEOUT, etc... */ ++ int bg, /* 1 if called from background handler, */ + /* else 0 */ +- char *detail; ++ char *detail) + { + ExpState *esPtr = 0; + Tcl_Obj *body = 0; +@@ -2385,9 +2384,9 @@ expMatchProcess(interp, eo, cc, bg, deta + /* this function is called from the background when input arrives */ + /*ARGSUSED*/ + void +-exp_background_channelhandler(clientData,mask) /* INTL */ +-ClientData clientData; +-int mask; ++exp_background_channelhandler( /* INTL */ ++ ClientData clientData, ++ int mask) + { + char backup[EXP_CHANNELNAMELEN+1]; /* backup copy of esPtr channel name! */ + +@@ -2510,11 +2509,11 @@ do_more_data: + + /*ARGSUSED*/ + int +-Exp_ExpectObjCmd(clientData, interp, objc, objv) +-ClientData clientData; +-Tcl_Interp *interp; +-int objc; +-Tcl_Obj *CONST objv[]; /* Argument objects. */ ++Exp_ExpectObjCmd( ++ ClientData clientData, ++ Tcl_Interp *interp, ++ int objc, ++ Tcl_Obj *CONST objv[]) /* Argument objects. */ + { + int cc; /* number of chars returned in a single read */ + /* or negative EXP_whatever */ +@@ -2767,11 +2766,11 @@ error: + + /*ARGSUSED*/ + static int +-Exp_TimestampObjCmd(clientData, interp, objc, objv) +-ClientData clientData; +-Tcl_Interp *interp; +- int objc; +- Tcl_Obj *CONST objv[]; /* Argument objects. */ ++Exp_TimestampObjCmd( ++ ClientData clientData, ++ Tcl_Interp *interp, ++ int objc, ++ Tcl_Obj *CONST objv[]) /* Argument objects. */ + { + char *format = 0; + time_t seconds = -1; +@@ -2866,14 +2865,14 @@ process_di _ANSI_ARGS_ ((Tcl_Interp* int + CONST char* cmd)); + + static int +-process_di (interp,objc,objv,at,Default,esOut,cmd) +-Tcl_Interp *interp; +- int objc; +- Tcl_Obj *CONST objv[]; /* Argument objects. */ +- int* at; +- int* Default; +- CONST char* cmd; +- ExpState **esOut; ++process_di ( ++ Tcl_Interp *interp, ++ int objc, ++ Tcl_Obj *CONST objv[], /* Argument objects. */ ++ int* at, ++ int* Default, ++ ExpState **esOut, ++ CONST char* cmd) + { + static char* options[] = { + "-d", +@@ -2947,11 +2946,11 @@ Tcl_Interp *interp; + + /*ARGSUSED*/ + int +-Exp_MatchMaxObjCmd(clientData,interp,objc,objv) +- ClientData clientData; +- Tcl_Interp *interp; +- int objc; +- Tcl_Obj *CONST objv[]; /* Argument objects. */ ++Exp_MatchMaxObjCmd( ++ ClientData clientData, ++ Tcl_Interp *interp, ++ int objc, ++ Tcl_Obj *CONST objv[]) /* Argument objects. */ + { + int size = -1; + ExpState *esPtr = 0; +@@ -2993,11 +2992,11 @@ Exp_MatchMaxObjCmd(clientData,interp,obj + + /*ARGSUSED*/ + int +-Exp_RemoveNullsObjCmd(clientData,interp,objc,objv) +-ClientData clientData; +-Tcl_Interp *interp; +- int objc; +- Tcl_Obj *CONST objv[]; /* Argument objects. */ ++Exp_RemoveNullsObjCmd( ++ ClientData clientData, ++ Tcl_Interp *interp, ++ int objc, ++ Tcl_Obj *CONST objv[]) /* Argument objects. */ + { + int value = -1; + ExpState *esPtr = 0; +@@ -3037,11 +3036,11 @@ Tcl_Interp *interp; + + /*ARGSUSED*/ + int +-Exp_ParityObjCmd(clientData,interp,objc,objv) +-ClientData clientData; +-Tcl_Interp *interp; +- int objc; +- Tcl_Obj *CONST objv[]; /* Argument objects. */ ++Exp_ParityObjCmd( ++ ClientData clientData, ++ Tcl_Interp *interp, ++ int objc, ++ Tcl_Obj *CONST objv[]) /* Argument objects. */ + { + int parity; + ExpState *esPtr = 0; +@@ -3076,11 +3075,11 @@ Tcl_Interp *interp; + + /*ARGSUSED*/ + int +-Exp_CloseOnEofObjCmd(clientData,interp,objc,objv) +-ClientData clientData; +-Tcl_Interp *interp; +- int objc; +- Tcl_Obj *CONST objv[]; /* Argument objects. */ ++Exp_CloseOnEofObjCmd( ++ ClientData clientData, ++ Tcl_Interp *interp, ++ int objc, ++ Tcl_Obj *CONST objv[]) /* Argument objects. */ + { + int close_on_eof; + ExpState *esPtr = 0; +@@ -3117,8 +3116,7 @@ Tcl_Interp *interp; + /* This big chunk of code is just for debugging the permanent */ + /* expect cases */ + void +-exp_fd_print(slPtr) +-struct exp_state_list *slPtr; ++exp_fd_print(struct exp_state_list *slPtr) + { + if (!slPtr) return; + printf("%d ",slPtr->esPtr); +@@ -3126,8 +3124,7 @@ struct exp_state_list *slPtr; + } + + void +-exp_i_print(exp_i) +-struct exp_i *exp_i; ++exp_i_print(struct exp_i *exp_i) + { + if (!exp_i) return; + printf("exp_i %x",exp_i); +@@ -3143,16 +3140,14 @@ struct exp_i *exp_i; + } + + void +-exp_ecase_print(ecase) +-struct ecase *ecase; ++exp_ecase_print(struct ecase *ecase) + { + printf("pat <%s>\n",ecase->pat); + printf("exp_i = %x\n",ecase->i_list); + } + + void +-exp_ecases_print(ecd) +-struct exp_cases_descriptor *ecd; ++exp_ecases_print(struct exp_cases_descriptor *ecd) + { + int i; + +@@ -3161,8 +3156,7 @@ struct exp_cases_descriptor *ecd; + } + + void +-exp_cmd_print(ecmd) +-struct exp_cmd_descriptor *ecmd; ++exp_cmd_print(struct exp_cmd_descriptor *ecmd) + { + printf("expect cmd type: %17s",exp_cmdtype_printable(ecmd->cmdtype)); + printf((ecmd->duration==EXP_PERMANENT)?" perm ": "tmp "); +@@ -3172,7 +3166,7 @@ struct exp_cmd_descriptor *ecmd; + } + + void +-exp_cmds_print() ++exp_cmds_print(void) + { + exp_cmd_print(&exp_cmds[EXP_CMD_BEFORE]); + exp_cmd_print(&exp_cmds[EXP_CMD_AFTER]); +@@ -3181,11 +3175,11 @@ exp_cmds_print() + + /*ARGSUSED*/ + int +-cmdX(clientData, interp, objc, objv) +-ClientData clientData; +-Tcl_Interp *interp; +- int objc; +- Tcl_Obj *CONST objv[]; /* Argument objects. */ ++cmdX( ++ ClientData clientData, ++ Tcl_Interp *interp, ++ int objc, ++ Tcl_Obj *CONST objv[]) /* Argument objects. */ + { + exp_cmds_print(); + return TCL_OK; +@@ -3193,7 +3187,7 @@ Tcl_Interp *interp; + #endif /*DEBUG_PERM_ECASES*/ + + void +-expExpectVarsInit() ++expExpectVarsInit(void) + { + ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); + +@@ -3216,8 +3210,7 @@ cmd_data[] = { + {0}}; + + void +-exp_init_expect_cmds(interp) +-Tcl_Interp *interp; ++exp_init_expect_cmds(Tcl_Interp *interp) + { + exp_create_commands(interp,cmd_data); + +@@ -3248,7 +3241,7 @@ Tcl_Interp *interp; + } + + void +-exp_init_sig() { ++exp_init_sig(void) { + #if 0 + signal(SIGALRM,sigalarm_handler); + signal(SIGINT,sigint_handler); +Index: retoglob.c +=================================================================== +--- retoglob.c.orig ++++ retoglob.c +@@ -44,9 +44,9 @@ xxx (Tcl_UniChar* x, int xl) + + + Tcl_Obj* +-exp_retoglob (str,strlen) +- Tcl_UniChar* str; +- int strlen; ++exp_retoglob ( ++ Tcl_UniChar* str, ++ int strlen) + { + /* + * Output: x2 size of input (literal where every character has to be +Index: exp_main_exp.c +=================================================================== +--- exp_main_exp.c.orig ++++ exp_main_exp.c +@@ -14,6 +14,7 @@ would appreciate credit if this program #include - #include -+#include -+#include + #include "tcl.h" + #include "expect_tcl.h" ++#include - #if defined(SIGCLD) && !defined(SIGCHLD) - #define SIGCHLD SIGCLD + int + main(argc, argv) +Index: exp_win.c +=================================================================== +--- exp_win.c.orig ++++ exp_win.c +@@ -51,7 +51,7 @@ conflicts with sys/ioctl.h + # include + #endif /* HAVE_SYS_PTEM_H */ + +-#include "exp_tty.h" ++#include "exp_tty_in.h" + #include "exp_win.h" + + #ifdef TIOCGWINSZ +Index: pty_termios.c +=================================================================== +--- pty_termios.c.orig ++++ pty_termios.c +@@ -627,10 +627,10 @@ int control; /* if 1, enable pty trappin + } + + int +-exp_getptyslave(ttycopy,ttyinit,stty_args) +-int ttycopy; +-int ttyinit; +-char *stty_args; ++exp_getptyslave( ++ int ttycopy, ++ int ttyinit, ++ CONST char *stty_args) + { + int slave, slave2; + char buf[10240]; +Index: exp_strf.c +=================================================================== +--- exp_strf.c.orig ++++ exp_strf.c +@@ -148,7 +148,7 @@ int low, item, hi; + void + /*size_t*/ + #ifndef __STDC__ +-exp_strftime(/*s,*/ format, timeptr, dstring) ++exp_strftime( + /*char *s;*/ + char *format; + const struct tm *timeptr; diff --git a/expect.changes b/expect.changes index db6e6e1..aec0652 100644 --- a/expect.changes +++ b/expect.changes @@ -1,3 +1,15 @@ +------------------------------------------------------------------- +Thu Mar 20 19:13:00 CET 2008 - max@suse.de + +- Update to version 5.44.1.5 from CVS: + * Improved internal buffer management + * Ported script-level commands to the newer Tcl object API + * Optimized regular expression matching +- Split off a -devel subpackage +- Don't package the example subdir anymore. +- Fix all critical and part of the non-critical warnings that + show up with gcc 4.3. To be continued... + ------------------------------------------------------------------- Wed Jan 25 21:30:10 CET 2006 - mls@suse.de diff --git a/expect.patch b/expect.patch index 4cf9cf0..35cfd33 100644 --- a/expect.patch +++ b/expect.patch @@ -1,15 +1,8 @@ +Index: Makefile.in +================================================================================ --- Makefile.in +++ Makefile.in -@@ -23,7 +23,7 @@ - SETUID = @SETUID@ - # SETUID = chmod u+s - --LIB_RUNTIME_DIR = $(INSTALL_ROOT)@libdir@ -+LIB_RUNTIME_DIR = $(DESTDIR)@libdir@ - - # The following Expect scripts are not necessary to have installed as - # commands, but are very useful. Edit out what you don't want -@@ -101,7 +101,7 @@ +@@ -103,7 +103,7 @@ PKG_STUB_LIB_FILE = @PKG_STUB_LIB_FILE@ lib_BINARIES = $(PKG_LIB_FILE) @@ -18,48 +11,16 @@ BINARIES = $(lib_BINARIES) $(bin_BINARIES) SHELL = @SHELL@ -@@ -120,7 +120,7 @@ +@@ -175,7 +175,7 @@ + TCLSH = $(TCLSH_ENV) $(TCLSH_PROG) + SHARED_BUILD = @SHARED_BUILD@ - PKG_DIR = $(PACKAGE_NAME)$(PACKAGE_VERSION) - pkgdatadir = $(datadir)/$(PKG_DIR) --pkglibdir = $(libdir)/$(PKG_DIR) -+pkglibdir = $(datadir)/tcl/$(PKG_DIR) - pkgincludedir = $(includedir)/$(PKG_DIR) +-INCLUDES = @PKG_INCLUDES@ @TCL_INCLUDES@ @TK_INCLUDES@ ++INCLUDES = @PKG_INCLUDES@ @TCL_INCLUDES@ - top_builddir = . -@@ -236,10 +236,10 @@ - $(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(includedir) ; \ - done; - # install standalone scripts and their man pages, if requested -- @mkdir -p $(INSTALL_ROOT)$(prefix)/bin -+ @mkdir -p $(DESTDIR)$(prefix)/bin - -for i in $(SCRIPT_LIST) ; do \ - if [ -f $$i ] ; then \ -- $(INSTALL_PROGRAM) $$i $(INSTALL_ROOT)$(prefix)/bin/$$i ; \ -+ $(INSTALL_PROGRAM) $$i $(DESTDIR)$(prefix)/bin/$$i ; \ - rm -f $$i ; \ - else true; fi ; \ - done -@@ -254,14 +254,14 @@ - @mkdir -p $(DESTDIR)$(mandir)/man3 - @echo "Installing documentation in $(DESTDIR)$(mandir)" - # install Expectk man page if present -- $(INSTALL_DATA) $(srcdir)/expectk.man $(mandir)/man1/expectk.1 ; \ -+ $(INSTALL_DATA) $(srcdir)/expectk.man $(DESTDIR)$(mandir)/man1/expectk.1 ; \ - # install Expect man page -- $(INSTALL_DATA) $(srcdir)/expect.man $(mandir)/man1/expect.1 -+ $(INSTALL_DATA) $(srcdir)/expect.man $(DESTDIR)$(mandir)/man1/expect.1 - # install man page for Expect and Expectk libraries -- $(INSTALL_DATA) $(srcdir)/libexpect.man $(mandir)/man3/libexpect.3 -+ $(INSTALL_DATA) $(srcdir)/libexpect.man $(DESTDIR)$(mandir)/man3/libexpect.3 - -for i in $(SCRIPT_MANPAGE_LIST) ; do \ - if [ -f $(srcdir)/example/$$i.man ] ; then \ -- $(INSTALL_DATA) $(srcdir)/example/$$i.man $(mandir)/man1/$$i.1 ; \ -+ $(INSTALL_DATA) $(srcdir)/example/$$i.man $(DESTDIR)$(mandir)/man1/$$i.1 ; \ - else true; fi ; \ - done + PKG_CFLAGS = @PKG_CFLAGS@ -@@ -329,7 +329,7 @@ +@@ -331,7 +331,7 @@ pkgIndex.tcl-hand: (echo 'package ifneeded Expect $(PACKAGE_VERSION) \ @@ -68,7 +29,7 @@ ) > pkgIndex.tcl #======================================================================== -@@ -460,29 +460,30 @@ +@@ -552,29 +552,30 @@ #======================================================================== install-lib-binaries: @@ -108,7 +69,7 @@ @list='$(PKG_TCL_SOURCES)'; for p in $$list; do \ if test -f $(srcdir)/$$p; then \ destp=`basename $$p`; \ -@@ -521,7 +522,7 @@ +@@ -613,7 +614,7 @@ uninstall-binaries: list='$(lib_BINARIES)'; for p in $$list; do \ @@ -119,144 +80,21 @@ p=`basename $$p`; \ --- configure.in +++ configure.in -@@ -49,8 +49,8 @@ +@@ -49,9 +49,6 @@ TEA_PATH_TCLCONFIG TEA_LOAD_TCLCONFIG -TEA_PATH_TKCONFIG -TEA_LOAD_TKCONFIG -+# TEA_PATH_TKCONFIG -+# TEA_LOAD_TKCONFIG - +- #----------------------------------------------------------------------- # Handle the --prefix=... option by defaulting to what Tcl gave. -@@ -79,7 +79,8 @@ + # Must be called after TEA_LOAD_TCLCONFIG and before TEA_SETUP_COMPILER. +@@ -79,7 +76,6 @@ #TEA_PUBLIC_TCL_HEADERS TEA_PRIVATE_TCL_HEADERS -TEA_PUBLIC_TK_HEADERS -+#TEA_PUBLIC_TK_HEADERS -+AC_SUBST(TK_INCLUDES) #-------------------------------------------------------------------- # A few miscellaneous platform-specific items: ---- exp_main_tk.c -+++ exp_main_tk.c -@@ -36,6 +36,7 @@ - #undef USE_TCL_STUBS - - #include -+#include - - #include "tk.h" - ---- expect_cf.h.in -+++ expect_cf.h.in -@@ -4,7 +4,7 @@ - #ifndef __EXPECT_CF_H__ - #define __EXPECT_CF_H__ - --#undef NO_STDLIB_H /* Tcl requires this name */ -+#undef NO_STDLIB_H - #undef NO_UNION_WAIT - #undef HAVE_STDARG_H - #undef HAVE_VARARGS_H -@@ -12,12 +12,12 @@ - #undef HAVE_SYSCONF_H - #undef HAVE_SYS_FCNTL_H - #undef HAVE_SYS_WAIT_H --#undef HAVE_SYS_BSDTYPES_H /* nice ISC special */ --#undef HAVE_SYS_SELECT_H /* nice ISC special */ --#undef HAVE_SYS_TIME_H /* nice ISC special */ --#undef HAVE_SYS_PTEM_H /* SCO needs this for window size */ --#undef HAVE_STRREDIR_H /* Solaris needs this for console redir */ --#undef HAVE_STRPTY_H /* old-style Dynix ptys need this */ -+#undef HAVE_SYS_BSDTYPES_H -+#undef HAVE_SYS_SELECT_H -+#undef HAVE_SYS_TIME_H -+#undef HAVE_SYS_PTEM_H -+#undef HAVE_STRREDIR_H -+#undef HAVE_STRPTY_H - #undef HAVE_UNISTD_H - #undef HAVE_SYSMACROS_H - #undef HAVE_INTTYPES_H -@@ -26,8 +26,8 @@ - - #undef pid_t - #undef RETSIGTYPE --#undef TIME_WITH_SYS_TIME /* ok to include both time.h and sys/time.h */ --#undef SETPGRP_VOID /* if setpgrp takes 0 args */ -+#undef TIME_WITH_SYS_TIME -+#undef SETPGRP_VOID - - /* - * This section is for compile macros needed by -@@ -42,7 +42,7 @@ - #undef SIMPLE_EVENT - #undef HAVE_STRFTIME - #undef HAVE_MEMMOVE --#undef HAVE_TIMEZONE /* timezone() a la Pyramid */ -+#undef HAVE_TIMEZONE - #undef HAVE_SIGLONGJMP - #undef HAVE_STRCHR - ---- pty_termios.c -+++ pty_termios.c -@@ -7,6 +7,8 @@ - - */ - -+#define _XOPEN_SOURCE 1 /* for ptsname */ -+ - #include - #include - ---- tclconfig/tcl.m4 -+++ tclconfig/tcl.m4 -@@ -794,7 +794,7 @@ - # results, and the version is kept in special file). - - if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then -- system=MP-RAS-`awk '{print $3}' /etc/.relid'` -+ system=MP-RAS-`awk '{print $3}' /etc/.relid` - fi - if test "`uname -s`" = "AIX" ; then - system=AIX-`uname -v`.`uname -r` -@@ -2208,7 +2208,7 @@ - # results, and the version is kept in special file). - - if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then -- system=MP-RAS-`awk '{print $3}' /etc/.relid'` -+ system=MP-RAS-`awk '{print $3}' /etc/.relid` - fi - if test "`uname -s`" = "AIX" ; then - system=AIX-`uname -v`.`uname -r` ---- testsuite/configure.in -+++ testsuite/configure.in -@@ -1,12 +1,12 @@ - dnl Process this file with autoconf to produce a configure script. - AC_INIT(exp_test.c) - --CY_AC_PATH_TCLCONFIG --CY_AC_LOAD_TCLCONFIG -+TEA_PATH_TCLCONFIG -+TEA_LOAD_TCLCONFIG - CC=$TCL_CC - - AC_PROG_CC --CY_AC_C_WORKS -+#CY_AC_C_WORKS - - # This is for LynxOS, which needs a flag to force true POSIX when - # building. It's weirder than that, cause the flag varies depending -@@ -15,8 +15,8 @@ - # -mposix is for the new gcc (at least 2.5.8) - # This modifies the value of $CC to have the POSIX flag added - # so it'll configure correctly --CY_AC_TCL_LYNX_POSIX --CY_AC_PATH_TCLH -+#CY_AC_TCL_LYNX_POSIX -+#CY_AC_PATH_TCLH - - AC_SUBST(CC) - AC_SUBST(TCLHDIR) diff --git a/expect.spec b/expect.spec index c90d35e..a007466 100644 --- a/expect.spec +++ b/expect.spec @@ -1,36 +1,56 @@ # -# spec file for package expect (Version 5.43.0) +# spec file for package expect (Version 5.44.1.5) # -# Copyright (c) 2005 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany. # This file and all modifications and additions to the pristine # package are under the same license as the package itself. # -# Please submit bugfixes or comments via http://bugs.opensuse.org +# Please submit bugfixes or comments via http://bugs.opensuse.org/ # # norootforbuild -Name: expect -BuildRequires: tcl-devel -Version: 5.43.0 -Release: 5 -BuildRoot: %{_tmppath}/%{name}-%{version}-build -Group: Development/Tools/Building -License: distributable, Other License(s), see package -Summary: A Tool for Automating Interactive Programs -Autoreqprov: on -Source: %{name}-%{version}.tar.bz2 -Patch0: expect-CVS.patch.bz2 -Patch1: expect.patch -Patch2: expect-5.38.0-spawn-43310.patch -Patch3: expect-warnings.patch +Url: http://expect.nist.gov + +Name: expect +BuildRequires: tcl-devel +Version: 5.44.1.5 +Release: 1 +BuildRoot: %{_tmppath}/%{name}-%{version}-build +Group: Development/Languages/Tcl +License: Public Domain, Freeware +Summary: A Tool for Automating Interactive Programs +AutoReqProv: on +Source: %{name}-%{version}.tar.bz2 +Source1: expect-rpmlintrc +Patch1: expect.patch +Patch2: expect-fixes.patch +Patch3: expect-warnings.patch %description -Expect is a tool primarily for automating interactive applications such -as telnet, ftp, passwd, fsck, rlogin, tip, and more. Expect really -makes this stuff trivial. Expect is also useful for testing these -applications. It is described in many books, articles, papers, and -FAQs. There is an entire book on it available from O'Reilly. +Expect is a tool primarily for automating interactive applications, +such as telnet, ftp, passwd, fsck, rlogin, tip, and more. Expect +really makes this stuff trivial. Expect is also useful for testing +these applications. It is described in many books, articles, papers, +and FAQs. There is an entire book on it available from O'Reilly. + + + +Authors: +-------- + libes@nist.gov + +%package devel +Group: Development/Libraries/Tcl +Summary: Header Files and C API Documentation for expect + +%description devel +This package contains header files and documentation needed for linking +to expect from programs written in compiled languages like C, C++, etc. + +This package is not needed for developing scripts that run under the +/usr/bin/expect interpreter, or any other Tcl interpreter with the +expect package loaded. @@ -39,28 +59,28 @@ Authors: libes@nist.gov %prep -%setup -q -n %name-5.43 -%patch0 -p1 +%setup -q %patch1 -%patch2 -p2 +%patch2 %patch3 %build -%{?suse_update_config:%suse_update_config -f tclconfig} -autoreconf --force --include=tclconfig +autoreconf CFLAGS="%optflags" \ ./configure \ --prefix=%_prefix \ --libdir=%_libdir \ - --with-tclconfig=%_libdir \ + --with-tcl=%_libdir \ + --with-tk=no_tk \ --mandir=%_mandir \ --enable-shared make all + +%check make test %install # set the right path to the expect binary... -rm -rf %buildroot cd example for f in *; do sed -e '1s,^#![^ ]*expectk,#!/usr/bin/wish\npackage require Expect,' \ @@ -69,7 +89,7 @@ for f in *; do chmod a+x $f done cd .. -make DESTDIR=$RPM_BUILD_ROOT install +make DESTDIR=$RPM_BUILD_ROOT pkglibdir=%tclscriptdir/%name%version install # Remove some executables and manpages we don't want to ship rm $RPM_BUILD_ROOT%_prefix/bin/*passwd rm $RPM_BUILD_ROOT%_mandir/*/*passwd* @@ -80,68 +100,80 @@ rm -rf %buildroot %files %defattr(-,root,root) %{_prefix}/bin/* -%{_includedir}/* %{_libdir}/libexpect* %{_datadir}/tcl/expect* -%doc %{_mandir}/man?/* +%doc %{_mandir}/man1/* %doc ChangeLog HISTORY INSTALL FAQ NEWS README -%doc example -%changelog -n expect -* Wed Jan 25 2006 - mls@suse.de +%files devel +%defattr(-,root,root) +%{_includedir}/* +%doc %{_mandir}/man3/* + +%changelog +* Thu Mar 20 2008 max@suse.de +- Update to version 5.44.1.5 from CVS: + * Improved internal buffer management + * Ported script-level commands to the newer Tcl object API + * Optimized regular expression matching +- Split off a -devel subpackage +- Don't package the example subdir anymore. +- Fix all critical and part of the non-critical warnings that + show up with gcc 4.3. To be continued... +* Wed Jan 25 2006 mls@suse.de - converted neededforbuild to BuildRequires -* Tue Dec 13 2005 - max@suse.de +* Tue Dec 13 2005 max@suse.de - Fixed a typo in tcl.m4 that broke configure with bash 3.1. - Updated expect-CVS.patch.bz2 . -* Fri Sep 23 2005 - ro@suse.de +* Fri Sep 23 2005 ro@suse.de - fix some missing declarations -* Tue Jun 14 2005 - max@suse.de +* Tue Jun 14 2005 max@suse.de - New version: 5.43 plus patch to current CVS head. - Disabled building of the static library. - Moved script library to /usr/share/tcl . -* Tue Jul 13 2004 - max@suse.de +* Tue Jul 13 2004 max@suse.de - New version: 5.41. -* Mon Mar 01 2004 - max@suse.de +* Mon Mar 01 2004 max@suse.de - Re-enabled the test suite and added expect-send_tty.patch to prevent it from crashing. -* Fri Feb 27 2004 - max@suse.de +* Fri Feb 27 2004 max@suse.de - New version: 5.40 - Fixed warnings that broke build (expect-warnings.patch). - Temporarily disabled "make test" to prevent crashes in autobuild on some architectures (ppc, s390). -* Fri Oct 31 2003 - max@suse.de +* Fri Oct 31 2003 max@suse.de - New version: 5.39 - Buliding as non-root user -* Wed May 28 2003 - ro@suse.de +* Wed May 28 2003 ro@suse.de - package include files and static lib as well -* Tue Jan 28 2003 - max@suse.de +* Tue Jan 28 2003 max@suse.de - Fixed path to /usr/bin/write in kibitz. -* Fri Jan 10 2003 - max@suse.de +* Fri Jan 10 2003 max@suse.de - Fixed a segfault case during application shutdown, and sent the patch to the author. -* Tue Nov 26 2002 - max@suse.de +* Tue Nov 26 2002 max@suse.de - New version: 5.38 - Don't build the expectk binary anymore to remove the buildtime dependency on Tk and X. Scripts that needed to run in expectk before can be fixed by running them in expect and adding a line that says "package require Tk" before the first tk command is executed. -* Mon Aug 19 2002 - aj@suse.de +* Mon Aug 19 2002 aj@suse.de - Read all input from invoked program. -* Wed Apr 03 2002 - max@suse.de +* Wed Apr 03 2002 max@suse.de - Replaced autoreconf by autoconf because it breaks on autoconf-2.53 and was overkill anyways. -* Wed Feb 20 2002 - max@suse.de +* Wed Feb 20 2002 max@suse.de - Fixed for lib64-s390x. -* Thu Jan 24 2002 - max@suse.de +* Thu Jan 24 2002 max@suse.de - Removed the mkpasswd manpage due to a file name conflict and because the respective program is also not included. -* Fri Jan 18 2002 - max@suse.de +* Fri Jan 18 2002 max@suse.de - added tk to neededforbuild to prevent linking to static libtk which is included in tcl-devel -* Fri Jan 18 2002 - ro@suse.de +* Fri Jan 18 2002 ro@suse.de - fixed neededforbuild -* Thu Jan 17 2002 - max@suse.de +* Thu Jan 17 2002 max@suse.de - New version 5.34. - Separated this package from the tcl source RPM, because it doesn not any longer need the Tcl and Tk sources at hand.