#! /usr/local/bin/magicfilter
#
# Magic filter setup file for HP DeskJet 500 series color printers with
# both black and CMY cartridges installed
#
# This file has been automatically adapted to your system.
#

# PostScript
0	%!		filter	/usr/local/bin/gs  -q -dSAFER -dNOPAUSE -r300 -sDEVICE=cdj550 -sOutputFile=- - 
0	\004%!		filter	/usr/local/bin/gs  -q -dSAFER -dNOPAUSE -r300 -sDEVICE=cdj550 -sOutputFile=- - 

# TeX DVI
0	\367\002	fpipe	/usr/local/bin/dvips  -D 300  -R -q -f 

# compress'd data
0	\037\235	pipe	/usr/bin/gzip  -cdq 

# packed, gzipped, frozen and SCO LZH data
0	\037\036	pipe	/usr/bin/gzip  -cdq 
0	\037\213	pipe	/usr/bin/gzip  -cdq 
0	\037\236	pipe	/usr/bin/gzip  -cdq 
0	\037\240	pipe	/usr/bin/gzip  -cdq 

# troff documents
0	.\?\?\040	fpipe 	`/usr/local/bin/grog  -Tps $FILE` 
0	.\\\"		fpipe 	`/usr/local/bin/grog  -Tps $FILE` 
0	'\\\"		fpipe 	`/usr/local/bin/grog  -Tps $FILE` 
0	'.\\\"		fpipe 	`/usr/local/bin/grog  -Tps $FILE` 
0	\\\"		fpipe 	`/usr/local/bin/grog  -Tps $FILE` 

# ditroff
0	"x T ps"	pipe 	/usr/bin/grops 
0	"x T dvi"	pipe	/usr/bin/grodvi 
0	"x T ascii"	pipe	/usr/bin/grotty 
0	"x T latin1"	pipe	/usr/bin/grotty 
0	"x T lj4"	reject	Cannot print LaserJet 4 ditroff files.

# Portable bit-, grey- and pixmaps
0	P1\n		reject	Cannot print PBM/PGM/PPM files on this printer. 
0	P2\n		reject	Cannot print PBM/PGM/PPM files on this printer. 
0	P3\n		reject	Cannot print PBM/PGM/PPM files on this printer. 
0	P4\n		reject	Cannot print PBM/PGM/PPM files on this printer. 
0	P5\n		reject	Cannot print PBM/PGM/PPM files on this printer. 
0	P6\n		reject	Cannot print PBM/PGM/PPM files on this printer. 

# HP Printer Control Language (PCL) -- assume start with reset code
0	\033E\033	cat 

# HP Printer Job Language (PJL)
0	\033%-12345X	reject	Cannot print PJL files on this printer. 
0	"@PJL "		reject	Cannot print PJL files on this printer. 
0	@PJL\t		reject	Cannot print PJL files on this printer. 
0	@PJL\r		reject	Cannot print PJL files on this printer. 
0	@PJL\n		reject	Cannot print PJL files on this printer. 

# GIF files
0	GIF87a		reject	Cannot print GIF images on this printer.
0	GIF89a		reject	Cannot print GIF images on this printer.

# JFIF (JPEG) files
0	\377\330\377\340\?\?JFIF\0	reject	Cannot print JPEG images \
	on this printer.

# TIFF files (the last two bytes of the "magic" is really a version number;
# but the magic is really lame and as far as I have understood the version
# number has never changed and never will, so we include it.)
0	MM\0\x2a	pipe	Cannot print TIFF images on this printer.
0	II\x2a\0	pipe	Cannot print TIFF images on this printer.

# BMP files (even lousier magic -- Microsoft strikes again!)
0	BM\?\?\?\?\?\?\?\?\?\?\?\?\x0c	reject	\
	Cannot print BMP files on this printer.
0	BM\?\?\?\?\?\?\?\?\?\?\?\?\x40	reject	\
	Cannot print BMP files on this printer.
0	BM\?\?\?\?\?\?\?\?\?\?\?\?\x28	reject	\
	Cannot print BMP files on this printer.

# Sun rasterfiles
0	\x59\xa6\x6a\x95 reject	Cannot print Sun rasterfiles on this printer.

# SGI Imagelib (IRIS RGB) files
0	\x1\xda		reject	Cannot print SGI RGB files on this printer.
0	\xda\x1		reject	Cannot print SGI RGB files on this printer.

# FIG files; reported by Steven P. Hill <sph@uscbu.ih.att.com>
0	#FIG		reject	Cannot print FIG files on this printer.

#
# Standard rejects... things we don't want to print
#

# Various archive formats
257	ustar\0		reject	Attempted to print a tar file.
257	"ustar  \0"	reject	Attempted to print a tar file.
0	07070		reject	Attempted to print a cpio file.
0	PK\3\4		reject	Attempted to print a zip file.
20	\xdc\xa7\xc7\xfd reject	Attempted to print a zoo file.

# Binaries (Linux): reject with email message
0	\013\1d\0	reject	Attempted to print a compiled binary.
0	\100\1d\0	reject	Attempted to print a compiled binary.
0	\007\1d\0	reject	Attempted to print a compiled binary.
0	\314\0d\0	reject	Attempted to print a compiled binary.
0	\177ELF		reject	Attempted to print an ELF object.
0	\007\001\0	reject	Attempted to print an object file.
216	\021\001\0\0	reject	Attempted to print a core dump file.
0	!<arch>		reject	Attempted to print an archive.
0	=<ar>		reject	Attempted to print an archive.

# Don't confuse this one with troff!
0	.snd		reject	Attempted to print Sun/NeXT audio data.

# optimistic troff magic
0	.		fpipe 	`/usr/local/bin/grog  -Tps $FILE` 
# wacko troff magic
0	'''		fpipe 	`/usr/local/bin/grog  -Tps $FILE` 

# wild guess: PCL control codes start with <ESC>
0	\033		cat 

# Default entry -- for normal (text) files.  MUST BE LAST.
default			cat	\eE\e&k2G\e(0N	\eE 
