|
|
1.1 root 1: # include "pipes.h"
2: # include <sccs.h>
3:
4: SCCSID(@(#)pb_dump.c 7.1 2/5/81)
5:
6: /*
7: ** PB_DUMP -- dump pipe buffer for debugging
8: **
9: ** Parameters:
10: ** ppb -- pointer to the structure to dump.
11: ** full -- if set, dump everything, else just
12: ** dump the header.
13: **
14: ** Returns:
15: ** none
16: **
17: ** Side Effects:
18: ** none
19: **
20: ** Trace Flags:
21: ** none
22: */
23:
24: pb_dump(ppb, full)
25: register pb_t *ppb;
26: int full;
27: {
28: printf("PB @ %x:\n", ppb);
29: printf("\t st %4d proc %4d resp %4d from %4d\n",
30: ppb->pb_st, ppb->pb_proc, ppb->pb_resp, ppb->pb_from);
31: printf("\t type %2d stat %4o nused %3d nleft %3d",
32: ppb->pb_type, ppb->pb_stat, ppb->pb_nused, ppb->pb_nleft);
33: if (full)
34: {
35: register int i;
36: register char *p;
37: register char c;
38:
39: p = ppb->pb_data;
40: for (i = 0; i < ppb->pb_nused; i++)
41: {
42: c = *p++;
43: if (i % 10 == 0)
44: printf("\n\t%3d:", i);
45: putchar(' ');
46: if (c >= 040 && c < 0177)
47: printf(" %c ", c);
48: else
49: xputchar(c);
50: }
51: }
52: putchar('\n');
53: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.