1
Author: LaMont Jones <lamont@debian.org>
2
Description: Fix implicit definitions throughout (Closes: #441115).
4
diff -Naurp expect.orig/Dbg.c expect/Dbg.c
5
--- expect.orig/Dbg.c 2002-03-23 04:11:54.000000000 +0000
6
+++ expect/Dbg.c 2009-08-03 08:39:40.000000000 +0000
7
@@ -8,6 +8,7 @@ would appreciate credit if this program
15
diff -Naurp expect.orig/exp_chan.c expect/exp_chan.c
16
--- expect.orig/exp_chan.c 2009-08-03 08:39:25.000000000 +0000
17
+++ expect/exp_chan.c 2009-08-03 08:39:40.000000000 +0000
23
#include "exp_rename.h"
25
#include "exp_command.h"
26
+#include "exp_event.h"
29
static int ExpBlockModeProc _ANSI_ARGS_((ClientData instanceData,
30
diff -Naurp expect.orig/exp_clib.c expect/exp_clib.c
31
--- expect.orig/exp_clib.c 2009-08-03 08:39:25.000000000 +0000
32
+++ expect/exp_clib.c 2009-08-03 08:39:40.000000000 +0000
33
@@ -7,6 +7,8 @@ dollars. Therefore it is public domain.
34
would appreciate credit if this program or parts of it are used.
39
#include "expect_cf.h"
42
@@ -116,7 +118,9 @@ extern unsigned long strtoul _ANSI_ARGS_
43
#include <stdlib.h> /* for malloc */
48
+#include "exp_command.h"
49
#define TclRegError exp_TclRegError
52
@@ -1463,6 +1467,7 @@ TclGetRegError()
53
* end of regexp definitions and code
58
* following stolen from tcl8.0.4/generic/tclPosixStr.c
60
@@ -1919,6 +1924,7 @@ Tcl_ErrnoMsg(err)
67
* end of excerpt from tcl8.0.X/generic/tclPosixStr.c
68
diff -Naurp expect.orig/exp_command.c expect/exp_command.c
69
--- expect.orig/exp_command.c 2009-08-03 08:39:25.000000000 +0000
70
+++ expect/exp_command.c 2009-08-03 08:39:40.000000000 +0000
71
@@ -29,7 +29,6 @@ would appreciate credit if this program
79
@@ -64,6 +63,7 @@ would appreciate credit if this program
80
/* objects to including varargs.h twice, just */
86
#include "expect_tcl.h"
87
@@ -72,6 +72,7 @@ would appreciate credit if this program
88
#include "exp_command.h"
90
#include "exp_event.h"
91
+#include "exp_tty_in.h"
95
diff -Naurp expect.orig/exp_command.h expect/exp_command.h
96
--- expect.orig/exp_command.h 2009-08-03 08:39:25.000000000 +0000
97
+++ expect/exp_command.h 2009-08-03 08:39:40.000000000 +0000
98
@@ -7,6 +7,9 @@ dollars. Therefore it is public domain.
99
would appreciate credit if this program or parts of it are used.
102
+#ifndef __EXP_COMMAND_H
103
+#define __EXP_COMMAND_H
105
#ifdef HAVE_SYS_WAIT_H
106
/* ISC doesn't def WNOHANG unless _POSIX_SOURCE is def'ed */
107
# ifdef WNOHANG_REQUIRES_POSIX_SOURCE
108
@@ -23,7 +26,7 @@ would appreciate credit if this program
112
-#include <tclPort.h>
113
+#include "tclPort.h"
115
#define EXP_CHANNELNAMELEN (16 + TCL_INTEGER_SPACE)
117
@@ -89,11 +92,11 @@ typedef struct ExpState {
118
char name[EXP_CHANNELNAMELEN+1]; /* expect and interact set variables
119
to channel name, so for efficiency
121
- int fdin; /* input fd */
122
- int fdout; /* output fd - usually the same as fdin, although
123
+ long fdin; /* input fd - may be used for storing ClientData, a pointer */
124
+ long fdout; /* output fd - usually the same as fdin, although
125
may be different if channel opened by tcl::open */
126
Tcl_Channel channel_orig; /* If opened by someone else, i.e. tcl::open */
127
- int fd_slave; /* slave fd if "spawn -pty" used */
128
+ long fd_slave; /* slave fd if "spawn -pty" used */
130
/* this may go away if we find it is not needed */
131
/* it might be needed by inherited channels */
132
@@ -231,6 +234,7 @@ EXTERN void exp_init_trap _ANSI_ARGS_((
133
EXTERN void exp_init_send _ANSI_ARGS_((void));
134
EXTERN void exp_init_unit_random _ANSI_ARGS_((void));
135
EXTERN void exp_init_sig _ANSI_ARGS_((void));
136
+EXTERN void exp_ecmd_remove_state_direct_and_indirect _ANSI_ARGS_((Tcl_Interp *interp,ExpState *esPtr));
137
EXTERN void expChannelInit _ANSI_ARGS_((void));
138
EXTERN int expChannelCountGet _ANSI_ARGS_((void));
140
@@ -323,9 +327,13 @@ EXTERN void expExpectVarsInit _ANSI_ARG
141
EXTERN int expStateAnyIs _ANSI_ARGS_((ExpState *));
142
EXTERN int expDevttyIs _ANSI_ARGS_((ExpState *));
143
EXTERN int expStdinOutIs _ANSI_ARGS_((ExpState *));
144
+EXTERN int expStdinoutIs _ANSI_ARGS_((ExpState *esPtr));
145
EXTERN ExpState * expStdinoutGet _ANSI_ARGS_((void));
146
EXTERN ExpState * expDevttyGet _ANSI_ARGS_((void));
148
+EXTERN int Exp_StringCaseMatch _ANSI_ARGS_((char *string, char *pattern, int nocase, int *offset));
150
/* generic functions that really should be provided by Tcl */
151
EXTERN int expSizeGet _ANSI_ARGS_((ExpState *));
152
EXTERN int expSizeZero _ANSI_ARGS_((ExpState *));
153
+#endif /* __EXP_COMMAND_H */
154
diff -Naurp expect.orig/exp_glob.c expect/exp_glob.c
155
--- expect.orig/exp_glob.c 2002-03-23 04:11:54.000000000 +0000
156
+++ expect/exp_glob.c 2009-08-03 08:39:40.000000000 +0000
157
@@ -11,10 +11,17 @@ would appreciate credit if this program
163
#include "expect_cf.h"
167
+int Exp_StringCaseMatch2(
168
+ register CONST char *string,
169
+ register CONST char *pattern,
172
/* The following functions implement expect's glob-style string matching */
173
/* Exp_StringMatch allow's implements the unanchored front (or conversely */
174
/* the '^') feature. Exp_StringMatch2 does the rest of the work. */
175
diff -Naurp expect.orig/exp_inter.c expect/exp_inter.c
176
--- expect.orig/exp_inter.c 2004-08-18 02:03:00.000000000 +0000
177
+++ expect/exp_inter.c 2009-08-03 08:39:40.000000000 +0000
178
@@ -42,6 +42,7 @@ would appreciate credit if this program
179
#include "exp_rename.h"
180
#include "exp_prog.h"
181
#include "exp_command.h"
182
+#include "exp_event.h"
185
typedef struct ThreadSpecificData {
186
diff -Naurp expect.orig/exp_main_exp.c expect/exp_main_exp.c
187
--- expect.orig/exp_main_exp.c 2009-08-03 08:39:25.000000000 +0000
188
+++ expect/exp_main_exp.c 2009-08-03 08:39:40.000000000 +0000
189
@@ -12,6 +12,7 @@ would appreciate credit if this program
191
#include "expect_cf.h"
195
#include "expect_tcl.h"
197
diff -Naurp expect.orig/exp_main_sub.c expect/exp_main_sub.c
198
--- expect.orig/exp_main_sub.c 2009-08-03 08:39:25.000000000 +0000
199
+++ expect/exp_main_sub.c 2009-08-03 08:39:40.000000000 +0000
202
#include "expect_cf.h"
206
#ifdef HAVE_INTTYPES_H
207
# include <inttypes.h>
208
diff -Naurp expect.orig/exp_main_tk.c expect/exp_main_tk.c
209
--- expect.orig/exp_main_tk.c 2009-08-03 08:39:25.000000000 +0000
210
+++ expect/exp_main_tk.c 2009-08-03 08:39:40.000000000 +0000
211
@@ -38,11 +38,19 @@ static char sccsid[] = "@(#) tkAppInit.c
213
#include <string.h> /* strrchr(3) */
215
+#include "tclInt.h" /* Internal definitions for Tcl. */
221
#include "expect_tcl.h"
225
+#include "exp_command.h"
226
+#include "exp_log.h"
228
#if (TCL_MAJOR_VERSION < 8) || ((TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION < 4))
230
* The following variable is a special hack that is needed in order for
231
@@ -56,6 +64,8 @@ int *tclDummyMathPtr = (int *) matherr;
233
EXTERN int Tktest_Init _ANSI_ARGS_((Tcl_Interp *interp));
235
+int Tk_Init2(Tcl_Interp *interp);
239
*----------------------------------------------------------------------
240
@@ -386,7 +396,7 @@ Tk_Init2(interp)
241
* Invoke platform-specific initialization.
244
- code = TkpInit(interp, 0);
245
+ code = TkpInit(interp);
249
diff -Naurp expect.orig/exp_trap.c expect/exp_trap.c
250
--- expect.orig/exp_trap.c 2009-08-03 08:39:25.000000000 +0000
251
+++ expect/exp_trap.c 2009-08-03 08:39:40.000000000 +0000
252
@@ -28,6 +28,7 @@ would appreciate credit if this program
253
#include "exp_prog.h"
254
#include "exp_command.h"
256
+#include "exp_event.h"
260
diff -Naurp expect.orig/exp_tty.c expect/exp_tty.c
261
--- expect.orig/exp_tty.c 2004-05-07 16:23:26.000000000 +0000
262
+++ expect/exp_tty.c 2009-08-03 08:39:40.000000000 +0000
264
#include "exp_tty_in.h"
265
#include "exp_command.h"
267
+#include "exp_win.h"
269
static int is_raw = FALSE;
270
static int is_noecho = FALSE;
271
diff -Naurp expect.orig/exp_tty.h expect/exp_tty.h
272
--- expect.orig/exp_tty.h 2002-02-12 02:00:55.000000000 +0000
273
+++ expect/exp_tty.h 2009-08-03 08:39:40.000000000 +0000
274
@@ -21,6 +21,7 @@ void exp_tty_break();
275
int exp_tty_raw_noecho();
278
+EXTERN int exp_tty_cooked_echo _ANSI_ARGS_((Tcl_Interp *interp, exp_tty *tty_old, int *was_raw, int *was_echo));
281
int exp_tty_set_simple();
282
diff -Naurp expect.orig/exp_tty_in.h expect/exp_tty_in.h
283
--- expect.orig/exp_tty_in.h 2002-02-12 02:00:55.000000000 +0000
284
+++ expect/exp_tty_in.h 2009-08-03 08:39:40.000000000 +0000
286
#define __EXP_TTY_IN_H__
288
#include "expect_cf.h"
293
#include "sys/types.h"
294
diff -Naurp expect.orig/exp_win.c expect/exp_win.c
295
--- expect.orig/exp_win.c 2002-02-12 02:00:55.000000000 +0000
296
+++ expect/exp_win.c 2009-08-03 08:39:40.000000000 +0000
297
@@ -51,7 +51,8 @@ conflicts with sys/ioctl.h
298
# include <sys/ptem.h>
299
#endif /* HAVE_SYS_PTEM_H */
301
-#include "exp_tty.h"
303
+#include "exp_tty_in.h"
307
diff -Naurp expect.orig/exp_win.h expect/exp_win.h
308
--- expect.orig/exp_win.h 2002-02-12 02:00:56.000000000 +0000
309
+++ expect/exp_win.h 2009-08-03 08:39:40.000000000 +0000
313
/* exp_win.h - window support
315
Written by: Don Libes, NIST, 10/25/93
316
@@ -6,15 +8,17 @@ This file is in the public domain. Howe
317
would appreciate credit if you use this file or parts of it.
320
-int exp_window_size_set();
321
-int exp_window_size_get();
322
+EXTERN int exp_window_size_set _ANSI_ARGS_((int fd));
323
+EXTERN int exp_window_size_get _ANSI_ARGS_((int fd));
325
-void exp_win_rows_set();
326
-void exp_win_rows_get();
327
-void exp_win_columns_set();
328
-void exp_win_columns_get();
330
-void exp_win2_rows_set();
331
-void exp_win2_rows_get();
332
-void exp_win2_columns_set();
333
-void exp_win2_columns_get();
334
+EXTERN void exp_win_rows_set _ANSI_ARGS_((char *rows));
335
+EXTERN void exp_win_rows_get _ANSI_ARGS_((char *rows));
336
+EXTERN void exp_win_columns_set _ANSI_ARGS_((char *columns));
337
+EXTERN void exp_win_columns_get _ANSI_ARGS_((char *columns));
339
+EXTERN void exp_win2_rows_set _ANSI_ARGS_((int fd, char *rows));
340
+EXTERN void exp_win2_rows_get _ANSI_ARGS_((int fd, char *rows));
341
+EXTERN void exp_win2_columns_set _ANSI_ARGS_((int fd, char *columns));
342
+EXTERN void exp_win2_columns_get _ANSI_ARGS_((int fd, char *columns));
344
+#endif /* __EXP_WIN_H */
345
diff -Naurp expect.orig/expect.c expect/expect.c
346
--- expect.orig/expect.c 2009-08-03 08:39:25.000000000 +0000
347
+++ expect/expect.c 2009-08-03 08:39:40.000000000 +0000
348
@@ -10,6 +10,8 @@ would appreciate credit if this program
350
#include <sys/types.h>
356
#include <ctype.h> /* for isspace */
357
@@ -29,12 +31,13 @@ would appreciate credit if this program
362
+#include "exp_tty_in.h"
363
#include "exp_rename.h"
364
#include "exp_prog.h"
365
#include "exp_command.h"
367
#include "exp_event.h"
368
-#include "exp_tty.h"
369
#include "exp_tstamp.h" /* this should disappear when interact */
370
/* loses ref's to it */
372
diff -Naurp expect.orig/pty_termios.c expect/pty_termios.c
373
--- expect.orig/pty_termios.c 2009-08-03 08:39:25.000000000 +0000
374
+++ expect/pty_termios.c 2009-08-03 08:39:40.000000000 +0000
375
@@ -9,13 +9,18 @@ would appreciate credit if you use this
383
#if defined(SIGCLD) && !defined(SIGCHLD)
384
#define SIGCHLD SIGCLD
388
#include "expect_cf.h"
391
+#include "exp_tty_in.h"
392
#include "exp_int.h" /* expErrnoMsg() prototype */
395
@@ -98,7 +103,6 @@ with openpty which supports 4000 while p
399
-#include "exp_tty_in.h"
400
#include "exp_rename.h"
403
@@ -368,7 +372,7 @@ exp_init_pty()
407
-static int ttyname_checked(int fd) {
408
+static char * ttyname_checked(int fd) {