Mercurial > hg > octave-lojdl
comparison src/sysdep.cc @ 767:42731861ee09
[project @ 1994-10-05 21:26:54 by jwe]
author | jwe |
---|---|
date | Wed, 05 Oct 1994 21:32:24 +0000 |
parents | 36ba0576bd1b |
children | c70cd573d3dc |
comparison
equal
deleted
inserted
replaced
766:b70e0404a8da | 767:42731861ee09 |
---|---|
138 } | 138 } |
139 #endif | 139 #endif |
140 #endif | 140 #endif |
141 #endif | 141 #endif |
142 | 142 |
143 | |
144 | |
145 #if defined (HAVE_QUIET_NAN) | 143 #if defined (HAVE_QUIET_NAN) |
146 octave_NaN = (double) quiet_nan (); | 144 octave_NaN = (double) quiet_nan (); |
147 #else | 145 #else |
148 #ifdef linux | 146 #ifdef linux |
149 octave_NaN = NAN; | 147 octave_NaN = NAN; |
165 octave_Inf = DBL_MAX; | 163 octave_Inf = DBL_MAX; |
166 octave_NaN = DBL_MAX; | 164 octave_NaN = DBL_MAX; |
167 | 165 |
168 #endif | 166 #endif |
169 } | 167 } |
170 | |
171 | 168 |
172 #if defined (EXCEPTION_IN_MATH) | 169 #if defined (EXCEPTION_IN_MATH) |
173 extern "C" | 170 extern "C" |
174 { | 171 { |
175 int | 172 int |
210 #endif | 207 #endif |
211 | 208 |
212 octave_ieee_init (); | 209 octave_ieee_init (); |
213 } | 210 } |
214 | 211 |
215 /* | 212 // Set terminal in raw mode. From less-177. |
216 * Set terminal in raw mode. From less-177. | 213 // |
217 * | 214 // Change terminal to "raw mode", or restore to "normal" mode. |
218 * Change terminal to "raw mode", or restore to "normal" mode. | 215 // "Raw mode" means |
219 * "Raw mode" means | 216 // 1. An outstanding read will complete on receipt of a single keystroke. |
220 * 1. An outstanding read will complete on receipt of a single keystroke. | 217 // 2. Input is not echoed. |
221 * 2. Input is not echoed. | 218 // 3. On output, \n is mapped to \r\n. |
222 * 3. On output, \n is mapped to \r\n. | 219 // 4. \t is NOT expanded into spaces. |
223 * 4. \t is NOT expanded into spaces. | 220 // 5. Signal-causing characters such as ctrl-C (interrupt), |
224 * 5. Signal-causing characters such as ctrl-C (interrupt), | 221 // etc. are NOT disabled. |
225 * etc. are NOT disabled. | 222 // It doesn't matter whether an input \n is mapped to \r, or vice versa. |
226 * It doesn't matter whether an input \n is mapped to \r, or vice versa. | 223 |
227 */ | |
228 void | 224 void |
229 raw_mode (int on) | 225 raw_mode (int on) |
230 { | 226 { |
231 static int curr_on = 0; | 227 static int curr_on = 0; |
232 | 228 |
358 #endif | 354 #endif |
359 | 355 |
360 curr_on = on; | 356 curr_on = on; |
361 } | 357 } |
362 | 358 |
363 /* | 359 // Read one character from the terminal. |
364 * Read one character from the terminal. | 360 |
365 */ | |
366 int | 361 int |
367 kbhit (void) | 362 kbhit (void) |
368 { | 363 { |
369 int c; | 364 int c; |
370 raw_mode (1); | 365 raw_mode (1); |