4.4BSD/usr/src/contrib/dipress/src/bin/iptroff.skel

#! /bin/csh
#
# portions Copyright (c) 1984, 1985, 1986 Xerox Corp.
#
# The next line contains the full path name of your typesetter-independent
# troff binary.
set titroff=TITROFFBINARY
#
# The following two lines are changed by a sed script in the Makefile
set xeroxbin=DESTBIN
set xeroxlib=DESTLIB
#
set metricsDirectory=8044
set deviceType=Xerox8044_Services8
umask 0
set flags=() noglob passes outputname=()
unset output
unset t
top:
if ($#argv > 0) then
	switch ($argv[1])

	case -D:
		shift argv
		set metricsDirectory=$argv[1]
		shift argv
		goto top

	case -[op]:
		shift argv
		set outputname=$argv[1]
		set output
		shift argv
		goto top

	case -q:
		unset passes
		shift argv
		goto top

	case -t:
		set t
		unset passes
		shift argv
		goto top

	case -*:
		set flags = ($flags $argv[1])
		shift argv
		goto top

	endsw
endif
if ($#argv == 0) then
	set argv=(-)
endif
set intermediate=/tmp/ptroff$$
if ($?passes) then
	echo "[Starting troff]"
endif
if ($?t) then
	$titroff  -Tipress $flags -F$xeroxlib/fonts/$metricsDirectory $*
else
	$titroff  -Tipress $flags -F$xeroxlib/fonts/$metricsDirectory $* > $intermediate
	if ($status != 0) then
		echo "Error in ti-troff. Process aborted."
		rm $intermediate
		exit
	endif
	if ($?passes) then
		echo "[Starting interpress conversion]"
	endif
	if ($?output) then
        	$xeroxbin/dipress -t -D $deviceType -f $xeroxlib/fonts/$metricsDirectory $intermediate > $outputname
	else
        	$xeroxbin/dipress -D $deviceType -f $xeroxlib/fonts/$metricsDirectory $intermediate
	endif
	/bin/rm $intermediate
endif