new compression algorithm
[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
5e8b0e60
KB
6 * provided that the above copyright notice and this paragraph are
7 * duplicated in all such forms and that any documentation,
8 * advertising materials, and other materials related to such
9 * distribution and use acknowledge that the software was developed
10 * by the University of California, Berkeley. The name of the
11 * University may not be used to endorse or promote products derived
12 * from this software without specific prior written permission.
13 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
14 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
15 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
60de5df9
EW
16 */
17
46e9ea25 18#ifndef lint
5e8b0e60 19static char sccsid[] = "@(#)wwdump.c 3.13 (Berkeley) %G%";
46e9ea25
KB
20#endif /* not lint */
21
3f60a359 22#include "ww.h"
e908bfac 23#include "tt.h"
3f60a359
EW
24
25static char cmap[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
26
3f60a359
EW
27wwdumpwin(w)
28register struct ww *w;
29{
30 register i, j;
31
3130283e 32 tt.tt_nmodes = 0;
3f60a359 33 (*tt.tt_clear)();
f2a77fe1
EW
34 for (i = w->ww_i.t; i < w->ww_i.b; i++) {
35 (*tt.tt_move)(i, w->ww_i.l);
36 for (j = w->ww_i.l; j < w->ww_i.r; j++)
84ad208b 37 (*tt.tt_putc)(w->ww_win[i][j] & WWM_GLS ? 'G' : ' ');
3f60a359
EW
38 }
39}
40
41wwdumpnvis(w)
42register struct ww *w;
43{
44 register i;
1023bffa 45 char buf[20];
3f60a359 46
3130283e 47 tt.tt_nmodes = 0;
3f60a359 48 (*tt.tt_clear)();
1023bffa
EW
49 for (i = w->ww_i.t; i < w->ww_i.b; i++) {
50 (*tt.tt_move)(i, w->ww_i.l);
51 (void) sprintf(buf, "%d", w->ww_nvis[i]);
52 (*tt.tt_write)(buf, strlen(buf));
3f60a359
EW
53 }
54}
55
56wwdumpsmap()
57{
58 register i, j;
59
3130283e 60 tt.tt_nmodes = 0;
3f60a359
EW
61 (*tt.tt_clear)();
62 for (i = 0; i < wwnrow; i++) {
63 (*tt.tt_move)(i, 0);
64 for (j = 0; j < wwncol; j++)
65 (*tt.tt_putc)(cmap[wwsmap[i][j]]);
66 }
67}
68
3f60a359
EW
69wwdumpns()
70{
71 register i, j;
72
3f60a359
EW
73 (*tt.tt_clear)();
74 for (i = 0; i < wwnrow; i++) {
75 (*tt.tt_move)(i, 0);
76 for (j = 0; j < wwncol; j++) {
3130283e 77 tt.tt_nmodes = wwns[i][j].c_m & tt.tt_availmodes;
3f60a359
EW
78 (*tt.tt_putc)(wwns[i][j].c_c);
79 }
80 }
81}
82
83wwdumpos()
84{
85 register i, j;
86
f86b4409 87 (*tt.tt_clear)();
3f60a359
EW
88 for (i = 0; i < wwnrow; i++) {
89 (*tt.tt_move)(i, 0);
90 for (j = 0; j < wwncol; j++) {
3130283e 91 tt.tt_nmodes = wwos[i][j].c_m & tt.tt_availmodes;
3f60a359
EW
92 (*tt.tt_putc)(wwns[i][j].c_c);
93 }
94 }
95}