annotate src/mingw-texinfo-1-fixes.patch @ 3609:360eff7d9c06

texinfo: compile native info when native target. * src/mingw-texinfo-1-fixes.patch: define sleep in mingw. * src/texinfo.mk: only build tools libs for cross build ginfo when doing cross build.
author John Donoghue
date Mon, 09 Jun 2014 08:11:22 -0400
parents 4e90544559a3
children 28a83a566666
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3587
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
1 diff -ur texinfo-4.13.orig/info/man.c texinfo-4.13/info/man.c
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
2 --- texinfo-4.13.orig/info/man.c 2014-04-24 13:39:35.918682762 -0400
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
3 +++ texinfo-4.13/info/man.c 2014-04-24 13:40:33.385768723 -0400
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
4 @@ -20,7 +20,9 @@
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
5 Originally written by Brian Fox Thu May 4 09:17:52 1995. */
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
6
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
7 #include "info.h"
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
8 +#if defined (HAVE_SYS_IOCTL_H)
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
9 #include <sys/ioctl.h>
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
10 +#endif
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
11 #include "signals.h"
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
12 #if defined (HAVE_SYS_TIME_H)
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
13 #include <sys/time.h>
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
14 diff -ur texinfo-4.13.orig/info/pcterm.c texinfo-4.13/info/pcterm.c
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
15 --- texinfo-4.13.orig/info/pcterm.c 2014-04-24 13:39:35.917682743 -0400
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
16 +++ texinfo-4.13/info/pcterm.c 2014-04-24 13:44:02.643696094 -0400
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
17 @@ -717,7 +717,7 @@
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
18 }
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
19
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
20 /* These should never be called, but they make the linker happy. */
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
21 -
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
22 +#ifndef __MINGW32__
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
23 void tputs (char *a, int b, int (*c)())
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
24 {
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
25 perror ("tputs");
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
26 @@ -757,3 +757,4 @@
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
27 {
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
28 perror ("tcsetattr"); return 0;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
29 }
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
30 +#endif
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
31 diff -ur texinfo-4.13.orig/info/session.c texinfo-4.13/info/session.c
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
32 --- texinfo-4.13.orig/info/session.c 2014-04-24 13:39:35.917682743 -0400
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
33 +++ texinfo-4.13/info/session.c 2014-04-24 13:41:43.144087140 -0400
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
34 @@ -21,7 +21,9 @@
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
35
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
36 #include "info.h"
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
37 #include "search.h"
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
38 +#if defined (HAVE_SYS_IOCTL_H)
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
39 #include <sys/ioctl.h>
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
40 +#endif
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
41
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
42 #if defined (HAVE_SYS_TIME_H)
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
43 # include <sys/time.h>
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
44 diff -ur texinfo-4.13.orig/info/search.c texinfo-4.13/info/search.c
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
45 --- texinfo-4.13.orig/info/search.c 2014-04-24 13:51:21.592277409 -0400
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
46 +++ texinfo-4.13/info/search.c 2014-04-24 13:52:53.217898167 -0400
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
47 @@ -20,7 +20,14 @@
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
48 Originally written by Brian Fox (bfox@ai.mit.edu). */
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
49
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
50 #include "info.h"
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
51 -#include <regex.h>
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
52 +
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
53 +#ifndef __MINGW32__
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
54 + #include <regex.h>
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
55 +#else
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
56 + // using pcre
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
57 + #include <pcre.h>
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
58 + #include <pcreposix.h>
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
59 +#endif
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
60
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
61 #include "search.h"
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
62 #include "nodes.h"
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
63 diff -ur texinfo-4.13.orig/info/termdep.h texinfo-4.13/info/termdep.h
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
64 --- texinfo-4.13.orig/info/termdep.h 2014-04-24 13:55:42.343917317 -0400
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
65 +++ texinfo-4.13/info/termdep.h 2014-04-24 13:56:31.331797804 -0400
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
66 @@ -43,7 +43,9 @@
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
67 # endif /* M_XENIX */
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
68 # endif /* HAVE_SYS_PTEM_H */
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
69 # else /* !HAVE_TERMIO_H */
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
70 +#ifndef __MINGW32__
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
71 # include <sgtty.h>
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
72 +#endif
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
73 # endif /* !HAVE_TERMIO_H */
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
74 #endif /* !HAVE_TERMIOS_H */
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
75
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
76 diff -ur texinfo-4.13.orig/info/terminal.c texinfo-4.13/info/terminal.c
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
77 --- texinfo-4.13.orig/info/terminal.c 2014-04-24 13:55:42.344917335 -0400
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
78 +++ texinfo-4.13/info/terminal.c 2014-04-24 14:17:33.962456844 -0400
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
79 @@ -572,7 +572,9 @@
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
80 ospeed = B9600;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
81 }
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
82 # else
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
83 +#ifndef __MINGW32__
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
84 ospeed = B9600;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
85 +#endif
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
86 # endif /* !TIOCGETP */
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
87 #endif
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
88
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
89 @@ -663,7 +665,9 @@
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
90 /* Buffers containing the terminal mode flags upon entry to info. */
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
91 int original_tty_flags = 0;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
92 int original_lmode;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
93 +#ifndef __MINGW32__
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
94 struct sgttyb ttybuff;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
95 +#endif
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
96
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
97 # if defined(TIOCGETC) && defined(M_XENIX)
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
98 /* SCO 3.2v5.0.2 defines but does not support TIOCGETC. Gak. Maybe
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
99 @@ -758,7 +762,7 @@
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
100 # endif
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
101 #endif
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
102
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
103 -#if !defined (HAVE_TERMIOS_H) && !defined (HAVE_TERMIO_H)
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
104 +#if !defined (HAVE_TERMIOS_H) && !defined (HAVE_TERMIO_H) && !defined(__MINGW32__)
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
105 ioctl (tty, TIOCGETP, &ttybuff);
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
106
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
107 if (!original_tty_flags)
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
108 @@ -818,10 +822,11 @@
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
109 ioctl (tty, TIOCSLTC, &temp);
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
110 }
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
111 # endif /* TIOCGLTC */
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
112 -
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
113 +#ifndef __MINGW32__
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
114 ttybuff.sg_flags &= ~ECHO;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
115 ttybuff.sg_flags |= CBREAK;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
116 ioctl (tty, TIOCSETN, &ttybuff);
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
117 +#endif
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
118 #endif /* !HAVE_TERMIOS_H && !HAVE_TERMIO_H */
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
119 }
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
120
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
121 @@ -846,9 +851,11 @@
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
122 # if defined (HAVE_TERMIO_H)
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
123 ioctl (tty, TCSETA, &original_termio);
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
124 # else /* !HAVE_TERMIO_H */
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
125 +#ifndef __MINGW32__
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
126 ioctl (tty, TIOCGETP, &ttybuff);
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
127 ttybuff.sg_flags = original_tty_flags;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
128 ioctl (tty, TIOCSETN, &ttybuff);
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
129 +#endif
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
130
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
131 # if defined (TIOCGETC)
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
132 ioctl (tty, TIOCSETC, &original_tchars);
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
133 @@ -867,6 +874,6 @@
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
134 terminal_end_using_terminal ();
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
135 }
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
136
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
137 -#ifdef __MSDOS__
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
138 +#if defined(__MSDOS__) || defined(__MINGW32__)
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
139 # include "pcterm.c"
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
140 #endif
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
141 diff -ur texinfo-4.13.orig/info/pcterm.c texinfo-4.13/info/pcterm.c
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
142 --- texinfo-4.13.orig/info/pcterm.c 2014-04-24 14:19:51.514087212 -0400
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
143 +++ texinfo-4.13/info/pcterm.c 2014-04-24 14:42:21.295014635 -0400
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
144 @@ -24,6 +24,7 @@
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
145
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
146 /* intl/libintl.h defines a macro `gettext' which
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
147 conflicts with conio.h header. */
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
148 +#ifdef __MSDOS__
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
149 #ifdef gettext
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
150 # undef gettext
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
151 # define gettext _gettext
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
152 @@ -32,6 +33,42 @@
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
153 #include <pc.h>
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
154 #include <keys.h>
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
155 #include <conio.h>
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
156 +#endif
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
157 +
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
158 +#ifdef _WIN32
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
159 +#include <io.h>
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
160 +#include <conio.h>
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
161 +#include <process.h>
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
162 +#include <windows.h>
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
163 +
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
164 +struct text_info {
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
165 + WORD normattr;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
166 + WORD attribute;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
167 + SHORT winleft;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
168 + SHORT wintop;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
169 + SHORT winright;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
170 + SHORT winbottom;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
171 + SHORT screenheight;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
172 + SHORT screenwidth;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
173 + SHORT curx;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
174 + SHORT cury;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
175 + COORD bufsize;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
176 + unsigned char currmode; /* unused and unsupported for Windows */
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
177 +};
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
178 +
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
179 +struct termios {
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
180 + int dummy;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
181 +};
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
182 +
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
183 +enum text_modes { LASTMODE=-1 };
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
184 +
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
185 +#define cprintf _cprintf
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
186 +#define cputs _cputs
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
187 +
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
188 +#undef read
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
189 +#undef _read
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
190 +
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
191 +#endif
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
192
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
193 #include "variables.h"
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
194
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
195 @@ -44,10 +81,511 @@
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
196 /* **************************************************************** */
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
197
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
198 static struct text_info outside_info; /* holds screen params outside Info */
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
199 +#ifdef _WIN32
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
200 +static SHORT norm_attr, inv_attr;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
201 +static SHORT current_attr;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
202 +static HANDLE hstdin = INVALID_HANDLE_VALUE;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
203 +static HANDLE hstdout = INVALID_HANDLE_VALUE;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
204 +static HANDLE hinfo = INVALID_HANDLE_VALUE;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
205 +static HANDLE hscreen = INVALID_HANDLE_VALUE;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
206 +static DWORD old_inpmode;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
207 +#else
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
208 static unsigned char norm_attr, inv_attr;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
209 -
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
210 +#endif
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
211 static unsigned const char * find_sequence (int);
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
212
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
213 +#ifdef _WIN32
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
214 +
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
215 +/* Windows-specific initialization and de-initialization. */
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
216 +void
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
217 +w32_info_prep (void)
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
218 +{
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
219 + SetConsoleActiveScreenBuffer (hinfo);
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
220 + current_attr = norm_attr;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
221 + hscreen = hinfo;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
222 + SetConsoleMode (hstdin, ENABLE_WINDOW_INPUT);
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
223 +}
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
224 +
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
225 +void
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
226 +w32_info_unprep (void)
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
227 +{
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
228 + SetConsoleActiveScreenBuffer (hstdout);
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
229 + current_attr = outside_info.normattr;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
230 + hscreen = hstdout;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
231 + SetConsoleMode (hstdin, old_inpmode);
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
232 +}
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
233 +
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
234 +void
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
235 +w32_cleanup (void)
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
236 +{
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
237 + CloseHandle (hinfo);
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
238 +}
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
239 +
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
240 +static void w32_info_init (void) __attribute__((constructor));
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
241 +static void pc_initialize_terminal (char *);
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
242 +
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
243 +static void
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
244 +w32_info_init (void)
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
245 +{
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
246 + /* We need to set this single hook here; the rest
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
247 + * will be set by pc_initialize_terminal when it is called. */
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
248 + terminal_initialize_terminal_hook = pc_initialize_terminal;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
249 +}
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
250 +
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
251 +/* Emulate DJGPP conio functions for Windows. */
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
252 +static void
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
253 +gettextinfo (struct text_info *ti)
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
254 +{
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
255 + CONSOLE_SCREEN_BUFFER_INFO csbi;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
256 + static TCHAR errbuf[500];
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
257 +
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
258 + hstdin = GetStdHandle (STD_INPUT_HANDLE);
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
259 + hstdout = GetStdHandle (STD_OUTPUT_HANDLE);
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
260 + hinfo = CreateConsoleScreenBuffer (GENERIC_READ | GENERIC_WRITE,
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
261 + FILE_SHARE_READ | FILE_SHARE_WRITE,
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
262 + NULL, CONSOLE_TEXTMODE_BUFFER, NULL);
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
263 +
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
264 + if (hstdin != INVALID_HANDLE_VALUE
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
265 + && hstdout != INVALID_HANDLE_VALUE
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
266 + && hinfo != INVALID_HANDLE_VALUE
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
267 + && GetConsoleMode (hstdin, &old_inpmode)
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
268 + && GetConsoleScreenBufferInfo (hstdout, &csbi))
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
269 + {
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
270 + ti->normattr = csbi.wAttributes;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
271 + ti->winleft = 1;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
272 + ti->wintop = 1;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
273 + ti->winright = csbi.srWindow.Right + 1;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
274 + ti->winbottom = csbi.srWindow.Bottom - csbi.srWindow.Top + 1;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
275 + ti->attribute = csbi.wAttributes;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
276 + ti->screenheight = csbi.srWindow.Bottom - csbi.srWindow.Top + 1;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
277 + ti->screenwidth = csbi.srWindow.Right - csbi.srWindow.Left + 1;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
278 + ti->curx = csbi.dwCursorPosition.X;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
279 + ti->cury = csbi.dwCursorPosition.Y;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
280 + ti->bufsize = csbi.dwSize;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
281 +
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
282 +
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
283 + atexit (w32_cleanup);
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
284 + }
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
285 + else
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
286 + {
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
287 + DWORD error_no = GetLastError ();
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
288 +
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
289 + if (!FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM, NULL,
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
290 + error_no,
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
291 + 0, /* choose most suitable language */
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
292 + errbuf, sizeof (errbuf), NULL))
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
293 + sprintf (errbuf, "w32 error %u", error_no);
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
294 + CloseHandle (hinfo);
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
295 + info_error (_("Terminal cannot be initialized: %s\n"), errbuf, NULL);
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
296 + exit (1);
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
297 + }
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
298 +}
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
299 +
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
300 +void
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
301 +textattr (int attr)
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
302 +{
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
303 + SetConsoleTextAttribute (hscreen, attr);
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
304 +}
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
305 +
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
306 +void
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
307 +textmode (int mode)
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
308 +{
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
309 + /* Nothing. */
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
310 +}
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
311 +
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
312 +void
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
313 +ScreenGetCursor (int *row, int *col)
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
314 +{
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
315 + CONSOLE_SCREEN_BUFFER_INFO csbi;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
316 +
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
317 + GetConsoleScreenBufferInfo (hscreen, &csbi);
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
318 + *row = csbi.dwCursorPosition.Y;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
319 + *col = csbi.dwCursorPosition.X;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
320 +}
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
321 +
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
322 +void
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
323 +ScreenSetCursor (int row, int col)
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
324 +{
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
325 + COORD cursor_pos;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
326 +
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
327 + cursor_pos.X = col;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
328 + cursor_pos.Y = row;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
329 +
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
330 + SetConsoleCursorPosition (hscreen, cursor_pos);
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
331 +}
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
332 +
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
333 +void
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
334 +ScreenClear (void)
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
335 +{
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
336 + DWORD nchars = screenwidth * screenheight;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
337 + COORD start_pos;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
338 + DWORD written;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
339 +
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
340 + start_pos.X = start_pos.Y = 0;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
341 + FillConsoleOutputAttribute (hscreen, norm_attr, nchars, start_pos, &written);
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
342 + FillConsoleOutputCharacter (hscreen, ' ', nchars, start_pos, &written);
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
343 +}
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
344 +void
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
345 +clreol (void)
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
346 +{
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
347 + DWORD nchars;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
348 + COORD start_pos;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
349 + DWORD written;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
350 + CONSOLE_SCREEN_BUFFER_INFO csbi;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
351 +
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
352 + GetConsoleScreenBufferInfo (hscreen, &csbi);
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
353 + start_pos = csbi.dwCursorPosition;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
354 + nchars = csbi.dwSize.X - start_pos.X;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
355 +
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
356 + FillConsoleOutputAttribute (hscreen, current_attr, nchars, start_pos,
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
357 + &written);
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
358 + FillConsoleOutputCharacter (hscreen, ' ', nchars, start_pos, &written);
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
359 +}
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
360 +
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
361 +void
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
362 +ScreenVisualBell (void)
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
363 +{
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
364 + DWORD nchars = screenwidth * screenheight;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
365 + COORD start_pos;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
366 + DWORD written;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
367 +
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
368 + start_pos.X = start_pos.Y = 0;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
369 + FillConsoleOutputAttribute (hscreen, inv_attr, nchars, start_pos, &written);
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
370 + Sleep (20);
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
371 + FillConsoleOutputAttribute (hscreen, norm_attr, nchars, start_pos, &written);
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
372 +}
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
373 +
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
374 +int
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
375 +movetext(int left, int top, int right, int bottom, int destleft, int desttop)
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
376 +{
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
377 + SMALL_RECT src;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
378 + COORD dest;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
379 + CHAR_INFO fill;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
380 +
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
381 + src.Left = left - 1;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
382 + src.Top = top - 1;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
383 + src.Right = right - 1;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
384 + src.Bottom = bottom - 1;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
385 +
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
386 + dest.X = destleft - 1;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
387 + dest.Y = desttop - 1;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
388 +
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
389 + fill.Attributes = norm_attr;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
390 + fill.Char.AsciiChar = (CHAR)' ';
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
391 +
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
392 + return ScrollConsoleScreenBuffer (hscreen, &src , NULL, dest, &fill) != 0;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
393 +}
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
394 +
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
395 +int
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
396 +ScreenRows (void)
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
397 +{
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
398 + CONSOLE_SCREEN_BUFFER_INFO csbi;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
399 +
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
400 + GetConsoleScreenBufferInfo (hscreen, &csbi);
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
401 + return csbi.srWindow.Bottom - csbi.srWindow.Top + 1;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
402 +}
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
403 +int
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
404 +ScreenCols (void)
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
405 +{
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
406 + CONSOLE_SCREEN_BUFFER_INFO csbi;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
407 +
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
408 + GetConsoleScreenBufferInfo (hscreen, &csbi);
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
409 + return csbi.srWindow.Right - csbi.srWindow.Left + 1;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
410 +}
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
411 +
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
412 +void
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
413 +_set_screen_lines (int lines)
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
414 +{
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
415 + SMALL_RECT window_rectangle;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
416 + CONSOLE_SCREEN_BUFFER_INFO csbi;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
417 + COORD scrbufsize;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
418 +
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
419 + GetConsoleScreenBufferInfo (hscreen, &csbi);
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
420 +
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
421 + window_rectangle = csbi.srWindow;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
422 + window_rectangle.Bottom = window_rectangle.Top + lines - 1;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
423 + SetConsoleWindowInfo (hscreen, TRUE, &window_rectangle);
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
424 +
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
425 + /* Set the screen buffer size to the same dimensions as the window,
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
426 + * so that the dysfunctional scroll bar disappears. */
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
427 + scrbufsize.X = window_rectangle.Right - window_rectangle.Left + 1;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
428 + scrbufsize.Y = window_rectangle.Bottom - window_rectangle.Top + 1;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
429 + SetConsoleScreenBufferSize (hscreen, scrbufsize);
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
430 +}
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
431 +
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
432 +void
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
433 +w32_set_screen_dimensions (int cols, int rows)
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
434 +{
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
435 + SMALL_RECT window_rectangle;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
436 + CONSOLE_SCREEN_BUFFER_INFO csbi;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
437 +
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
438 + GetConsoleScreenBufferInfo (hscreen, &csbi);
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
439 +
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
440 + window_rectangle = csbi.srWindow;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
441 + window_rectangle.Bottom = window_rectangle.Top + rows - 1;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
442 + window_rectangle.Right = window_rectangle.Left + cols - 1;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
443 + SetConsoleWindowInfo (hscreen, TRUE, &window_rectangle);
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
444 +}
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
445 +
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
446 +/* Emulate `sleep'. */
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
447 +unsigned
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
448 +sleep (unsigned sec)
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
449 +{
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
450 + Sleep (sec*1000);
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
451 + return 0;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
452 +}
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
453 +
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
454 +/* Keyboard input support. */
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
455 +
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
456 +static int
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
457 +w32_our_tty (int fd)
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
458 +{
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
459 + return
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
460 + isatty (fd)
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
461 + /* Windows `isatty' actually tests for character devices, so the
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
462 + null device gets reported as a tty. Fix that by calling
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
463 + `lseek'. */
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
464 + && lseek (fd, SEEK_CUR, 0) == -1
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
465 + /* Is this our tty? */
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
466 + && hstdin != INVALID_HANDLE_VALUE
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
467 + && hstdin == (HANDLE)_get_osfhandle (fd);
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
468 +}
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
469 +
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
470 +/* Translate a Windows key event into the equivalent sequence of bytes
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
471 + to be submitted to Info dispatcher. */
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
472 +#define define_seq(p,s1,s2) \
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
473 + do { \
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
474 + if ((ctl & (LEFT_CTRL_PRESSED | RIGHT_CTRL_PRESSED)) != 0) \
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
475 + memcpy (p, s1, sizeof (s1)), p += sizeof (s1) - 1; \
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
476 + else \
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
477 + memcpy (p, s2, sizeof (s2)), p += sizeof (s2) - 1; \
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
478 + } while (0)
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
479 +
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
480 +static int
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
481 +w32keyseq (unsigned char ascii_ch, WORD vkey, DWORD ctl, unsigned char *seq)
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
482 +{
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
483 + unsigned char *p = seq;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
484 +
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
485 + switch (ascii_ch)
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
486 + {
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
487 + case '\0':
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
488 + /* Keys with no ASCII code are extended keys, like arrows. */
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
489 + switch (vkey)
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
490 + {
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
491 + case VK_PRIOR:
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
492 + define_seq (p, "\033\061p", "\033v");
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
493 + break;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
494 + case VK_NEXT:
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
495 + define_seq (p, "\033\061n", "\026");
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
496 + break;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
497 + case VK_END:
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
498 + define_seq (p, "\033>", "\033>");
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
499 + break;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
500 + case VK_HOME:
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
501 + define_seq (p, "\033<", "\033<");
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
502 + break;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
503 + case VK_LEFT:
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
504 + define_seq (p, "\033b", "\033[D");
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
505 + break;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
506 + case VK_UP:
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
507 + define_seq (p, "\033\061u", "\033[A");
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
508 + break;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
509 + case VK_RIGHT:
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
510 + define_seq (p, "\033f", "\033[C");
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
511 + break;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
512 + case VK_DOWN:
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
513 + define_seq (p, "\033\061m", "\033[B");
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
514 + break;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
515 + case VK_INSERT:
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
516 + define_seq (p, "\033[L", "\033[L");
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
517 + break;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
518 + case VK_DELETE: /* Delete => Ctrl-d, Alt-Delete => ESC d */
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
519 + if ((ctl & (LEFT_ALT_PRESSED | RIGHT_ALT_PRESSED)) != 0)
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
520 + define_seq (p, "\033d", "\033d");
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
521 + else
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
522 + define_seq (p, "\033d", "\004");
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
523 + break;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
524 + case VK_F1:
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
525 + *p++ = '\010';
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
526 + break;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
527 + case 50: /* Ctrl-@ => '\0' */
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
528 + if ((ctl & SHIFT_PRESSED) != 0)
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
529 + *p++ = '\0';
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
530 + break;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
531 + default:
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
532 + if (0x41 <= vkey && vkey <= 0x5a)
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
533 + {
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
534 + /* Alt-Ctrl-a, Alt-Ctrl-b, etc. */
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
535 + *p++ = '\033';
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
536 + *p++ = '\001' + vkey - 0x41;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
537 + }
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
538 + }
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
539 + break;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
540 + case ' ': /* Ctrl-SPC => '\0' */
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
541 + if ((ctl & (LEFT_CTRL_PRESSED | RIGHT_CTRL_PRESSED)) != 0)
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
542 + ascii_ch = '\0';
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
543 + *p++ = ascii_ch;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
544 + break;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
545 + case '\t': /* Shift-TAB/Alt-TAB => Esc-TAB */
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
546 + if ((ctl & (SHIFT_PRESSED | LEFT_ALT_PRESSED | RIGHT_ALT_PRESSED)) != 0)
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
547 + {
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
548 + memcpy (p, "\033\011", sizeof ("\033\011"));
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
549 + p += sizeof ("\033\011") - 1;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
550 + }
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
551 + else
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
552 + *p++ = '\t';
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
553 + break;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
554 + case '\b':
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
555 + /* Backspace => DEL. */
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
556 + ascii_ch = '\177';
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
557 + /* FALLTHROUGH */
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
558 + default:
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
559 + if ((ctl & (LEFT_ALT_PRESSED | RIGHT_ALT_PRESSED)) != 0)
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
560 + *p++ = '\033';
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
561 + *p++ = ascii_ch;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
562 + break;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
563 + }
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
564 + return p - seq;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
565 +}
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
566 +
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
567 +static unsigned char buffered_chars[512];
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
568 +static size_t buf_head;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
569 +static size_t buf_tail;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
570 +
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
571 +static ssize_t
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
572 +w32_kbd_read (unsigned char *inbuf, size_t n)
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
573 +{
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
574 + DWORD nevents, nread;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
575 + INPUT_RECORD inrec;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
576 + ssize_t nret = 0;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
577 +
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
578 + do {
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
579 +
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
580 + /* Stuff any unread buffered characters. */
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
581 + while (buf_head < buf_tail && n > 0)
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
582 + {
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
583 + *inbuf++ = buffered_chars[buf_head++];
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
584 + nret++;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
585 + n--;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
586 + }
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
587 + if (n <= 0)
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
588 + break;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
589 +
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
590 + /* Wait for input. */
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
591 + while (GetNumberOfConsoleInputEvents (hstdin, &nevents)
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
592 + && nevents < 1)
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
593 + Sleep (20);
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
594 +
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
595 + while (nevents-- && n > 0)
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
596 + {
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
597 + if (!ReadConsoleInput (hstdin, &inrec, 1, &nread))
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
598 + return -1;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
599 +
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
600 + if (nread > 0)
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
601 + {
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
602 + switch (inrec.EventType)
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
603 + {
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
604 + case KEY_EVENT:
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
605 + if (inrec.Event.KeyEvent.bKeyDown == TRUE
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
606 + && !(inrec.Event.KeyEvent.wVirtualScanCode == 0
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
607 + || inrec.Event.KeyEvent.wVirtualKeyCode == VK_SHIFT
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
608 + || inrec.Event.KeyEvent.wVirtualKeyCode == VK_CONTROL
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
609 + || inrec.Event.KeyEvent.wVirtualKeyCode == VK_MENU))
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
610 + {
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
611 + unsigned char keyseq[10];
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
612 + int count = inrec.Event.KeyEvent.wRepeatCount;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
613 + unsigned char ch = inrec.Event.KeyEvent.uChar.AsciiChar;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
614 + WORD vkey = inrec.Event.KeyEvent.wVirtualKeyCode;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
615 + DWORD ctl_state = inrec.Event.KeyEvent.dwControlKeyState;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
616 + int nbytes = w32keyseq (ch, vkey, ctl_state, keyseq);
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
617 +
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
618 + /* Supply up to N characters to the caller. */
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
619 + while (count && n >= nbytes)
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
620 + {
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
621 + if (nbytes == 1 && keyseq[0] == '\032')
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
622 + {
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
623 + terminal_goto_xy (0, screenheight - 1);
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
624 + terminal_clear_to_eol ();
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
625 + fflush (stdout);
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
626 + terminal_unprep_terminal ();
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
627 + kill (getpid (), 0);
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
628 + terminal_prep_terminal ();
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
629 + reset_info_window_sizes ();
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
630 + }
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
631 + else
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
632 + {
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
633 + memcpy (&inbuf[nret], keyseq, nbytes);
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
634 + nret += nbytes;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
635 + n -= nbytes;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
636 + }
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
637 + count--;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
638 + }
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
639 + /* Buffer the rest. */
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
640 + if (count > 0)
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
641 + {
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
642 + buf_head = buf_tail = 0;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
643 + while (count--
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
644 + && buf_tail < sizeof(buffered_chars) - nbytes)
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
645 + {
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
646 + memcpy (&buffered_chars[buf_tail], keyseq, nbytes);
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
647 + buf_tail += nbytes;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
648 + }
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
649 + }
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
650 + }
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
651 + break;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
652 + case WINDOW_BUFFER_SIZE_EVENT:
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
653 + {
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
654 + int rows, cols;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
655 +
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
656 + /* Note: this event is only sent when the console
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
657 + window's _screen_buffer_ size is changed via
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
658 + the Properties->Layout dialog. */
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
659 + cols = inrec.Event.WindowBufferSizeEvent.dwSize.X;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
660 + rows = inrec.Event.WindowBufferSizeEvent.dwSize.Y;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
661 + screenwidth = cols;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
662 + screenheight = rows;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
663 + w32_set_screen_dimensions (cols, rows);
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
664 + display_initialize_display (screenwidth, screenheight);
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
665 + window_new_screen_size (screenwidth, screenheight);
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
666 + redisplay_after_signal ();
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
667 + }
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
668 + break;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
669 + default:
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
670 + break;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
671 + }
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
672 + }
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
673 + }
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
674 + } while (n > 0);
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
675 + return nret;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
676 +}
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
677 +long
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
678 +w32_chars_avail (int fd)
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
679 +{
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
680 + if (w32_our_tty (fd))
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
681 + return buf_tail - buf_head;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
682 + else
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
683 + {
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
684 + struct stat st;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
685 +
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
686 + if (fstat (fd, &st) < 0)
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
687 + return 1;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
688 + else
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
689 + return st.st_size;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
690 + }
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
691 +}
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
692 +
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
693 +ssize_t
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
694 +w32_read (int fd, void *buf, size_t n)
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
695 +{
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
696 + if (w32_our_tty (fd))
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
697 + return w32_kbd_read (buf, n);
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
698 + else
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
699 + return _read (fd, buf, n);
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
700 +}
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
701 +
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
702 +#endif /* _WIN32 */
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
703 +
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
704 +
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
705 /* Turn on reverse video. */
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
706 static void
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
707 pc_begin_inverse (void)
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
708 @@ -192,6 +730,11 @@
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
709 {
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
710 int tty;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
711
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
712 +#ifdef _WIN32
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
713 + w32_info_prep ();
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
714 +#endif
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
715 +
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
716 +
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
717 /* Do not set screen height if we already have it, because
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
718 doing so erases the screen. */
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
719 if (screenheight != ScreenRows ())
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
720 @@ -221,6 +764,11 @@
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
721 {
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
722 int tty;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
723
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
724 +#ifdef _WIN32
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
725 + w32_info_unprep ();
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
726 +#endif
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
727 +
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
728 +
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
729 textattr (outside_info.normattr);
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
730
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
731 /* Do not set screen height if we already have it, because
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
732 @@ -230,8 +778,14 @@
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
733 _set_screen_lines (outside_info.screenheight);
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
734 textmode (LASTMODE);
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
735 }
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
736 +#ifdef __MSDOS__
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
737 else
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
738 pc_clear_to_eol (); /* for text attributes to really take effect */
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
739 +#endif
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
740 +#ifdef _WIN32
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
741 + SetConsoleScreenBufferSize (hstdout, outside_info.bufsize);
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
742 +#endif
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
743 +
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
744
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
745 /* Switch back to text mode on stdin. */
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
746 tty = fileno (stdin);
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
747 @@ -256,7 +810,12 @@
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
748 {
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
749 term_name = getenv ("TERM");
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
750 if (!term_name)
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
751 +#ifdef __MSDOS__
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
752 term_name = "pc-dos"; /* ``what's in a name?'' */
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
753 +#endif
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
754 +#ifdef _WIN32
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
755 + term_name = "w32console";
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
756 +#endif
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
757 }
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
758
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
759 /* Get current video information, to be restored later. */
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
760 @@ -310,7 +869,7 @@
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
761 terminal_is_dumb_p = 0;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
762
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
763 pc_get_screen_size ();
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
764 -
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
765 +#ifdef __MSDOS__
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
766 /* Store the arrow keys. */
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
767 term_ku = (char *)find_sequence (K_Up);
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
768 term_kd = (char *)find_sequence (K_Down);
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
769 @@ -326,6 +885,7 @@
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
770 term_ki = (char *)find_sequence (K_Insert);
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
771 term_kx = (char *)find_sequence (K_Delete);
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
772 #endif
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
773 +#endif
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
774
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
775 /* Set all the hooks to our PC-specific functions. */
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
776 terminal_begin_inverse_hook = pc_begin_inverse;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
777 @@ -687,10 +1247,11 @@
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
778 xexit (1);
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
779 case SIGUSR1:
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
780 /* Simulate SIGTSTP by invoking a subsidiary shell. */
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
781 +#ifndef _WIN32
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
782 pc_goto_xy (0, outside_info.screenheight - 1);
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
783 pc_clear_to_eol ();
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
784 pc_write_chars (stopped_msg, sizeof (stopped_msg) - 1);
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
785 -
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
786 +#endif
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
787 /* The child shell can change the working directory, so
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
788 we need to save and restore it, since it is global. */
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
789 if (!getcwd (cwd, PATH_MAX)) /* should never happen */
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
790 @@ -699,7 +1260,26 @@
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
791 /* We don't want to get fatal signals while the subshell runs. */
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
792 old_INT = signal (SIGINT, SIG_IGN);
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
793 old_QUIT = signal (SIGQUIT, SIG_IGN);
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
794 +#ifdef _WIN32
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
795 + {
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
796 + const char *argv[2];
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
797 + const char *shell = NULL;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
798 +
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
799 + argv[0] = NULL;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
800 + shell = getenv ("SHELL");
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
801 + if (!shell)
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
802 + {
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
803 + shell = getenv ("COMSPEC");
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
804 + if (!shell)
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
805 + return -1;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
806 + argv[0] = " /k";
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
807 + }
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
808 + argv[1] = NULL;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
809 + _spawnvp (_P_WAIT, shell, argv);
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
810 + }
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
811 +#else
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
812 system ("");
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
813 +#endif
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
814 if (*cwd)
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
815 chdir (cwd);
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
816 signal (SIGINT, old_INT);
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
817 @@ -758,3 +1338,4 @@
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
818 perror ("tcsetattr"); return 0;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
819 }
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
820 #endif
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
821 +
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
822 diff -ur texinfo-4.13.orig/info/tilde.c texinfo-4.13/info/tilde.c
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
823 --- texinfo-4.13.orig/info/tilde.c 2014-04-24 14:52:47.757094645 -0400
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
824 +++ texinfo-4.13/info/tilde.c 2014-04-24 14:58:38.949450825 -0400
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
825 @@ -190,11 +190,15 @@
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
826 the password database. */
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
827 if (!temp_home)
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
828 {
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
829 +#ifndef __MINGW32__
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
830 struct passwd *entry;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
831
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
832 entry = (struct passwd *) getpwuid (getuid ());
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
833 if (entry)
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
834 temp_home = entry->pw_dir;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
835 +#else
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
836 + temp_home = ".";
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
837 +#endif
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
838 }
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
839
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
840 temp_name = xmalloc (1 + strlen (&dirname[1])
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
841 @@ -210,7 +214,9 @@
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
842 }
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
843 else
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
844 {
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
845 +#ifndef __MINGW32__
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
846 struct passwd *user_entry;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
847 +#endif
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
848 char *username = xmalloc (257);
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
849 int i, c;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
850
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
851 @@ -222,7 +228,7 @@
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
852 username[i - 1] = c;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
853 }
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
854 username[i - 1] = 0;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
855 -
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
856 +#ifndef __MINGW32__
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
857 if (!(user_entry = (struct passwd *) getpwnam (username)))
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
858 {
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
859 /* If the calling program has a special syntax for
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
860 @@ -259,6 +265,24 @@
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
861
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
862 endpwent ();
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
863 free (username);
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
864 +#else
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
865 + if (tilde_expansion_failure_hook)
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
866 + {
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
867 + char *expansion = (*tilde_expansion_failure_hook) (username);
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
868 +
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
869 + if (expansion)
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
870 + {
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
871 + temp_name = xmalloc (1 + strlen (expansion)
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
872 + + strlen (&dirname[i]));
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
873 + strcpy (temp_name, expansion);
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
874 + strcat (temp_name, &dirname[i]);
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
875 + free (expansion);
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
876 + }
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
877 + }
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
878 + free (dirname);
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
879 + dirname = xstrdup (temp_name);
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
880 + free (temp_name);
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
881 +#endif
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
882 }
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
883 }
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
884 return dirname;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
885 diff -ur texinfo-4.13.orig/info/info.c texinfo-4.13/info/info.c
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
886 --- texinfo-4.13.orig/info/info.c 2014-04-24 15:00:00.165123612 -0400
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
887 +++ texinfo-4.13/info/info.c 2014-04-24 15:07:10.262443440 -0400
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
888 @@ -82,7 +82,7 @@
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
889 /* Non-zero means print the absolute location of the file to be loaded. */
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
890 static int print_where_p = 0;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
891
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
892 -#ifdef __MSDOS__
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
893 +#if defined(__MSDOS__) || defined(__MINGW32__)
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
894 /* Non-zero indicates that screen output should be made 'speech-friendly'.
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
895 Since on MSDOS the usual behavior is to write directly to the video
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
896 memory, speech synthesizer software cannot grab the output. Therefore,
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
897 @@ -118,14 +118,14 @@
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
898 { "version", 0, &print_version_p, 1 },
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
899 { "vi-keys", 0, &vi_keys_p, 1 },
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
900 { "where", 0, &print_where_p, 1 },
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
901 -#ifdef __MSDOS__
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
902 +#if defined(__MSDOS__) || defined(__MINGW32__)
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
903 { "speech-friendly", 0, &speech_friendly, 1 },
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
904 #endif
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
905 {NULL, 0, NULL, 0}
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
906 };
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
907
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
908 /* String describing the shorthand versions of the long options found above. */
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
909 -#ifdef __MSDOS__
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
910 +#if defined(__MSDOS__) || defined(__MINGW32__)
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
911 static char *short_options = "k:d:n:f:ho:ORswb";
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
912 #else
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
913 static char *short_options = "k:d:n:f:ho:ORws";
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
914 @@ -239,7 +239,7 @@
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
915 print_where_p = 1;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
916 break;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
917
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
918 -#ifdef __MSDOS__
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
919 +#if defined(__MSDOS__) || defined(__MINGW32__)
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
920 /* User wants speech-friendly output. */
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
921 case 'b':
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
922 speech_friendly = 1;
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
923 @@ -621,8 +621,7 @@
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
924 --no-raw-escapes output escapes as literal text.\n\
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
925 --restore=FILENAME read initial keystrokes from FILENAME.\n\
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
926 -O, --show-options, --usage go to command-line options node."));
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
927 -
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
928 -#ifdef __MSDOS__
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
929 +#if defined(__MSDOS__) || defined(__MINGW32__)
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
930 puts (_("\
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
931 -b, --speech-friendly be friendly to speech synthesizers."));
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
932 #endif
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
933 diff -ur texinfo-4.13.orig/info/signals.c texinfo-4.13/info/signals.c
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
934 --- texinfo-4.13.orig/info/signals.c 2014-04-24 15:00:00.164123591 -0400
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
935 +++ texinfo-4.13/info/signals.c 2014-04-24 15:13:26.706132612 -0400
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
936 @@ -151,7 +151,7 @@
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
937 #endif
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
938 }
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
939
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
940 -static void
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
941 +void
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
942 redisplay_after_signal (void)
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
943 {
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
944 terminal_clear_screen ();
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
945 @@ -162,7 +162,7 @@
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
946 fflush (stdout);
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
947 }
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
948
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
949 -static void
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
950 +void
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
951 reset_info_window_sizes (void)
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
952 {
4e90544559a3 texinfo: update to install info.exe
John Donoghue
parents:
diff changeset
953 terminal_goto_xy (0, 0);
3609
360eff7d9c06 texinfo: compile native info when native target.
John Donoghue
parents: 3587
diff changeset
954 diff -ur texinfo-4.13.orig/info/terminal.c texinfo-4.13/info/terminal.c
360eff7d9c06 texinfo: compile native info when native target.
John Donoghue
parents: 3587
diff changeset
955 --- texinfo-4.13.orig/info/terminal.c 2014-06-09 00:27:32 -0400
360eff7d9c06 texinfo: compile native info when native target.
John Donoghue
parents: 3587
diff changeset
956 +++ texinfo-4.13/info/terminal.c 2014-06-09 00:33:37 -0400
360eff7d9c06 texinfo: compile native info when native target.
John Donoghue
parents: 3587
diff changeset
957 @@ -47,6 +47,10 @@
360eff7d9c06 texinfo: compile native info when native target.
John Donoghue
parents: 3587
diff changeset
958 #endif /* not HAVE_TERMCAP_H */
360eff7d9c06 texinfo: compile native info when native target.
John Donoghue
parents: 3587
diff changeset
959 #endif /* not HAVE_NCURSES_TERMCAP_H */
360eff7d9c06 texinfo: compile native info when native target.
John Donoghue
parents: 3587
diff changeset
960
360eff7d9c06 texinfo: compile native info when native target.
John Donoghue
parents: 3587
diff changeset
961 +#if defined(__MSDOS__) || defined(__MINGW32__)
360eff7d9c06 texinfo: compile native info when native target.
John Donoghue
parents: 3587
diff changeset
962 + unsigned int sleep(unsigned int);
360eff7d9c06 texinfo: compile native info when native target.
John Donoghue
parents: 3587
diff changeset
963 +#endif
360eff7d9c06 texinfo: compile native info when native target.
John Donoghue
parents: 3587
diff changeset
964 +
360eff7d9c06 texinfo: compile native info when native target.
John Donoghue
parents: 3587
diff changeset
965 /* Function "hooks". If you make one of these point to a function, that
360eff7d9c06 texinfo: compile native info when native target.
John Donoghue
parents: 3587
diff changeset
966 function is called when appropriate instead of its namesake. Your
360eff7d9c06 texinfo: compile native info when native target.
John Donoghue
parents: 3587
diff changeset
967 function is called with exactly the same arguments that were passed