blob: 7d211b3dff61e014998b6a3f8ea7d191e3eb0835 [file] [log] [blame]
Patrick Williams92b42cb2022-09-03 06:53:57 -05001From 904c7cf6647594939ce1e398468bca3c885f0622 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Mon, 15 Aug 2022 18:25:23 -0700
4Subject: [PATCH] Add prototype to function definitions
5
6Compilers like clang has started erroring out on implicit-function-declaration
7therefore arrange the relevant include files where needed.
8
9Upstream-Status: Submitted [https://sourceforge.net/p/expect/patches/24/]
10Signed-off-by: Khem Raj <raj.khem@gmail.com>
11---
12 exp_chan.c | 5 +++--
13 exp_clib.c | 4 +++-
14 exp_main_sub.c | 5 +++++
15 pty_termios.c | 4 ++++
16 4 files changed, 15 insertions(+), 3 deletions(-)
17
18diff --git a/exp_chan.c b/exp_chan.c
19index 79f486c..50375d3 100644
20--- a/exp_chan.c
21+++ b/exp_chan.c
22@@ -35,6 +35,7 @@
23 #include "exp_prog.h"
24 #include "exp_command.h"
25 #include "exp_log.h"
26+#include "exp_event.h" /* exp_background_channelhandler */
27 #include "tcldbg.h" /* Dbg_StdinMode */
28
29 extern int expSetBlockModeProc _ANSI_ARGS_((int fd, int mode));
30@@ -631,7 +632,7 @@ expWaitOnOne() {
31 }
32
33 void
34-exp_background_channelhandlers_run_all()
35+exp_background_channelhandlers_run_all(void)
36 {
37 ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
38 ExpState *esPtr;
39@@ -760,7 +761,7 @@ expCreateChannel(interp,fdin,fdout,pid)
40 }
41
42 void
43-expChannelInit() {
44+expChannelInit(void) {
45 ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
46
47 tsdPtr->channelCount = 0;
48diff --git a/exp_clib.c b/exp_clib.c
49index b21fb5d..8f31fc3 100644
50--- a/exp_clib.c
51+++ b/exp_clib.c
52@@ -9,13 +9,14 @@ would appreciate credit if this program or parts of it are used.
53
54 #include "expect_cf.h"
55 #include <stdio.h>
56+#include <unistd.h>
57 #include <setjmp.h>
58 #ifdef HAVE_INTTYPES_H
59 # include <inttypes.h>
60 #endif
61 #include <sys/types.h>
62 #include <sys/ioctl.h>
63-
64+#include <sys/wait.h>
65 #ifdef TIME_WITH_SYS_TIME
66 # include <sys/time.h>
67 # include <time.h>
68@@ -1738,6 +1739,7 @@ int exp_getptyslave();
69 #define sysreturn(x) return(errno = x, -1)
70
71 void exp_init_pty();
72+void exp_init_tty();
73
74 /*
75 The following functions are linked from the Tcl library. They
76diff --git a/exp_main_sub.c b/exp_main_sub.c
77index bf6c4be..f53b89e 100644
78--- a/exp_main_sub.c
79+++ b/exp_main_sub.c
80@@ -61,6 +61,11 @@ int exp_cmdlinecmds = FALSE;
81 int exp_interactive = FALSE;
82 int exp_buffer_command_input = FALSE;/* read in entire cmdfile at once */
83 int exp_fgets();
84+int exp_tty_cooked_echo(
85+ Tcl_Interp *interp,
86+ exp_tty *tty_old,
87+ int *was_raw,
88+ int *was_echo);
89
90 Tcl_Interp *exp_interp; /* for use by signal handlers who can't figure out */
91 /* the interpreter directly */
92diff --git a/pty_termios.c b/pty_termios.c
93index c605b23..80ed5e7 100644
94--- a/pty_termios.c
95+++ b/pty_termios.c
96@@ -7,6 +7,7 @@ would appreciate credit if you use this file or parts of it.
97
98 */
99
100+#include <pty.h> /* openpty */
101 #include <stdio.h>
102 #include <signal.h>
103
104@@ -15,6 +16,9 @@ would appreciate credit if you use this file or parts of it.
105 #endif
106
107 #include "expect_cf.h"
108+#include "tclInt.h"
109+
110+extern char * expErrnoMsg _ANSI_ARGS_((int));
111
112 /*
113 The following functions are linked from the Tcl library. They