1: # include "ctlmod.h"
2: # include "pipes.h"
3: # include <sccs.h>
4:
5: SCCSID(@(#)readmon.c 8.1 12/31/84)
6:
7: /*
8: ** READMON -- Read bytes from tty monitor
9: **
10: ** This routine is a cludge. It will exist only in version
11: ** 6.3 with split monitor/parser. The purpose is to get
12: ** around the problem caused by the monitor not outputting
13: ** text in one of the basic internal data types. What it
14: ** can do is to output no parameters & terminate with a
15: ** PV_EOF. This doesn't flush the pipe, so it can continue
16: ** with plain text. This routine retrieves that text.
17: ** The name "readmon" is somewhat of a misnomer -- it is
18: ** not restricted to the monitor, & does not necessarily
19: ** read from the monitor; but this routine should only
20: ** be called from the parser on the monitor pipe.
21: **
22: ** Parameters:
23: ** buf -- a buffer to read into.
24: ** nbytes -- the max number of bytes to read.
25: **
26: ** Returns:
27: ** The actual number of bytes read.
28: ** zero on eof.
29: **
30: ** Side Effects:
31: ** none.
32: **
33: ** NOTE:
34: ** When this routine is eliminated, so should the
35: ** 'cm_monppb' field of the Cm struct and the code
36: ** in proc_err to flush the monitor input pipe.
37: **
38: ** Trace Flags:
39: ** none.
40: */
41:
42: pb_t *MonPpb; /* pointer to ppb for monitor */
43:
44: readmon(buf, nbytes)
45: char *buf;
46: int nbytes;
47: {
48: Cm.cm_input = Cm.cm_rinput;
49: return (pb_get(MonPpb, buf, nbytes));
50: }
Defined functions
Defined variables