|
Last change
on this file since 8973acd was b28a12e, checked in by Thomas Lopatic <thomas@…>, 8 years ago |
|
Zero redundant declarations.
|
-
Property mode
set to
100644
|
|
File size:
1.1 KB
|
| Rev | Line | |
|---|
| [f40a309] | 1 | /*
|
|---|
| 2 | =============================================================================
|
|---|
| 3 | waitcr.c -- wait for a CR from the console and allow for debugging
|
|---|
| 4 | Version 3 -- 1987-07-15 -- D.N. Lynx Crowe
|
|---|
| 5 | =============================================================================
|
|---|
| 6 | */
|
|---|
| 7 |
|
|---|
| [b28a12e] | 8 | #include "ram.h"
|
|---|
| [f40a309] | 9 |
|
|---|
| 10 | /*
|
|---|
| 11 | =============================================================================
|
|---|
| 12 | waitcr() -- wait for a CR or a CTL-G. CR returns control to the
|
|---|
| 13 | caller, CTL-G invokes xtrap15(), which if it returns, returns to
|
|---|
| 14 | the caller. The xtrap15() escape is to allow a convenient debug
|
|---|
| 15 | point whenever we wait on the console. The character that caused
|
|---|
| 16 | the return (CR or CTL-G) is returned as the value of the function.
|
|---|
| 17 | =============================================================================
|
|---|
| 18 | */
|
|---|
| 19 |
|
|---|
| [7258c6a] | 20 | int16_t waitcr(void)
|
|---|
| [f40a309] | 21 | {
|
|---|
| [7258c6a] | 22 | int16_t c;
|
|---|
| [f40a309] | 23 |
|
|---|
| 24 | BIOS(B_PUTC, CON_DEV, '\007'); /* wake up the operator */
|
|---|
| 25 |
|
|---|
| 26 | /* await a CR, in which case we just exit */
|
|---|
| 27 |
|
|---|
| [7258c6a] | 28 | while ('\r' NE (c = (0x007F & (int16_t)BIOS(B_GETC, CON_DEV))))
|
|---|
| [f40a309] | 29 | if (c EQ '\007') /* ... or a control-G */
|
|---|
| 30 | xtrap15(); /* ... in which case we trap first */
|
|---|
| 31 |
|
|---|
| 32 | return(c); /* return the character that caused us to exit */
|
|---|
| 33 | }
|
|---|
| [6262b5c] | 34 |
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.