1*12981Ssam /* dumpmat.c 4.2 83/06/10 */ 211470Sralph 311470Sralph #include "bit.h" 411470Sralph 511470Sralph #ifdef TRACE 611470Sralph /* 711470Sralph * dumpmat: debugging dumpmat of a window or other bit matrix. 811470Sralph * msg is a handy label, m is the matrix, rows, cols is the size of the matrix. 911470Sralph */ 1011470Sralph dumpmat(msg, m, rows, cols) 1111470Sralph char *msg; 1211470Sralph bitmat m; 1311470Sralph int rows, cols; 1411470Sralph { 1511470Sralph register int r, c; 1611470Sralph int r1, r2, c1, c2; 1711470Sralph 1811470Sralph if (trace == NULL) 1911470Sralph return; 2011470Sralph fprintf(trace, "\ndumpmat %s, m=%x, rows=%d, cols=%d\n", msg, m, rows, cols); 2111470Sralph minmax(m, rows, cols, &r1, &c1, &r2, &c2); 2211470Sralph fprintf(trace, "r1=%d, r2=%d, c1=%d, c2=%d\n", r1, r2, c1, c2); 2311470Sralph for (r=r1; r<=r2; r++) { 2411470Sralph fprintf(trace, "%2d ", r); 2511470Sralph for (c=c1; c<=c2; c++) 2611470Sralph fprintf(trace, "%c", mat(m, rows, cols, r, c, 5) ? 'X' : '.'); 2711470Sralph fprintf(trace, "\n"); 2811470Sralph } 2911470Sralph fprintf(trace, "\n"); 3011470Sralph } 31*12981Ssam #endif 32