date and time created 88/06/29 21:19:25 by bostic
[unix-history] / usr / src / usr.bin / window / wwdump.c
CommitLineData
60de5df9 1/*
46e9ea25
KB
2 * Copyright (c) 1983 Regents of the University of California.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms are permitted
6 * provided that this notice is preserved and that due credit is given
7 * to the University of California at Berkeley. The name of the University
8 * may not be used to endorse or promote products derived from this
9 * software without specific prior written permission. This software
10 * is provided ``as is'' without express or implied warranty.
60de5df9
EW
11 */
12
46e9ea25
KB
13#ifndef lint
14static char sccsid[] = "@(#)wwdump.c 3.12 (Berkeley) %G%";
15#endif /* not lint */
16
3f60a359 17#include "ww.h"
e908bfac 18#include "tt.h"
3f60a359
EW
19
20static char cmap[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
21
3f60a359
EW
22wwdumpwin(w)
23register struct ww *w;
24{
25 register i, j;
26
3130283e 27 tt.tt_nmodes = 0;
3f60a359 28 (*tt.tt_clear)();
f2a77fe1
EW
29 for (i = w->ww_i.t; i < w->ww_i.b; i++) {
30 (*tt.tt_move)(i, w->ww_i.l);
31 for (j = w->ww_i.l; j < w->ww_i.r; j++)
84ad208b 32 (*tt.tt_putc)(w->ww_win[i][j] & WWM_GLS ? 'G' : ' ');
3f60a359
EW
33 }
34}
35
36wwdumpnvis(w)
37register struct ww *w;
38{
39 register i;
1023bffa 40 char buf[20];
3f60a359 41
3130283e 42 tt.tt_nmodes = 0;
3f60a359 43 (*tt.tt_clear)();
1023bffa
EW
44 for (i = w->ww_i.t; i < w->ww_i.b; i++) {
45 (*tt.tt_move)(i, w->ww_i.l);
46 (void) sprintf(buf, "%d", w->ww_nvis[i]);
47 (*tt.tt_write)(buf, strlen(buf));
3f60a359
EW
48 }
49}
50
51wwdumpsmap()
52{
53 register i, j;
54
3130283e 55 tt.tt_nmodes = 0;
3f60a359
EW
56 (*tt.tt_clear)();
57 for (i = 0; i < wwnrow; i++) {
58 (*tt.tt_move)(i, 0);
59 for (j = 0; j < wwncol; j++)
60 (*tt.tt_putc)(cmap[wwsmap[i][j]]);
61 }
62}
63
3f60a359
EW
64wwdumpns()
65{
66 register i, j;
67
3f60a359
EW
68 (*tt.tt_clear)();
69 for (i = 0; i < wwnrow; i++) {
70 (*tt.tt_move)(i, 0);
71 for (j = 0; j < wwncol; j++) {
3130283e 72 tt.tt_nmodes = wwns[i][j].c_m & tt.tt_availmodes;
3f60a359
EW
73 (*tt.tt_putc)(wwns[i][j].c_c);
74 }
75 }
76}
77
78wwdumpos()
79{
80 register i, j;
81
f86b4409 82 (*tt.tt_clear)();
3f60a359
EW
83 for (i = 0; i < wwnrow; i++) {
84 (*tt.tt_move)(i, 0);
85 for (j = 0; j < wwncol; j++) {
3130283e 86 tt.tt_nmodes = wwos[i][j].c_m & tt.tt_availmodes;
3f60a359
EW
87 (*tt.tt_putc)(wwns[i][j].c_c);
88 }
89 }
90}