2 Copyright (c) 1990-2001 Info-ZIP. All rights reserved.
4 See the accompanying file LICENSE, version 2000-Apr-09 or later
5 (the contents of which are also included in zip.h) for terms of use.
6 If, for some reason, all these files are missing, the Info-ZIP license
7 also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html
13 #ifndef __ttyio_h /* don't include more than once */
17 # include "crypt.h" /* ensure that encryption header file has been seen */
20 #if (CRYPT || (defined(UNZIP) && !defined(FUNZIP)))
22 * Non-echo keyboard/console input support is needed and enabled.
25 #ifndef __G /* UnZip only, for now (DLL stuff) */
33 #ifndef ZCONST /* UnZip only (until have configure script like Zip) */
37 #if (defined(MSDOS) || defined(OS2) || defined(WIN32))
43 #if (defined(DOS_OS2_W32) || defined(__human68k__))
44 # ifndef DOS_H68_OS2_W32
45 # define DOS_H68_OS2_W32
49 #if (defined(DOS_OS2_W32) || defined(FLEXOS))
50 # ifndef DOS_FLX_OS2_W32
51 # define DOS_FLX_OS2_W32
55 #if (defined(DOS_H68_OS2_W32) || defined(FLEXOS))
56 # ifndef DOS_FLX_H68_OS2_W32
57 # define DOS_FLX_H68_OS2_W32
61 #if (defined(VM_CMS) || defined(MVS))
68 /* Function prototypes */
70 /* The following systems supply a `non-echo' character input function "getch()"
71 * (or an alias) and do not need the echoff() / echon() function pair.
76 # define getch() Agetch()
77 # define HAVE_WORKING_GETCH
84 # define getch() (Cnecin() & 0x000000ff)
85 # define HAVE_WORKING_GETCH
91 # define getch() macgetch()
92 # define HAVE_WORKING_GETCH
98 # define HAVE_WORKING_GETCH
104 # define HAVE_WORKING_GETCH
110 # define getch() SWI_OS_ReadC()
111 # define HAVE_WORKING_GETCH
114 #ifdef DOS_H68_OS2_W32
119 # define getch() getch_win32()
124 # define getch() _read_kbd(0, 1, 0)
126 # else /* !__EMX__ */
129 # define getch() getkey()
130 # else /* !__GO32__ */
132 # endif /* ?__GO32__ */
133 # endif /* ?__EMX__ */
135 # define HAVE_WORKING_GETCH
136 #endif /* DOS_H68_OS2_W32 */
141 # define getch() getchar() /* not correct, but may not be on a console */
142 # define HAVE_WORKING_GETCH
145 /* For VM/CMS and MVS, we do not (yet) have any support to switch terminal
146 * input echo on and off. The following "fake" definitions allow inclusion
147 * of crypt support and UnZip's "pause prompting" features, but without
148 * any echo suppression.
158 # define getch() zgetch() /* defined in TANDEMC */
159 # define HAVE_WORKING_GETCH
162 /* The THEOS C runtime library supplies the function conmask() to toggle
163 * terminal input echo on (conmask("e")) and off (conmask("n")). But,
164 * since THEOS C RTL also contains a working non-echo getch() function,
165 * the echo toggles are not needed.
170 # define HAVE_WORKING_GETCH
173 /* VMS has a single echo() function in ttyio.c to toggle terminal
174 * input echo on and off.
177 # define echoff(f) echo(0)
178 # define echon() echo(1)
179 # define getch() tt_getch()
180 # define FGETCH(f) tt_getch()
182 int tt_getch
OF((void));
185 /* For all other systems, ttyio.c supplies the two functions Echoff() and
186 * Echon() for suppressing and (re)enabling console input echo.
189 # define echoff(f) Echoff(__G__ f)
190 # define echon() Echon(__G)
191 void Echoff
OF((__GPRO__
int f
));
192 void Echon
OF((__GPRO
));
195 /* this stuff is used by MORE and also now by the ctrl-S code; fileio.c only */
196 #if (defined(UNZIP) && !defined(FUNZIP))
197 # ifdef HAVE_WORKING_GETCH
198 # define FGETCH(f) getch()
201 /* default for all systems where no getch()-like function is available */
202 int zgetch
OF((__GPRO__
int f
));
203 # define FGETCH(f) zgetch(__G__ f)
205 #endif /* UNZIP && !FUNZIP */
207 #if (CRYPT && !defined(WINDLL))
208 char *getp
OF((__GPRO__ ZCONST
char *m
, char *p
, int n
));
211 #else /* !(CRYPT || (UNZIP && !FUNZIP)) */
214 * No need for non-echo keyboard/console input; provide dummy definitions.
219 #endif /* ?(CRYPT || (UNZIP && !FUNZIP)) */
221 #endif /* !__ttyio_h */