* Copyright (c) 1980 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
"@(#) Copyright (c) 1980 Regents of the University of California.\n\
static char sccsid
[] = "@(#)colcrt.c 5.1 (Berkeley) %G%";
* colcrt - replaces col for crts with new nroff esp. when using tbl.
* Bill Joy UCB July 14, 1977
* This filter uses a screen buffer, 267 half-lines by 132 columns.
* It interprets the up and down sequences generated by the new
* nroff when used with tbl and by \u \d and \r.
* General overstriking doesn't work correctly.
* Underlining is split onto multiple lines, etc.
* Option - suppresses all underlining.
* Option -2 forces printing of all half lines.
while (argc
> 0 && argv
[0][0] == '-') {
printf("usage: %s [ - ] [ -2 ] [ file ... ]\n", progname
);
if ((f
=fopen(argv
[0], "r")
cp
= &page
[outline
][outcol
];
for (cp
--; cp
>= dp
&& *cp
== 0; cp
--)
if (plus(c
, *cp
) || plus(*cp
, c
))
else if (*cp
== ' ' || *cp
== 0)
return (c
== '|' && d
== '-' || d
== '_');
for (i
= first
| 1; i
< l
; i
++) {
for (i
= first
; i
< l
; i
++) {
if (printall
== 0 && lastomit
== 0 && *cp
== 0) {
bcopy(page
[ol
], page
, (267 - ol
) * 132);
bzero(page
[267- ol
], ol
* 132);
for (cp
= page
[l
], dp
= page
[m
]; *cp
; cp
++, dp
++) {
if (*dp
!= ' ' && *dp
!= '|' && *dp
!= 0)
for (cp
= page
[l
], dp
= page
[m
]; *cp
; cp
++, dp
++)