[comp.sources.bugs] Patch 5 for psroff

clewis@eci386.uucp (Chris Lewis) (12/15/89)

	Patch 05 for psroff, please install it.

	To install the patch, please:

	cd to your psroff source directory
	restore the original defs.h and Makefile
	unshar this patch
	execute the file 'prepatch', by executing 'sh ./prepatch'
	patch -p < Patch05
	Please read README for patch 05 and see if any of the
	the changes affect your installation.
	Reconfigure the new defs.h and Makefile to match your system
	make
	su root
	make install
#! /bin/sh
# This is a shell archive.  Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file".  To overwrite existing
# files, type "sh file -c".  You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g..  If this archive is complete, you
# will see the following message at the end:
#		"End of archive 1 (of 1)."
# Contents:  ./Intro.05 ./Patch05 ./fontps/DESC ./prepatch
# Wrapped by clewis@eci386 on Thu Dec 14 11:42:36 1989
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f './Intro.05' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'./Intro.05'\"
else
echo shar: Extracting \"'./Intro.05'\" \(435 characters\)
sed "s/^X//" >'./Intro.05' <<'END_OF_FILE'
X	Patch 05 for psroff, please install it.
X
X	To install the patch, please:
X
X	cd to your psroff source directory
X	restore the original defs.h and Makefile
X	unshar this patch
X	execute the file 'prepatch', by executing 'sh ./prepatch'
X	patch -p < Patch05
X	Please read README for patch 05 and see if any of the
X	the changes affect your installation.
X	Reconfigure the new defs.h and Makefile to match your system
X	make
X	su root
X	make install
END_OF_FILE
if test 435 -ne `wc -c <'./Intro.05'`; then
    echo shar: \"'./Intro.05'\" unpacked with wrong size!
