Update install docs
[carla.git] / data / windows / unzipfx-carla-control / ttyio.h
blob43f004fe4e9d47ce963c6767cf762ca47a07634b
1 /*
2 Copyright (c) 1990-2004 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
8 */
9 /*
10 ttyio.h
13 #ifndef __ttyio_h /* don't include more than once */
14 #define __ttyio_h
16 #ifndef __crypt_h
17 # include "crypt.h" /* ensure that encryption header file has been seen */
18 #endif
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) */
26 # define __G
27 # define __G__
28 # define __GDEF
29 # define __GPRO void
30 # define __GPRO__
31 #endif
33 #ifndef ZCONST /* UnZip only (until have configure script like Zip) */
34 # define ZCONST const
35 #endif
37 #if (defined(MSDOS) || defined(OS2) || defined(WIN32))
38 # ifndef DOS_OS2_W32
39 # define DOS_OS2_W32
40 # endif
41 #endif
43 #if (defined(DOS_OS2_W32) || defined(__human68k__))
44 # ifndef DOS_H68_OS2_W32
45 # define DOS_H68_OS2_W32
46 # endif
47 #endif
49 #if (defined(DOS_OS2_W32) || defined(FLEXOS))
50 # ifndef DOS_FLX_OS2_W32
51 # define DOS_FLX_OS2_W32
52 # endif
53 #endif
55 #if (defined(DOS_H68_OS2_W32) || defined(FLEXOS))
56 # ifndef DOS_FLX_H68_OS2_W32
57 # define DOS_FLX_H68_OS2_W32
58 # endif
59 #endif
61 #if (defined(__ATHEOS__) || defined(__BEOS__) || defined(UNIX))
62 # ifndef ATH_BEO_UNX
63 # define ATH_BEO_UNX
64 # endif
65 #endif
67 #if (defined(VM_CMS) || defined(MVS))
68 # ifndef CMS_MVS
69 # define CMS_MVS
70 # endif
71 #endif
74 /* Function prototypes */
76 /* The following systems supply a `non-echo' character input function "getch()"
77 * (or an alias) and do not need the echoff() / echon() function pair.
79 #ifdef AMIGA
80 # define echoff(f)
81 # define echon()
82 # define getch() Agetch()
83 # define HAVE_WORKING_GETCH
84 #endif /* AMIGA */
86 #ifdef ATARI
87 # define echoff(f)
88 # define echon()
89 # include <osbind.h>
90 # define getch() (Cnecin() & 0x000000ff)
91 # define HAVE_WORKING_GETCH
92 #endif
94 #ifdef MACOS
95 # define echoff(f)
96 # define echon()
97 # define getch() macgetch()
98 # define HAVE_WORKING_GETCH
99 #endif
101 #ifdef NLM
102 # define echoff(f)
103 # define echon()
104 # define HAVE_WORKING_GETCH
105 #endif
107 #ifdef QDOS
108 # define echoff(f)
109 # define echon()
110 # define HAVE_WORKING_GETCH
111 #endif
113 #ifdef RISCOS
114 # define echoff(f)
115 # define echon()
116 # define getch() SWI_OS_ReadC()
117 # define HAVE_WORKING_GETCH
118 #endif
120 #ifdef DOS_H68_OS2_W32
121 # define echoff(f)
122 # define echon()
123 # ifdef WIN32
124 # ifndef getch
125 # define getch() getch_win32()
126 # endif
127 # else /* !WIN32 */
128 # ifdef __EMX__
129 # ifndef getch
130 # define getch() _read_kbd(0, 1, 0)
131 # endif
132 # else /* !__EMX__ */
133 # ifdef __GO32__
134 # include <pc.h>
135 # define getch() getkey()
136 # else /* !__GO32__ */
137 # include <conio.h>
138 # endif /* ?__GO32__ */
139 # endif /* ?__EMX__ */
140 # endif /* ?WIN32 */
141 # define HAVE_WORKING_GETCH
142 #endif /* DOS_H68_OS2_W32 */
144 #ifdef FLEXOS
145 # define echoff(f)
146 # define echon()
147 # define getch() getchar() /* not correct, but may not be on a console */
148 # define HAVE_WORKING_GETCH
149 #endif
151 /* For VM/CMS and MVS, we do not (yet) have any support to switch terminal
152 * input echo on and off. The following "fake" definitions allow inclusion
153 * of crypt support and UnZip's "pause prompting" features, but without
154 * any echo suppression.
156 #ifdef CMS_MVS
157 # define echoff(f)
158 # define echon()
159 #endif
161 #ifdef TANDEM
162 # define echoff(f)
163 # define echon()
164 # define getch() zgetch() /* defined in TANDEMC */
165 # define HAVE_WORKING_GETCH
166 #endif
168 /* The THEOS C runtime library supplies the function conmask() to toggle
169 * terminal input echo on (conmask("e")) and off (conmask("n")). But,
170 * since THEOS C RTL also contains a working non-echo getch() function,
171 * the echo toggles are not needed.
173 #ifdef THEOS
174 # define echoff(f)
175 # define echon()
176 # define HAVE_WORKING_GETCH
177 #endif
179 /* VMS has a single echo() function in ttyio.c to toggle terminal
180 * input echo on and off.
182 #ifdef VMS
183 # define echoff(f) echo(0)
184 # define echon() echo(1)
185 # define getch() tt_getch()
186 # define FGETCH(f) tt_getch()
187 int echo OF((int));
188 int tt_getch OF((void));
189 #endif
191 /* For all other systems, ttyio.c supplies the two functions Echoff() and
192 * Echon() for suppressing and (re)enabling console input echo.
194 #ifndef echoff
195 # define echoff(f) Echoff(__G__ f)
196 # define echon() Echon(__G)
197 void Echoff OF((__GPRO__ int f));
198 void Echon OF((__GPRO));
199 #endif
201 /* this stuff is used by MORE and also now by the ctrl-S code; fileio.c only */
202 #if (defined(UNZIP) && !defined(FUNZIP))
203 # ifdef HAVE_WORKING_GETCH
204 # define FGETCH(f) getch()
205 # endif
206 # ifndef FGETCH
207 /* default for all systems where no getch()-like function is available */
208 int zgetch OF((__GPRO__ int f));
209 # define FGETCH(f) zgetch(__G__ f)
210 # endif
211 #endif /* UNZIP && !FUNZIP */
213 #if (CRYPT && !defined(WINDLL))
214 char *getp OF((__GPRO__ ZCONST char *m, char *p, int n));
215 #endif
217 #else /* !(CRYPT || (UNZIP && !FUNZIP)) */
220 * No need for non-echo keyboard/console input; provide dummy definitions.
222 #define echoff(f)
223 #define echon()
225 #endif /* ?(CRYPT || (UNZIP && !FUNZIP)) */
227 #endif /* !__ttyio_h */