* Copyright (c) 1980 The Regents of the University of California.
* Redistribution and use in source and binary forms are permitted
* provided that the above copyright notice and this paragraph are
* duplicated in all such forms and that any documentation,
* advertising materials, and other materials related to such
* distribution and use acknowledge that the software was developed
* by the University of California, Berkeley. The name of the
* University may not be used to endorse or promote products derived
* from this software without specific prior written permission.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
"@(#) Copyright (c) 1980 The Regents of the University of California.\n\
static char sccsid
[] = "@(#)colcrt.c 5.3 (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
++)