#
# Sample control file for xtlpd
# 

PORTNAME=printer
XTLPDSPOOL=SPOOLDIR/xtlpd
LOGFILE=xtlpd-log
DEBUG=0

# Commands to invoke to produce short and long lists

SHORTLIST=DATADIR/shortlist
LONGLIST=DATADIR/longlist
REMOVE=DATADIR/remove

# Initialise "pr" command options

Prcmd = "pr -f -l66"

# Get default form type

Form = `spuser -d|grep 'Default form'|sed -e 's/.*Default form \([^ ]*\).*$/\1/'`

# Control character interpretation
# First give things we want to initialise

!:	sprflags= -E BSD -o $HOSTNAME -P $PRINTER
!:	propts=
!:	cpsflags=
!:	<indent>0
!:	plainlist=

S<s>:
J<s>:	header = "-h '<s>'"
C<s>:
L<s>:	sprflags += " -U <s>"
T<s>:	propts += " -h '<s>'"
H<s>:
P<s>:
W<n>:	propts += " -w<n>"
I<n>:	<indent><n>
1<s>:
2<s>:
3<s>:
4<s>:
N<s>:	header = "-h '<s>'"
M<s>:	sprflags += " -m"

# Pre-repeatable.
# Flush out any pending files
# We do it this way to absorb Ns which come after the files.

*<n>:	(plainlist) | spr $sprflags $cpsflags $header -f $Form
*<n>:	(prlist) | $Prcmd $propts | spr $sprflags $cpsflags -f $Form
*<n>:	(pslist) | spr $sprflags $cpsflags $header -f $Form.ps
*<n>:	(trofflist) | spr $sprflags $cpsflags $header -f $Form.troff
*<n>:	(ditrofflist) | spr $sprflags $cpsflags $header -f $Form.ditroff
*<n>:	(dvilist) | spr $sprflags $cpsflags $header -f $Form.dvi
*<n>:	(plotlist) | spr $sprflags $cpsflags $header -f $Form.plot
*<n>:	(rasterlist) | spr $sprflags $cpsflags $header -f $Form.raster
*<n>:	(cifplotlist) | spr $sprflags $cpsflags $header -f $Form.cifplot
*<n>:	plainlist =
*<n>:	prlist =
*<n>:	pslist =
*<n>:	trofflist =
*<n>:	ditrofflist =
*<n>:	dvilist =
*<n>:	plotlist =
*<n>:	rasterlist =
*<n>:	cifplotlist =

# The next line sets the copies number to default
# The line after is only executed if the number of copies > 1
# and sets to the number of copies
 
*<n>:	cpsflags =
*<n>*:	cpsflags = " -c <n>"

# Repeatable commands
f<f>*:	plainlist += " <f>"
p<f>*:	prlist += " <f>"
l<f>*:	pslist += " <f>"
t<f>*:	trofflist += " <f>"
n<f>*:	ditrofflist += " <f>"
d<f>*:	dvilist += " <f>"
g<f>*:	plotlist += " <f>"
v<f>*:	rasterlist += " <f>"
c<f>*:	cifplotlist += " <f>"
U<f>:	unlinks += " <f>"

# End of file, flush out any pending files and unlink

@:	(plainlist) | gspl-pr $sprflags $cpsflags $header -f $Form
@:	(prlist) | $Prcmd $propts | gspl-pr $sprflags $cpsflags -f $Form
@:	(pslist) | gspl-pr$sprflags $cpsflags $header -f $Form.ps
@:	(trofflist) | gspl-pr$sprflags $cpsflags $header -f $Form.troff
@:	(ditrofflist) | gspl-pr$sprflags $cpsflags $header -f $Form.ditroff
@:	(dvilist) | gspl-pr$sprflags $cpsflags $header -f $Form.dvi
@:	(plotlist) | gspl-pr$sprflags $cpsflags $header -f $Form.plot
@:	(rasterlist) | gspl-pr$sprflags $cpsflags $header -f $Form.raster
@:	(cifplotlist) | gspl-pr$sprflags $cpsflags $header -f $Form.cifplot
@:	<unlink> $unlinks