fi
# end of './Intro.05'
fi
if test -f './Patch05' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'./Patch05'\"
else
echo shar: Extracting \"'./Patch05'\" \(41823 characters\)
sed "s/^X//" >'./Patch05' <<'END_OF_FILE'
X*** /usr4/public/src/t2current/./t2conf.c	Thu Dec 14 11:40:22 1989
X--- ./t2conf.c	Thu Dec 14 11:41:26 1989
X***************
X*** 18,27 ****
X  
X  #ifndef	SVR3
X  #ifndef	lint
X! static char SCCSid[] = "@(#)t2conf.c: 1.8 Copyright 89/11/09 13:29:42 Chris Lewis";
X  #endif
X  #else
X! #ident  "@(#)t2conf.c: 1.8 Copyright 89/11/09 13:29:42 Chris Lewis"
X  #endif
X  
X  #ifdef	PS
X--- 18,27 ----
X  
X  #ifndef	SVR3
X  #ifndef	lint
X! static char SCCSid[] = "@(#)t2conf.c: 1.10 Copyright 89/12/13 13:15:50 Chris Lewis";
X  #endif
X  #else
X! #ident  "@(#)t2conf.c: 1.10 Copyright 89/12/13 13:15:50 Chris Lewis"
X  #endif
X  
X  #ifdef	PS
X***************
X*** 35,40 ****
X--- 35,44 ----
X  #ifdef	DT
X  #include "dt.h"
X  #endif
X+ 
X+ /*	Common variables */
X+ int	pagePending = 1;
X+ int	currentPage = 0;
X  
X  struct backend B[] = {
X  /*   bename,	beprolog,	beepilog,	bechar,	bepage,	befontsel */
X*** /usr4/public/src/t2current/./gfnttab.sh	Thu Dec 14 11:40:55 1989
X--- ./gfnttab.sh	Thu Dec 14 11:41:27 1989
X***************
X*** 1,62 ****
X  :
X! #@(#)gfnttab.sh 1.6 89/12/06
X  #	Set this to something non-null if you need a.out.h/COFF
X  #	headers on your width files, and the COFF/HEADERSIZE
X  #	defines cause dit2catwid to generate width tables that
X  #	troff screams about.
X  COMPILE=
X! install=$1
X! trap "exit 1" 0 1 2 3 15
X! if [ -n "$install" -a ! -d /usr/lib/oldfonts ]
X  then
X!     if mkdir /usr/lib/oldfonts
X      then
X! 	:
X      else
X! 	exit 1
X      fi
X!     cp /usr/lib/font/* /usr/lib/oldfonts
X  fi
X! set -e
X! rm -f /tmp/S
X! cp font/S /tmp/S
X! chmod 644 /tmp/S
X! sed -e '1,/charset/d' font/S2 >> /tmp/S
X! for i in font/[A-Z]*
X  do
X      case $i in
X! 	font/S)
X! 	    echo "Generating font S"
X! 	    if [ -n "$COMPILE" ]
X! 	    then
X! 		./dit2catwid -cs /tmp/S font/R font/ftS.c
X! 		cc -c font/ftS.c
X! 		mv ftS.o font/ftS
X! 	    else
X! 		./dit2catwid -s /tmp/S font/R font/ftS
X! 	    fi
X  	    ;;
X! 	font/S2)
X  	    continue
X  	    ;;
X  	*)
X! 	    f=`basename $i`
X! 	    echo "Generating font $f"
X! 	    if [ -n "$COMPILE" ]
X! 	    then
X! 		./dit2catwid -c /tmp/S $i font/ft${f}.c
X! 		cc -c font/ft${f}.c
X! 		mv ft${f}.o font/ft${f}
X! 	    else
X! 		./dit2catwid /tmp/S $i font/ft${f}
X! 	    fi
X  	    ;;
X      esac
X  done
X! trap "" 0
X  if [ -n "$install" ]
X  then
X!     mv font/ft* /usr/lib/font
X!     exit $?
X  fi
X  exit 0
X--- 1,149 ----
X  :
X! #@(#)gfnttab.sh 1.8 89/12/13
X  #	Set this to something non-null if you need a.out.h/COFF
X  #	headers on your width files, and the COFF/HEADERSIZE
X  #	defines cause dit2catwid to generate width tables that
X  #	troff screams about.
X  COMPILE=
X! rc=1
X! dir=$1
X! install=$2
X! curdir=`pwd`
X! trap "echo GFNTTAB failed ; exit \$rc" 0
X! if [ -z "$dir" ]
X  then
X!     echo "Missing font directory argument"
X!     exit
X! fi
X! echo "GFNTTAB: Processing font directory $dir"
X! if [ -n "$install" ]
X! then
X!     ffile=$curdir/fonts.$install.new
X! else
X!     ffile=`basename $dir | sed -e 's/^.*\(..\)$/\1/'`
X!     ffile=$curdir/fonts.$ffile.new
X! fi
X! rm -f $ffile
X! if [ ! -d $dir ]
X! then
X!     echo "No $dir directory"
X!     exit
X! fi
X! cd $dir
X! rm -f /tmp/S
X! if [ -r S ]
X! then
X!     cp S /tmp/S
X!     chmod 644 /tmp/S
X!     if [ -r S2 ]
X      then
X! 	sed -e '1,/charset/d' S2 >> /tmp/S
X!     fi
X! else
X!     echo "WARNING: no symbol font!"
X!     > /tmp/S
X! fi
X! DESC=DESC
X! if [ -r $DESC ]
X! then
X!     res=`sed -n -e 's/^[ 	]*res[ 	][ 	]*\([0-9][0-9]*\).*/\1/p' $DESC`
X!     if [ -z "$res" ]
X!     then
X! 	echo "WARNING: no `res' command in DESC - assuming 720"
X! 	res="-r 720"
X      else
X! 	res="-r $res"
X      fi
X! else
X!     echo "WARNING: no DESC file in $dir - assuming 'res 720'"
X!     res="-r 720"
X  fi
X! for i in [A-Z]*
X  do
X      case $i in
X! 	??) ;;
X! 	?) ;;
X! 	*) continue ;;
X!     esac
X!     trc=0
X!     if [ "$i" != S2 ]
X!     then
X! 	Cline=`sed -e '1q' $i | sed -e 's/^#[ 	]*//'`
X! 	echo "$i	$Cline" >> $ffile
X!     fi
X!     case $i in
X! 	S)
X! 	    args="-s /tmp/S R"
X  	    ;;
X! 	S2)
X  	    continue
X  	    ;;
X  	*)
X! 	    args="/tmp/S $i"
X  	    ;;
X      esac
X+     echo "GFNTTAB: processing font $i ($Cline)"
X+     if [ -n "$COMPILE" ]
X+     then
X+ 	$curdir/dit2catwid $res -c $args ft${i}.c
X+ 	if [ $? != 0 ]
X+ 	then
X+ 	    trc=1
X+ 	else
X+ 	    cc -c ft${i}.c
X+ 	    trc=$?
X+ 	    mv ft${i}.o ft${i}
X+ 	fi
X+     else
X+ 	$curdir/dit2catwid $res $args ft${i}
X+ 	trc=$?
X+     fi
X+     if [ $trc != 0 ]
X+     then
X+ 	rc=2
X+     fi
X  done
X! if [ $rc -gt 1 ]
X! then
X!     exit
X! fi
X! if [ -s "$ffile" ]
X! then
X!     ed - $ffile <<\!
X! 0a
X! DUM
X! DUM
X! DUM
X! DUM
X! .
X! g/^R	/m0
X! g/^I	/m1
X! g/^B	/m2
X! g/^S	/m3
X! 4a
X! ..	BracketFont
X! .
X! g/^DUM/d
X! w
X! q
X! !
X! fi
X! if [ $? != 0 ]
X! then
X!     exit
X! fi
X  if [ -n "$install" ]
X  then
X!     if [ ! -d /usr/lib/font/$install ]
X!     then
X! 	mkdir /usr/lib/font/$install
X!     fi
X!     mv ft* /usr/lib/font/$install
X!     if [ $? != 0 ]
X!     then
X! 	exit
X!     fi
X  fi
X+ trap '' 0
X+ rc=0
X  exit 0
X*** /usr4/public/src/t2current/./troff2ps.1	Thu Dec 14 11:40:58 1989
X--- ./troff2ps.1	Thu Dec 14 11:41:30 1989
X***************
X*** 1,4 ****
X! .\"Copyright 1988 by Chris Lewis 1.5 89/12/06
X  .TH TROFF2PS 1 local
X  .SH NAME
X  troff2ps, troff2lj, troff2xx \- convert troff output to Postscript, HP etc.
X--- 1,4 ----
X! .\"Copyright 1988 by Chris Lewis 1.7 89/12/12
X  .TH TROFF2PS 1 local
X  .SH NAME
X  troff2ps, troff2lj, troff2xx \- convert troff output to Postscript, HP etc.
X***************
X*** 5,11 ****
X  .SH SYNOPSIS
X  .BI /usr/lib/troff2/troff2 xx
X  [-D] 
X! .RI "[-d" xx "]"
X  .RI "[-l" length "]"
X  [-V] [-M]
X  .SH DESCRIPTION
X--- 5,12 ----
X  .SH SYNOPSIS
X  .BI /usr/lib/troff2/troff2 xx
X  [-D] 
X! .RI "[-T" xx "]"
X! .RI "[-R" nn "]"
X  .RI "[-l" length "]"
X  [-V] [-M]
X  .SH DESCRIPTION
X***************
X*** 48,59 ****
X  units and points respectively.
X  .P
X  The
X! .BI -d xx
X  option can be used to override the format determined by looking at the
X  last two characters of how 
X  .I troff2ps 
X  was invoked.
X! For example, "troff2ps -dlj" will generate Laserjet output.
X  .P
X  The
X  .B -D
X--- 49,60 ----
X  units and points respectively.
X  .P
X  The
X! .BI -T xx
X  option can be used to override the format determined by looking at the
X  last two characters of how 
X  .I troff2ps 
X  was invoked.
X! For example, "troff2ps -Tlj" will generate Laserjet output.
X  .P
X  The
X  .B -D
X***************
X*** 71,76 ****
X--- 72,90 ----
X  A trailer page of statistics can be generated by using the
X  .B -M
X  option provided that the driver supports it.
X+ .P
X+ Where 
X+ .I troff2ps 
X+ is generating output for another typesetting filter (eg: jetroff),
X+ sometimes the filter will require different resolution settings for output.
X+ For example, jetroff parsing of ditroff input assumes a resolution of
X+ 300 in character positioning, but jetroff does not parse the "x res <nn>"
X+ command.
X+ The 
X+ .BI "[-R" nn "]"
X+ option allows you to specify the resolution that the output filter expects.
X+ Ditroff output has the default resolution set to 300.
X+ (Which is compatible with jetroff.)
X  .SH "SPECIAL REQUESTS"
X  .BI troff2 xx
X  supports a number of additional features over and above bare
X*** /usr4/public/src/t2current/./dt.h	Thu Dec 14 11:38:34 1989
X--- ./dt.h	Thu Dec 14 11:41:31 1989
X***************
X*** 14,33 ****
X  
X  #ifndef	SVR3
X  #ifndef	lint
X! static char dtID[] = "@(#)dt.h: 1.1 Copyright 89/06/14 17:40:54 Chris Lewis";
X  #endif
X  #else
X! #ident  "@(#)dt.h: 1.1 Copyright 89/06/14 17:40:54 Chris Lewis"
X  #endif
X  
X  /*	This is actually done in the back-end */
X! #define	DTRESOLUTION	432
X  /*	Length scaling factor */
X! #define	DTSCALEFACTOR	((double) DTRESOLUTION / TROFFRESOLUTION)
X  /*	Troff assumes 7.5" paper width, most macro packages print in
X  	6.5" area within that.  Sooo, we'll center the paperwidth on the 
X  	physical page - implying .5" inch physical margins.*/
X! #define	TROFF2DTX(x) ((x) * DTSCALEFACTOR + DTRESOLUTION / 2)
X  /*	11" paper length */
X  #define	TROFF2DTY(y) ((y) * DTSCALEFACTOR)
X  
X--- 14,33 ----
X  
X  #ifndef	SVR3
X  #ifndef	lint
X! static char dtID[] = "@(#)dt.h: 1.2 Copyright 89/12/08 15:35:07 Chris Lewis";
X  #endif
X  #else
X! #ident  "@(#)dt.h: 1.2 Copyright 89/12/08 15:35:07 Chris Lewis"
X  #endif
X  
X  /*	This is actually done in the back-end */
X! #define	DTRESOLUTION	300
X  /*	Length scaling factor */
X! #define	DTSCALEFACTOR	((double) dtresolution / TROFFRESOLUTION)
X  /*	Troff assumes 7.5" paper width, most macro packages print in
X  	6.5" area within that.  Sooo, we'll center the paperwidth on the 
X  	physical page - implying .5" inch physical margins.*/
X! #define	TROFF2DTX(x) ((x) * DTSCALEFACTOR + dtresolution / 2)
X  /*	11" paper length */
X  #define	TROFF2DTY(y) ((y) * DTSCALEFACTOR)
X  
X***************
X*** 41,45 ****
X  #define	DTNAME	"dt"
X  
X  #ifdef	DT
X! struct troff2befont dtSymFont[], dtStdFont[];
X  #endif
X--- 41,46 ----
X  #define	DTNAME	"dt"
X  
X  #ifdef	DT
X! extern struct troff2befont dtSymFont[], dtStdFont[];
X! extern int dtresolution;
X  #endif
X*** /usr4/public/src/t2current/./psroff.sh	Thu Dec 14 11:40:59 1989
X--- ./psroff.sh	Thu Dec 14 11:41:31 1989
X***************
X*** 11,17 ****
X  #	Author: 	Chris Lewis
X  #	Specs:		troff driver
X  #
X! #ident  "@(#)psroff.sh: 1.19 Copyright 89/12/06 15:28:43 Chris Lewis"
X  term=false
X  type=`basename $0 | sed -e 's/^\(..\).*/\1/'`
X  copies=1
X--- 11,19 ----
X  #	Author: 	Chris Lewis
X  #	Specs:		troff driver
X  #
X! #ident  "@(#)psroff.sh: 1.22 Copyright 89/12/12 15:55:55 Chris Lewis"
X! troff=troff
X! #troff=/usr2/clewis/src/spxroff/tnroff/troff
X  term=false
X  type=`basename $0 | sed -e 's/^\(..\).*/\1/'`
X  copies=1
X***************
X*** 25,31 ****
X  	    term=true
X  	    ;;
X  	-T*)
X! 	    device=`echo $i | sed -e 's/-T//'`
X  	    ;;
X  	-d*)
X  	    type=`echo $i | sed -e 's/-d//'`
X--- 27,33 ----
X  	    term=true
X  	    ;;
X  	-T*)
X! 	    type=`echo $i | sed -e 's/-T//'`
X  	    ;;
X  	-d*)
X  	    type=`echo $i | sed -e 's/-d//'`
X***************
X*** 33,39 ****
X  	-n*)
X  	    copies=`echo $i | sed -e 's/-n//'`
X  	    ;;
X! 	-D | -M)
X  	    debug="$debug $i"
X  	    ;;
X  	-m*)
X--- 35,41 ----
X  	-n*)
X  	    copies=`echo $i | sed -e 's/-n//'`
X  	    ;;
X! 	-D | -M | -R*)
X  	    debug="$debug $i"
X  	    ;;
X  	-m*)
X***************
X*** 49,55 ****
X  		exit 1
X  	    fi
X  	    files="$files $file"
X- 	    seenmacro=1
X  	    ;;
X  	-)
X  	    files="$files $i"
X--- 51,56 ----
X***************
X*** 81,87 ****
X      esac
X  done
X  
X! if [ -n "$seenmac" -a -z "$seenfiles" ]
X  then
X      files="$files -"
X  fi
X--- 82,88 ----
X      esac
X  done
X  
X! if [ -z "$seenfiles" ]
X  then
X      files="$files -"
X  fi
X***************
X*** 107,115 ****
X  esac
X  if $term
X  then
X!     ( troff -t $args $files 2>&1 ) | $t2 $length -d$type $debug $device
X      exit $?
X  else
X!     eval "( troff -t $args $files 2>&1 ) | $t2 $length -d$type $debug $device $OUTPUT"
X      exit $?
X  fi
X--- 108,116 ----
X  esac
X  if $term
X  then
X!     ( $troff -t -T$type $args $files 2>&1 ) | $t2 $length -T$type $debug
X      exit $?
X  else
X!     eval "( $troff -t -T$type $args $files 2>&1 ) | $t2 $length -T$type $debug $OUTPUT"
X      exit $?
X  fi
X*** /usr4/public/src/t2current/./dt.c	Thu Dec 14 11:41:00 1989
X--- ./dt.c	Thu Dec 14 11:41:33 1989
X***************
X*** 16,29 ****
X  #ifdef	DT
X  #include "dt.h"
X  
X- int currentPage = 0;
X  
X  #ifndef	SVR3
X  #ifndef	lint
X! static char SCCSid[] = "@(#)dt.c: 1.7 Copyright 89/12/05 14:04:01 Chris Lewis";
X  #endif
X  #else
X! #ident  "@(#)dt.c: 1.7 Copyright 89/12/05 14:04:01 Chris Lewis" /*(SVR3)*/
X  #endif
X  
X  #define	MAXFONT	50
X--- 16,28 ----
X  #ifdef	DT
X  #include "dt.h"
X  
X  
X  #ifndef	SVR3
X  #ifndef	lint
X! static char SCCSid[] = "@(#)dt.c: 1.9 Copyright 89/12/13 11:28:39 Chris Lewis";
X  #endif
X  #else
X! #ident  "@(#)dt.c: 1.9 Copyright 89/12/13 11:28:39 Chris Lewis" /*(SVR3)*/
X  #endif
X  
X  #define	MAXFONT	50
X***************
X*** 36,41 ****
X--- 35,42 ----
X      int	 flags;
X  } dtFts[MAXFONT+1];
X  
X+ int dtresolution = DTRESOLUTION;
X+ 
X  struct dtFts *t2dtf[8];
X  
X  struct troff2befont dtStdFont[108] = {
X***************
X*** 452,458 ****
X      printf("#DocumentFonts: (atend)\n");
X      printf("#EndComments\n");
X      printf("x T %s\n", device);
X!     printf("x res %d %d %d\n", DTRESOLUTION, 1, 1);
X      printf("x init\n");
X  
X  }
X--- 453,459 ----
X      printf("#DocumentFonts: (atend)\n");
X      printf("#EndComments\n");
X      printf("x T %s\n", device);
X!     printf("x res %d %d %d\n", dtresolution, 1, 1);
X      printf("x init\n");
X  
X  }
X***************
X*** 499,505 ****
X  FILE *f; {
X      struct dtFts *p = dtFts;
X      extern char *malloc();
X-     int flags;
X      char rbuf[512], nbuf[512], dtbuf[512];
X      while(fgets(rbuf, sizeof(rbuf), f)) {
X  	if (rbuf[0] == '#')
X--- 500,505 ----
X*** /usr4/public/src/t2current/./fonts.ps	Thu Dec 14 11:41:01 1989
X--- ./fonts.ps	Thu Dec 14 11:41:34 1989
X***************
X*** 1,4 ****
X! #@(#)fonts.ps 1.11 89/12/06
X  #	DO NOT CHANGE THE ORDER OF THE FIRST FOUR LINES - THESE ARE
X  #	THE DEFAULT TROFF FONTS IN POSITIONS 1-5.  IN PARTICULAR, IF
X  #	SYMBOL ISN'T THE FOURTH ENTRY AND BRACKETFONT ISN'T THE FIFTH, 
X--- 1,4 ----
X! #@(#)fonts.ps 1.15 89/12/13
X  #	DO NOT CHANGE THE ORDER OF THE FIRST FOUR LINES - THESE ARE
X  #	THE DEFAULT TROFF FONTS IN POSITIONS 1-5.  IN PARTICULAR, IF
X  #	SYMBOL ISN'T THE FOURTH ENTRY AND BRACKETFONT ISN'T THE FIFTH, 
X***************
X*** 11,20 ****
X  S	Symbol
X  ..	BracketFont
X  AB	AvantGarde-Demi
X! AI	AvantGarde-DemiItalic
X  AR	AvantGarde-Book
X! AX	AvantGarde-BookOblique
X  BI	Times-BoldItalic
X  C	Courier
X  CB	Courier-Bold
X  CO	Courier-Oblique
X--- 11,24 ----
X  S	Symbol
X  ..	BracketFont
X  AB	AvantGarde-Demi
X! AI	AvantGarde-BookOblique
X  AR	AvantGarde-Book
X! AX	AvantGarde-DemiOblique
X! BB	Bookman-Demi
X  BI	Times-BoldItalic
X+ BO	Bookman-LightItalic
X+ BR	Bookman-Light
X+ BX	Bookman-DemiItalic
X  C	Courier
X  CB	Courier-Bold
X  CO	Courier-Oblique
X***************
X*** 31,38 ****
X  NI	NewCenturySchlbk-Italic
X  NR	NewCenturySchlbk-Roman
X  NX	NewCenturySchlbk-BoldItalic
X  PB	Palatino-Bold
X! PI	Palatino-Italic PalatPI
X! PR	Palatino-Roman
X! PX	Palatino-BoldItalic PalatPX
X  ZC	ZapfChancery-MediumItalic
X--- 35,42 ----
X  NI	NewCenturySchlbk-Italic
X  NR	NewCenturySchlbk-Roman
X  NX	NewCenturySchlbk-BoldItalic
X+ PA	Palatino-Roman
X  PB	Palatino-Bold
X! PI	Palatino-Italic
X! PX	Palatino-BoldItalic
X  ZC	ZapfChancery-MediumItalic
X*** /usr4/public/src/t2current/./psxlate.c	Thu Dec 14 11:39:28 1989
X--- ./psxlate.c	Thu Dec 14 11:41:35 1989
X***************
X*** 12,27 ****
X   */
X  #ifndef	SVR3
X  #ifndef	lint
X! static char SCCSid[] = "@(#)psxlate.c: 1.4 Copyright 89/04/21 11:48:27 Chris Lewis";
X  #endif
X  #else
X! #ident  "@(#)psxlate.c: 1.4 Copyright 89/04/21 11:48:27 Chris Lewis"
X  #endif
X  #include <stdio.h>
X  
X  int	xlate = 0;
X  #define	MAXPAGE	1000
X  
X  struct headers {
X      char *hptr;
X      struct headers *next;
X--- 12,33 ----
X   */
X  #ifndef	SVR3
X  #ifndef	lint
X! static char SCCSid[] = "@(#)psxlate.c: 1.5 Copyright 89/12/12 15:50:44 Chris Lewis";
X  #endif
X  #else
X! #ident  "@(#)psxlate.c: 1.5 Copyright 89/12/12 15:50:44 Chris Lewis"
X  #endif
X  #include <stdio.h>
X  
X  int	xlate = 0;
X  #define	MAXPAGE	1000
X+ #define	BUFFERSIZE	512
X  
X+ /* define if you want to page flip %! documents (eg: some TeX out stuff)
X+    not recommended....
X+  */
X+ #undef	TRYPERBANG
X+ 
X  struct headers {
X      char *hptr;
X      struct headers *next;
X***************
X*** 37,80 ****
X  char *tmp = "/tmp/psxXXXXXX";
X  int page = 0;
X  char *progname;
X! int debug;
X  
X  main(argc, argv)
X  int argc; char **argv; {
X      extern int optind;
X      int c;
X      progname = argv[0];
X!     while ((c = getopt(argc, argv, "drx")) != EOF)
X  	switch(c) {
X  	    case 'r': xlate = 0; break;
X  	    case 'x': xlate = 1; break;
X  	    case 'd': debug = 1; break;
X  	    default:
X  		usage();
X  		exit(1);
X  	}
X!     mktemp(tmp);
X!     scan(stdin, tmp);
X!     transform();
X!     emit(tmp);
X      if (!debug)
X  	cleanup();
X      exit(0);
X  }
X  
X! scan(f, file)
X! FILE *f; char *file; {
X      FILE *t;
X      extern char *malloc();
X      int state = 1;
X      long ind = 0;
X      int c;
X!     char buf[100];
X      if ((t = fopen(file, "w")) == NULL) {
X  	fprintf(stderr, "Cannot open temporary file %s\n", file);
X  	exit(1);
X      }
X!     page = 0;
X      while((c = getc(f)) != EOF) {
X  	putc(c, t);
X  	ind++;
X--- 43,116 ----
X  char *tmp = "/tmp/psxXXXXXX";
X  int page = 0;
X  char *progname;
X! int debug, verbose;
X! 
X  
X  main(argc, argv)
X  int argc; char **argv; {
X      extern int optind;
X+     char buffer[BUFFERSIZE];
X      int c;
X      progname = argv[0];
X!     while ((c = getopt(argc, argv, "drxv")) != EOF)
X  	switch(c) {
X  	    case 'r': xlate = 0; break;
X  	    case 'x': xlate = 1; break;
X  	    case 'd': debug = 1; break;
X+ 	    case 'v': verbose = 1; break;
X  	    default:
X  		usage();
X  		exit(1);
X  	}
X!     if (fgets(buffer, BUFFERSIZE, stdin)) {
X! 	if (strncmp(buffer, "%!PS-Adobe-", 11) == 0) {
X! 	    if (verbose)
X! 		fprintf(stderr, "DEBUG: conformant file %s\n", buffer);
X! 	    mktemp(tmp);
X! 	    scan(stdin, tmp, buffer);
X! 	    transform();
X! 	    emit(tmp);
X! #ifdef	TRYPERBANG
X! 	} else if (strncmp(buffer, "%!", 2) == 0) {
X! 	    if (verbose)
X! 		fprintf(stderr, "DEBUG: hopefully conformant file %s\n", buffer);
X! 	    mktemp(tmp);
X! 	    scan(stdin, tmp, buffer);
X! 	    transform();
X! 	    emit(tmp);
X! #endif
X! 	} else {
X! 	    if (verbose)
X! 		fprintf(stderr, "DEBUG: nonconformant file %s\n", buffer);
X! 	    fputs(buffer, stdout);
X! 	    while ((c = fread(buffer, 1, sizeof(buffer), stdin)) > 0)
X! 		fwrite(buffer, 1, c, stdout);
X! 	}
X!     }
X      if (!debug)
X  	cleanup();
X      exit(0);
X  }
X  
X! scan(f, file, buffer)
X! FILE *f; 
X! char *file, *buffer; {
X      FILE *t;
X      extern char *malloc();
X      int state = 1;
X      long ind = 0;
X      int c;
X! 
X      if ((t = fopen(file, "w")) == NULL) {
X  	fprintf(stderr, "Cannot open temporary file %s\n", file);
X  	exit(1);
X      }
X!     fputs(buffer, t);
X!     ind += strlen(buffer);
X!     pageidx[page].start = 0;
X!     strcpy(pageidx[page].type = malloc(strlen(buffer)+1), buffer);
X!     add(page, buffer);
X!     page = 1;
X      while((c = getc(f)) != EOF) {
X  	putc(c, t);
X  	ind++;
X***************
X*** 86,105 ****
X  		break;
X  	    case 1:	/* seen \n */
X  		if (c == '%') {
X! 		    fgets(buf, sizeof(buf), f);
X! 		    fputs(buf, t);
X! 		    if (0 == strncmp(buf, "!PS-Adobe", 9) ||
X! 			0 == strncmp(buf, "%Page:", 6) ||
X! 			0 == strncmp(buf, "%Trailer", 8)) {
X! 			if (page)
X! 			    pageidx[page-1].end = ind - 2;
X  			pageidx[page].start = ind - 1;
X! 			strcpy(pageidx[page].type = malloc(strlen(buf)+1), buf);
X! 			add(page, buf);
X  			page++;
X  		    } else
X! 			add(page, buf);
X! 		    ind += strlen(buf);
X  		    break;
X  		}
X  		state = 0;
X--- 122,141 ----
X  		break;
X  	    case 1:	/* seen \n */
X  		if (c == '%') {
X! 		    fgets(buffer, BUFFERSIZE, f);
X! 		    fputs(buffer, t);
X! 		    if (0 == strncmp(buffer, "%Page:", 6) ||
X! 			0 == strncmp(buffer, "%Page ", 6) ||
X! 			0 == strncmp(buffer, "%Trailer", 8)) {
X! 			pageidx[page-1].end = ind - 2;
X  			pageidx[page].start = ind - 1;
X! 			strcpy(pageidx[page].type = malloc(strlen(buffer)+1),
X! 			    buffer);
X! 			add(page, buffer);
X  			page++;
X  		    } else
X! 			add(page, buffer);
X! 		    ind += strlen(buffer);
X  		    break;
X  		}
X  		state = 0;
X***************
X*** 146,155 ****
X      register struct headers *h;
X      if (debug) {
X  	for (i = 0; i < page; i++) {
X! 	    fprintf(stderr, "%d %d %d %s\n", i, pageidx[i].start, 
X  		pageidx[i].end, pageidx[i].type);
X  	    for (h = pageidx[i].comments; h; h=h->next)
X! 		fprintf(stderr, "%s", h->hptr);
X  	}
X      }
X  }
X--- 182,191 ----
X      register struct headers *h;
X      if (debug) {
X  	for (i = 0; i < page; i++) {
X! 	    fprintf(stderr, "Page: %d %d %d %s\n", i, pageidx[i].start, 
X  		pageidx[i].end, pageidx[i].type);
X  	    for (h = pageidx[i].comments; h; h=h->next)
X! 		fprintf(stderr, "  %s", h->hptr);
X  	}
X      }
X  }
X***************
X*** 170,176 ****
X  fstart() {
X      register int i;
X      for (i = 0; i < page; i++)
X! 	if (0 == strncmp(pageidx[i].type, "%Page:", 6))
X  	    break;
X      return(i);
X  }
X--- 206,212 ----
X  fstart() {
X      register int i;
X      for (i = 0; i < page; i++)
X! 	if (0 == strncmp(pageidx[i].type, "%Page", 5))
X  	    break;
X      return(i);
X  }
X***************
X*** 177,183 ****
X  fend() {
X      register int i;
X      for (i = page-1; i >= 0; i--)
X! 	if (0 == strncmp(pageidx[i].type, "%Page:", 6))
X  	    break;
X      return(i);
X  }
X--- 213,219 ----
X  fend() {
X      register int i;
X      for (i = page-1; i >= 0; i--)
X! 	if (0 == strncmp(pageidx[i].type, "%Page:", 5))
X  	    break;
X      return(i);
X  }
X*** /usr4/public/src/t2current/./lj.h	Thu Dec 14 11:41:05 1989
X--- ./lj.h	Thu Dec 14 11:41:35 1989
X***************
X*** 16,25 ****
X  
X  #ifndef	SVR3
X  #ifndef	lint
X! static char ljID[] = "@(#)lj.h: 1.6 Copyright 89/12/05 14:04:08 Chris Lewis";
X  #endif
X  #else
X! #ident  "@(#)lj.h: 1.6 Copyright 89/12/05 14:04:08 Chris Lewis"
X  #endif
X  
X  /*	We're using decipoints */
X--- 16,25 ----
X  
X  #ifndef	SVR3
X  #ifndef	lint
X! static char ljID[] = "@(#)lj.h: 1.7 Copyright 89/12/14 11:29:36 Chris Lewis";
X  #endif
X  #else
X! #ident  "@(#)lj.h: 1.7 Copyright 89/12/14 11:29:36 Chris Lewis"
X  #endif
X  
X  /*	We're using decipoints */
X***************
X*** 40,46 ****
X  				/* spoils it, and the length scaling */
X  				/* won't fit on a page.  I'll only */
X  				/* change the DJ */
X! #define TROFF2DJX(x)	((x) * LJSCALEFACTOR)
X  				/* for length, we want .25 inch */
X  				/* margins top and bottom, so we'll */
X  				/* scale the requests and add .25 inch */
X--- 40,50 ----
X  				/* spoils it, and the length scaling */
X  				/* won't fit on a page.  I'll only */
X  				/* change the DJ */
X! #ifdef BROKEN_XENIX
X! #define	TROFF2DJX(x) ((x) * LJSCALEFACTOR)
X! #else
X! #define	TROFF2DJX(x) TROFF2LJX(x)
X! #endif
X  				/* for length, we want .25 inch */
X  				/* margins top and bottom, so we'll */
X  				/* scale the requests and add .25 inch */
X*** /usr4/public/src/t2current/./troff2.c	Thu Dec 14 11:41:06 1989
X--- ./troff2.c	Thu Dec 14 11:41:36 1989
X***************
X*** 15,24 ****
X  
X  #ifndef	SVR3
X  #ifndef	lint
X! static char SCCSid[] = "@(#)troff2.c: 1.21 Copyright 89/12/06 15:28:53 Chris Lewis";
X  #endif
X  #else
X! #ident  "@(#)troff2.c: 1.21 Copyright 89/12/06 15:28:53 Chris Lewis"
X  #endif
X  
X  #define	ESC	0x80
X--- 15,24 ----
X  
X  #ifndef	SVR3
X  #ifndef	lint
X! static char SCCSid[] = "@(#)troff2.c: 1.23 Copyright 89/12/12 15:50:48 Chris Lewis";
X  #endif
X  #else
X! #ident  "@(#)troff2.c: 1.23 Copyright 89/12/12 15:50:48 Chris Lewis"
X  #endif
X  
X  #define	ESC	0x80
X***************
X*** 87,97 ****
X  	else
X  	    driver = "ZZ";
X  
X! 	while((c = getopt(argc, argv, "T:VDd:l:M")) != EOF)
X  	    switch (c) {
X  		case 'T':
X! 		    device = optarg;
X  		    break;
X  		case 'M':
X  		    metrics = 1;
X  		    break;
X--- 87,114 ----
X  	else
X  	    driver = "ZZ";
X  
X! 	while((c = getopt(argc, argv, "T:VDd:l:MR:")) != EOF)
X  	    switch (c) {
X  		case 'T':
X! 		    driver = optarg;
X  		    break;
X+ 		case 'R':
X+ #if	defined(DT)
X+ 		    {
X+ 			extern int dtresolution;
X+ 			dtresolution = atoi(optarg);
X+ 			if (dtresolution == 0) {
X+ 			    fprintf(stderr, "%s: Invalid resolution: %s\n",
X+ 				progname, optarg);
X+ 			    exit(1);
X+ 			}
X+ 		    }
X+ 		    break;
X+ #else
X+ 		    fprintf(stderr, "%s: Resolution not supported\n",
X+ 			progname);
X+ 		    exit(1);
X+ #endif
X  		case 'M':
X  		    metrics = 1;
X  		    break;
X*** /usr4/public/src/t2current/./defs.h	Thu Dec 14 11:41:07 1989
X--- ./defs.h	Thu Dec 14 11:41:37 1989
X***************
X*** 17,23 ****
X  #define	LIBDIR	"/usr/lib/troff2"
X  #endif
X  
X! #define	T2VERSION	"Release 1 Patchlevel 4 89/12/06"
X  
X  /*	Configuration parameters:
X   */
X--- 17,23 ----
X  #define	LIBDIR	"/usr/lib/troff2"
X  #endif
X  
X! #define	T2VERSION	"Release 1 Patchlevel 5 89/12/14"
X  
X  /*	Configuration parameters:
X   */
X***************
X*** 69,75 ****
X     codes to set the tilt (used only on 8-font CATs, which most CAT troff
X     programs don't support).  
X     
X!    Both FONT8 and BSDHACK code are *untested*.
X   */
X  
X  #undef	BSDHACK		/* Has magnify lead opcode - untested */
X--- 69,76 ----
X     codes to set the tilt (used only on 8-font CATs, which most CAT troff
X     programs don't support).  
X     
X!    Both FONT8 and BSDHACK code are *untested*.  FONT8 probably does *not*
X!    work.
X   */
X  
X  #undef	BSDHACK		/* Has magnify lead opcode - untested */
X***************
X*** 76,81 ****
X--- 77,98 ----
X  #undef	FONT8		/* 8 Font device - untested */
X  #define FONT4		/* Normal 4 font device */
X  
X+ /*	Some versions of troff (only Xenix as far as I know) introduce
X+ 	hard-coded page offsets for some reason, which defeats (or 
X+ 	other wise renders invalid) the X positioning.  define this
X+ 	macro if your stuff seems shuffled too far off the right side.
X+ 	This has only appeared in Deskjet printing, so this only takes
X+ 	effect in lj.h for Deskjet printing.
X+  */
X+ #undef	BROKEN_XENIX
X+ 
X+ /*	Some postscript printers don't accept control-D as job termination
X+ 	(DEC scriptwriters for instance).  In that case, define this
X+ 	macro.  Alternately, if you have a proper printer manager that
X+ 	does this sort of stuff, define it too.
X+  */
X+ #undef	NOCONTROLD
X+ 
X  
X  /*	The only advantage to commenting-out one of these is to make the
X  	binary executable of troff2?? smaller.
X***************
X*** 101,110 ****
X  
X  #ifndef	SVR3
X  #ifndef	lint
X! static char defid[] = "@(#)defs.h: 1.20 Copyright 89/12/06 15:28:57 Chris Lewis";
X  #endif
X  #else
X! #ident  "@(#)defs.h: 1.20 Copyright 89/12/06 15:28:57 Chris Lewis"
X  #endif
X  
X  #include <stdio.h>
X--- 118,127 ----
X  
X  #ifndef	SVR3
X  #ifndef	lint
X! static char defid[] = "@(#)defs.h: 1.23 Copyright 89/12/14 11:29:44 Chris Lewis";
X  #endif
X  #else
X! #ident  "@(#)defs.h: 1.23 Copyright 89/12/14 11:29:44 Chris Lewis"
X  #endif
X  
X  #include <stdio.h>
X***************
X*** 194,198 ****
X  
X  #define	SN(x) , x
X  
X! int currentPage;
X! int pagePending;
X--- 211,215 ----
X  
X  #define	SN(x) , x
X  
X! extern int currentPage;
X! extern int pagePending;
X*** /usr4/public/src/t2current/./ps.c	Thu Dec 14 11:41:09 1989
X--- ./ps.c	Thu Dec 14 11:41:41 1989
X***************
X*** 18,27 ****
X  
X  #ifndef	SVR3
X  #ifndef	lint
X! static char SCCSid[] = "@(#)ps.c: 1.30 Copyright 89/12/06 17:27:35 Chris Lewis";
X  #endif
X  #else
X! #ident  "@(#)ps.c: 1.30 Copyright 89/12/06 17:27:35 Chris Lewis" /*(SVR3)*/
X  #endif
X  
X  /*	ps.c will generate some additional "print" commands to cause
X--- 18,27 ----
X  
X  #ifndef	SVR3
X  #ifndef	lint
X! static char SCCSid[] = "@(#)ps.c: 1.32 Copyright 89/12/14 11:29:57 Chris Lewis";
X  #endif
X  #else
X! #ident  "@(#)ps.c: 1.32 Copyright 89/12/14 11:29:57 Chris Lewis" /*(SVR3)*/
X  #endif
X  
X  /*	ps.c will generate some additional "print" commands to cause
X***************
X*** 267,273 ****
X  	/* 58*/	{U, 0, 0, 1, "\\176",		"approximates"},
X  	/* 59*/	{S, 0, 0, 1, "\\266",		"partial derivative"},
X  	/* 60*/	{S, 0, 0, 1, "\\104",		"Delta"},
X! 	/* 61*/	{S, .35, 0, 1, "\\326",		"square root"},
X  	/* 62*/	{S, 0, 0, 1, "\\123",		"Sigma"},
X  	/* 63*/	{S, 0, 0, 1, "\\273",		"approx ="},
X  	/* 64*/	{S, 0, 0, 1, "\\076",		">"},
X--- 267,273 ----
X  	/* 58*/	{U, 0, 0, 1, "\\176",		"approximates"},
X  	/* 59*/	{S, 0, 0, 1, "\\266",		"partial derivative"},
X  	/* 60*/	{S, 0, 0, 1, "\\104",		"Delta"},
X! 	/* 61*/	{S, 0, 0, 1, "\\326",		"square root"},
X  	/* 62*/	{S, 0, 0, 1, "\\123",		"Sigma"},
X  	/* 63*/	{S, 0, 0, 1, "\\273",		"approx ="},
X  	/* 64*/	{S, 0, 0, 1, "\\076",		">"},
X***************
X*** 326,332 ****
X  }
X  
X  static
X! doPageStart(e) {
X      currentPage++;
X      EMITPS("%%%%Page: ? %d\n", currentPage);
X  #ifdef	BIN
X--- 326,332 ----
X  }
X  
X  static
X! doPageStart() {
X      currentPage++;
X      EMITPS("%%%%Page: ? %d\n", currentPage);
X  #ifdef	BIN
X***************
X*** 560,565 ****
X--- 560,567 ----
X  
X  psEpilog() {
X      int i;
X+     if (!currentPage)
X+ 	return;
X      EMITPS("%%%%Trailer\n");
X      if (metrics)
X  	EMITPS("%ld metrics\n", charCount);
X***************
X*** 575,581 ****
X--- 577,585 ----
X  	    EMITPS(" %s", psFts[i].fontName);
X      EMITPS("\n");
X      EMITPS("%%%%Pages: %d\n", currentPage);
X+ #ifndef	NOCONTROLD
X      putchar('\004');
X+ #endif
X  }
X  
X  psFontSel(from, to)
X*** /usr4/public/src/t2current/./psroff.1	Thu Dec 14 11:41:10 1989
X--- ./psroff.1	Thu Dec 14 11:41:43 1989
X***************
X*** 1,4 ****
X! .\"Copyright 1988 by Chris Lewis 1.5 89/12/06
X  .TH PSROFF 1 local
X  .SH NAME
X  psroff,ljroff,xxroff \- troff replacement for PostScript or other printers
X--- 1,4 ----
X! .\"Copyright 1988 by Chris Lewis 1.7 89/12/12
X  .TH PSROFF 1 local
X  .SH NAME
X  psroff,ljroff,xxroff \- troff replacement for PostScript or other printers
X***************
X*** 5,11 ****
X  .SH SYNOPSIS
X  .IB xx roff
X  [-D] [-X] [-M]
X! .RI "[-d" xx "]"
X  .RI "[-rL" length "]"
X  .RI [ troffopts ] files ...
X  .SH DESCRIPTION
X--- 5,12 ----
X  .SH SYNOPSIS
X  .IB xx roff
X  [-D] [-X] [-M]
X! [-Rnn]
X! .RI "[-T" xx "]"
X  .RI "[-rL" length "]"
X  .RI [ troffopts ] files ...
X  .SH DESCRIPTION
X***************
X*** 22,30 ****
X  The "-X" option does a "set -x" for debugging.
X  The "-D" option passes the "-D" option through to troff2ps.
X  The "-M" option turns on printer metrics (if supported by the driver).
X  .P
X  Note that -m directives are parsed by psroff itself, not troff, and
X! must be invoked *after* -d if -d is used.
X  .P
X  .I Psroff
X  can be made to generate several different printer output formats.
X--- 23,33 ----
X  The "-X" option does a "set -x" for debugging.
X  The "-D" option passes the "-D" option through to troff2ps.
X  The "-M" option turns on printer metrics (if supported by the driver).
X+ The "-Rnn" option is passed to troff2ps and will set the resolution of
X+ the generated output (ditroff output only).
X  .P
X  Note that -m directives are parsed by psroff itself, not troff, and
X! must be invoked *after* -T if -T is used.
X  .P
X  .I Psroff
X  can be made to generate several different printer output formats.
X***************
X*** 36,42 ****
X  generate LaserJet codes.
X  Additionally, you can override this by specifying
X  the
X! .RI -d xx
X  option, where
X  .I xx
X  will select which printer codes to generate.
X--- 39,45 ----
X  generate LaserJet codes.
X  Additionally, you can override this by specifying
X  the
X! .RI -T xx
X  option, where
X  .I xx
X  will select which printer codes to generate.
X*** /usr4/public/src/t2current/./Makefile	Thu Dec 14 11:41:11 1989
X--- ./Makefile	Thu Dec 14 11:41:44 1989
X***************
X*** 12,18 ****
X  #	Note:		This is a System V Makefile, so you may
X  #			have some problems making a few of the items.
X  #
X! #ident  "@(#)Makefile: 1.38 Copyright 89/12/06 17:27:41 Chris Lewis"
X  
X  #	Set to where you want the user-interfaces to go
X  BINDIR	= /usr/lbin
X--- 12,18 ----
X  #	Note:		This is a System V Makefile, so you may
X  #			have some problems making a few of the items.
X  #
X! #ident  "@(#)Makefile: 1.42 Copyright 89/12/13 14:19:41 Chris Lewis"
X  
X  #	Set to where you want the user-interfaces to go
X  BINDIR	= /usr/lbin
X***************
X*** 33,39 ****
X  DTOUTPUT	= | /usr/lib/troff/tpscript | rlp -dgate!AppleLaser -n$$copies
X  #	Testing type:
X  TTYPE	= ps
X! TFLAGS	= -mt2 -M
X  
X  #	Libraries for Troff2 internals, created if it doesn't exist.
X  #	This *must* be a directory all by itself with no other stuff
X--- 33,39 ----
X  DTOUTPUT	= | /usr/lib/troff/tpscript | rlp -dgate!AppleLaser -n$$copies
X  #	Testing type:
X  TTYPE	= ps
X! TFLAGS	= -mt2
X  
X  #	Libraries for Troff2 internals, created if it doesn't exist.
X  #	This *must* be a directory all by itself with no other stuff
X***************
X*** 54,59 ****
X--- 54,61 ----
X  LIBFLAGS = -lc_s
X  
X  #	Dinna touch from here on
X+ MAIN	= troff2.o utils.o t2conf.o
X+ BACKENDS = lj.o ps.o lj.o ljtables.o dt.o
X  PLIBDIR = $(LIBDIR)/lib
X  INSTALL	=	$(LIBDIR)/troff2ps $(BINDIR)/psroff $(LIBDIR)/psxlate \
X  		$(T2DIR)/tmac.t2 \
X***************
X*** 74,83 ****
X  	$(GET) $(GFLAGS) $<
X  
X  .m.prt:
X! 	tbl $*.m | eqn | ./psroff -d$(TTYPE) $(TFLAGS) -
X  
X  .m.tst:
X! 	tbl $*.m | eqn | ./psroff -d$(TTYPE) $(TFLAGS) -t - > $*.tst
X  
X  .m~.m:
X  	$(GET) $(GFLAGS) $<
X--- 76,85 ----
X  	$(GET) $(GFLAGS) $<
X  
X  .m.prt:
X! 	tbl $*.m | eqn | ./psroff -T$(TTYPE) $(TFLAGS) -
X  
X  .m.tst:
X! 	tbl $*.m | eqn | ./psroff -T$(TTYPE) $(TFLAGS) -t - > $*.tst
X  
X  .m~.m:
X  	$(GET) $(GFLAGS) $<
X***************
X*** 112,127 ****
X  prtall:	ltest.prt chartab.prt
X  testall: ltest.tst chartab.tst
X  
X! troff2ps:	troff2.o utils.o t2conf.o lj.o ps.o lj.o ljtables.o dt.o
X! 	$(CC) $(CFLAGS) -o troff2ps troff2.o t2conf.o utils.o \
X! 		ps.o \
X! 		dt.o \
X! 		lj.o ljtables.o \
X! 		$(LIBFLAGS)
X  
X  dit2catwid:	dit2catwid.o
X  	$(CC) $(CFLAGS) -o dit2catwid dit2catwid.o $(LIBFLAGS)
X  
X  #	Drivers include dependencies - add to this list if you're adding
X  #	drivers.
X  t2conf.o:	defs.h ps.h lj.h dt.h
X--- 114,131 ----
X  prtall:	ltest.prt chartab.prt
X  testall: ltest.tst chartab.tst
X  
X! troff2ps:	$(MAIN) $(BACKENDS)
X! 	$(CC) $(CFLAGS) -o troff2ps $(MAIN) $(BACKENDS) $(LIBFLAGS)
X  
X  dit2catwid:	dit2catwid.o
X  	$(CC) $(CFLAGS) -o dit2catwid dit2catwid.o $(LIBFLAGS)
X  
X+ #	The following is commented out because make has a bug in that
X+ #	even if you don't want to make lint, it insists on making
X+ #	the .c's from the SCCS files.
X+ #lint:	$(MAIN:.o=.c) $(BACKENDS:.o=.c)
X+ #	lint $(CFLAGS) $(MAIN:.o=.c) $(BACKENDS:.o=.c) > output.lint
X+ 
X  #	Drivers include dependencies - add to this list if you're adding
X  #	drivers.
X  t2conf.o:	defs.h ps.h lj.h dt.h
X***************
X*** 139,148 ****
X  		$(INSTALL) installfonts
X  
X  fonts:	dit2catwid gfnttab
X! 	./gfnttab
X  
X  installfonts:	dit2catwid gfnttab
X! 	su root -c "./gfnttab install"
X  
X  $(INSTALL):	$$(@F)
X  	su root -c "cp $(@F) $@"
X--- 143,162 ----
X  		$(INSTALL) installfonts
X  
X  fonts:	dit2catwid gfnttab
X! 	for i in font?? ; \
X! 	    do \
X! 		./gfnttab $$i ; \
X! 		if [ $$? != 0 ] ; \
X! 		then \
X! 		    exit 1 ; \
X! 		fi ; \
X! 	    done
X  
X  installfonts:	dit2catwid gfnttab
X! 	for i in font?? ; \
X! 	    do \
X! 		su root -c "./gfnttab $$i `echo $$i | sed -e 's/.*\(..\)/\1/'`" ; \
X! 	    done
X  
X  $(INSTALL):	$$(@F)
X  	su root -c "cp $(@F) $@"
X*** /usr4/public/src/t2current/./dit2catwid.c	Thu Dec 14 11:41:11 1989
X--- ./dit2catwid.c	Thu Dec 14 11:41:45 1989
X***************
X*** 1,9 ****
X! /* Brute force ditroff to CAT width table converter 1.8 89/12/06
X     Will generate ft* files that are compatible with troff (at least the
X     Xenix version that is)
X  */
X  
X! static char SCCSid[] = "@(#)dit2catwid.c 1.8 89/12/06";
X  
X  #include <stdio.h>
X  #include "defs.h"
X--- 1,9 ----
X! /* Brute force ditroff to CAT width table converter 1.9 89/12/12
X     Will generate ft* files that are compatible with troff (at least the
X     Xenix version that is)
X  */
X  
X! static char SCCSid[] = "@(#)dit2catwid.c 1.9 89/12/12";
X  
X  #include <stdio.h>
X  #include "defs.h"
X***************
X*** 382,389 ****
X      fprintf(f, "char ftXX[224] = {\n");
X      for (i = 0; i < 224; i++) {
X  	if (symset[i].name && !symset[i].catwidth) {
X! 	    fprintf(stderr, "%s: No width for %s (file %s)\n",
X! 		progname, symset[i].name, file);
X  	    gencline(f, i, normal[0].catwidth, symset[i].name);
X  	} else
X  	    gencline(f, i, symset[i].catwidth, symset[i].name);
X--- 382,389 ----
X      fprintf(f, "char ftXX[224] = {\n");
X      for (i = 0; i < 224; i++) {
X  	if (symset[i].name && !symset[i].catwidth) {
X! 	    fprintf(stderr, "INFO: No width for %s (file %s)\n",
X! 		symset[i].name, file);
X  	    gencline(f, i, normal[0].catwidth, symset[i].name);
X  	} else
X  	    gencline(f, i, symset[i].catwidth, symset[i].name);
X***************
X*** 422,429 ****
X  	fputc('\0', f);
X      for (i = 0; i < 224; i++) {
X  	if (symset[i].name && !symset[i].catwidth) {
X! 	    fprintf(stderr, "%s: No width for %s (file %s)\n",
X! 		progname, symset[i].name, file);
X  	    fputc(normal[0].catwidth, f);
X  	} else
X  	    fputc(symset[i].catwidth, f);
X--- 422,429 ----
X  	fputc('\0', f);
X      for (i = 0; i < 224; i++) {
X  	if (symset[i].name && !symset[i].catwidth) {
X! 	    fprintf(stderr, "INFO: No width for %s (file %s)\n",
X! 		symset[i].name, file);
X  	    fputc(normal[0].catwidth, f);
X  	} else
X  	    fputc(symset[i].catwidth, f);
X***************
X*** 468,474 ****
X      int commentsok = 1;
X      int widval, oldwidval;
X      while(fgets(buffer, sizeof(buffer), f) && buffer[0] == '#');
X!     while(fgets(buffer, sizeof(buffer), f)) {
X  	tok = gettoken(buffer, NULL);
X  
X  	if (!tok)
X--- 468,478 ----
X      int commentsok = 1;
X      int widval, oldwidval;
X      while(fgets(buffer, sizeof(buffer), f) && buffer[0] == '#');
X! 
X!     if (feof(f))	/* NULL file */
X! 	return;
X! 
X!     do {
X  	tok = gettoken(buffer, NULL);
X  
X  	if (!tok)
X***************
X*** 491,497 ****
X  	    update(symbol, "half narrow space", widval / 4);
X  	    update(normal, "half narrow space", widval / 4);
X  	}
X!     }
X      if (strcmp(tok, "charset")) {
X  	fprintf(stderr, "%s: %s bad format - no charset line\n", progname,
X  	    filename);
X--- 495,502 ----
X  	    update(symbol, "half narrow space", widval / 4);
X  	    update(normal, "half narrow space", widval / 4);
X  	}
X!     } while(fgets(buffer, sizeof(buffer), f));
X! 
X      if (strcmp(tok, "charset")) {
X  	fprintf(stderr, "%s: %s bad format - no charset line\n", progname,
X  	    filename);
X*** /usr4/public/src/t2current/./README	Thu Dec 14 11:41:14 1989
X--- ./README	Thu Dec 14 11:41:53 1989
X***************
X*** 1,6 ****
X! 			README 1.15 89/12/06
X  		See defs.h for the patchlevel
X  
X  Normal UNIX troff only prints its output on WANG C/A/T Phototypesetters.
X  This package contains a generic interface between standard troff and
X  other types of printers.  The package has a driver for PostScript printers
X--- 1,9 ----
X! 			README 1.20 89/12/14
X  		See defs.h for the patchlevel
X  
X+ Please read this document, especially any new patches near the end before
X+ reconfiguring.
X+ 
X  Normal UNIX troff only prints its output on WANG C/A/T Phototypesetters.
X  This package contains a generic interface between standard troff and
X  other types of printers.  The package has a driver for PostScript printers
X***************
X*** 237,244 ****
X  is called with to determine which printer driver to use.
X  Therefore, invoking troff2ps as "troff2ps" will use the PostScript
X  driver.  If you link troff2ps to "troff2lj", and run troff2lj,
X! it will emit Laserjet codes.  Additionally, if you use the "-dxx"
X! option, troff2ps will use the "xx" driver.  Eg: troff2ps -dlj
X  will print laserjet codes.
X  
X  Extra stuff:
X--- 240,247 ----
X  is called with to determine which printer driver to use.
X  Therefore, invoking troff2ps as "troff2ps" will use the PostScript
X  driver.  If you link troff2ps to "troff2lj", and run troff2lj,
X! it will emit Laserjet codes.  Additionally, if you use the "-Txx"
X! option, troff2ps will use the "xx" driver.  Eg: troff2ps -Tlj
X  will print laserjet codes.
X  
X  Extra stuff:
X***************
X*** 356,361 ****
X--- 359,416 ----
X  	   Should work better now.  \- still broken, but better
X  	7) Minor cleanups here and there.
X  	8) Completed fonts.ps.
X+ 
X+ Patch 5: Dec 13, 1989 	(installability/maintenance/multi-printer support)
X+ 	1) Introduced -R option to psroff and troff2ps so that psroff
X+ 	   can generate different resolutions in its ditroff output.
X+ 	   WARNING: the default resolution has been changed from 432 to
X+ 	   300 for compatibility with jetroff.
X+ 	2) Fixed - handling in psroff.
X+ 	3) Major extensions to dit2catwid and gfnttab to understand
X+ 	   and generate multiple ditroff font width directories.  gfnttab
X+ 	   now understands the res command in DESC files (now included)
X+ 	   and will provide the appropriate scaling when converting from
X+ 	   ditroff to CAT troff widths.
X+ 
X+ 	   If you have jetroff, it is now easy to generate the width files.
X+ 	   As root, execute:
X+ 	    ./gfnttab <jetroff font source directory> dt
X+ 	   Where <jetroff font source directory> is the directory that
X+ 	   contains the readable ditroff DESC and font width files (eg:
X+ 	   "R").  This will compile the jetroff width tables into a form
X+ 	   suitable for troff, and install them in /usr/lib/font/dt for
X+ 	   use by "psroff -Tdt".
X+ 	4) psroff now uses -T option to troff and troff2lj to distinguish
X+ 	   both width table directories *and* driver types.  "-d" option
X+ 	   is now obsolete, undocumented, but still there for compatibility.
X+ 	   This means that your troff *must* understand the "-T" option.
X+ 	   If not, "-F" may work instead (modify psroff).  (The -T<dir>
X+ 	   and/or -F<dir> options seem to be universal in telling troff
X+ 	   to look in /usr/lib/font/<dir> for their width tables).
X+ 	   If neither, you're sort of stuck; you can either:
X+ 		- use only one set of width tables by moving the ft*
X+ 		  files from /usr/lib/font/?? directory of your choice
X+ 		  to /usr/lib/font, and disabling the -T to troff in
X+ 		  psroff.
X+ 		- Or, disabling the -T option in troff in psroff, moving the
X+ 		  /usr/lib/font/?? directories to /usr/lib/fo?? directories
X+ 		  and making several copies of troff after binary patching
X+ 		  the /usr/lib/font string to the appropriate /usr/lib/fo??.
X+ 		  And, modify psroff to select the right troff binary...
X+ 		  (Usually, the name has to stay the same length)
X+ 	5) moved the font directory to fontps, in preparation for distribution
X+ 	   of width tables for different printers.  (done by prepatch file)
X+ 	6) defs.h:
X+ 		- BROKEN_XENIX for certain troff's which introduce hard-coded 
X+ 		  page offsets.
X+ 		- NOCONTROLD for postscript printers that don't like ^D.
X+ 
X+ Coming features (watch this space!)
X+ 	- automatic macro/pre/post-processor determination (ala Doug
X+ 	  Gwyn's doctype function)
X+ 	- More complete listings of Postscript font widths.
X+ 	- Automatic generation of the fonts.?? file by gfnttab.
X+ 	  (it already does, but not completely)
X  
X  PLEASE PLEASE PLEASE!  If you have any problems with it, or would like
X  to make some suggestions for changing it, or have implemented a new driver
END_OF_FILE
if test 41823 -ne `wc -c <'./Patch05'`; then
    echo shar: \"'./Patch05'\" unpacked with wrong size!
fi
# end of './Patch05'
fi
if test -f './fontps/DESC' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'./fontps/DESC'\"
else
echo shar: Extracting \"'./fontps/DESC'\" \(129 characters\)
sed "s/^X//" >'./fontps/DESC' <<'END_OF_FILE'
X#
X#	This is simply here to specify res for the fontps files.
X#	gfnttab will do the right thing with a *real* DESC file
X#
Xres 720
END_OF_FILE
if test 129 -ne `wc -c <'./fontps/DESC'`; then
    echo shar: \"'./fontps/DESC'\" unpacked with wrong size!
fi
# end of './fontps/DESC'
fi
if test -f './prepatch' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'./prepatch'\"
else
echo shar: Extracting \"'./prepatch'\" \(108 characters\)
sed "s/^X//" >'./prepatch' <<'END_OF_FILE'
X:
Xif [ -d font -a ! -d fontps ]
Xthen
X    mkdir fontps
X    mv font/* fontps
X    rmdir font
Xfi
Xrm -f prepatch
END_OF_FILE
if test 108 -ne `wc -c <'./prepatch'`; then
    echo shar: \"'./prepatch'\" unpacked with wrong size!
fi
# end of './prepatch'
fi
echo shar: End of archive 1 \(of 1\).
cp /dev/null ark1isdone
MISSING=""
for I in 1 ; do
    if test ! -f ark${I}isdone ; then
	MISSING="${MISSING} ${I}"
    fi
done
if test "${MISSING}" = "" ; then
    echo You have the archive.
    rm -f ark[1-9]isdone
else
    echo You still need to unpack the following archives:
    echo "        " ${MISSING}
fi
##  End of shell archive.
exit 0
-- 
Chris Lewis, Elegant Communications Inc, {uunet!attcan,utzoo}!lsuc!eci386!clewis
Ferret mailing list: eci386!ferret-list, psroff mailing list: eci386!psroff-list