CGI laserjet landscape bug
Ronald Florence
ron at mlfarm.UUCP
Wed Jul 19 23:33:22 AEST 1989
The laserjet driver supplied with SCO CGI version 1.1 appears to have
a bug in landscape mode. Every line of raster output comes out
preceded by the positioning sequence "\033&a864V" -- the effect of
which is to print every line of output at the same place on the page.
Calls, faxes, and email to SCO have gotten kind replies from Ned
Hogan, one of their support engineers, but no real solutions. We have
had to use a kludge-filter in our lp-interface to klobber the
offending escape sequences.
Has anyone come up with a better solution?
#! /bin/sh
# This is a shell archive, meaning:
# 1. Remove everything above the #! /bin/sh line.
# 2. Save the resulting text in a file.
# 3. Execute the file with /bin/sh (not csh) to create:
# cgiland.c
# This archive created: Wed Jul 19 09:27:58 1989
# By: Ronald Florence (Maple Lawn Farm, Stonington, CT)
export PATH; PATH=/bin:/usr/bin:$PATH
echo shar: "extracting 'cgiland.c'" '(1024 characters)'
if test -f 'cgiland.c'
then
echo shar: "will not over-write existing file 'cgiland.c'"
else
sed 's/^X//' << \SHAR_EOF > 'cgiland.c'
X/*
X * cgiland.c - kludge to filter \033&a864V sequences out of
X * SCO CGI laserjet landscape output
X * copyright 1989 Ronald Florence (ron at mlfarm)
X */
X
X#include <stdio.h>
X#define ESC \033
X
XS_graph()
X{
X register c, checking = 0;
X int quit = 0;
X char save[8];
X
X while ((c = getchar()) != EOF)
X {
X if (c != ESC && checking == 0)
X putchar(c);
X else
X {
X switch (checking)
X {
X case 0 :
X break;
X case 1:
X if (c != '&')
X quit++;
X break;
X case 2:
X if (c != 'a')
X quit++;
X break;
X case 3:
X if (c != '8')
X quit++;
X break;
X case 4:
X if (c != '6')
X quit++;
X break;
X case 5:
X if (c != '4')
X quit++;
X break;
X case 6:
X if (c != 'V')
X quit++;
X break;
X }
X save[checking] = c;
X checking++;
X if (quit)
X {
X register k;
X for (k = 0; k < checking; k++)
X putchar (save[k]);
X checking = 0;
X quit = 0;
X }
X else if (checking == 7)
X checking = 0;
X }
X }
X}
X
X
SHAR_EOF
if test 1024 -ne "`wc -c < 'cgiland.c'`"
then
echo shar: "error transmitting 'cgiland.c'" '(should have been 1024 characters)'
fi
fi
exit 0
# End of shell archive
--
Ronald Florence
ron at mlfarm.uucp
...{hsi!aati,rayssd}!mlfarm!ron
More information about the Comp.unix.xenix
mailing list