date and time created 83/03/09 16:23:24 by ralph
[unix-history] / usr / src / old / lib2648 / dumpmat.c
CommitLineData
37f0cd4f
RC
1/* dumpmat.c 4.1 83/03/09 */
2
3#include "bit.h"
4
5#ifdef TRACE
6/*
7 * dumpmat: debugging dumpmat of a window or other bit matrix.
8 * msg is a handy label, m is the matrix, rows, cols is the size of the matrix.
9 */
10dumpmat(msg, m, rows, cols)
11char *msg;
12bitmat m;
13int rows, cols;
14{
15 register int r, c;
16 int r1, r2, c1, c2;
17
18 if (trace == NULL)
19 return;
20 fprintf(trace, "\ndumpmat %s, m=%x, rows=%d, cols=%d\n", msg, m, rows, cols);
21 minmax(m, rows, cols, &r1, &c1, &r2, &c2);
22 fprintf(trace, "r1=%d, r2=%d, c1=%d, c2=%d\n", r1, r2, c1, c2);
23 for (r=r1; r<=r2; r++) {
24 fprintf(trace, "%2d ", r);
25 for (c=c1; c<=c2; c++)
26 fprintf(trace, "%c", mat(m, rows, cols, r, c, 5) ? 'X' : '.');
27 fprintf(trace, "\n");
28 }
29 fprintf(trace, "\n");
30}