1: # include <stdio.h>
2:
3: # include "../ingres.h"
4: # include "../aux.h"
5: # include "monitor.h"
6:
7: /*
8: ** GET CHARACTER
9: **
10: ** This routine is just a getchar, except it allows a single
11: ** backup character ("Peekch"). If Peekch is nonzero it is
12: ** returned, otherwise a getchar is returned.
13: */
14:
15: char
16: getch()
17: {
18: register char c;
19:
20: c = Peekch;
21: if (c)
22: Peekch = 0;
23: else
24: {
25: c = getc(Input);
26: }
27: if (c < 0)
28: c = 0;
29:
30: /* deliver EOF if newline in Oneline mode */
31: if (c == '\n' && Oneline)
32: {
33: Peekch = c;
34: c = 0;
35: }
36:
37: return (c);
38: }
Defined functions
getch
defined in line
15; used 9 times