magicfilter-1.2.orig/ 40755 144 144 0 6122776053 13177 5ustar davidusersmagicfilter-1.2.orig/acconfig.h100644 144 144 170 5735613740 15176 0ustar davidusers/* define if ditroff works as expected */ #undef DITROFF_WORKS /* define if zcat is really gzip */ #undef ZCAT_IS_GZIP magicfilter-1.2.orig/aclocal.m4100644 144 144 2356 5740413415 15135 0ustar davidusersdnl Like AC_PATH_PROGS, but add to the .h file as well AC_DEFUN(AC_PATH_INCLUDE, [AC_PATH_PROGS($1,$2) if test -n "$$1"; then AC_DEFINE(HAVE_$1) AC_DEFINE_UNQUOTED(PATH_$1, $$1) fi]) dnl Like AC_PATH_INCLUDE, but enclose in double quotes for inclusion into C AC_DEFUN(AC_PATH_CINCLUDE, [AC_PATH_PROGS($1,$2) if test -n "$$1"; then AC_DEFINE(HAVE_$1) AC_DEFINE_UNQUOTED(PATH_$1, "$$1") fi]) dnl Check to see if zcat is really gzip AC_DEFUN(AC_PROG_GNU_ZCAT, [AC_MSG_CHECKING(whether zcat is really gzip) AC_CACHE_VAL(ac_cv_prog_gnu_zcat, [if echo -e "\37\213\10\10\273\31\152\57\4\3\170\0\3\0\0\0\0\0\0\0\0\0\c"| $1 \ 2>&1 >/dev/null || grep "GNU" $1 2>&1 >/dev/null then ac_cv_prog_gnu_zcat=yes else ac_cv_prog_gnu_zcat=no fi]) if test "$ac_cv_prog_gnu_zcat" = "yes" then AC_DEFINE(ZCAT_IS_GZIP) fi AC_MSG_RESULT($ac_cv_prog_gnu_zcat) ]) dnl Check to see if ditroff works AC_DEFUN(AC_PROG_DITROFF, [AC_MSG_CHECKING(whether ditroff works) AC_CACHE_VAL(ac_cv_prog_ditroff, [if cat << EOF | $1 2>&1 >/dev/null x T ps x res 72000 1 1 x init p1 x trailer V792000 x stop EOF then ac_cv_prog_ditroff=yes else ac_cv_prog_ditroff=no fi]) if test "$ac_cv_prog_ditroff" = "yes" then AC_DEFINE(DITROFF_WORKS) fi AC_MSG_RESULT($ac_cv_prog_ditroff) ]) magicfilter-1.2.orig/ChangeLog100644 144 144 1723 6122773245 15051 0ustar davidusers1.2 Mar 17, 1996 * Most standard conversions moved to .xh include files in the filters directory, will hopefully make maintenance of the filter files a lot easier. * Added fig file support. * Added \004%! as a PostScript magic. * LPRng support (UNTESTED!) * Lots of suggestions were received, most got lost in a flood of email. Sorry... 1.1b Apr 4, 1995 * Portability improvements. * Added filters for PostScript only printers; using (n)enscript. 1.1a Mar 28, 1995 * Fixed bug in parseconfig.c that would cause perfectly legal config files to abort with an "Invalid action" message. 1.1 Mar 27, 1995 * Added prefix and suffix options to "cat" and "text" facilities. * Fixed bugs in dj550c and ljet4 sample filters. * Added another 37 different sample filters. * Uses "autoconf" to automatically localize the sample filters to fit your system. They should now be ready to drop in place. 1.0 Mar 17, 1995 * Initial public release. magicfilter-1.2.orig/README100644 144 144 2373 6122751751 14157 0ustar davidusers MAGICFILTER v 1.1 by H. Peter Anvin ===> Read the file QuickInst for quick installation instructions <=== MAGICFILTER is a customizable, extensible automatic printer filter. Although written for Linux, it should work on any UNIX system which has an ANSI C compiler. If you use MAGICFILTER and find it useful, I would appreciate an email note from you. If you are using it on a type of printer that I do not have, I would also appreciate a copy of your configuration file for inclusion in future versions. If you have suggestions for improvement, I would love to hear them as well. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. magicfilter-1.2.orig/config.h.in100644 144 144 2066 5736361535 15330 0ustar davidusers/* config.h.in */ /* Define if you are using MINIX. */ #undef _MINIX /* Define if necessary to use POSIX facilities on your system. */ #undef _POSIX_SOURCE #undef _POSIX_1_SOURCE /* Define if you have that is POSIX.1 compatible. */ #undef HAVE_SYS_WAIT_H /* Define to `int' if doesn't define. */ #undef pid_t /* Define if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define if you have the dup2 function. */ #undef HAVE_DUP2 /* Define if you have the tmpnam function. */ #undef HAVE_TMPNAM /* Define if you have the waitpid function. */ #undef HAVE_WAITPID /* Define if you have the wait4 function. */ #undef HAVE_WAIT4 /* Define if you have the header file. */ #undef HAVE_MEMORY_H /* Define if you have the header file. */ #undef HAVE_PATHS_H /* Define if you have the header file. */ #undef HAVE_STDLIB_H /* Define if you have the header file. */ #undef HAVE_UNISTD_H /* Define if you have a sendmail-compatible mailer. */ #undef HAVE_SENDMAIL #undef PATH_SENDMAIL magicfilter-1.2.orig/QuickInst100644 144 144 6146 6122775512 15137 0ustar davidusersQuick installation instructions: * Run "configure". If you want to put the files in any other directory tree than /usr/local (i.e. /usr/local/bin, /usr/local/man) then call it with the option --prefix=, for example: ./configure --prefix=/usr See the file INSTALL for more information. * Run "make". * Run "make install". * If you want to install all the sample printer filters (there are 40 of them in the 1.1 release) then do "make install_filters". Otherwise pick the one(s) you want from the "filters" directory and put them in the appropriate location. Make sure they are executable (they can be considered "scripts", with magicfilter being the interpreter.) ----------------------------------------------------------------------------- The following instructions apply only to systems using the BSD printing system. Linux and BSD-derived OSes all use the BSD printing system, some System V-based systems such as IRIX do as an option whereas others, such as Solaris, do not. If in doubt, check for the existence of the file /etc/printcap. NOTE: The standard BSD print daemon does *not* support filters for remote printers, hence the instructions below apply only to systems which have the printers physically attached. A version of lpd which does not have this problem is available as a part of the LPRng package from ftp://dickory.sdsu.edu/pub/LPRng/. To use filters with remote printers for LPRng, specify the "bqfilter" flag in /etc/printcap, for example: # Remote HP LaserJet 4 (possibly connected via built-in Ethernet) remoteprinter:\ :lp=:rm=printserver:rp=remoteprinter:\ :sd=/var/spool/lpd/remoteprinter:\ :bqfilter:mx#0:\ if=/usr/local/bin/ljet4-filter: ----------------------------------------------------------------------------- * Edit your /etc/printcap file to contain a call to the appropriate printer filter in the "if" entry of each local printer. This will typically look something like this: pencil|lp|PostScript|ljet4|HP LaserJet 4:\ :lp=/dev/lp1:sd=/var/spool/lpd/pencil:sh:mx#0:\ :if=/usr/local/bin/ljet4-filter: crayon|dj550c|color|HP DeskJet 550C:\ :lp=/dev/lp2:sd=/var/spool/lpd/crayon:sh:mx#0:\ :if=/usr/local/bin/dj550c-filter: Note the alias "lp" for the default (text) printer, and "PostScript" for the preferred PostScript printer. IMPORTANT: If you're on a really old version of UNIX which doesn't support the so-called "#!-hack" for selecting an interpreter for your filters, this form of installation does not work. Instead, you need to make your /etc/printcap file look something like this: pencil|lp|PostScript|ljet4|HP LaserJet 4:\ :lp=/dev/lp1:sd=/var/spool/lpd/pencil:sh:mx#0:\ :if=/usr/local/bin/magicfilter:\ :af=/usr/local/bin/ljet4-filter: To test if your OS supports the #!-hack, type at the command line: /usr/local/bin/XXXX-filter < /dev/null ... where XXXX-filter is any installed magic filter. If you get an error message, your OS does *not* support the #!-hack. Linux, all BSD-derived OSes and System V R3 and later all support the #!-hack. * Kill and restart lpd. Your printer filter should now be working. magicfilter-1.2.orig/configure100755 144 144 234031 6122770136 15242 0ustar davidusers#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated automatically using autoconf version 2.7 # Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc. # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. # Defaults: ac_help= ac_default_prefix=/usr/local # Any additions from configure.in: # Initialize some variables set by options. # The variables have the same names as the options, with # dashes changed to underlines. build=NONE cache_file=./config.cache exec_prefix=NONE host=NONE no_create= nonopt=NONE no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= target=NONE verbose= x_includes=NONE x_libraries=NONE bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datadir='${prefix}/share' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' # Initialize some other variables. subdirs= MFLAGS= MAKEFLAGS= ac_prev= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" ac_prev= continue fi case "$ac_option" in -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; *) ac_optarg= ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case "$ac_option" in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir="$ac_optarg" ;; -build | --build | --buil | --bui | --bu) ac_prev=build ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build="$ac_optarg" ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file="$ac_optarg" ;; -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) datadir="$ac_optarg" ;; -disable-* | --disable-*) ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` # Reject names that are not valid shell variable names. if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } fi ac_feature=`echo $ac_feature| sed 's/-/_/g'` eval "enable_${ac_feature}=no" ;; -enable-* | --enable-*) ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` # Reject names that are not valid shell variable names. if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } fi ac_feature=`echo $ac_feature| sed 's/-/_/g'` case "$ac_option" in *=*) ;; *) ac_optarg=yes ;; esac eval "enable_${ac_feature}='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix="$ac_optarg" ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he) # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat << EOF Usage: configure [options] [host] Options: [defaults in brackets after descriptions] Configuration: --cache-file=FILE cache test results in FILE --help print this message --no-create do not create output files --quiet, --silent do not print \`checking...' messages --version print the version of autoconf that created configure Directory and file names: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [same as prefix] --bindir=DIR user executables in DIR [EPREFIX/bin] --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] --libexecdir=DIR program executables in DIR [EPREFIX/libexec] --datadir=DIR read-only architecture-independent data in DIR [PREFIX/share] --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data in DIR [PREFIX/com] --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] --libdir=DIR object code libraries in DIR [EPREFIX/lib] --includedir=DIR C header files in DIR [PREFIX/include] --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] --infodir=DIR info documentation in DIR [PREFIX/info] --mandir=DIR man documentation in DIR [PREFIX/man] --srcdir=DIR find the sources in DIR [configure dir or ..] --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names EOF cat << EOF Host type: --build=BUILD configure for building on BUILD [BUILD=HOST] --host=HOST configure for HOST [guessed] --target=TARGET configure for TARGET [TARGET=HOST] Features and packages: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --x-includes=DIR X include files are in DIR --x-libraries=DIR X library files are in DIR EOF if test -n "$ac_help"; then echo "--enable and --with options recognized:$ac_help" fi exit 0 ;; -host | --host | --hos | --ho) ac_prev=host ;; -host=* | --host=* | --hos=* | --ho=*) host="$ac_optarg" ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir="$ac_optarg" ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir="$ac_optarg" ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir="$ac_optarg" ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir="$ac_optarg" ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) localstatedir="$ac_optarg" ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir="$ac_optarg" ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir="$ac_optarg" ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix="$ac_optarg" ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix="$ac_optarg" ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix="$ac_optarg" ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name="$ac_optarg" ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir="$ac_optarg" ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir="$ac_optarg" ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site="$ac_optarg" ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir="$ac_optarg" ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir="$ac_optarg" ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target="$ac_optarg" ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers) echo "configure generated by autoconf version 2.7" exit 0 ;; -with-* | --with-*) ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` # Reject names that are not valid shell variable names. if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } fi ac_package=`echo $ac_package| sed 's/-/_/g'` case "$ac_option" in *=*) ;; *) ac_optarg=yes ;; esac eval "with_${ac_package}='$ac_optarg'" ;; -without-* | --without-*) ac_package=`echo $ac_option|sed -e 's/-*without-//'` # Reject names that are not valid shell variable names. if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } fi ac_package=`echo $ac_package| sed 's/-/_/g'` eval "with_${ac_package}=no" ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes="$ac_optarg" ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries="$ac_optarg" ;; -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } ;; *) if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then echo "configure: warning: $ac_option: invalid host type" 1>&2 fi if test "x$nonopt" != xNONE; then { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } fi nonopt="$ac_option" ;; esac done if test -n "$ac_prev"; then { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } fi trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 # File descriptor usage: # 0 standard input # 1 file creation # 2 errors and warnings # 3 some systems may open it to /dev/tty # 4 used on the Kubota Titan # 6 checking for... messages and results # 5 compiler messages saved in config.log if test "$silent" = yes; then exec 6>/dev/null else exec 6>&1 fi exec 5>./config.log echo "\ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. " 1>&5 # Strip out --no-create and --no-recursion so they do not pile up. # Also quote any args containing shell metacharacters. ac_configure_args= for ac_arg do case "$ac_arg" in -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c) ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) ac_configure_args="$ac_configure_args '$ac_arg'" ;; *) ac_configure_args="$ac_configure_args $ac_arg" ;; esac done # NLS nuisances. # Only set LANG and LC_ALL to C if already set. # These must not be set unconditionally because not all systems understand # e.g. LANG=C (notably SCO). if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi if test "${LANG+set}" = set; then LANG=C; export LANG; fi # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h # AIX cpp loses on an empty file, so make sure it contains at least a newline. echo > confdefs.h # A filename unique to this package, relative to the directory that # configure is in, which we can look for to find out if srcdir is correct. ac_unique_file=magicfilter.c # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then its parent. ac_prog=$0 ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. srcdir=$ac_confdir if test ! -r $srcdir/$ac_unique_file; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r $srcdir/$ac_unique_file; then if test "$ac_srcdir_defaulted" = yes; then { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } else { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } fi fi srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` # Prefer explicitly selected file to automatically selected ones. if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" else CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then echo "loading site script $ac_site_file" . "$ac_site_file" fi done if test -r "$cache_file"; then echo "loading cache $cache_file" . $cache_file else echo "creating cache $cache_file" > $cache_file fi ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='echo $CPP $CPPFLAGS 1>&5; $CPP $CPPFLAGS' ac_compile='echo ${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5; ${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5 2>&5' ac_link='echo ${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5; ${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5 2>&5' if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then ac_n= ac_c=' ' ac_t=' ' else ac_n=-n ac_c= ac_t= fi else ac_n= ac_c='\c' ac_t= fi # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_CC="gcc" break fi done IFS="$ac_save_ifs" test -z "$ac_cv_prog_CC" && ac_cv_prog_CC="cc" fi fi CC="$ac_cv_prog_CC" if test -n "$CC"; then echo "$ac_t""$CC" 1>&6 else echo "$ac_t""no" 1>&6 fi echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.c <&5 | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no fi fi echo "$ac_t""$ac_cv_prog_gcc" 1>&6 if test $ac_cv_prog_gcc = yes; then GCC=yes if test "${CFLAGS+set}" != set; then echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 if eval "test \"`echo '$''{'ac_cv_prog_gcc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else echo 'void f(){}' > conftest.c if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then ac_cv_prog_gcc_g=yes else ac_cv_prog_gcc_g=no fi rm -f conftest* fi echo "$ac_t""$ac_cv_prog_gcc_g" 1>&6 if test $ac_cv_prog_gcc_g = yes; then CFLAGS="-g -O" else CFLAGS="-O" fi fi else GCC= test "${CFLAGS+set}" = set || CFLAGS="-g" fi echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else # This must be in double quotes, not single quotes, because CPP may get # substituted into the Makefile and "${CC-cc}" will confuse make. CPP="${CC-cc} -E" # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : else echo "$ac_err" >&5 rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : else echo "$ac_err" >&5 rm -rf conftest* CPP=/lib/cpp fi rm -f conftest* fi rm -f conftest* ac_cv_prog_CPP="$CPP" fi CPP="$ac_cv_prog_CPP" else ac_cv_prog_CPP="$CPP" fi echo "$ac_t""$CPP" 1>&6 ac_safe=`echo "minix/config.h" | tr './\055' '___'` echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" else echo "$ac_err" >&5 rm -rf conftest* eval "ac_cv_header_$ac_safe=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 MINIX=yes else echo "$ac_t""no" 1>&6 MINIX= fi if test "$MINIX" = yes; then cat >> confdefs.h <<\EOF #define _POSIX_SOURCE 1 EOF cat >> confdefs.h <<\EOF #define _POSIX_1_SOURCE 2 EOF cat >> confdefs.h <<\EOF #define _MINIX 1 EOF fi echo $ac_n "checking for AIX""... $ac_c" 1>&6 cat > conftest.$ac_ext <&5 | egrep "yes" >/dev/null 2>&1; then rm -rf conftest* echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF #define _ALL_SOURCE 1 EOF else rm -rf conftest* echo "$ac_t""no" 1>&6 fi rm -f conftest* echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6 if test -d /etc/conf/kconfig.d && grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1 then echo "$ac_t""yes" 1>&6 ISC=yes # If later tests want to check for ISC. cat >> confdefs.h <<\EOF #define _POSIX_SOURCE 1 EOF if test "$GCC" = yes; then CC="$CC -posix" else CC="$CC -Xp" fi else echo "$ac_t""no" 1>&6 ISC= fi ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do if test -f $ac_dir/install-sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f $ac_dir/install.sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break fi done if test -z "$ac_aux_dir"; then { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; } fi ac_config_guess=$ac_aux_dir/config.guess ac_config_sub=$ac_aux_dir/config.sub ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do # Account for people who put trailing slashes in PATH elements. case "$ac_dir/" in /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. for ac_prog in ginstall installbsd scoinst install; do if test -f $ac_dir/$ac_prog; then if test $ac_prog = install && grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. # OSF/1 installbsd also uses dspmsg, but is usable. : else ac_cv_path_install="$ac_dir/$ac_prog -c" break 2 fi fi done ;; esac done IFS="$ac_save_ifs" fi if test "${ac_cv_path_install+set}" = set; then INSTALL="$ac_cv_path_install" else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. INSTALL="$ac_install_sh" fi fi echo "$ac_t""$INSTALL" 1>&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else rm -f conftestdata if ln -s X conftestdata 2>/dev/null then rm -f conftestdata ac_cv_prog_LN_S="ln -s" else ac_cv_prog_LN_S=ln fi fi LN_S="$ac_cv_prog_LN_S" if test "$ac_cv_prog_LN_S" = "ln -s"; then echo "$ac_t""yes" 1>&6 else echo "$ac_t""no" 1>&6 fi echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else # This must be in double quotes, not single quotes, because CPP may get # substituted into the Makefile and "${CC-cc}" will confuse make. CPP="${CC-cc} -E" # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : else echo "$ac_err" >&5 rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : else echo "$ac_err" >&5 rm -rf conftest* CPP=/lib/cpp fi rm -f conftest* fi rm -f conftest* ac_cv_prog_CPP="$CPP" fi CPP="$ac_cv_prog_CPP" else ac_cv_prog_CPP="$CPP" fi echo "$ac_t""$CPP" 1>&6 for ac_prog in gs do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 if eval "test \"`echo '$''{'ac_cv_path_GHOSTSCRIPT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case "$GHOSTSCRIPT" in /*) ac_cv_path_GHOSTSCRIPT="$GHOSTSCRIPT" # Let the user override the test with a path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_path_GHOSTSCRIPT="$ac_dir/$ac_word" break fi done IFS="$ac_save_ifs" ;; esac fi GHOSTSCRIPT="$ac_cv_path_GHOSTSCRIPT" if test -n "$GHOSTSCRIPT"; then echo "$ac_t""$GHOSTSCRIPT" 1>&6 else echo "$ac_t""no" 1>&6 fi test -n "$GHOSTSCRIPT" && break done if test -n "$GHOSTSCRIPT"; then cat >> confdefs.h <<\EOF #define HAVE_GHOSTSCRIPT 1 EOF cat >> confdefs.h <&6 if eval "test \"`echo '$''{'ac_cv_path_GROG'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case "$GROG" in /*) ac_cv_path_GROG="$GROG" # Let the user override the test with a path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_path_GROG="$ac_dir/$ac_word" break fi done IFS="$ac_save_ifs" ;; esac fi GROG="$ac_cv_path_GROG" if test -n "$GROG"; then echo "$ac_t""$GROG" 1>&6 else echo "$ac_t""no" 1>&6 fi test -n "$GROG" && break done if test -n "$GROG"; then cat >> confdefs.h <<\EOF #define HAVE_GROG 1 EOF cat >> confdefs.h <&6 if eval "test \"`echo '$''{'ac_cv_path_GROFF'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case "$GROFF" in /*) ac_cv_path_GROFF="$GROFF" # Let the user override the test with a path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_path_GROFF="$ac_dir/$ac_word" break fi done IFS="$ac_save_ifs" ;; esac fi GROFF="$ac_cv_path_GROFF" if test -n "$GROFF"; then echo "$ac_t""$GROFF" 1>&6 else echo "$ac_t""no" 1>&6 fi test -n "$GROFF" && break done if test -n "$GROFF"; then cat >> confdefs.h <<\EOF #define HAVE_GROFF 1 EOF cat >> confdefs.h <&6 if eval "test \"`echo '$''{'ac_cv_path_DITROFF'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case "$DITROFF" in /*) ac_cv_path_DITROFF="$DITROFF" # Let the user override the test with a path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_path_DITROFF="$ac_dir/$ac_word" break fi done IFS="$ac_save_ifs" ;; esac fi DITROFF="$ac_cv_path_DITROFF" if test -n "$DITROFF"; then echo "$ac_t""$DITROFF" 1>&6 else echo "$ac_t""no" 1>&6 fi test -n "$DITROFF" && break done if test -n "$DITROFF"; then cat >> confdefs.h <<\EOF #define HAVE_DITROFF 1 EOF cat >> confdefs.h <&6 if eval "test \"`echo '$''{'ac_cv_path_GROPS'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case "$GROPS" in /*) ac_cv_path_GROPS="$GROPS" # Let the user override the test with a path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_path_GROPS="$ac_dir/$ac_word" break fi done IFS="$ac_save_ifs" ;; esac fi GROPS="$ac_cv_path_GROPS" if test -n "$GROPS"; then echo "$ac_t""$GROPS" 1>&6 else echo "$ac_t""no" 1>&6 fi test -n "$GROPS" && break done if test -n "$GROPS"; then cat >> confdefs.h <<\EOF #define HAVE_GROPS 1 EOF cat >> confdefs.h <&6 if eval "test \"`echo '$''{'ac_cv_path_GRODVI'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case "$GRODVI" in /*) ac_cv_path_GRODVI="$GRODVI" # Let the user override the test with a path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_path_GRODVI="$ac_dir/$ac_word" break fi done IFS="$ac_save_ifs" ;; esac fi GRODVI="$ac_cv_path_GRODVI" if test -n "$GRODVI"; then echo "$ac_t""$GRODVI" 1>&6 else echo "$ac_t""no" 1>&6 fi test -n "$GRODVI" && break done if test -n "$GRODVI"; then cat >> confdefs.h <<\EOF #define HAVE_GRODVI 1 EOF cat >> confdefs.h <&6 if eval "test \"`echo '$''{'ac_cv_path_GROTTY'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case "$GROTTY" in /*) ac_cv_path_GROTTY="$GROTTY" # Let the user override the test with a path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_path_GROTTY="$ac_dir/$ac_word" break fi done IFS="$ac_save_ifs" ;; esac fi GROTTY="$ac_cv_path_GROTTY" if test -n "$GROTTY"; then echo "$ac_t""$GROTTY" 1>&6 else echo "$ac_t""no" 1>&6 fi test -n "$GROTTY" && break done if test -n "$GROTTY"; then cat >> confdefs.h <<\EOF #define HAVE_GROTTY 1 EOF cat >> confdefs.h <&6 if eval "test \"`echo '$''{'ac_cv_path_GROLJ4'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case "$GROLJ4" in /*) ac_cv_path_GROLJ4="$GROLJ4" # Let the user override the test with a path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_path_GROLJ4="$ac_dir/$ac_word" break fi done IFS="$ac_save_ifs" ;; esac fi GROLJ4="$ac_cv_path_GROLJ4" if test -n "$GROLJ4"; then echo "$ac_t""$GROLJ4" 1>&6 else echo "$ac_t""no" 1>&6 fi test -n "$GROLJ4" && break done if test -n "$GROLJ4"; then cat >> confdefs.h <<\EOF #define HAVE_GROLJ4 1 EOF cat >> confdefs.h <&6 if eval "test \"`echo '$''{'ac_cv_path_GZIP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case "$GZIP" in /*) ac_cv_path_GZIP="$GZIP" # Let the user override the test with a path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_path_GZIP="$ac_dir/$ac_word" break fi done IFS="$ac_save_ifs" ;; esac fi GZIP="$ac_cv_path_GZIP" if test -n "$GZIP"; then echo "$ac_t""$GZIP" 1>&6 else echo "$ac_t""no" 1>&6 fi test -n "$GZIP" && break done if test -n "$GZIP"; then cat >> confdefs.h <<\EOF #define HAVE_GZIP 1 EOF cat >> confdefs.h <&6 if eval "test \"`echo '$''{'ac_cv_path_ZCAT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case "$ZCAT" in /*) ac_cv_path_ZCAT="$ZCAT" # Let the user override the test with a path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_path_ZCAT="$ac_dir/$ac_word" break fi done IFS="$ac_save_ifs" ;; esac fi ZCAT="$ac_cv_path_ZCAT" if test -n "$ZCAT"; then echo "$ac_t""$ZCAT" 1>&6 else echo "$ac_t""no" 1>&6 fi test -n "$ZCAT" && break done if test -n "$ZCAT"; then cat >> confdefs.h <<\EOF #define HAVE_ZCAT 1 EOF cat >> confdefs.h <&6 if eval "test \"`echo '$''{'ac_cv_path_UNCOMPRESS'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case "$UNCOMPRESS" in /*) ac_cv_path_UNCOMPRESS="$UNCOMPRESS" # Let the user override the test with a path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_path_UNCOMPRESS="$ac_dir/$ac_word" break fi done IFS="$ac_save_ifs" ;; esac fi UNCOMPRESS="$ac_cv_path_UNCOMPRESS" if test -n "$UNCOMPRESS"; then echo "$ac_t""$UNCOMPRESS" 1>&6 else echo "$ac_t""no" 1>&6 fi test -n "$UNCOMPRESS" && break done if test -n "$UNCOMPRESS"; then cat >> confdefs.h <<\EOF #define HAVE_UNCOMPRESS 1 EOF cat >> confdefs.h <&6 if eval "test \"`echo '$''{'ac_cv_path_DVIPS'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case "$DVIPS" in /*) ac_cv_path_DVIPS="$DVIPS" # Let the user override the test with a path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_path_DVIPS="$ac_dir/$ac_word" break fi done IFS="$ac_save_ifs" ;; esac fi DVIPS="$ac_cv_path_DVIPS" if test -n "$DVIPS"; then echo "$ac_t""$DVIPS" 1>&6 else echo "$ac_t""no" 1>&6 fi test -n "$DVIPS" && break done if test -n "$DVIPS"; then cat >> confdefs.h <<\EOF #define HAVE_DVIPS 1 EOF cat >> confdefs.h <&6 if eval "test \"`echo '$''{'ac_cv_path_PNMTOPS'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case "$PNMTOPS" in /*) ac_cv_path_PNMTOPS="$PNMTOPS" # Let the user override the test with a path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_path_PNMTOPS="$ac_dir/$ac_word" break fi done IFS="$ac_save_ifs" ;; esac fi PNMTOPS="$ac_cv_path_PNMTOPS" if test -n "$PNMTOPS"; then echo "$ac_t""$PNMTOPS" 1>&6 else echo "$ac_t""no" 1>&6 fi test -n "$PNMTOPS" && break done if test -n "$PNMTOPS"; then cat >> confdefs.h <<\EOF #define HAVE_PNMTOPS 1 EOF cat >> confdefs.h <&6 if eval "test \"`echo '$''{'ac_cv_path_GIFTOPPM'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case "$GIFTOPPM" in /*) ac_cv_path_GIFTOPPM="$GIFTOPPM" # Let the user override the test with a path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_path_GIFTOPPM="$ac_dir/$ac_word" break fi done IFS="$ac_save_ifs" ;; esac fi GIFTOPPM="$ac_cv_path_GIFTOPPM" if test -n "$GIFTOPPM"; then echo "$ac_t""$GIFTOPPM" 1>&6 else echo "$ac_t""no" 1>&6 fi test -n "$GIFTOPPM" && break done if test -n "$GIFTOPPM"; then cat >> confdefs.h <<\EOF #define HAVE_GIFTOPPM 1 EOF cat >> confdefs.h <&6 if eval "test \"`echo '$''{'ac_cv_path_DJPEG'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case "$DJPEG" in /*) ac_cv_path_DJPEG="$DJPEG" # Let the user override the test with a path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_path_DJPEG="$ac_dir/$ac_word" break fi done IFS="$ac_save_ifs" ;; esac fi DJPEG="$ac_cv_path_DJPEG" if test -n "$DJPEG"; then echo "$ac_t""$DJPEG" 1>&6 else echo "$ac_t""no" 1>&6 fi test -n "$DJPEG" && break done if test -n "$DJPEG"; then cat >> confdefs.h <<\EOF #define HAVE_DJPEG 1 EOF cat >> confdefs.h <&6 if eval "test \"`echo '$''{'ac_cv_path_SGITOPNM'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case "$SGITOPNM" in /*) ac_cv_path_SGITOPNM="$SGITOPNM" # Let the user override the test with a path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_path_SGITOPNM="$ac_dir/$ac_word" break fi done IFS="$ac_save_ifs" ;; esac fi SGITOPNM="$ac_cv_path_SGITOPNM" if test -n "$SGITOPNM"; then echo "$ac_t""$SGITOPNM" 1>&6 else echo "$ac_t""no" 1>&6 fi test -n "$SGITOPNM" && break done if test -n "$SGITOPNM"; then cat >> confdefs.h <<\EOF #define HAVE_SGITOPNM 1 EOF cat >> confdefs.h <&6 if eval "test \"`echo '$''{'ac_cv_path_TOPS'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case "$TOPS" in /*) ac_cv_path_TOPS="$TOPS" # Let the user override the test with a path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_path_TOPS="$ac_dir/$ac_word" break fi done IFS="$ac_save_ifs" ;; esac fi TOPS="$ac_cv_path_TOPS" if test -n "$TOPS"; then echo "$ac_t""$TOPS" 1>&6 else echo "$ac_t""no" 1>&6 fi test -n "$TOPS" && break done if test -n "$TOPS"; then cat >> confdefs.h <<\EOF #define HAVE_TOPS 1 EOF cat >> confdefs.h <&6 if eval "test \"`echo '$''{'ac_cv_path_SGITOPS'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case "$SGITOPS" in /*) ac_cv_path_SGITOPS="$SGITOPS" # Let the user override the test with a path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_path_SGITOPS="$ac_dir/$ac_word" break fi done IFS="$ac_save_ifs" ;; esac fi SGITOPS="$ac_cv_path_SGITOPS" if test -n "$SGITOPS"; then echo "$ac_t""$SGITOPS" 1>&6 else echo "$ac_t""no" 1>&6 fi test -n "$SGITOPS" && break done if test -n "$SGITOPS"; then cat >> confdefs.h <<\EOF #define HAVE_SGITOPS 1 EOF cat >> confdefs.h <&6 if eval "test \"`echo '$''{'ac_cv_path_TIFFTOPNM'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case "$TIFFTOPNM" in /*) ac_cv_path_TIFFTOPNM="$TIFFTOPNM" # Let the user override the test with a path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_path_TIFFTOPNM="$ac_dir/$ac_word" break fi done IFS="$ac_save_ifs" ;; esac fi TIFFTOPNM="$ac_cv_path_TIFFTOPNM" if test -n "$TIFFTOPNM"; then echo "$ac_t""$TIFFTOPNM" 1>&6 else echo "$ac_t""no" 1>&6 fi test -n "$TIFFTOPNM" && break done if test -n "$TIFFTOPNM"; then cat >> confdefs.h <<\EOF #define HAVE_TIFFTOPNM 1 EOF cat >> confdefs.h <&6 if eval "test \"`echo '$''{'ac_cv_path_BMPTOPPM'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case "$BMPTOPPM" in /*) ac_cv_path_BMPTOPPM="$BMPTOPPM" # Let the user override the test with a path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_path_BMPTOPPM="$ac_dir/$ac_word" break fi done IFS="$ac_save_ifs" ;; esac fi BMPTOPPM="$ac_cv_path_BMPTOPPM" if test -n "$BMPTOPPM"; then echo "$ac_t""$BMPTOPPM" 1>&6 else echo "$ac_t""no" 1>&6 fi test -n "$BMPTOPPM" && break done if test -n "$BMPTOPPM"; then cat >> confdefs.h <<\EOF #define HAVE_BMPTOPPM 1 EOF cat >> confdefs.h <&6 if eval "test \"`echo '$''{'ac_cv_path_RASTTOPNM'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case "$RASTTOPNM" in /*) ac_cv_path_RASTTOPNM="$RASTTOPNM" # Let the user override the test with a path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_path_RASTTOPNM="$ac_dir/$ac_word" break fi done IFS="$ac_save_ifs" ;; esac fi RASTTOPNM="$ac_cv_path_RASTTOPNM" if test -n "$RASTTOPNM"; then echo "$ac_t""$RASTTOPNM" 1>&6 else echo "$ac_t""no" 1>&6 fi test -n "$RASTTOPNM" && break done if test -n "$RASTTOPNM"; then cat >> confdefs.h <<\EOF #define HAVE_RASTTOPNM 1 EOF cat >> confdefs.h <&6 if eval "test \"`echo '$''{'ac_cv_path_NENSCRIPT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case "$NENSCRIPT" in /*) ac_cv_path_NENSCRIPT="$NENSCRIPT" # Let the user override the test with a path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_path_NENSCRIPT="$ac_dir/$ac_word" break fi done IFS="$ac_save_ifs" ;; esac fi NENSCRIPT="$ac_cv_path_NENSCRIPT" if test -n "$NENSCRIPT"; then echo "$ac_t""$NENSCRIPT" 1>&6 else echo "$ac_t""no" 1>&6 fi test -n "$NENSCRIPT" && break done if test -n "$NENSCRIPT"; then cat >> confdefs.h <<\EOF #define HAVE_NENSCRIPT 1 EOF cat >> confdefs.h <&6 if eval "test \"`echo '$''{'ac_cv_path_A2X'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case "$A2X" in /*) ac_cv_path_A2X="$A2X" # Let the user override the test with a path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_path_A2X="$ac_dir/$ac_word" break fi done IFS="$ac_save_ifs" ;; esac fi A2X="$ac_cv_path_A2X" if test -n "$A2X"; then echo "$ac_t""$A2X" 1>&6 else echo "$ac_t""no" 1>&6 fi test -n "$A2X" && break done if test -n "$A2X"; then cat >> confdefs.h <<\EOF #define HAVE_A2X 1 EOF cat >> confdefs.h <&6 if eval "test \"`echo '$''{'ac_cv_path_A2PS'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case "$A2PS" in /*) ac_cv_path_A2PS="$A2PS" # Let the user override the test with a path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_path_A2PS="$ac_dir/$ac_word" break fi done IFS="$ac_save_ifs" ;; esac fi A2PS="$ac_cv_path_A2PS" if test -n "$A2PS"; then echo "$ac_t""$A2PS" 1>&6 else echo "$ac_t""no" 1>&6 fi test -n "$A2PS" && break done if test -n "$A2PS"; then cat >> confdefs.h <<\EOF #define HAVE_A2PS 1 EOF cat >> confdefs.h <&6 if eval "test \"`echo '$''{'ac_cv_path_FIG2DEV'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case "$FIG2DEV" in /*) ac_cv_path_FIG2DEV="$FIG2DEV" # Let the user override the test with a path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_path_FIG2DEV="$ac_dir/$ac_word" break fi done IFS="$ac_save_ifs" ;; esac fi FIG2DEV="$ac_cv_path_FIG2DEV" if test -n "$FIG2DEV"; then echo "$ac_t""$FIG2DEV" 1>&6 else echo "$ac_t""no" 1>&6 fi test -n "$FIG2DEV" && break done if test -n "$FIG2DEV"; then cat >> confdefs.h <<\EOF #define HAVE_FIG2DEV 1 EOF cat >> confdefs.h <&6 if eval "test \"`echo '$''{'ac_cv_prog_gnu_zcat'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if echo -e "\37\213\10\10\273\31\152\57\4\3\170\0\3\0\0\0\0\0\0\0\0\0\c"| $ZCAT \ 2>&1 >/dev/null || grep "GNU" $ZCAT 2>&1 >/dev/null then ac_cv_prog_gnu_zcat=yes else ac_cv_prog_gnu_zcat=no fi fi if test "$ac_cv_prog_gnu_zcat" = "yes" then cat >> confdefs.h <<\EOF #define ZCAT_IS_GZIP 1 EOF fi echo "$ac_t""$ac_cv_prog_gnu_zcat" 1>&6 echo $ac_n "checking whether ditroff works""... $ac_c" 1>&6 if eval "test \"`echo '$''{'ac_cv_prog_ditroff'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if cat << EOF | $DITROFF 2>&1 >/dev/null x T ps x res 72000 1 1 x init p1 x trailer V792000 x stop EOF then ac_cv_prog_ditroff=yes else ac_cv_prog_ditroff=no fi fi if test "$ac_cv_prog_ditroff" = "yes" then cat >> confdefs.h <<\EOF #define DITROFF_WORKS 1 EOF fi echo "$ac_t""$ac_cv_prog_ditroff" 1>&6 ac_save_path="$PATH" PATH=$PATH:/usr/libexec:/usr/sbin:/usr/lib:/usr/etc:/etc for ac_prog in sendmail smail mail do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 if eval "test \"`echo '$''{'ac_cv_path_SENDMAIL'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case "$SENDMAIL" in /*) ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_path_SENDMAIL="$ac_dir/$ac_word" break fi done IFS="$ac_save_ifs" ;; esac fi SENDMAIL="$ac_cv_path_SENDMAIL" if test -n "$SENDMAIL"; then echo "$ac_t""$SENDMAIL" 1>&6 else echo "$ac_t""no" 1>&6 fi test -n "$SENDMAIL" && break done if test -n "$SENDMAIL"; then cat >> confdefs.h <<\EOF #define HAVE_SENDMAIL 1 EOF cat >> confdefs.h <&6 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" else echo "$ac_err" >&5 rm -rf conftest* eval "ac_cv_header_$ac_safe=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_hdr=HAVE_`echo $ac_hdr | tr 'abcdefghijklmnopqrstuvwxyz./\055' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ___'` cat >> confdefs.h <&6 fi done for ac_hdr in paths.h do ac_safe=`echo "$ac_hdr" | tr './\055' '___'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" else echo "$ac_err" >&5 rm -rf conftest* eval "ac_cv_header_$ac_safe=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_hdr=HAVE_`echo $ac_hdr | tr 'abcdefghijklmnopqrstuvwxyz./\055' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ___'` cat >> confdefs.h <&6 fi done for ac_hdr in stdlib.h do ac_safe=`echo "$ac_hdr" | tr './\055' '___'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" else echo "$ac_err" >&5 rm -rf conftest* eval "ac_cv_header_$ac_safe=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_hdr=HAVE_`echo $ac_hdr | tr 'abcdefghijklmnopqrstuvwxyz./\055' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ___'` cat >> confdefs.h <&6 fi done for ac_hdr in unistd.h do ac_safe=`echo "$ac_hdr" | tr './\055' '___'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" else echo "$ac_err" >&5 rm -rf conftest* eval "ac_cv_header_$ac_safe=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_hdr=HAVE_`echo $ac_hdr | tr 'abcdefghijklmnopqrstuvwxyz./\055' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ___'` cat >> confdefs.h <&6 fi done echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include #ifndef WEXITSTATUS #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8) #endif #ifndef WIFEXITED #define WIFEXITED(stat_val) (((stat_val) & 255) == 0) #endif int main() { return 0; } int t() { int s; wait (&s); s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } EOF if eval $ac_compile; then rm -rf conftest* ac_cv_header_sys_wait_h=yes else rm -rf conftest* ac_cv_header_sys_wait_h=no fi rm -f conftest* fi echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6 if test $ac_cv_header_sys_wait_h = yes; then cat >> confdefs.h <<\EOF #define HAVE_SYS_WAIT_H 1 EOF fi echo $ac_n "checking for working const""... $ac_c" 1>&6 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; } ; return 0; } EOF if eval $ac_compile; then rm -rf conftest* ac_cv_c_const=yes else rm -rf conftest* ac_cv_c_const=no fi rm -f conftest* fi echo "$ac_t""$ac_cv_c_const" 1>&6 if test $ac_cv_c_const = no; then cat >> confdefs.h <<\EOF #define const EOF fi # If we cannot run a trivial program, we must be cross compiling. echo $ac_n "checking whether cross-compiling""... $ac_c" 1>&6 if eval "test \"`echo '$''{'ac_cv_c_cross'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then ac_cv_c_cross=yes else cat > conftest.$ac_ext </dev/null; then ac_cv_c_cross=no else ac_cv_c_cross=yes fi fi rm -fr conftest* fi echo "$ac_t""$ac_cv_c_cross" 1>&6 cross_compiling=$ac_cv_c_cross echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include #include #include EOF eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* ac_cv_header_stdc=yes else echo "$ac_err" >&5 rm -rf conftest* ac_cv_header_stdc=no fi rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "memchr" >/dev/null 2>&1; then : else rm -rf conftest* ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "free" >/dev/null 2>&1; then : else rm -rf conftest* ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF eval $ac_link if test -s conftest && (./conftest; exit) 2>/dev/null; then : else ac_cv_header_stdc=no fi fi rm -fr conftest* fi fi echo "$ac_t""$ac_cv_header_stdc" 1>&6 if test $ac_cv_header_stdc = yes; then cat >> confdefs.h <<\EOF #define STDC_HEADERS 1 EOF fi echo $ac_n "checking for pid_t""... $ac_c" 1>&6 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS #include #endif EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "pid_t" >/dev/null 2>&1; then rm -rf conftest* ac_cv_type_pid_t=yes else rm -rf conftest* ac_cv_type_pid_t=no fi rm -f conftest* fi echo "$ac_t""$ac_cv_type_pid_t" 1>&6 if test $ac_cv_type_pid_t = no; then cat >> confdefs.h <<\EOF #define pid_t int EOF fi for ac_func in dup2 do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ char $ac_func(); int main() { return 0; } int t() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else $ac_func(); #endif ; return 0; } EOF if eval $ac_link; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else rm -rf conftest* eval "ac_cv_func_$ac_func=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` cat >> confdefs.h <&6 fi done for ac_func in tmpnam do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ char $ac_func(); int main() { return 0; } int t() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else $ac_func(); #endif ; return 0; } EOF if eval $ac_link; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else rm -rf conftest* eval "ac_cv_func_$ac_func=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` cat >> confdefs.h <&6 fi done for ac_func in waitpid do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ char $ac_func(); int main() { return 0; } int t() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else $ac_func(); #endif ; return 0; } EOF if eval $ac_link; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else rm -rf conftest* eval "ac_cv_func_$ac_func=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` cat >> confdefs.h <&6 fi done for ac_func in wait4 do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ char $ac_func(); int main() { return 0; } int t() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else $ac_func(); #endif ; return 0; } EOF if eval $ac_link; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else rm -rf conftest* eval "ac_cv_func_$ac_func=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` cat >> confdefs.h <&6 fi done for ac_func in unsetenv do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ char $ac_func(); int main() { return 0; } int t() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else $ac_func(); #endif ; return 0; } EOF if eval $ac_link; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else rm -rf conftest* eval "ac_cv_func_$ac_func=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` cat >> confdefs.h <&6 fi done trap '' 1 2 15 cat > confcache <<\EOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs. It is not useful on other systems. # If it contains results you don't want to keep, you may remove or edit it. # # By default, configure uses ./config.cache as the cache file, # creating it if it does not exist already. You can give configure # the --cache-file=FILE option to use a different cache file; that is # what configure does when it calls configure scripts in # subdirectories, so they share the cache. # Giving --cache-file=/dev/null disables caching, for debugging configure. # config.status only pays attention to the cache file if you give it the # --recheck option to rerun configure. # EOF # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. (set) 2>&1 | sed -n "s/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=\${\1='\2'}/p" \ >> confcache if cmp -s $cache_file confcache; then : else if test -w $cache_file; then echo "updating cache $cache_file" cat confcache > $cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # Any assignment to VPATH causes Sun make to only execute # the first set of double-colon rules, so remove it if not needed. # If there is a colon in the path, we need to keep it. if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' fi trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 DEFS=-DHAVE_CONFIG_H # Without the "./", some shells look in PATH for config.status. : ${CONFIG_STATUS=./config.status} echo creating $CONFIG_STATUS rm -f $CONFIG_STATUS cat > $CONFIG_STATUS </dev/null | sed 1q`: # # $0 $ac_configure_args # # Compiler output produced by configure, useful for debugging # configure, is in ./config.log if it exists. ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" for ac_option do case "\$ac_option" in -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; -version | --version | --versio | --versi | --vers | --ver | --ve | --v) echo "$CONFIG_STATUS generated by autoconf version 2.7" exit 0 ;; -help | --help | --hel | --he | --h) echo "\$ac_cs_usage"; exit 0 ;; *) echo "\$ac_cs_usage"; exit 1 ;; esac done ac_given_srcdir=$srcdir ac_given_INSTALL="$INSTALL" trap 'rm -fr `echo "Makefile filters/Makefile config.h filters/filters.h filters/filters2.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 EOF cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF $ac_vpsub $extrasub s%@CFLAGS@%$CFLAGS%g s%@CPPFLAGS@%$CPPFLAGS%g s%@CXXFLAGS@%$CXXFLAGS%g s%@DEFS@%$DEFS%g s%@LDFLAGS@%$LDFLAGS%g s%@LIBS@%$LIBS%g s%@exec_prefix@%$exec_prefix%g s%@prefix@%$prefix%g s%@program_transform_name@%$program_transform_name%g s%@bindir@%$bindir%g s%@sbindir@%$sbindir%g s%@libexecdir@%$libexecdir%g s%@datadir@%$datadir%g s%@sysconfdir@%$sysconfdir%g s%@sharedstatedir@%$sharedstatedir%g s%@localstatedir@%$localstatedir%g s%@libdir@%$libdir%g s%@includedir@%$includedir%g s%@oldincludedir@%$oldincludedir%g s%@infodir@%$infodir%g s%@mandir@%$mandir%g s%@CC@%$CC%g s%@CPP@%$CPP%g s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g s%@INSTALL_DATA@%$INSTALL_DATA%g s%@LN_S@%$LN_S%g s%@GHOSTSCRIPT@%$GHOSTSCRIPT%g s%@GROG@%$GROG%g s%@GROFF@%$GROFF%g s%@DITROFF@%$DITROFF%g s%@GROPS@%$GROPS%g s%@GRODVI@%$GRODVI%g s%@GROTTY@%$GROTTY%g s%@GROLJ4@%$GROLJ4%g s%@GZIP@%$GZIP%g s%@ZCAT@%$ZCAT%g s%@UNCOMPRESS@%$UNCOMPRESS%g s%@DVIPS@%$DVIPS%g s%@PNMTOPS@%$PNMTOPS%g s%@GIFTOPPM@%$GIFTOPPM%g s%@DJPEG@%$DJPEG%g s%@SGITOPNM@%$SGITOPNM%g s%@TOPS@%$TOPS%g s%@SGITOPS@%$SGITOPS%g s%@TIFFTOPNM@%$TIFFTOPNM%g s%@BMPTOPPM@%$BMPTOPPM%g s%@RASTTOPNM@%$RASTTOPNM%g s%@NENSCRIPT@%$NENSCRIPT%g s%@A2X@%$A2X%g s%@A2PS@%$A2PS%g s%@FIG2DEV@%$FIG2DEV%g s%@SENDMAIL@%$SENDMAIL%g CEOF EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then # Support "outfile[:infile]", defaulting infile="outfile.in". case "$ac_file" in *:*) ac_file_in=`echo "$ac_file"|sed 's%.*:%%'` ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; *) ac_file_in="${ac_file}.in" ;; esac # Adjust relative srcdir, etc. for subdirectories. # Remove last slash and all that follows it. Not all systems have dirname. ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then # The file is in a subdirectory. test ! -d "$ac_dir" && mkdir "$ac_dir" ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" # A "../" for each directory in $ac_dir_suffix. ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` else ac_dir_suffix= ac_dots= fi case "$ac_given_srcdir" in .) srcdir=. if test -z "$ac_dots"; then top_srcdir=. else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; *) # Relative path. srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" top_srcdir="$ac_dots$ac_given_srcdir" ;; esac case "$ac_given_INSTALL" in [/$]*) INSTALL="$ac_given_INSTALL" ;; *) INSTALL="$ac_dots$ac_given_INSTALL" ;; esac echo creating "$ac_file" rm -f "$ac_file" configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." case "$ac_file" in *Makefile*) ac_comsub="1i\\ # $configure_input" ;; *) ac_comsub= ;; esac sed -e "$ac_comsub s%@configure_input@%$configure_input%g s%@srcdir@%$srcdir%g s%@top_srcdir@%$top_srcdir%g s%@INSTALL@%$INSTALL%g " -f conftest.subs $ac_given_srcdir/$ac_file_in > $ac_file fi; done rm -f conftest.subs # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where # NAME is the cpp macro being defined and VALUE is the value it is being given. # # ac_d sets the value in "#define NAME VALUE" lines. ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)' ac_dB='\([ ][ ]*\)[^ ]*%\1#\2' ac_dC='\3' ac_dD='%g' # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE". ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' ac_uB='\([ ]\)%\1#\2define\3' ac_uC=' ' ac_uD='\4%g' # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE". ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' ac_eB='$%\1#\2define\3' ac_eC=' ' ac_eD='%g' CONFIG_HEADERS=${CONFIG_HEADERS-"config.h filters/filters.h filters/filters2.h"} for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then # Support "outfile[:infile]", defaulting infile="outfile.in". case "$ac_file" in *:*) ac_file_in=`echo "$ac_file"|sed 's%.*:%%'` ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; *) ac_file_in="${ac_file}.in" ;; esac echo creating $ac_file rm -f conftest.frag conftest.in conftest.out cp $ac_given_srcdir/$ac_file_in conftest.in EOF # Transform confdefs.h into a sed script conftest.vals that substitutes # the proper values into config.h.in to produce config.h. And first: # Protect against being on the right side of a sed subst in config.status. # Protect against being in an unquoted here document in config.status. rm -f conftest.vals cat > conftest.hdr <<\EOF s/[\\&%]/\\&/g s%[\\$`]%\\&%g s%#define \([A-Za-z_][A-Za-z0-9_]*\) \(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp s%ac_d%ac_u%gp s%ac_u%ac_e%gp EOF sed -n -f conftest.hdr confdefs.h > conftest.vals rm -f conftest.hdr # This sed command replaces #undef with comments. This is necessary, for # example, in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. cat >> conftest.vals <<\EOF s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */% EOF # Break up conftest.vals because some shells have a limit on # the size of here documents, and old seds have small limits too. # Maximum number of lines to put in a single here document. ac_max_here_lines=12 rm -f conftest.tail while : do ac_lines=`grep -c . conftest.vals` # grep -c gives empty output for an empty file on some AIX systems. if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi # Write a limited-size here document to conftest.frag. echo ' cat > conftest.frag <> $CONFIG_STATUS sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS echo 'CEOF sed -f conftest.frag conftest.in > conftest.out rm -f conftest.in mv conftest.out conftest.in ' >> $CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail rm -f conftest.vals mv conftest.tail conftest.vals done rm -f conftest.vals cat >> $CONFIG_STATUS <<\EOF rm -f conftest.frag conftest.h echo "/* $ac_file. Generated automatically by configure. */" > conftest.h cat conftest.in >> conftest.h rm -f conftest.in if cmp -s $ac_file conftest.h 2>/dev/null; then echo "$ac_file is unchanged" rm -f conftest.h else rm -f $ac_file mv conftest.h $ac_file fi fi; done exit 0 EOF chmod +x $CONFIG_STATUS rm -fr confdefs* $ac_clean_files test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 magicfilter-1.2.orig/configure.in100644 144 144 3555 6122763743 15617 0ustar davidusersdnl Process this file with autoconf to produce a configure script. AC_INIT(magicfilter.c) AC_CONFIG_HEADER(config.h filters/filters.h filters/filters2.h) dnl Figure out the C compiler AC_PROG_CC AC_MINIX AC_AIX AC_ISC_POSIX dnl Check for programs used by makefiles AC_PROG_INSTALL AC_PROG_LN_S AC_PROG_CPP dnl Check for programs used in filters AC_PATH_INCLUDE(GHOSTSCRIPT, gs) AC_PATH_INCLUDE(GROG, grog) AC_PATH_INCLUDE(GROFF, groff) AC_PATH_INCLUDE(DITROFF, gtroff ditroff troff) AC_PATH_INCLUDE(GROPS, grops) AC_PATH_INCLUDE(GRODVI, grodvi) AC_PATH_INCLUDE(GROTTY, grotty) AC_PATH_INCLUDE(GROLJ4, grolj4) AC_PATH_INCLUDE(GZIP, gzip gunzip gzcat) AC_PATH_INCLUDE(ZCAT, zcat) AC_PATH_INCLUDE(UNCOMPRESS, uncompress) AC_PATH_INCLUDE(DVIPS, dvips) AC_PATH_INCLUDE(PNMTOPS, pnmtops) AC_PATH_INCLUDE(GIFTOPPM, giftopnm giftoppm) AC_PATH_INCLUDE(DJPEG, djpeg) AC_PATH_INCLUDE(SGITOPNM, sgitopnm) AC_PATH_INCLUDE(TOPS, tops) AC_PATH_INCLUDE(SGITOPS, sgitops) AC_PATH_INCLUDE(TIFFTOPNM, tifftopnm) AC_PATH_INCLUDE(BMPTOPPM, bmptopnm bmptoppm) AC_PATH_INCLUDE(RASTTOPNM, rasttopnm) AC_PATH_INCLUDE(NENSCRIPT, nenscript enscript) AC_PATH_INCLUDE(A2X, a2x) AC_PATH_INCLUDE(A2PS, a2ps) AC_PATH_INCLUDE(FIG2DEV, fig2dev) dnl Check to see if zcat is gzip AC_PROG_GNU_ZCAT($ZCAT) dnl Check to see if ditroff works AC_PROG_DITROFF($DITROFF) dnl Look for sendmail and /bin/mail ac_save_path="$PATH" PATH=$PATH:/usr/libexec:/usr/sbin:/usr/lib:/usr/etc:/etc AC_PATH_CINCLUDE(SENDMAIL, sendmail smail mail) PATH="$ac_save_path" dnl Check for header files AC_CHECK_HEADERS(memory.h) AC_CHECK_HEADERS(paths.h) AC_CHECK_HEADERS(stdlib.h) AC_CHECK_HEADERS(unistd.h) AC_HEADER_SYS_WAIT dnl Check for missing C things AC_C_CONST AC_TYPE_PID_T AC_CHECK_FUNCS(dup2) AC_CHECK_FUNCS(tmpnam) AC_CHECK_FUNCS(waitpid) AC_CHECK_FUNCS(wait4) AC_CHECK_FUNCS(unsetenv) dnl Write Makefile AC_OUTPUT(Makefile filters/Makefile) magicfilter-1.2.orig/COPYING100644 144 144 43076 5732365727 14371 0ustar davidusers GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 675 Mass Ave, Cambridge, MA 02139, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Appendix: How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19yy name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. magicfilter-1.2.orig/filters/ 40755 144 144 0 6122776053 14647 5ustar davidusersmagicfilter-1.2.orig/filters/bj10e-filter.x100644 144 144 1451 5744156400 17317 0ustar davidusers%include # # Magic filter setup file for Canon BubbleJet 10E # THIS FILE IS UNTESTED! # # This file is in the public domain. # # This file has been automatically adapted to your system. %ifndef HAVE_GHOSTSCRIPT # However, since you didn't have GhostScript installed, most entries # are going to be rejects. %endif # /* * Printer resolution */ %define DPI 360 /* * PostScript */ %ifdef HAVE_GHOSTSCRIPT %define HANDLE_PS filter PATH_GHOSTSCRIPT -q -dSAFER -dNOPAUSE -r360 -sDEVICE=bj10e -sOutputFile=- - %endif /* * Text */ %define HANDLE_TEXT text /* * Native here to override PCL magic */ # wild guess: native control codes start with 0 \033 cat %include # Default entry -- for normal (text) files. MUST BE LAST. default HANDLE_TEXT magicfilter-1.2.orig/filters/bj200-filter.x100644 144 144 1451 5744156457 17247 0ustar davidusers%include # # Magic filter setup file for Canon BubbleJet 200 # THIS FILE IS UNTESTED! # # This file is in the public domain. # # This file has been automatically adapted to your system. %ifndef HAVE_GHOSTSCRIPT # However, since you didn't have GhostScript installed, most entries # are going to be rejects. %endif # /* * Printer resolution */ %define DPI 360 /* * PostScript */ %ifdef HAVE_GHOSTSCRIPT %define HANDLE_PS filter PATH_GHOSTSCRIPT -q -dSAFER -dNOPAUSE -r360 -sDEVICE=bj200 -sOutputFile=- - %endif /* * Text */ %define HANDLE_TEXT text /* * Native here to override PCL magic */ # wild guess: native control codes start with 0 \033 cat %include # Default entry -- for normal (text) files. MUST BE LAST. default HANDLE_TEXT magicfilter-1.2.orig/filters/Makefile.in100640 144 144 12661 6122774325 17033 0ustar davidusers# # Makefile for printer filters # # The printer filters are localized for this system # CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ -I. SED = sed RM = rm -f LN = @LN_S@ CHMOD = chmod prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = ${exec_prefix}/bin INSTALL = @INSTALL@ INSTALL_EXEC = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ FILTERS= bj10e-filter laserjet-filter m8510-filter \ bj200-filter laserjetlo-filter necp6-filter \ deskjet-filter lbp8-filter oki182-filter \ dj500-filter lj250-filter pj-filter \ dj500c-filter ljet2p-filter pjxl-filter \ dj550c-filter ljet2plo-filter pjxl300-filter \ epson9-filter ljet3-filter ps300-filter \ epson9c-filter ljet4-filter ps400-filter \ epsonlq-filter ljet4l-filter ps600-filter \ epsonlqc-filter ljet4m-filter r4081-filter \ ibmpro-filter ljet4ml-filter tek4693-filter \ jetp3852-filter ljetplus-filter tek4696-filter \ la50-filter ljetpluslo-filter \ la75-filter ln03-filter \ psonly300-filter psonly400-filter psonly600-filter \ cps300-filter cps400-filter cps600-filter \ cpsonly300-filter cpsonly400-filter cpsonly600-filter .SUFFIXES: .SUFFIXES: .x .xc .h .xh .mh .xt .x.xc: ${SED} -e 's/~/~~SQU~~/g' -e "s/'/~~APO~~/g" -e 's/"/~~QUO~~/g' \ -e 's/\\/~~BSL~~/g' -e 's/^#/~~~/' -e 's/^%/#/' \ -e 's/^[ ]*$$/~~BLANK~~/' < $< > $*.xc .xh.mh: ${SED} -e 's/~/~~SQU~~/g' -e "s/'/~~APO~~/g" -e 's/"/~~QUO~~/g' \ -e 's/\\/~~BSL~~/g' -e 's/^#/~~~/' -e 's/^%/#/' \ -e 's/^[ ]*$$/~~BLANK~~/' < $< > $*.mh .xc.xt: -${RM} $*.c ${LN} $< $*.c ${CPP} ${CPPFLAGS} $*.c > $*.xt ${RM} $*.c .xt: echo "#! ${bindir}/magicfilter" > $* ${SED} -e '/^#/d' -e '/^[ ]*$$/d' -e 's/^~~~/#/' \ -e 's/^~~BLANK~~$$//' -e "s/~~APO~~/'/g" \ -e 's/~~QUO~~/"/g' -e 's/~~BSL~~/\\/g' \ -e 's/~~SQU~~/~/g' < $< >> $* ${CHMOD} a+x $* all: ${FILTERS} install: all for filter in ${FILTERS}; do \ ${INSTALL_EXEC} $$filter ${bindir}/$$filter; \ done clean: -${RM} *.c *.xc *.xt *.mh *-filter distclean: clean -${RM} *~ Makefile filters.h filters2.h # The dependencies the following defines are a little overly restrictive, # but get the job done depend: head -n `grep -n '^# DEPENDENCIES' Makefile | cut -d':' -f1 ` \ Makefile > Makefile.tmp for xfile in *.x; do \ echo $${xfile}c: *.xh | sed -e 's/\.xh/.mh/g' \ >> Makefile.tmp; \ done mv Makefile.tmp Makefile idepend: head -n `grep -n '^# DEPENDENCIES' Makefile.in | cut -d':' -f1 ` \ Makefile.in > Makefile.in.tmp for xfile in *.x; do \ echo $${xfile}c: *.xh | sed -e 's/\.xh/.mh/g' \ >> Makefile.in.tmp; \ done mv Makefile.in.tmp Makefile.in # DEPENDENCIES -- do not delete this line -- bj10e-filter.xc: genericps.mh stdconv.mh stdrejects.mh bj200-filter.xc: genericps.mh stdconv.mh stdrejects.mh cps300-filter.xc: genericps.mh stdconv.mh stdrejects.mh cps400-filter.xc: genericps.mh stdconv.mh stdrejects.mh cps600-filter.xc: genericps.mh stdconv.mh stdrejects.mh cpsonly300-filter.xc: genericps.mh stdconv.mh stdrejects.mh cpsonly400-filter.xc: genericps.mh stdconv.mh stdrejects.mh cpsonly600-filter.xc: genericps.mh stdconv.mh stdrejects.mh deskjet-filter.xc: genericps.mh stdconv.mh stdrejects.mh dj500-filter.xc: genericps.mh stdconv.mh stdrejects.mh dj500c-filter.xc: genericps.mh stdconv.mh stdrejects.mh dj550c-filter.xc: genericps.mh stdconv.mh stdrejects.mh epson9-filter.xc: genericps.mh stdconv.mh stdrejects.mh epson9c-filter.xc: genericps.mh stdconv.mh stdrejects.mh epsonlq-filter.xc: genericps.mh stdconv.mh stdrejects.mh epsonlqc-filter.xc: genericps.mh stdconv.mh stdrejects.mh ibmpro-filter.xc: genericps.mh stdconv.mh stdrejects.mh jetp3852-filter.xc: genericps.mh stdconv.mh stdrejects.mh la50-filter.xc: genericps.mh stdconv.mh stdrejects.mh la75-filter.xc: genericps.mh stdconv.mh stdrejects.mh laserjet-filter.xc: genericps.mh stdconv.mh stdrejects.mh laserjetlo-filter.xc: genericps.mh stdconv.mh stdrejects.mh lbp8-filter.xc: genericps.mh stdconv.mh stdrejects.mh lj250-filter.xc: genericps.mh stdconv.mh stdrejects.mh ljet2p-filter.xc: genericps.mh stdconv.mh stdrejects.mh ljet2plo-filter.xc: genericps.mh stdconv.mh stdrejects.mh ljet3-filter.xc: genericps.mh stdconv.mh stdrejects.mh ljet4-filter.xc: genericps.mh stdconv.mh stdrejects.mh ljet4l-filter.xc: genericps.mh stdconv.mh stdrejects.mh ljet4m-filter.xc: genericps.mh stdconv.mh stdrejects.mh ljet4ml-filter.xc: genericps.mh stdconv.mh stdrejects.mh ljetplus-filter.xc: genericps.mh stdconv.mh stdrejects.mh ljetpluslo-filter.xc: genericps.mh stdconv.mh stdrejects.mh ln03-filter.xc: genericps.mh stdconv.mh stdrejects.mh m8510-filter.xc: genericps.mh stdconv.mh stdrejects.mh necp6-filter.xc: genericps.mh stdconv.mh stdrejects.mh oki182-filter.xc: genericps.mh stdconv.mh stdrejects.mh pj-filter.xc: genericps.mh stdconv.mh stdrejects.mh pjxl-filter.xc: genericps.mh stdconv.mh stdrejects.mh pjxl300-filter.xc: genericps.mh stdconv.mh stdrejects.mh ps300-filter.xc: genericps.mh stdconv.mh stdrejects.mh ps400-filter.xc: genericps.mh stdconv.mh stdrejects.mh ps600-filter.xc: genericps.mh stdconv.mh stdrejects.mh psonly300-filter.xc: genericps.mh stdconv.mh stdrejects.mh psonly400-filter.xc: genericps.mh stdconv.mh stdrejects.mh psonly600-filter.xc: genericps.mh stdconv.mh stdrejects.mh r4081-filter.xc: genericps.mh stdconv.mh stdrejects.mh tek4693-filter.xc: genericps.mh stdconv.mh stdrejects.mh tek4696-filter.xc: genericps.mh stdconv.mh stdrejects.mh magicfilter-1.2.orig/filters/cps300-filter.x100644 144 144 121 5744607361 17406 0ustar davidusers%define DPI 300 %define NATIVE_TEXT 1 %define IS_COLOR 1 %include magicfilter-1.2.orig/filters/cps400-filter.x100644 144 144 122 5744607374 17414 0ustar davidusers%define DPI 400 %define NATIVE_TEXT 1 %define IS_COLOR 1 %include magicfilter-1.2.orig/filters/cps600-filter.x100644 144 144 122 5744607407 17413 0ustar davidusers%define DPI 600 %define NATIVE_TEXT 1 %define IS_COLOR 1 %include magicfilter-1.2.orig/filters/cpsonly300-filter.x100644 144 144 74 5744607501 20273 0ustar davidusers%define DPI 300 %define IS_COLOR 1 %include magicfilter-1.2.orig/filters/cpsonly400-filter.x100644 144 144 73 5744607514 20277 0ustar davidusers%define DPI 400 %define IS_COLOR 1 %include magicfilter-1.2.orig/filters/stdconv.xh100644 144 144 17570 6122772324 17014 0ustar davidusers/* * Generic conversions for magicfilters */ # PostScript %ifdef HANDLE_PS %define PS_OK 1 %define PSACT pipe %define FPSACT fpipe %else %ifdef NATIVE_PS %define HANDLE_PS postscript %define PS_OK 1 %define PSACT filter %define FPSACT ffilter %else %define HANDLE_PS reject Cannot print PostScript on this printer. %endif %endif 0 %! HANDLE_PS 0 \004%! HANDLE_PS /* Check out a couple of common data types; if we can't handle them, see if we can find something that can; also define _OK entries and appropriate rejects. */ /* ASCII/Latin1 text */ %if !defined(HANDLE_TEXT) && defined(PS_OK) %if defined(HAVE_NENSCRIPT) %define HANDLE_TEXT pipe PATH_NENSCRIPT -B -p- %define LATIN1_OK 1 %elif defined(HAVE_A2X) %define HANDLE_TEXT pipe PATH_A2X -p -dps -man %define LATIN1_OK 1 %elif defined(HAVE_A2PS) %define HANDLE_TEXT pipe PATH_A2PS -p -nh -nn -f12 -b %define LATIN1_OK 1 %endif %endif %ifdef HANDLE_TEXT %define ASCII_OK 1 %else %define HANDLE_TEXT reject Cannot print text files on this printer. %endif /* HP PCL */ %ifdef HANDLE_PCL5E %define PCL5E_OK 1 %define PCL_OK 1 %ifndef HANDLE_PCL %define HANDLE_PCL HANDLE_PCL5E %endif %else %define HANDLE_PCL5E reject Cannot print PCL5E files on this printer. %ifdef HANDLE_PCL %define PCL_OK 1 %else %define HANDLE_PCL reject Cannot print PCL files on this printer. %endif %endif /* HP PJL */ %ifdef HANDLE_PJL %define PJL_OK 1 %else %define HANDLE_PJL reject Cannot print PJL files on this printer. %endif /* TeX DVI */ %ifndef HANDLE_DVI %if defined(HAVE_DVIPS) && defined(PS_OK) %ifdef NATIVE_PS %ifdef XDPI %define HANDLE_DVI ffilter PATH_DVIPS -X XDPI -Y YDPI -R -q -F -f %else %define HANDLE_DVI ffilter PATH_DVIPS -D DPI -R -q -F -f %endif %else %ifdef XDPI %define HANDLE_DVI fpipe PATH_DVIPS -X XDPI -Y YDPI -R -q -f %else %define HANDLE_DVI fpipe PATH_DVIPS -D DPI -R -q -f %endif %endif %endif %endif %ifdef HANDLE_DVI %define DVI_OK 1 %else %define HANDLE_DVI reject Cannot print DVI files on this printer. %endif /* troff */ %ifndef HANDLE_TROFF %ifdef HAVE_GROG %if defined(HAVE_GROLJ4) && defined(PCL5E_OK) %define HANDLE_TROFF ffilter `PATH_GROG -Tlj4 $FILE` %elif defined(HAVE_GROPS) && defined(PS_OK) %define HANDLE_TROFF FPSACT `PATH_GROG -Tps $FILE` %elif defined(HAVE_GRODVI) && defined(DVI_OK) %define HANDLE_TROFF fpipe `PATH_GROG -Tdvi $FILE` %elif defined(HAVE_GROTTY) && defined(LATIN1_OK) %define HANDLE_TROFF fpipe `PATH_GROG -Tlatin1 $FILE` %elif defined(HAVE_GROTTY) && defined(ASCII_OK) %define HANDLE_TROFF fpipe `PATH_GROG -Tascii $FILE` %endif %elif defined(HAVE_GROFF) /* We don't have grog -- use options seemingly appropriate for man pages */ %if defined(HAVE_GROLJ4) && defined(PCL5E_OK) %define HANDLE_TROFF filter PATH_GROFF -Tlj4 -t -mandoc %elif defined(HAVE_GROPS) && defined(PS_OK) %define HANDLE_TROFF PSACT PATH_GROFF -Tps -t -mandoc %elif defined(HAVE_GRODVI) && defined(DVI_OK) %define HANDLE_TROFF pipe PATH_GROFF -Tdvi -t -mandoc %elif defined(HAVE_GROTTY) && defined(LATIN1_OK) %define HANDLE_TROFF pipe PATH_GROFF -Tlatin1 -t -mandoc %elif defined(HAVE_GROTTY) && defined(ASCII_OK) %define HANDLE_TROFF pipe PATH_GROFF -Tascii -t -mandoc %endif %endif %endif %ifdef HANDLE_TROFF %define TROFF_OK 1 %else %define HANDLE_TROFF reject Cannot print troff files on this printer. %endif # TeX DVI 0 \367\002 HANDLE_DVI # compress'd data %ifdef ZCAT 0 \037\235 pipe ZCAT %else 0 \037\235 reject Cannot print compressed files on this printer. %endif # packed, gzipped, frozen and SCO LZH data %ifdef GZCAT 0 \037\036 pipe GZCAT 0 \037\213 pipe GZCAT 0 \037\236 pipe GZCAT 0 \037\240 pipe GZCAT %else 0 \037\036 reject Cannot print packed files on this printer. 0 \037\213 reject Cannot print gzipped files on this printer. 0 \037\236 reject Cannot print frozen files on this printer. 0 \037\240 reject Cannot print SCO LZH files on this printer. %endif # troff documents 0 .\?\?\040 HANDLE_TROFF 0 .\\\" HANDLE_TROFF 0 '\\\" HANDLE_TROFF 0 '.\\\" HANDLE_TROFF 0 \\\" HANDLE_TROFF # ditroff %if defined(HAVE_GROPS) && defined(PS_OK) 0 "x T ps" PSACT PATH_GROPS %else 0 "x T ps" reject Cannot print PostScript ditroff files. %endif %if defined(HAVE_GRODVI) && defined(DVI_OK) 0 "x T dvi" pipe PATH_GRODVI %else 0 "x T dvi" reject Cannot print DVI ditroff files. %endif %if defined(HAVE_GROTTY) && defined(ASCII_OK) 0 "x T ascii" pipe PATH_GROTTY 0 "x T latin1" pipe PATH_GROTTY %else 0 "x T ascii" reject Cannot print ASCII ditroff files. 0 "x T latin1" reject Cannot print Latin-1 ditroff files. %endif %if defined(HAVE_GROLJ4) && defined(PCL5E_OK) 0 "x T lj4" filter PATH_GROLJ4 %else 0 "x T lj4" reject Cannot print LaserJet 4 ditroff files. %endif # Portable bit-, grey- and pixmaps %ifdef HANDLE_PNM %define PNM_OK 1 %else %if defined(HAVE_PNMTOPS) && defined(PS_OK) %define HANDLE_PNM PSACT PATH_PNMTOPS -scale 1000 -dpi DPI 2>/dev/null %define PNM_OK 1 %else %define HANDLE_PNM reject Cannot print PBM/PGM/PPM files on this printer. %endif %endif 0 P1\n HANDLE_PNM 0 P2\n HANDLE_PNM 0 P3\n HANDLE_PNM 0 P4\n HANDLE_PNM 0 P5\n HANDLE_PNM 0 P6\n HANDLE_PNM # HP Printer Control Language (PCL) -- assume start with reset code 0 \033E\033 HANDLE_PCL # HP Printer Job Language (PJL) 0 \033%-12345X HANDLE_PJL 0 "@PJL " HANDLE_PJL 0 @PJL\t HANDLE_PJL 0 @PJL\r HANDLE_PJL 0 @PJL\n HANDLE_PJL # GIF files %if defined(HAVE_GIFTOPPM) && defined(PNM_OK) 0 GIF87a pipe PATH_GIFTOPPM 2>/dev/null 0 GIF89a pipe PATH_GIFTOPPM 2>/dev/null %else 0 GIF87a reject Cannot print GIF images on this printer. 0 GIF89a reject Cannot print GIF images on this printer. %endif # JFIF (JPEG) files %if defined(HAVE_DJPEG) && defined(PNM_OK) 0 \377\330\377\340\?\?JFIF\0 pipe PATH_DJPEG -pnm %else 0 \377\330\377\340\?\?JFIF\0 reject Cannot print JPEG images \ on this printer. %endif # 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.) %if defined(HAVE_TIFFTOPNM) && defined(PNM_OK) 0 MM\0\x2a pipe PATH_TIFFTOPNM 2>/dev/null 0 II\x2a\0 pipe PATH_TIFFTOPNM 2>/dev/null %else 0 MM\0\x2a pipe Cannot print TIFF images on this printer. 0 II\x2a\0 pipe Cannot print TIFF images on this printer. %endif # BMP files (even lousier magic -- Microsoft strikes again!) %if defined(HAVE_BMPTOPPM) && defined(PNM_OK) 0 BM\?\?\?\?\?\?\?\?\?\?\?\?\x0c pipe \ PATH_BMPTOPPM 2>/dev/null 0 BM\?\?\?\?\?\?\?\?\?\?\?\?\x40 pipe \ PATH_BMPTOPPM 2>/dev/null 0 BM\?\?\?\?\?\?\?\?\?\?\?\?\x28 pipe \ PATH_BMPTOPPM 2>/dev/null %else 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. %endif # Sun rasterfiles %if defined(HAVE_RASTTOPNM) && defined(PNM_OK) 0 \x59\xa6\x6a\x95 pipe PATH_RASTTOPNM 2>/dev/null %else 0 \x59\xa6\x6a\x95 reject Cannot print Sun rasterfiles on this printer. %endif # SGI Imagelib (IRIS RGB) files %ifdef IS_COLOR %define SGITOPS_OPT $FILE -cmyk %else %define SGITOPS_OPT $FILE %endif %if defined(HAVE_SGITOPNM) && defined(PNM_OK) 0 \x1\xda pipe PATH_SGITOPNM 2>/dev/null 0 \xda\x1 pipe PATH_SGITOPNM 2>/dev/null %elif defined(HAVE_TOPS) && defined(sgi) && defined(PS_OK) 0 \x1\xda FPSACT PATH_TOPS SGITOPS_OPT 0 \xda\x1 FPSACT PATH_TOPS SGITOPS_OPT %elif defined(HAVE_SGITOPS) && defined(PS_OK) 0 \x1\xda FPSACT PATH_SGITOPS SGITOPS_OPT 0 \xda\x1 FPSACT PATH_SGITOPS SGITOPS_OPT %else 0 \x1\xda reject Cannot print SGI RGB files on this printer. 0 \xda\x1 reject Cannot print SGI RGB files on this printer. %endif # FIG files; reported by Steven P. Hill %if defined(HAVE_FIG2DEV) && defined(PS_OK) 0 #FIG pipe PATH_FIG2DEV -Lps -P -l dummy %else 0 #FIG reject Cannot print FIG files on this printer. %endif %include %ifdef TROFF_OK # optimistic troff magic 0 . HANDLE_TROFF # wacko troff magic 0 ''' HANDLE_TROFF %endif magicfilter-1.2.orig/filters/cpsonly600-filter.x100644 144 144 73 5744607531 20300 0ustar davidusers%define DPI 600 %define IS_COLOR 1 %include magicfilter-1.2.orig/filters/Makefile.tmp100640 144 144 6517 6122774572 17214 0ustar davidusers# Generated automatically from Makefile.in by configure. # # Makefile for printer filters # # The printer filters are localized for this system # CPP = gcc -E CPPFLAGS = -I. SED = sed RM = rm -f LN = ln -s CHMOD = chmod prefix = /usr exec_prefix = ${prefix} bindir = ${exec_prefix}/bin INSTALL = /bin/install -c INSTALL_EXEC = ${INSTALL} INSTALL_DATA = ${INSTALL} -m 644 FILTERS= bj10e-filter laserjet-filter m8510-filter \ bj200-filter laserjetlo-filter necp6-filter \ deskjet-filter lbp8-filter oki182-filter \ dj500-filter lj250-filter pj-filter \ dj500c-filter ljet2p-filter pjxl-filter \ dj550c-filter ljet2plo-filter pjxl300-filter \ epson9-filter ljet3-filter ps300-filter \ epson9c-filter ljet4-filter ps400-filter \ epsonlq-filter ljet4l-filter ps600-filter \ epsonlqc-filter ljet4m-filter r4081-filter \ ibmpro-filter ljet4ml-filter tek4693-filter \ jetp3852-filter ljetplus-filter tek4696-filter \ la50-filter ljetpluslo-filter \ la75-filter ln03-filter \ psonly300-filter psonly400-filter psonly600-filter \ cps300-filter cps400-filter cps600-filter \ cpsonly300-filter cpsonly400-filter cpsonly600-filter .SUFFIXES: .SUFFIXES: .x .xc .h .xh .mh .xt .x.xc: ${SED} -e 's/~/~~SQU~~/g' -e "s/'/~~APO~~/g" -e 's/"/~~QUO~~/g' \ -e 's/\\/~~BSL~~/g' -e 's/^#/~~~/' -e 's/^%/#/' \ -e 's/^[ ]*$$/~~BLANK~~/' < $< > $*.xc .xh.mh: ${SED} -e 's/~/~~SQU~~/g' -e "s/'/~~APO~~/g" -e 's/"/~~QUO~~/g' \ -e 's/\\/~~BSL~~/g' -e 's/^#/~~~/' -e 's/^%/#/' \ -e 's/^[ ]*$$/~~BLANK~~/' < $< > $*.mh .xc.xt: -${RM} $*.c ${LN} $< $*.c ${CPP} ${CPPFLAGS} $*.c > $*.xt ${RM} $*.c .xt: echo "#! ${bindir}/magicfilter" > $* ${SED} -e '/^#/d' -e '/^[ ]*$$/d' -e 's/^~~~/#/' \ -e 's/^~~BLANK~~$$//' -e "s/~~APO~~/'/g" \ -e 's/~~QUO~~/"/g' -e 's/~~BSL~~/\\/g' \ -e 's/~~SQU~~/~/g' < $< >> $* ${CHMOD} a+x $* all: depend ${FILTERS} install: all for filter in ${FILTERS}; do \ ${INSTALL_EXEC} $$filter ${bindir}/$$filter; \ done clean: -${RM} *.c *.xc *.xt *.mh *-filter distclean: clean -${RM} *~ Makefile filters.h filters2.h # The dependencies the following defines are a little overly restrictive, # but get the job done depend: head -n `grep -n '^# DEPENDENCIES' Makefile | cut -d':' -f1 ` \ Makefile > Makefile.tmp for xfile in *.x; do \ echo $${xfile}c: *.xh | sed -e 's/\.xh/.mh/g' \ >> Makefile.tmp; \ done mv Makefile.tmp Makefile idepend: head -n `grep -n '^# DEPENDENCIES' Makefile.in | cut -d':' -f1 ` \ Makefile.in > Makefile.in.tmp for xfile in *.x; do \ echo $${xfile}c: *.xh | sed -e 's/\.xh/.mh/g' \ >> Makefile.in.tmp; \ done mv Makefile.in.tmp Makefile.in # DEPENDENCIES -- do not delete this line -- bj10e-filter.xc: genericps.mh stdconv.mh stdrejects.mh bj200-filter.xc: genericps.mh stdconv.mh stdrejects.mh cps300-filter.xc: genericps.mh stdconv.mh stdrejects.mh cps400-filter.xc: genericps.mh stdconv.mh stdrejects.mh cps600-filter.xc: genericps.mh stdconv.mh stdrejects.mh cpsonly300-filter.xc: genericps.mh stdconv.mh stdrejects.mh cpsonly400-filter.xc: genericps.mh stdconv.mh stdrejects.mh cpsonly600-filter.xc: genericps.mh stdconv.mh stdrejects.mh deskjet-filter.xc: genericps.mh stdconv.mh stdrejects.mh dj500-filter.xc: genericps.mh stdconv.mh stdrejects.mh magicfilter-1.2.orig/filters/deskjet-filter.x100644 144 144 1374 5744160100 20043 0ustar davidusers%include # # Magic filter setup file for HP DeskJet pre-500 series # # This file has been automatically adapted to your system. %ifndef HAVE_GHOSTSCRIPT # However, since you didn't have GhostScript installed, most entries # are going to be rejects. %endif # /* * Printer resolution */ %define DPI 300 /* * PostScript */ %ifdef HAVE_GHOSTSCRIPT %define HANDLE_PS filter PATH_GHOSTSCRIPT -q -dSAFER -dNOPAUSE -r300 -sDEVICE=deskjet -sOutputFile=- - %endif /* * PCL, PJL */ %define HANDLE_PCL cat /* * Text */ %define HANDLE_TEXT cat \eE\e&k2G\e(0N \eE %define LATIN1_OK 1 %include # wild guess: PCL control codes start with 0 \033 HANDLE_PCL # Default entry -- for normal (text) files. MUST BE LAST. default HANDLE_TEXT magicfilter-1.2.orig/filters/dj500-filter.x100644 144 144 1475 5744160361 17247 0ustar davidusers%include # # Magic filter setup file for HP DeskJet 500 series B/W printers; including # DJ 500C with black ink cartridge installed # # This file has been automatically adapted to your system. %ifndef HAVE_GHOSTSCRIPT # However, since you didn't have GhostScript installed, most entries # are going to be rejects. %endif # /* * Printer resolution */ %define DPI 300 /* * PostScript */ %ifdef HAVE_GHOSTSCRIPT %define HANDLE_PS filter PATH_GHOSTSCRIPT -q -dSAFER -dNOPAUSE -r300 -sDEVICE=djet500 -sOutputFile=- - %endif /* * PCL, PJL */ %define HANDLE_PCL cat /* * Text */ %define HANDLE_TEXT cat \eE\e&k2G\e(0N \eE %define LATIN1_OK 1 %include # wild guess: PCL control codes start with 0 \033 HANDLE_PCL # Default entry -- for normal (text) files. MUST BE LAST. default HANDLE_TEXT magicfilter-1.2.orig/filters/dj500c-filter.x100644 144 144 1475 5744160703 17412 0ustar davidusers%include # # Magic filter setup file for HP DeskJet 500 series color printers with # only CMY cartridge installed # # This file has been automatically adapted to your system. %ifndef HAVE_GHOSTSCRIPT # However, since you didn't have GhostScript installed, most entries # are going to be rejects. %endif # /* * Printer resolution */ %define DPI 300 %define IS_COLOR 1 /* * PostScript */ %ifdef HAVE_GHOSTSCRIPT %define HANDLE_PS filter PATH_GHOSTSCRIPT -q -dSAFER -dNOPAUSE -r300 -sDEVICE=cdj500 -sOutputFile=- - %endif /* * PCL, PJL */ %define HANDLE_PCL cat /* * Text */ %define HANDLE_TEXT cat \eE\e&k2G\e(0N \eE %define LATIN1_OK 1 %include # wild guess: PCL control codes start with 0 \033 HANDLE_PCL # Default entry -- for normal (text) files. MUST BE LAST. default HANDLE_TEXT magicfilter-1.2.orig/filters/dj550c-filter.x100644 144 144 1510 5744160760 17410 0ustar davidusers%include # # 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. %ifndef HAVE_GHOSTSCRIPT # However, since you didn't have GhostScript installed, most entries # are going to be rejects. %endif # /* * Printer resolution */ %define DPI 300 %define IS_COLOR 1 /* * PostScript */ %ifdef HAVE_GHOSTSCRIPT %define HANDLE_PS filter PATH_GHOSTSCRIPT -q -dSAFER -dNOPAUSE -r300 -sDEVICE=cdj550 -sOutputFile=- - %endif /* * PCL, PJL */ %define HANDLE_PCL cat /* * Text */ %define HANDLE_TEXT cat \eE\e&k2G\e(0N \eE %define LATIN1_OK 1 %include # wild guess: PCL control codes start with 0 \033 HANDLE_PCL # Default entry -- for normal (text) files. MUST BE LAST. default HANDLE_TEXT magicfilter-1.2.orig/filters/epson9-filter.x100644 144 144 1636 5744576301 17646 0ustar davidusers%include # # Magic filter setup file for 9-pin Epson (or compatible) printers # THIS FILE IS UNTESTED! # # This file is in the public domain. # # This file has been automatically adapted to your system. %ifndef HAVE_GHOSTSCRIPT # However, since you didn't have GhostScript installed, most entries # are going to be rejects. %endif # /* * Printer resolution * DPI is set to the lowest common denominator of XDPI and YDPI */ %define XDPI 120 %define YDPI 72 %define DPI 360 /* * PostScript */ %ifdef HAVE_GHOSTSCRIPT %define HANDLE_PS filter PATH_GHOSTSCRIPT -q -dSAFER -dNOPAUSE -r120x72 -sDEVICE=epson -sOutputFile=- - %endif /* * Text */ %define HANDLE_TEXT text /* * Native here to override PCL magic */ # wild guess: native control codes start with 0 \033 cat %include # Default entry -- for normal (text) files. MUST BE LAST. default HANDLE_TEXT magicfilter-1.2.orig/filters/epson9c-filter.x100644 144 144 1645 5744576352 20017 0ustar davidusers%include # # Magic filter setup file for 9-pin Epson (or compatible) color printers # THIS FILE IS UNTESTED! # # This file is in the public domain. # # This file has been automatically adapted to your system. %ifndef HAVE_GHOSTSCRIPT # However, since you didn't have GhostScript installed, most entries # are going to be rejects. %endif # /* * Printer resolution * DPI is set to the lowest common denominator of XDPI and YDPI */ %define XDPI 120 %define YDPI 72 %define DPI 360 /* * PostScript */ %ifdef HAVE_GHOSTSCRIPT %define HANDLE_PS filter PATH_GHOSTSCRIPT -q -dSAFER -dNOPAUSE -r120x72 -sDEVICE=epsonc -sOutputFile=- - %endif /* * Text */ %define HANDLE_TEXT text /* * Native here to override PCL magic */ # wild guess: native control codes start with 0 \033 cat %include # Default entry -- for normal (text) files. MUST BE LAST. default HANDLE_TEXT magicfilter-1.2.orig/filters/epsonlq-filter.x100644 144 144 1456 5744575455 20123 0ustar davidusers%include # # Magic filter setup file for Epson LQ series printers # THIS FILE IS UNTESTED! # # This file is in the public domain. # # This file has been automatically adapted to your system. %ifndef HAVE_GHOSTSCRIPT # However, since you didn't have GhostScript installed, most entries # are going to be rejects. %endif # /* * Printer resolution */ %define DPI 180 /* * PostScript */ %ifdef HAVE_GHOSTSCRIPT %define HANDLE_PS filter PATH_GHOSTSCRIPT -q -dSAFER -dNOPAUSE -r180 -sDEVICE=epson -sOutputFile=- - %endif /* * Text */ %define HANDLE_TEXT text /* * Native here to override PCL magic */ # wild guess: native control codes start with 0 \033 cat %include # Default entry -- for normal (text) files. MUST BE LAST. default HANDLE_TEXT magicfilter-1.2.orig/filters/epsonlqc-filter.x100644 144 144 1510 5744575627 20256 0ustar davidusers%include # # Magic filter setup file for Epson LQ series color printers # THIS FILE IS UNTESTED! # # This file is in the public domain. # # This file has been automatically adapted to your system. %ifndef HAVE_GHOSTSCRIPT # However, since you didn't have GhostScript installed, most entries # are going to be rejects. %endif # /* * Printer resolution */ %define DPI 180 %define IS_COLOR 1 /* * PostScript */ %ifdef HAVE_GHOSTSCRIPT %define HANDLE_PS filter PATH_GHOSTSCRIPT -q -dSAFER -dNOPAUSE -r180 -sDEVICE=epsonc -sOutputFile=- - %endif /* * Text */ %define HANDLE_TEXT text /* * Native here to override PCL magic */ # wild guess: native control codes start with 0 \033 cat %include # Default entry -- for normal (text) files. MUST BE LAST. default HANDLE_TEXT magicfilter-1.2.orig/filters/filters.h.in100644 144 144 1021 5735615043 17164 0ustar davidusers/* * C-style header file used by filters */ /* HAVE_ and PATH_ macros */ #include "filters2.h" /* define if ditroff works as expected */ #undef DITROFF_WORKS /* define if zcat is really gzip */ #undef ZCAT_IS_GZIP /* try to figure out how to deal with compress and gzip files */ #ifdef HAVE_GZIP #define ZCAT PATH_GZIP -cdq #define GZCAT PATH_GZIP -cdq #elif defined(HAVE_ZCAT) #define ZCAT PATH_ZCAT #ifdef ZCAT_IS_GZIP #define GZCAT PATH_ZCAT #endif #elif defined(HAVE_UNCOMPRESS) #define ZCAT PATH_UNCOMPRESS -c #endif magicfilter-1.2.orig/filters/filters2.h.in100644 144 144 2026 6122770161 17246 0ustar davidusers/* filters2.h.in: This file was automatically generated by mkfilterhin */ #undef HAVE_GHOSTSCRIPT #undef PATH_GHOSTSCRIPT #undef HAVE_GROG #undef PATH_GROG #undef HAVE_GROFF #undef PATH_GROFF #undef HAVE_DITROFF #undef PATH_DITROFF #undef HAVE_GROPS #undef PATH_GROPS #undef HAVE_GRODVI #undef PATH_GRODVI #undef HAVE_GROTTY #undef PATH_GROTTY #undef HAVE_GROLJ4 #undef PATH_GROLJ4 #undef HAVE_GZIP #undef PATH_GZIP #undef HAVE_ZCAT #undef PATH_ZCAT #undef HAVE_UNCOMPRESS #undef PATH_UNCOMPRESS #undef HAVE_DVIPS #undef PATH_DVIPS #undef HAVE_PNMTOPS #undef PATH_PNMTOPS #undef HAVE_GIFTOPPM #undef PATH_GIFTOPPM #undef HAVE_DJPEG #undef PATH_DJPEG #undef HAVE_SGITOPNM #undef PATH_SGITOPNM #undef HAVE_TOPS #undef PATH_TOPS #undef HAVE_SGITOPS #undef PATH_SGITOPS #undef HAVE_TIFFTOPNM #undef PATH_TIFFTOPNM #undef HAVE_BMPTOPPM #undef PATH_BMPTOPPM #undef HAVE_RASTTOPNM #undef PATH_RASTTOPNM #undef HAVE_NENSCRIPT #undef PATH_NENSCRIPT #undef HAVE_A2X #undef PATH_A2X #undef HAVE_A2PS #undef PATH_A2PS #undef HAVE_FIG2DEV #undef PATH_FIG2DEV magicfilter-1.2.orig/filters/genericps.xh100644 144 144 1136 5744602456 17271 0ustar davidusers%include # %ifdef IS_COLOR # Magic filter setup file for DPI dpi color PostScript printers %else # Magic filter setup file for DPI dpi generic PostScript printers %endif %ifdef NATIVE_TEXT # with native capability to print ASCII text %endif # # THIS FILE IS UNTESTED! # # This file is in the public domain. # # This file has been automatically adapted to your system. # /* * PostScript */ %define NATIVE_PS /* * Text */ %ifdef NATIVE_TEXT %define HANDLE_TEXT text %endif %include # Default entry -- for normal (text) files. MUST BE LAST. default HANDLE_TEXT magicfilter-1.2.orig/filters/ibmpro-filter.x100644 144 144 1615 5744576755 17733 0ustar davidusers%include # # Magic filter setup file for the IBM ProPrinter # THIS FILE IS UNTESTED! # # This file is in the public domain. # # This file has been automatically adapted to your system. %ifndef HAVE_GHOSTSCRIPT # However, since you didn't have GhostScript installed, most entries # are going to be rejects. %endif # /* * Printer resolution * DPI is set to the lowest common denominator of XDPI and YDPI */ %define XDPI 120 %define YDPI 72 %define DPI 360 /* * PostScript */ %ifdef HAVE_GHOSTSCRIPT %define HANDLE_PS filter PATH_GHOSTSCRIPT -q -dSAFER -dNOPAUSE -r120x72 -sDEVICE=ibmpro -sOutputFile=- - %endif /* * Text */ %define HANDLE_TEXT text /* * Native here to override PCL magic */ # wild guess: native control codes start with 0 \033 cat %include # Default entry -- for normal (text) files. MUST BE LAST. default HANDLE_TEXT magicfilter-1.2.orig/filters/jetp3852-filter.x100644 144 144 1452 5744577142 17715 0ustar davidusers%include # # Magic filter setup file for IBM JetPrinter 3852 # THIS FILE IS UNTESTED! # # This file is in the public domain. # # This file has been automatically adapted to your system. %ifndef HAVE_GHOSTSCRIPT # However, since you didn't have GhostScript installed, most entries # are going to be rejects. %endif # /* * Printer resolution */ %define DPI 84 /* * PostScript */ %ifdef HAVE_GHOSTSCRIPT %define HANDLE_PS filter PATH_GHOSTSCRIPT -q -dSAFER -dNOPAUSE -r84 -sDEVICE=jetp3852 -sOutputFile=- - %endif /* * Text */ %define HANDLE_TEXT text /* * Native here to override PCL magic */ # wild guess: native control codes start with 0 \033 cat %include # Default entry -- for normal (text) files. MUST BE LAST. default HANDLE_TEXT magicfilter-1.2.orig/filters/la50-filter.x100644 144 144 1616 5744577350 17175 0ustar davidusers%include # # Magic filter setup file for the DEC LA-50 printer # THIS FILE IS UNTESTED! # # This file is in the public domain. # # This file has been automatically adapted to your system. %ifndef HAVE_GHOSTSCRIPT # However, since you didn't have GhostScript installed, most entries # are going to be rejects. %endif # /* * Printer resolution * DPI is set to the lowest common denominator of XDPI and YDPI */ %define XDPI 144 %define YDPI 72 %define DPI 144 /* * PostScript */ %ifdef HAVE_GHOSTSCRIPT %define HANDLE_PS filter PATH_GHOSTSCRIPT -q -dSAFER -dNOPAUSE -r144x72 -sDEVICE=la50 -sOutputFile=- - %endif /* * Text */ %define HANDLE_TEXT text /* * Native here to override PCL magic */ # wild guess: native control codes start with 0 \033 cat %include # Default entry -- for normal (text) files. MUST BE LAST. default HANDLE_TEXT magicfilter-1.2.orig/filters/la75-filter.x100644 144 144 1616 5744577413 17204 0ustar davidusers%include # # Magic filter setup file for the DEC LA-75 printer # THIS FILE IS UNTESTED! # # This file is in the public domain. # # This file has been automatically adapted to your system. %ifndef HAVE_GHOSTSCRIPT # However, since you didn't have GhostScript installed, most entries # are going to be rejects. %endif # /* * Printer resolution * DPI is set to the lowest common denominator of XDPI and YDPI */ %define XDPI 144 %define YDPI 72 %define DPI 144 /* * PostScript */ %ifdef HAVE_GHOSTSCRIPT %define HANDLE_PS filter PATH_GHOSTSCRIPT -q -dSAFER -dNOPAUSE -r144x72 -sDEVICE=la75 -sOutputFile=- - %endif /* * Text */ %define HANDLE_TEXT text /* * Native here to override PCL magic */ # wild guess: native control codes start with 0 \033 cat %include # Default entry -- for normal (text) files. MUST BE LAST. default HANDLE_TEXT magicfilter-1.2.orig/filters/laserjetlo-filter.x100644 144 144 1411 5744611703 20560 0ustar davidusers%include # # Magic filter setup file for HP LaserJet with less than 1.5 Mb RAM # # This file has been automatically adapted to your system. %ifndef HAVE_GHOSTSCRIPT # However, since you didn't have GhostScript installed, most entries # are going to be rejects. %endif # /* * Printer resolution */ %define DPI 150 /* * PostScript */ %ifdef HAVE_GHOSTSCRIPT %define HANDLE_PS filter PATH_GHOSTSCRIPT -q -dSAFER -dNOPAUSE -r150 -sDEVICE=laserjet -sOutputFile=- - %endif /* * PCL, PJL */ %define HANDLE_PCL cat /* * Text */ %define HANDLE_TEXT cat \eE\e&k2G\e(0N \eE %define LATIN1_OK 1 %include # wild guess: PCL control codes start with 0 \033 HANDLE_PCL # Default entry -- for normal (text) files. MUST BE LAST. default HANDLE_TEXT magicfilter-1.2.orig/filters/laserjet-filter.x100644 144 144 1407 5744611726 20237 0ustar davidusers%include # # Magic filter setup file for HP LaserJet with 1.5 Mb or more RAM # # This file has been automatically adapted to your system. %ifndef HAVE_GHOSTSCRIPT # However, since you didn't have GhostScript installed, most entries # are going to be rejects. %endif # /* * Printer resolution */ %define DPI 300 /* * PostScript */ %ifdef HAVE_GHOSTSCRIPT %define HANDLE_PS filter PATH_GHOSTSCRIPT -q -dSAFER -dNOPAUSE -r300 -sDEVICE=laserjet -sOutputFile=- - %endif /* * PCL, PJL */ %define HANDLE_PCL cat /* * Text */ %define HANDLE_TEXT cat \eE\e&k2G\e(0N \eE %define LATIN1_OK 1 %include # wild guess: PCL control codes start with 0 \033 HANDLE_PCL # Default entry -- for normal (text) files. MUST BE LAST. default HANDLE_TEXT magicfilter-1.2.orig/filters/lbp8-filter.x100644 144 144 1464 5744577567 17314 0ustar davidusers%include # # Magic filter setup file for the Canon LBP-8II laser printer # THIS FILE IS UNTESTED! # # This file is in the public domain. # # This file has been automatically adapted to your system. %ifndef HAVE_GHOSTSCRIPT # However, since you didn't have GhostScript installed, most entries # are going to be rejects. %endif # /* * Printer resolution */ %define DPI 300 /* * PostScript */ %ifdef HAVE_GHOSTSCRIPT %define HANDLE_PS filter PATH_GHOSTSCRIPT -q -dSAFER -dNOPAUSE -r300 -sDEVICE=lbp8 -sOutputFile=- - %endif /* * Text */ %define HANDLE_TEXT text /* * Native here to override PCL magic */ # wild guess: native control codes start with 0 \033 cat %include # Default entry -- for normal (text) files. MUST BE LAST. default HANDLE_TEXT magicfilter-1.2.orig/filters/lj250-filter.x100644 144 144 1443 5744577706 17273 0ustar davidusers%include # # Magic filter setup file for the DEC LJ250 # THIS FILE IS UNTESTED! # # This file is in the public domain. # # This file has been automatically adapted to your system. %ifndef HAVE_GHOSTSCRIPT # However, since you didn't have GhostScript installed, most entries # are going to be rejects. %endif # /* * Printer resolution */ %define DPI 180 /* * PostScript */ %ifdef HAVE_GHOSTSCRIPT %define HANDLE_PS filter PATH_GHOSTSCRIPT -q -dSAFER -dNOPAUSE -r180 -sDEVICE=lj250 -sOutputFile=- - %endif /* * Text */ %define HANDLE_TEXT text /* * Native here to override PCL magic */ # wild guess: native control codes start with 0 \033 cat %include # Default entry -- for normal (text) files. MUST BE LAST. default HANDLE_TEXT magicfilter-1.2.orig/filters/ljet2p-filter.x100644 144 144 1412 5744160156 17616 0ustar davidusers%include # # Magic filter setup file for LaserJet IID/IIP with 1.5 Mb or more RAM # # This file has been automatically adapted to your system. %ifndef HAVE_GHOSTSCRIPT # However, since you didn't have GhostScript installed, most entries # are going to be rejects. %endif # /* * Printer resolution */ %define DPI 300 /* * PostScript */ %ifdef HAVE_GHOSTSCRIPT %define HANDLE_PS filter PATH_GHOSTSCRIPT -q -dSAFER -dNOPAUSE -r300 -sDEVICE=ljet2p -sOutputFile=- - %endif /* * PCL, PJL */ %define HANDLE_PCL cat /* * Text */ %define HANDLE_TEXT cat \eE\e&k2G\e(0N \eE %define LATIN1_OK 1 %include # wild guess: PCL control codes start with 0 \033 HANDLE_PCL # Default entry -- for normal (text) files. MUST BE LAST. default HANDLE_TEXT magicfilter-1.2.orig/filters/ljet2plo-filter.x100644 144 144 1414 5744160206 20147 0ustar davidusers%include # # Magic filter setup file for LaserJet IID/IIP with less than 1.5 Mb RAM # # This file has been automatically adapted to your system. %ifndef HAVE_GHOSTSCRIPT # However, since you didn't have GhostScript installed, most entries # are going to be rejects. %endif # /* * Printer resolution */ %define DPI 150 /* * PostScript */ %ifdef HAVE_GHOSTSCRIPT %define HANDLE_PS filter PATH_GHOSTSCRIPT -q -dSAFER -dNOPAUSE -r150 -sDEVICE=ljet2p -sOutputFile=- - %endif /* * PCL, PJL */ %define HANDLE_PCL cat /* * Text */ %define HANDLE_TEXT cat \eE\e&k2G\e(0N \eE %define LATIN1_OK 1 %include # wild guess: PCL control codes start with 0 \033 HANDLE_PCL # Default entry -- for normal (text) files. MUST BE LAST. default HANDLE_TEXT magicfilter-1.2.orig/filters/ljet3-filter.x100644 144 144 1364 5744160250 17440 0ustar davidusers%include # # Magic filter setup file for LaserJet III series # # This file has been automatically adapted to your system. %ifndef HAVE_GHOSTSCRIPT # However, since you didn't have GhostScript installed, most entries # are going to be rejects. %endif # /* * Printer resolution */ %define DPI 300 /* * PostScript */ %ifdef HAVE_GHOSTSCRIPT %define HANDLE_PS filter PATH_GHOSTSCRIPT -q -dSAFER -dNOPAUSE -r300 -sDEVICE=ljet3 -sOutputFile=- - %endif /* * PCL, PJL */ %define HANDLE_PCL cat /* * Text */ %define HANDLE_TEXT cat \eE\e&k2G\e(0N \eE %define LATIN1_OK 1 %include # wild guess: PCL control codes start with 0 \033 HANDLE_PCL # Default entry -- for normal (text) files. MUST BE LAST. default HANDLE_TEXT magicfilter-1.2.orig/filters/ljet4-filter.x100644 144 144 1602 5744154452 17443 0ustar davidusers%include # # Magic filter setup file for 600 DPI LaserJet 4 series without PostScript # (i.e. LJ 4P, 4, 4+, 4V or 4Si without PostScript option installed) # # This file has been automatically adapted to your system. %ifndef HAVE_GHOSTSCRIPT # However, since you didn't have GhostScript installed, most entries # are going to be rejects. %endif # /* * Printer resolution */ %define DPI 600 /* * PostScript */ %ifdef HAVE_GHOSTSCRIPT %define HANDLE_PS filter PATH_GHOSTSCRIPT -q -dSAFER -dNOPAUSE -r600 -sDEVICE=ljet4 -sOutputFile=- - %endif /* * PCL, PJL */ %define HANDLE_PCL5E cat %define HANDLE_PCL cat %define HANDLE_PJL cat /* * Text */ %define HANDLE_TEXT cat \eE\e&k2G\e(0N \eE %define LATIN1_OK 1 %include # wild guess: PCL control codes start with 0 \033 HANDLE_PCL # Default entry -- for normal (text) files. MUST BE LAST. default HANDLE_TEXT magicfilter-1.2.orig/filters/ljet4l-filter.x100644 144 144 1514 5744156651 17624 0ustar davidusers%include # # Magic filter setup file for 300 DPI LaserJet 4 series without PostScript # (i.e. LJ 4L) # # This file has been automatically adapted to your system. %ifndef HAVE_GHOSTSCRIPT # However, since you didn't have GhostScript installed, most entries # are going to be rejects. %endif # /* * Printer resolution */ %define DPI 300 /* * PostScript */ %ifdef HAVE_GHOSTSCRIPT %define HANDLE_PS filter PATH_GHOSTSCRIPT -q -dSAFER -dNOPAUSE -r300 -sDEVICE=ljet4 -sOutputFile=- - %endif /* * PCL, PJL */ %define HANDLE_PCL5E cat %define HANDLE_PCL cat %define HANDLE_PJL cat /* * Text */ %define HANDLE_TEXT cat \eE\e&k2G\e(0N \eE %define LATIN1_OK 1 %include # wild guess: PCL control codes start with 0 \033 HANDLE_PCL # Default entry -- for normal (text) files. MUST BE LAST. default HANDLE_TEXT magicfilter-1.2.orig/filters/ljet4m-filter.x100644 144 144 1253 5744154511 17616 0ustar davidusers%include # # Magic filter setup file for 600 DPI LaserJet 4 series with PostScript # (i.e. LJ 4MP, 4M, 4M+, 4MV or 4SiMX or 4P, 4, 4+, 4V or 4Si with PostScript # option installed). # # This file has been automatically adapted to your system. # /* * Printer resolution */ %define DPI 600 /* * PostScript */ %define NATIVE_PS 1 /* * PCL, PJL */ %define HANDLE_PCL5E cat %define HANDLE_PCL cat %define HANDLE_PJL cat /* * Text */ %define HANDLE_TEXT cat \eE\e&k2G\e(0N \eE %define LATIN1_OK %include # wild guess: PCL control codes start with 0 \033 HANDLE_PCL # Default entry -- for normal (text) files. MUST BE LAST. default HANDLE_TEXT magicfilter-1.2.orig/filters/ljet4ml-filter.x100644 144 144 1131 5744156730 17772 0ustar davidusers%include # # Magic filter setup file for 300 DPI LaserJet 4 series with PostScript # (i.e. LJ 4ML). # # This file has been automatically adapted to your system. # /* * Printer resolution */ %define DPI 300 /* * PostScript */ %define NATIVE_PS 1 /* * PCL, PJL */ %define HANDLE_PCL5E cat %define HANDLE_PCL cat %define HANDLE_PJL cat /* * Text */ %define HANDLE_TEXT cat \eE\e&k2G\e(0N \eE %define LATIN1_OK %include # wild guess: PCL control codes start with 0 \033 HANDLE_PCL # Default entry -- for normal (text) files. MUST BE LAST. default HANDLE_TEXT magicfilter-1.2.orig/filters/ljetpluslo-filter.x100644 144 144 1421 5744612013 20605 0ustar davidusers%include # # Magic filter setup file for HP Laserjet + or II with less than 1.5 Mb RAM # # This file has been automatically adapted to your system. %ifndef HAVE_GHOSTSCRIPT # However, since you didn't have GhostScript installed, most entries # are going to be rejects. %endif # /* * Printer resolution */ %define DPI 150 /* * PostScript */ %ifdef HAVE_GHOSTSCRIPT %define HANDLE_PS filter PATH_GHOSTSCRIPT -q -dSAFER -dNOPAUSE -r150 -sDEVICE=ljetplus -sOutputFile=- - %endif /* * PCL, PJL */ %define HANDLE_PCL cat /* * Text */ %define HANDLE_TEXT cat \eE\e&k2G\e(0N \eE %define LATIN1_OK 1 %include # wild guess: PCL control codes start with 0 \033 HANDLE_PCL # Default entry -- for normal (text) files. MUST BE LAST. default HANDLE_TEXT magicfilter-1.2.orig/filters/ljetplus-filter.x100644 144 144 1417 5744612006 20261 0ustar davidusers%include # # Magic filter setup file for HP Laserjet + or II with 1.5 Mb or more RAM # # This file has been automatically adapted to your system. %ifndef HAVE_GHOSTSCRIPT # However, since you didn't have GhostScript installed, most entries # are going to be rejects. %endif # /* * Printer resolution */ %define DPI 300 /* * PostScript */ %ifdef HAVE_GHOSTSCRIPT %define HANDLE_PS filter PATH_GHOSTSCRIPT -q -dSAFER -dNOPAUSE -r300 -sDEVICE=ljetplus -sOutputFile=- - %endif /* * PCL, PJL */ %define HANDLE_PCL cat /* * Text */ %define HANDLE_TEXT cat \eE\e&k2G\e(0N \eE %define LATIN1_OK 1 %include # wild guess: PCL control codes start with 0 \033 HANDLE_PCL # Default entry -- for normal (text) files. MUST BE LAST. default HANDLE_TEXT magicfilter-1.2.orig/filters/ln03-filter.x100644 144 144 1452 5744600026 17171 0ustar davidusers%include # # Magic filter setup file for the DEC LN-03 printer # THIS FILE IS UNTESTED! # # This file is in the public domain. # # This file has been automatically adapted to your system. %ifndef HAVE_GHOSTSCRIPT # However, since you didn't have GhostScript installed, most entries # are going to be rejects. %endif # /* * Printer resolution */ %define DPI 300 /* * PostScript */ %ifdef HAVE_GHOSTSCRIPT %define HANDLE_PS filter PATH_GHOSTSCRIPT -q -dSAFER -dNOPAUSE -r300 -sDEVICE=ln03 -sOutputFile=- - %endif /* * Text */ %define HANDLE_TEXT text /* * Native here to override PCL magic */ # wild guess: native control codes start with 0 \033 cat %include # Default entry -- for normal (text) files. MUST BE LAST. default HANDLE_TEXT magicfilter-1.2.orig/filters/mkfilterhin100755 144 144 375 5740340121 17157 0ustar davidusers#!/bin/sh file=filters2.h.in echo "/* $file: This file was automatically generated by mkfilterhin */" \ > $file grep 'AC_PATH_INCLUDE' ../configure.in | \ sed -e 's/AC_PATH_INCLUDE(/#undef HAVE_/' \ -e 's/,.*$//' -e 'p' -e 's/HAVE_/PATH_/' >> $file magicfilter-1.2.orig/filters/m8510-filter.x100644 144 144 1625 5744600220 17165 0ustar davidusers%include # # Magic filter setup file for the C.Itoh M8510 printer # THIS FILE IS UNTESTED! # # This file is in the public domain. # # This file has been automatically adapted to your system. %ifndef HAVE_GHOSTSCRIPT # However, since you didn't have GhostScript installed, most entries # are going to be rejects. %endif # /* * Printer resolution * DPI is set to the lowest common denominator of XDPI and YDPI */ %define XDPI 160 %define YDPI 144 %define DPI 1440 /* * PostScript */ %ifdef HAVE_GHOSTSCRIPT %define HANDLE_PS filter PATH_GHOSTSCRIPT -q -dSAFER -dNOPAUSE -r160x144 -sDEVICE=epson -sOutputFile=- - %endif /* * Text */ %define HANDLE_TEXT text /* * Native here to override PCL magic */ # wild guess: native control codes start with 0 \033 cat %include # Default entry -- for normal (text) files. MUST BE LAST. default HANDLE_TEXT magicfilter-1.2.orig/filters/necp6-filter.x100644 144 144 1466 5744600671 17443 0ustar davidusers%include # # Magic filter setup file for the NEC P6, P6+ and P60 printers # THIS FILE IS UNTESTED! # # This file is in the public domain. # # This file has been automatically adapted to your system. %ifndef HAVE_GHOSTSCRIPT # However, since you didn't have GhostScript installed, most entries # are going to be rejects. %endif # /* * Printer resolution */ %define DPI 360 /* * PostScript */ %ifdef HAVE_GHOSTSCRIPT %define HANDLE_PS filter PATH_GHOSTSCRIPT -q -dSAFER -dNOPAUSE -r360 -sDEVICE=necp6 -sOutputFile=- - %endif /* * Text */ %define HANDLE_TEXT text /* * Native here to override PCL magic */ # wild guess: native control codes start with 0 \033 cat %include # Default entry -- for normal (text) files. MUST BE LAST. default HANDLE_TEXT magicfilter-1.2.orig/filters/oki182-filter.x100644 144 144 1442 5744601021 17425 0ustar davidusers%include # # Magic filter setup file for the OKI 182 # THIS FILE IS UNTESTED! # # This file is in the public domain. # # This file has been automatically adapted to your system. %ifndef HAVE_GHOSTSCRIPT # However, since you didn't have GhostScript installed, most entries # are going to be rejects. %endif # /* * Printer resolution */ %define DPI 144 /* * PostScript */ %ifdef HAVE_GHOSTSCRIPT %define HANDLE_PS filter PATH_GHOSTSCRIPT -q -dSAFER -dNOPAUSE -r144 -sDEVICE=oki182 -sOutputFile=- - %endif /* * Text */ %define HANDLE_TEXT text /* * Native here to override PCL magic */ # wild guess: native control codes start with 0 \033 cat %include # Default entry -- for normal (text) files. MUST BE LAST. default HANDLE_TEXT magicfilter-1.2.orig/filters/pj-filter.x100644 144 144 1431 5744601372 17030 0ustar davidusers%include # # Magic filter setup file for the HP PaintJet # THIS FILE IS UNTESTED! # # This file has been automatically adapted to your system. %ifndef HAVE_GHOSTSCRIPT # However, since you didn't have GhostScript installed, most entries # are going to be rejects. %endif # /* * Printer resolution */ %define DPI 180 %define IS_COLOR 1 /* * PostScript */ %ifdef HAVE_GHOSTSCRIPT %define HANDLE_PS filter PATH_GHOSTSCRIPT -q -dSAFER -dNOPAUSE -r180 -sDEVICE=pj -sOutputFile=- - %endif /* * PCL, PJL */ %define HANDLE_PCL cat /* * Text */ %define HANDLE_TEXT cat \eE\e&k2G\e(0N \eE %define LATIN1_OK 1 %include # wild guess: PCL control codes start with 0 \033 HANDLE_PCL # Default entry -- for normal (text) files. MUST BE LAST. default HANDLE_TEXT magicfilter-1.2.orig/filters/pjxl-filter.x100644 144 144 1436 5744601704 17400 0ustar davidusers%include # # Magic filter setup file for the HP PaintJet XL # THIS FILE IS UNTESTED! # # This file has been automatically adapted to your system. %ifndef HAVE_GHOSTSCRIPT # However, since you didn't have GhostScript installed, most entries # are going to be rejects. %endif # /* * Printer resolution */ %define DPI 180 %define IS_COLOR 1 /* * PostScript */ %ifdef HAVE_GHOSTSCRIPT %define HANDLE_PS filter PATH_GHOSTSCRIPT -q -dSAFER -dNOPAUSE -r180 -sDEVICE=pjxl -sOutputFile=- - %endif /* * PCL, PJL */ %define HANDLE_PCL cat /* * Text */ %define HANDLE_TEXT cat \eE\e&k2G\e(0N \eE %define LATIN1_OK 1 %include # wild guess: PCL control codes start with 0 \033 HANDLE_PCL # Default entry -- for normal (text) files. MUST BE LAST. default HANDLE_TEXT magicfilter-1.2.orig/filters/pjxl300-filter.x100644 144 144 1445 5744601577 17633 0ustar davidusers%include # # Magic filter setup file for the HP PaintJet XL 300 # THIS FILE IS UNTESTED! # # This file has been automatically adapted to your system. %ifndef HAVE_GHOSTSCRIPT # However, since you didn't have GhostScript installed, most entries # are going to be rejects. %endif # /* * Printer resolution */ %define DPI 300 %define IS_COLOR 1 /* * PostScript */ %ifdef HAVE_GHOSTSCRIPT %define HANDLE_PS filter PATH_GHOSTSCRIPT -q -dSAFER -dNOPAUSE -r300 -sDEVICE=pjxl300 -sOutputFile=- - %endif /* * PCL, PJL */ %define HANDLE_PCL cat /* * Text */ %define HANDLE_TEXT cat \eE\e&k2G\e(0N \eE %define LATIN1_OK 1 %include # wild guess: PCL control codes start with 0 \033 HANDLE_PCL # Default entry -- for normal (text) files. MUST BE LAST. default HANDLE_TEXT magicfilter-1.2.orig/filters/ps300-filter.x100644 144 144 76 5744607252 17233 0ustar davidusers%define DPI 300 %define NATIVE_TEXT 1 %include magicfilter-1.2.orig/filters/ps400-filter.x100644 144 144 76 5744607271 17235 0ustar davidusers%define DPI 400 %define NATIVE_TEXT 1 %include magicfilter-1.2.orig/filters/ps600-filter.x100644 144 144 76 5744607317 17240 0ustar davidusers%define DPI 600 %define NATIVE_TEXT 1 %include magicfilter-1.2.orig/filters/psonly300-filter.x100644 144 144 50 5744607435 20130 0ustar davidusers%define DPI 300 %include magicfilter-1.2.orig/filters/psonly400-filter.x100644 144 144 50 5744607447 20134 0ustar davidusers%define DPI 400 %include magicfilter-1.2.orig/filters/psonly600-filter.x100644 144 144 50 5744607457 20137 0ustar davidusers%define DPI 600 %include magicfilter-1.2.orig/filters/r4081-filter.x100644 144 144 1462 5744610743 17203 0ustar davidusers%include # # Magic filter setup file for the Ricoh 4081 laser printer # THIS FILE IS UNTESTED! # # This file is in the public domain. # # This file has been automatically adapted to your system. %ifndef HAVE_GHOSTSCRIPT # However, since you didn't have GhostScript installed, most entries # are going to be rejects. %endif # /* * Printer resolution */ %define DPI 300 /* * PostScript */ %ifdef HAVE_GHOSTSCRIPT %define HANDLE_PS filter PATH_GHOSTSCRIPT -q -dSAFER -dNOPAUSE -r300 -sDEVICE=r4081 -sOutputFile=- - %endif /* * Text */ %define HANDLE_TEXT text /* * Native here to override PCL magic */ # wild guess: native control codes start with 0 \033 cat %include # Default entry -- for normal (text) files. MUST BE LAST. default HANDLE_TEXT magicfilter-1.2.orig/filters/README100644 144 144 577 5735711223 15612 0ustar davidusersIMPORTANT: The only filters which have been tested are the dj500, dj550c and ljet4m filters, since those are the only printer types I use. Any additional files are untested, even if they do not explicitly say so. I would like information if they work properly or not; please send me email at if you are using any of the other sample filters. Thanks, /hpamagicfilter-1.2.orig/filters/stdrejects.xh100644 144 144 1716 5735627164 17473 0ustar davidusers# # 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 ! reject Attempted to print an archive. 0 = reject Attempted to print an archive. # Don't confuse this one with troff! 0 .snd reject Attempted to print Sun/NeXT audio data. magicfilter-1.2.orig/filters/tek4693-filter.x100644 144 144 1475 5744611306 17536 0ustar davidusers%include # # Magic filter setup file for the Tektronix 4693 # THIS FILE IS UNTESTED! # # This file is in the public domain. # # This file has been automatically adapted to your system. %ifndef HAVE_GHOSTSCRIPT # However, since you didn't have GhostScript installed, most entries # are going to be rejects. %endif # /* * Printer resolution */ %define DPI 100 %define IS_COLOR 1 /* * PostScript */ %ifdef HAVE_GHOSTSCRIPT %define HANDLE_PS filter PATH_GHOSTSCRIPT -q -dSAFER -dNOPAUSE -r100 -sDEVICE=t4693d8 -sOutputFile=- - %endif /* * Text */ %define HANDLE_TEXT text /* * Native here to override PCL magic */ # wild guess: native control codes start with 0 \033 cat %include # Default entry -- for normal (text) files. MUST BE LAST. default HANDLE_TEXT magicfilter-1.2.orig/filters/tek4696-filter.x100644 144 144 1536 5744611260 17536 0ustar davidusers%include # # Magic filter setup file for the Tektronix 4695/4696 # THIS FILE IS UNTESTED! # # This file is in the public domain. # # This file has been automatically adapted to your system. %ifndef HAVE_GHOSTSCRIPT # However, since you didn't have GhostScript installed, most entries # are going to be rejects. %endif # /* * Printer resolution */ %define DPI 120 %define IS_COLOR 1 /* At least I think it is */ /* * PostScript */ %ifdef HAVE_GHOSTSCRIPT %define HANDLE_PS filter PATH_GHOSTSCRIPT -q -dSAFER -dNOPAUSE -r120 -sDEVICE=t4696 -sOutputFile=- - %endif /* * Text */ %define HANDLE_TEXT text /* * Native here to override PCL magic */ # wild guess: native control codes start with 0 \033 cat %include # Default entry -- for normal (text) files. MUST BE LAST. default HANDLE_TEXT magicfilter-1.2.orig/install-sh100555 144 144 11244 5734632766 15332 0ustar davidusers#! /bin/sh # # install - install a program, script, or datafile # This comes from X11R5. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. # # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" tranformbasename="" transform_arg="" instcmd="$mvprog" chmodcmd="$chmodprog 0755" chowncmd="" chgrpcmd="" stripcmd="" rmcmd="$rmprog -f" mvcmd="$mvprog" src="" dst="" dir_arg="" while [ x"$1" != x ]; do case $1 in -c) instcmd="$cpprog" shift continue;; -d) dir_arg=true shift continue;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; -s) stripcmd="$stripprog" shift continue;; -t=*) transformarg=`echo $1 | sed 's/-t=//'` shift continue;; -b=*) transformbasename=`echo $1 | sed 's/-b=//'` shift continue;; *) if [ x"$src" = x ] then src=$1 else # this colon is to work around a 386BSD /bin/sh bug : dst=$1 fi shift continue;; esac done if [ x"$src" = x ] then echo "install: no input file specified" exit 1 else true fi if [ x"$dir_arg" != x ]; then dst=$src src="" if [ -d $dst ]; then instcmd=: else instcmd=mkdir fi else # Waiting for this to be detected by the "$instcmd $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if [ -f $src -o -d $src ] then true else echo "install: $src does not exist" exit 1 fi if [ x"$dst" = x ] then echo "install: no destination specified" exit 1 else true fi # If destination is a directory, append the input filename; if your system # does not like double slashes in filenames, you may need to add some logic if [ -d $dst ] then dst="$dst"/`basename $src` else true fi fi ## this sed command emulates the dirname command dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Make sure that the destination directory exists. # this part is taken from Noah Friedman's mkinstalldirs script # Skip lots of stat calls in the usual case. if [ ! -d "$dstdir" ]; then defaultIFS=' ' IFS="${IFS-${defaultIFS}}" oIFS="${IFS}" # Some sh's can't handle IFS=/ for some reason. IFS='%' set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` IFS="${oIFS}" pathcomp='' while [ $# -ne 0 ] ; do pathcomp="${pathcomp}${1}" shift if [ ! -d "${pathcomp}" ] ; then $mkdirprog "${pathcomp}" else true fi pathcomp="${pathcomp}/" done fi if [ x"$dir_arg" != x ] then $doit $instcmd $dst && if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi else # If we're going to rename the final executable, determine the name now. if [ x"$transformarg" = x ] then dstfile=`basename $dst` else dstfile=`basename $dst $transformbasename | sed $transformarg`$transformbasename fi # don't allow the sed command to completely eliminate the filename if [ x"$dstfile" = x ] then dstfile=`basename $dst` else true fi # Make a temp file name in the proper directory. dsttmp=$dstdir/#inst.$$# # Move or copy the file name to the temp name $doit $instcmd $src $dsttmp && trap "rm -f ${dsttmp}" 0 && # and set any options; do chmod last to preserve setuid bits # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $instcmd $src $dsttmp" command. if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && # Now rename the file to the real destination. $doit $rmcmd -f $dstdir/$dstfile && $doit $mvcmd $dsttmp $dstdir/$dstfile fi && exit 0 magicfilter-1.2.orig/INSTALL100644 144 144 16446 5735716144 14364 0ustar davidusersBasic Installation ================== These are generic installation instructions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, a file `config.cache' that saves the results of its tests to speed up reconfiguring, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.in' is used to create `configure' by a program called `autoconf'. You only need `configure.in' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. If you're using `csh' on an old version of System V, you might need to type `sh ./configure' instead to prevent `csh' from trying to execute `configure' itself. Running `configure' takes awhile. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package. 4. Type `make install' to install the programs and any data files and documentation. 5. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. You can give `configure' initial values for variables by setting them in the environment. Using a Bourne-compatible shell, you can do that on the command line like this: CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure Or on systems that have the `env' program, you can do it like this: env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you must use a version of `make' that supports the `VPATH' variable, such as GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. If you have to use a `make' that does not supports the `VPATH' variable, you have to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. Installation Names ================== By default, `make install' will install the package's files in `/usr/local/bin', `/usr/local/man', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PATH'. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you give `configure' the option `--exec-prefix=PATH', the package will use PATH as the prefix for installing programs and libraries. Documentation and other data files will still use the regular prefix. If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Optional Features ================= Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Specifying the System Type ========================== There may be some features `configure' can not figure out automatically, but needs to determine by the type of host the package will run on. Usually `configure' can figure that out, but if it prints a message saying it can not guess the host type, give it the `--host=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name with three fields: CPU-COMPANY-SYSTEM See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the host type. If you are building compiler tools for cross-compiling, you can also use the `--target=TYPE' option to select the type of system they will produce code for and the `--build=TYPE' option to select the type of system on which you are compiling the package. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Operation Controls ================== `configure' recognizes the following options to control how it operates. `--cache-file=FILE' Use and save the results of the tests in FILE instead of `./config.cache'. Set FILE to `/dev/null' to disable caching, for debugging `configure'. `--help' Print a summary of the options to `configure', and exit. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `--version' Print the version of Autoconf used to generate the `configure' script, and exit. `configure' also accepts some other, not widely useful, options. magicfilter-1.2.orig/loadconfig.c100644 144 144 10113 5736571673 15574 0ustar davidusers/* * loadconfig.c * * Copyright © 1995 H. Peter Anvin * * Load the configuration file */ #include "magicfilter.h" #define MAX_LINE 4096 /* Size of line buffer */ #define die(M) do { fprintf(stderr, "%s:%d: %s\n", file, lineno, (M)); \ fclose(f); return NULL; } while(0); /* * char *getline(FILE *f, char *file, int *lineno) * * Get a logical line from file f; returning a pointer to the allocated * storage. Advance the line pointer by # of lines. file used for * error messages. */ static char *getline(FILE *f, char *file, int *line) { char *buf, *p; int buflen, spc, ch, bslash; int lineno = *line; buf = p = malloc(BUFSIZ); if ( !buf ) die("Out of memory"); buflen = spc = BUFSIZ; bslash = 0; while(1) { if ( !spc ) /* Risk for overrun? */ { spc = p-buf; if ( !(buf = realloc(buf, buflen += BUFSIZ)) ) die("Out of memory"); p = buf+spc; spc = BUFSIZ; } ch = getc(f); if ( ch == EOF ) { if ( p == buf ) { free(buf); return NULL; /* EOF */ } else { bslash = 0; ch = '\n'; /* End of file -> end of line */ } } if ( ch == '\n' ) { lineno++; if ( bslash ) { p--; /* Delete backslash-newline combo */ spc++; while ( isspace(ch = getc(f)) ); /* Ignore leading whitespace */ ungetc(ch, f); } else { *p = '\0'; *line = lineno; return buf; } } else { bslash = (ch == '\\'); *(p++) = ch; spc--; } } } /* * struct datatype *load_config(char *file) * * Load the configuration file, returning the pointer to the lead node. * In case of error, return NULL. * * The variable pointed to by in_block_size is set to the size needed * for the input buffer. */ struct datatype *load_config(char *file, int *in_block_size) { FILE *f; struct datatype *head = NULL; /* Head pointer to linked list */ struct datatype **next = &head; /* Chase pointer to store in order */ struct datatype *new; char *line, *p; int lineno = 0; int max_line = 0; int bytes_needed = 0; int offset; int i; f = fopen(file, "r"); if ( !f ) { perror(file); return NULL; } while ( (line = getline(f, file, &lineno)) != NULL ) { offset = getoffset(line, &p); if ( offset == MAG_ERR ) die("Syntax error"); if ( offset != MAG_COMMENT ) { new = (struct datatype *) malloc(sizeof(struct datatype)); if ( !new ) die("Out of memory"); if ( offset == MAG_DEFAULT ) { new->offset = new->length = 0; new->magic = new->mask = ""; } else { i = getmagic(p, NULL, NULL, NULL); /* Get length of magic */ if ( i < 0 ) die("Syntax error"); new->offset = offset; new->length = i; new->magic = malloc(i); new->mask = malloc(i); if ( !(new->magic && new->mask) ) die("Out of memory"); if ( offset+i > bytes_needed ) bytes_needed = offset+i; #if DEBUG > 3 fprintf(stderr,"magic bytes: %d\n", i); #endif getmagic(p, &p, new->magic, new->mask); } if ( (new->action = getaction(p, &p)) < 0 ) die("Invalid action"); if ( (i = strlen(p)) > 0 ) { if ( !(new->command = malloc(i+1)) ) die("Out of memory"); strcpy(new->command, p); } else new->command = ""; /* Complete the linked list */ new->next = NULL; *next = new; next = &(new->next); #if DEBUG > 2 fprintf(stderr,"Added config entry: \n"); fprintf(stderr," offset = %d\n", new->offset); fprintf(stderr," length = %d\n", new->length); fprintf(stderr," action = %d\n", new->action); fprintf(stderr," command = %s\n", new->command); fprintf(stderr," bytes = "); for ( i = 0 ; i < new->length ; i++ ) { if ( (new->mask)[i] ) fprintf(stderr,"%03o ", (unsigned char)(new->magic)[i]); else fprintf(stderr,"??? "); } fprintf(stderr,"\n"); #endif } free(line); } fclose(f); if ( in_block_size ) *in_block_size = bytes_needed; return head; } magicfilter-1.2.orig/magicfilter.c100644 144 144 57207 6122774754 15767 0ustar davidusers/* * magicfilter.c * * Copyright © 1993-96 H. Peter Anvin * * "Magic" default filter for lpr/lpd which attempt to identify * the type of file and filter it accordingly * */ #include "magicfilter.h" #include #include #include #ifdef HAVE_MEMORY_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #include #include #ifdef HAVE_SYS_WAIT_H #include #endif char *inblock; /* Block read */ int inblock_size; /* Bytes reserved for the inblock */ int inblock_len; /* Number of bytes read (<= inblock_size) */ int done = 0; /* Set to 1 if no more iterations */ char *program; /* Set to argv[0] in main() */ char *config_file = NULL; /* Configuration file */ int debug_flag = 0; /* If debugging */ /* What to call ourselves in case of failure */ #define ERR_NAME (config_file ? config_file : program) extern const struct datatype dtypetab[]; /* Table of magic */ /* Location of the mailer */ #ifndef NOMAIL #ifndef SENDMAIL #ifdef _PATH_SENDMAIL /* Path defined in paths.h */ #define SENDMAIL _PATH_SENDMAIL #else #ifdef HAVE_SENDMAIL /* Path defined by autoconf */ #define SENDMAIL PATH_SENDMAIL #endif #endif #endif #ifndef SENDMAIL /* We couldn't find a mailer anywhere -- disable mail */ #define NOMAIL 1 #endif #endif /* Header of mail message */ #ifndef NOMAIL const char *mailheader = /* Header of complaint message */ "To: %s\n\ Subject: Rejected print job\n\ Your print job was automatically rejected as an invalid data type.\n\n"; #endif /* ------------------------------------------------------------------------- * * Fudging of certain functions if we do not have them. None of these * are very good to use, but are better than nothing. * ------------------------------------------------------------------------- */ #ifndef HAVE_DUP2 int dup2(int fd1, int fd2) #ifdef F_DUPFD { close(fd2); return fcntl(fildes, F_DUPFD, fd2); } #else { int rtn; close(fd2); /* Might return error if unused, is OK */ rtn = dup(fd1); if ( rtn >= 0 && rtn != fd2 ) { fprintf(stderr, "%s: dup() trick failed -- aborting\n", ERR_NAME); exit(1); } return rtn; } #endif #endif #ifdef HAVE_TMPNAM /* If we don't have L_tmpnam, we can't use the provided tmpnam */ #ifndef L_tmpnam #define tmpnam(X) my_tmpnam(X) #undef HAVE_TMPNAM #endif #endif #ifndef HAVE_TMPNAM /* * Lame implementation of tmpnam which works on most Unices */ #define L_tmpnam (15+3*sizeof(pid_t)) char *tmpnam(char *buf) { static char tmp_buf[L_tmpnam]; static int count = 0; if ( !buf ) buf = tmp_buf; sprintf(buf, "/tmp/_magf.%u.%02x", (unsigned int) getpid(), count++); return buf; } #endif /* ------------------------------------------------------------------------- * * run(command) * * Similar to system(), but always run a specified shell and does not * fork. We don't want to fork because we are creating a pipe, anyway. * * The shell is defined in SYSSHELL and is called as * `` -c command_line'' * ------------------------------------------------------------------------- */ #ifndef SYSSHELL #ifdef _PATH_BSHELL #define SYSSHELL _PATH_BSHELL #else #define SYSSHELL "/bin/sh" #endif #endif #ifndef SHELLFLAG #define SHELLFLAG "-c" #endif void run(char *command) { execl(SYSSHELL,SYSSHELL,SHELLFLAG,command,(char *)NULL); exit(255); /* If we get here, the exec failed */ } /* ------------------------------------------------------------------------- * * fork_daemon() * * Fork a process that doesn't have to be wait'ed on. This it done by * forking *twice* and orphanning the grandchild process, leaving it * adopted by init. Do a reasonable job of propagating errors. * * Returns 0 for the child and 1 for the parent if OK; otherwise -1. * (The reason the parent returns 1 is that is *doesn't know* the pid of * the spawned child process.) * ------------------------------------------------------------------------- */ /* This is for non-POSIX compliant systems */ #ifndef WEXITSTATUS #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8) #endif #ifndef WIFEXITED #define WIFEXITED(stat_val) (((stat_val) & 0xff) == 0) #endif #ifndef HAVE_WAITPID /* We don't have waitpid(), we have to emulate it */ #ifdef HAVE_WAIT4 /* With wait4() we should be set */ #define waitpid(p,s,o) wait4(p, s, o, NULL) #else /* This is a feeble implementation using wait(); it doesn't implement the full waitpid() semantics, but should be close enough for what we need. Use with caution. */ pid_t waitpid(pid_t pid, int *status, int options) { pid_t retval; do retval = wait(status); while ( retval > 0 && retval != pid ); return retval; } #endif #endif int fork_daemon(void) { pid_t pid; int status; pid = fork(); if ( pid < 0 ) return -1; /* Error on first fork */ else if ( pid == 0 ) { pid = fork(); if ( pid < 0 ) _exit(errno); else if ( pid == 0 ) return 0; /* Child process */ else _exit(0); } else { waitpid(pid,&status,0); if (status) /* Did we return error? */ { errno = WIFEXITED(status) ? WEXITSTATUS(status) : EINTR; return -1; } return 1; /* Parent process */ } } /* ------------------------------------------------------------------------- * * cat(file) * act_cat(opt_string) * * Feed the input to a specified file without any processing whatsoever. * * act_cat() is the action; it will attempt to extract a prefix and suffix * string from the included option string as well. * ------------------------------------------------------------------------- */ void cat(FILE *f) { if ( inblock_len > 0 ) fwrite(inblock,1,inblock_len,f); while( ( inblock_len = fread(inblock,1,inblock_size,stdin) ) > 0 ) { fwrite(inblock,1,inblock_len,f); } } typedef void datafunc(FILE *); void do_prefix_suffix(char *opt_str, datafunc *convfunc, FILE *f) { char *p, *prefix, *suffix = NULL; int n; if ( (n = getmagic(opt_str,&p,NULL,NO_WILD)) >= 0 ) { if ( n > 0 ) { if ( !(prefix = malloc(n)) ) { fprintf(stderr, "%s: Out of memory\n", ERR_NAME); exit(1); } getmagic(opt_str,&p,prefix,NO_WILD); fwrite(prefix,1,n,f); /* Write prefix string */ free(prefix); } if ( (n = getmagic(p,NULL,NULL,NO_WILD)) > 0 ) { if ( !(suffix = malloc(n)) ) { fprintf(stderr, "%s: Out of memory\n", ERR_NAME); exit(1); } getmagic(p,NULL,suffix,NO_WILD); } } convfunc(f); if ( suffix ) { fwrite(suffix,1,n,f); free(suffix); } } void act_cat(char *opt_str) { if ( debug_flag ) fprintf(stderr, "cat %s\n", opt_str); do_prefix_suffix(opt_str, cat, stdout); done = 1; } /* ------------------------------------------------------------------------- * * act_addcr() * * Feed the input to the output, substituting: * \n -> \r\n \f -> \r\f * * It also adds \r\f at the end of the file. * * Used for printers which need CR's at line endings. Note that if your * printer supports a different character set (say Roman-8) than your host * (say Latin-1) you may be better off using ACT_FILTER and a translating * filter such as "lpchar". * ------------------------------------------------------------------------- */ void addcr(FILE *f) { char *p; int i; do { for ( i = inblock_len, p = inblock ; i ; i--, p++ ) { switch ( *p ) { case '\n': case '\f': putc('\r', f); /* Fall through */ default: putc(*p, f); break; } } inblock_len = fread(inblock, 1, inblock_size, stdin); } while ( inblock_len > 0 ); putc('\r', f); putc('\f', f); } void act_addcr(char *opt_str) { if ( debug_flag ) fprintf(stderr, "text %s\n", opt_str); do_prefix_suffix(opt_str, addcr, stdout); done = 1; } /* ------------------------------------------------------------------------- * * act_ps() * * Like act_addcr() but add a Ctrl-D to the end (PostScript End of Job). * Keeps the printer from running two jobs together. nenscript in * particular is bad with this. * ------------------------------------------------------------------------- */ void act_ps(void) { if ( debug_flag ) fprintf(stderr, "postscript\n"); addcr(stdout); putchar('\4'); done = 1; } /* ------------------------------------------------------------------------- * * act_drop() * * Just sets the done flag. * ------------------------------------------------------------------------- */ void act_drop(void) { if ( debug_flag ) fprintf(stderr, "ignore\n"); done = 1; } /* ------------------------------------------------------------------------- * * act_reject(message,user,host) * * Sends a rejection message to the user. A bad file (such as an executable * binary) was encountered. * ------------------------------------------------------------------------- */ #ifndef NOMAIL void act_reject(char *message, char *user, char *host) { int fildes[2]; /* File descriptors for pipe */ pid_t pid; FILE *msg; /* Outgoing pipe */ char address[BUFSIZ]; /* Buffer to create address */ int status; if ( debug_flag ) fprintf(stderr, "reject %s\n", message); #ifdef BANG_ADDRESS sprintf(address,"%s!%s", host, user); #else sprintf(address,"%s@%s", user, host); #endif if ( pipe(fildes) ) { perror(ERR_NAME); exit(1); } pid = fork(); if ( pid < 0 ) /* Fork failed */ { perror(ERR_NAME); exit(1); } else if ( pid == 0 ) /* Child process */ { close(fildes[1]); dup2(fildes[0],fileno(stdin)); /* Redirect stdin */ execl(SENDMAIL,SENDMAIL,address,(char *) NULL); exit(255); /* Exec failed */ } else /* Parent process */ { close(fildes[0]); msg = fdopen(fildes[1],"wb"); /* Make pipe file pointer */ fprintf(msg, mailheader, address); fprintf(msg, "%s\n", message); fclose(msg); waitpid(pid,&status,0); if ( status ) { fprintf(stderr, "%s: %s failed\n", ERR_NAME, SENDMAIL); } } done = 1; } #else #define act_reject(MSG,USR,HST) act_drop() #endif /* ------------------------------------------------------------------------- * * act_filter(command) * * Set up a pipe and filter the input through that command. Output goes * to stdout. * ------------------------------------------------------------------------- */ void act_filter(char *command) { int fildes[2]; /* File descriptors for pipe */ FILE *out; /* Output file pointer */ pid_t pid; /* Child process ID */ int status; if ( debug_flag ) fprintf(stderr, "filter %s\n", command); if ( pipe(fildes) ) { perror(ERR_NAME); exit(1); } pid = fork(); if ( pid < 0 ) /* Fork failed */ { perror(ERR_NAME); exit(1); } else if ( pid == 0 ) /* Child process */ { close(fildes[1]); dup2(fildes[0],fileno(stdin)); /* Redirect stdin */ run(command); } else /* Parent process */ { close(fildes[0]); out = fdopen(fildes[1],"wb"); /* Make pipe file pointer */ cat(out); /* Send output into pipe */ fclose(out); waitpid(pid,&status,0); if ( status ) { fprintf(stderr, "%s: %s failed\n", ERR_NAME, command); } } done = 1; } /* ------------------------------------------------------------------------- * * act_ffilter(command) * * Create a temp file; then filter the temp file through that command. * Output goes to stdout. * ------------------------------------------------------------------------- */ void act_ffilter(char *command) { static char tmpbuf[L_tmpnam+6] = "FILE="; FILE *out; /* Output file pointer */ int outfd; /* Output file descriptor */ pid_t pid; /* Child process ID */ int status; if ( debug_flag ) fprintf(stderr, "ffilter %s\n", command); if ( !tmpnam(tmpbuf+5) || !(out = fopen(tmpbuf+5, "wb")) ) { perror(ERR_NAME); exit(1); } cat(out); /* Send output to temp file */ fclose(out); pid = fork(); if ( pid < 0 ) /* Fork failed */ { perror(ERR_NAME); exit(1); } else if ( pid == 0 ) /* Child process */ { putenv(tmpbuf); /* Store name in $FILE */ outfd = open(tmpbuf+5, O_RDONLY); dup2(outfd,fileno(stdin)); /* Redirect stdin */ run(command); } else /* Parent process */ { waitpid(pid,&status,0); /* Wait for process to finish */ if ( status ) { fprintf(stderr, "%s: %s failed\n", ERR_NAME, command); } unlink(tmpbuf+5); /* Remove temp file */ } done = 1; } /* ------------------------------------------------------------------------- * * act_pipethru(command) * * Pipes the output through a given command, creating a second pipe to * fetch the input for re-processing. * * This is done the "proper" way by creating a sender and a receiver process * around the filter process; who knows what the OS does if we overflow a * pipe. * ------------------------------------------------------------------------- */ void act_pipethru(char *command) { int inpipefd[2]; /* File descriptors for input pipe */ int outpipefd[2]; /* File descriptors for output pipe */ FILE *out; /* Output file pointer */ pid_t pid, xpid, wpid; int null; /* /dev/null */ int status; /* Process exit status */ if ( debug_flag ) fprintf(stderr, "pipe %s\n", command); if ( pipe(inpipefd) || pipe(outpipefd) ) { perror(ERR_NAME); exit(1); } xpid = fork_daemon(); if ( xpid < 0 ) { perror(ERR_NAME); exit(1); } else if ( xpid == 0 ) { close(outpipefd[0]); pid = fork(); if ( pid < 0 ) /* Fork failed */ { perror(ERR_NAME); exit(1); } else if ( pid == 0 ) /* Child process */ { close(inpipefd[1]); dup2(inpipefd[0],fileno(stdin)); dup2(outpipefd[1],fileno(stdout)); /* Redirect stdout */ run(command); } else { /* Writing process */ close(inpipefd[0]); close(outpipefd[1]); out = fdopen(inpipefd[1],"wb"); cat(out); /* Send output into pipe */ fclose(out); /* Wait for filter to exit */ if ( waitpid(pid,&status,0) < 0 ) perror("waitpid"); /* If status > 0 we should probably do something, but it is difficult to know what we can do at this stage */ exit(0); } } else { /* Reading process */ close(inpipefd[0]); close(outpipefd[1]); close(inpipefd[1]); /* Flush the stdin buffer */ null = open("/dev/null", O_RDONLY); dup2(null, fileno(stdin)); close(null); while ( fread(inblock,1,inblock_size,stdin) > 0 ); if ( dup2(outpipefd[0],fileno(stdin)) < 0 ) { perror("dup2"); exit(1); } /* Redirect stdin */ close(outpipefd[0]); rewind(stdin); inblock_len = fread(inblock,1,inblock_size,stdin); } } /* ------------------------------------------------------------------------- * * act_fpipe(command) * * Creates a temp file and sends the output through a given command, * creating a pipe to fetch the input for re-processing. * ------------------------------------------------------------------------- */ void act_fpipe(char *command) { static char tmpbuf[L_tmpnam+6] = "FILE="; int outpipefd[2]; /* File descriptors for output pipe */ FILE *out; /* Output file pointer */ int outfd; /* Output file descriptor */ pid_t pid, xpid, wpid; int null; /* /dev/null */ int status; /* Exit status */ if ( debug_flag ) fprintf(stderr, "fpipe %s\n", command); if ( !tmpnam(tmpbuf+5) || !(out = fopen(tmpbuf+5,"w+b")) || pipe(outpipefd) ) { #if DEBUG > 2 fprintf(stderr, "TMPBUF: %s\n", tmpbuf); #endif perror(ERR_NAME); exit(1); } cat(out); /* Write output to file */ fclose(out); xpid = fork_daemon(); if ( xpid < 0 ) { perror(ERR_NAME); exit(1); } else if ( xpid == 0 ) { close(outpipefd[0]); pid = fork(); if ( pid < 0 ) /* Fork failed */ { perror(ERR_NAME); exit(1); } else if ( pid == 0 ) /* Child process */ { putenv(tmpbuf); /* Store name in $FILE */ outfd = open(tmpbuf+5, O_RDONLY); dup2(outfd,fileno(stdin)); /* Redirect stdin */ dup2(outpipefd[1],fileno(stdout)); /* Redirect stdout */ run(command); } else /* Parent process */ { close(outpipefd[1]); /* Wait for filter to finish and then remove temp file */ if ( waitpid(pid,&status,0) < 0 ) perror("waitpid"); /* If status > 0 we should probably do something, but it is difficult to know what we can do at this stage */ unlink(tmpbuf+5); exit(0); } } else { close(outpipefd[1]); /* Reading process */ /* Flush the stdin buffer */ null = open("/dev/null", O_RDONLY); dup2(null, fileno(stdin)); close(null); while ( fread(inblock,1,inblock_size,stdin) > 0 ); if ( dup2(outpipefd[0],fileno(stdin)) < 0 ) { perror("dup2"); exit(1); } /* Redirect stdin */ close(outpipefd[0]); rewind(stdin); inblock_len = fread(inblock,1,inblock_size,stdin); } } /* ------------------------------------------------------------------------- * * matches(block, pattern, mask, length) * * Returns nonzero if block matches pattern. * ------------------------------------------------------------------------- */ int matches(char *block, char *pattern, char *mask, int length) { int i; char *p, *q, *m; q = block; p = pattern; m = mask; for ( i = length ; i ; i-- ) { if ( (*p ^ *q) & *m ) return 0; q++; p++; m++; } #if DEBUG > 3 fprintf(stderr,"Pattern: "); for ( i = 0 ; i < length ; i++ ) { fprintf(stderr,"%03o ", (unsigned char) block[i]); } fprintf(stderr,"\nMatches: "); for ( i = 0 ; i < length ; i++ ) { if ( mask[i] ) fprintf(stderr,"%03o ", (unsigned char) pattern[i]); else fprintf(stderr,"??? "); } fprintf(stderr,"\n"); #endif return 1; } /* ------------------------------------------------------------------------- * * envset(var,value) * * Inserts a key value into the environment * ------------------------------------------------------------------------- */ void envset(char *var, char *value) { char *buf; if ( !(buf = malloc(strlen(var)+strlen(value)+2)) ) { fprintf(stderr, "%s: out of memory\n", ERR_NAME); exit(1); } sprintf(buf, "%s=%s", var, value); if ( putenv(buf) ) { perror(ERR_NAME); exit(1); } if ( debug_flag ) fprintf(stderr, "%s\n", buf); } /* ------------------------------------------------------------------------- * * main(argc,argv) * * Analyze the input data and choose an appropriate way to handle it. * ------------------------------------------------------------------------- */ main(int argc, char *argv[]) { int do_cat = 0; /* True if -c option */ int i; const struct datatype *dtab; /* Data type table */ const struct datatype *dt; /* Data type searched */ char *user = "unknown"; /* User name */ char *host = "unknown"; /* Host name */ program = argv[0]; /* Make available for error messages */ if ( argc < 2 ) { fprintf(stderr, "%s: No configuration file specified\n", program); exit(1); } /* Clear these strings from environment; if we have unsetenv use it, otherwise set to blank strings */ #ifdef HAVE_UNSETENV unsetenv("LPUSER"); unsetenv("LPHOST"); unsetenv("LPJOB"); unsetenv("FILE"); unsetenv("PRINTER"); unsetenv("LPFORMAT"); unsetenv("LPCLASS"); unsetenv("LPACCT"); unsetenv("LPCOPIES"); unsetenv("LPQUEUE"); unsetenv("ZOPT"); unsetenv("BANNERNAME"); #else putenv("LPUSER="); putenv("LPHOST="); putenv("LPJOB="); putenv("FILE="); putenv("PRINTER="); putenv("LPFORMAT="); putenv("LPCLASS="); putenv("LPACCT="); putenv("LPCOPIES="); putenv("LPQUEUE="); putenv("ZOPT="); putenv("BANNERNAME="); #endif putenv("LPINDENT=0"); /* Default to zero */ for ( i = 1 ; i < argc ; i++ ) /* Options passed by lpd */ { if ( argv[i][0] == '-' ) { if ( strcmp(argv[i],"-c") == 0 ) do_cat = 1; else if ( strncmp(argv[i],"-n",2) == 0 ) { user = (argv[i][2] || i == argc-1) ? argv[i]+2 : argv[++i]; envset("LPUSER", user); } else if ( strncmp(argv[i],"-h",2) == 0 ) { host = (argv[i][2] || i == argc-1) ? argv[i]+2 : argv[++i]; envset("LPHOST", host); } else if ( strncmp(argv[i],"-i",2) == 0 ) envset("LPINDENT", argv[i]+2); else if ( strncmp(argv[i],"-C",2) == 0 ) envset("LPCLASS", argv[i]+2); else if ( strncmp(argv[i],"-F",2) == 0 ) envset("LPFORMAT", argv[i]+2); else if ( strncmp(argv[i],"-J",2) == 0 ) envset("LPJOB", argv[i]+2); else if ( strncmp(argv[i],"-K",2) == 0 ) envset("LPCOPIES", argv[i]+2); else if ( strncmp(argv[i],"-L",2) == 0 ) envset("BANNERNAME", argv[i]+2); else if ( strncmp(argv[i],"-P",2) == 0 ) envset("PRINTER", argv[i]+2); else if ( strncmp(argv[i],"-Q",2) == 0 ) envset("LPQUEUE", argv[i]+2); else if ( strncmp(argv[i],"-R",2) == 0 ) envset("LPACCT", argv[i]+2); else if ( strncmp(argv[i],"-Z",2) == 0 ) envset("ZOPT", argv[i]+2); else if ( strcmp(argv[i], "--debug") == 0 ) debug_flag = 1; /* Ignore other options passed by lpd */ } else if ( !config_file ) config_file = argv[i]; } umask(077); /* Protect the user's privacy */ if ( do_cat ) /* Literal flag: skip config file */ { if ( debug_flag ) fprintf(stderr, "(literal)\n"); inblock_size = BUFSIZ; } else { dtab = load_config(config_file, &i); /* Load configuration file */ if ( !dtab ) exit(1); /* load_config does the error message */ /* Round up to nearest multiple of BUFSIZ, for efficiency */ inblock_size = ((i+BUFSIZ-1)/BUFSIZ)*BUFSIZ; } if ( !(inblock = malloc(inblock_size)) ) { fprintf(stderr, "%s: Out of memory\n", ERR_NAME); exit(1); } inblock_len = fread(inblock,1,inblock_size,stdin); if ( do_cat ) /* Literal flag -> always ACT_CAT */ { cat(stdout); done = 1; } else { while ( !done && inblock_len > 0 ) { dt = dtab; /* Head of linked list */ while ( dt ) { if ( dt->length < 1 || matches(inblock+dt->offset,dt->magic,dt->mask,dt->length) ) break; dt = dt->next; } if ( !dt ) { fprintf(stderr, "%s: Unknown type data and no default; \ job sent by %s@%s)\n", ERR_NAME, user, host); exit(1); } /* Now dt should point to the proper data type record to use */ switch( dt->action ) { case ACT_CAT: act_cat(dt->command); break; case ACT_DROP: act_drop(); break; case ACT_REJECT: act_reject(dt->command, user, host); break; case ACT_FILTER: act_filter(dt->command); break; case ACT_PIPETHRU: act_pipethru(dt->command); break; case ACT_ADDCR: act_addcr(dt->command); break; case ACT_PS: act_ps(); break; case ACT_FFILTER: act_ffilter(dt->command); break; case ACT_FPIPE: act_fpipe(dt->command); break; default: fprintf(stderr, "%s(%s): Internal error - invalid parse\n\ Please mail your configuration file to \n", program, config_file); return 1; } } #ifdef REJECT_EMPTY if ( !done ) { /* Send a message to the user informing that his/her print job ended up empty */ act_reject(REJECT_EMPTY, user, host); } #endif } return 0; /* Error */ } magicfilter-1.2.orig/magicfilter.h100644 144 144 4067 5736361627 15751 0ustar davidusers/* * magicfilter.h * * Copyright © 1993-95 H. Peter Anvin * * Header file for the magic lpr/lpd filter */ #include "config.h" #include #ifdef HAVE_PATHS_H #include #endif #include #ifdef HAVE_MEMORY_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #include /* * These *must* be in the same order as the table in parseconfig.c! */ enum actions { ACT_CAT, /* Just output the file */ ACT_DROP, /* Silently ignore the file */ ACT_REJECT, /* Mail the user and complain */ ACT_FILTER, /* Run through filter, then done */ ACT_PIPETHRU, /* Pipe through command, then reprocess */ ACT_ADDCR, /* Like ACT_CAT, but \n -> \r\n, \f -> \r\f */ ACT_PS, /* Like ACT_ADDCR, but add PSEOJ (^D) at end */ ACT_FFILTER, /* Like ACT_FILTER, but use a temp file */ ACT_FPIPE, /* Like ACT_PIPETHRU, but use a temp file */ ACT_ERR = -1 }; /* * Special magic actions */ #define MAG_ERR (-1) /* Invalid line */ #define MAG_COMMENT (-2) /* Line is blank or comment */ #define MAG_DEFAULT (-3) /* Action is the default action */ #define MAG_SET (-4) /* Action is a set command */ struct datatype { struct datatype *next; /* Linked list pointer */ int offset; /* Where in file is ID string */ int length; /* Length of ID string */ char *magic; /* Expected ID string */ char *mask; /* Mask for ID string */ int action; /* What to do with it */ char *command; /* Command line, or for ACT_REJECT, */ /* text of complaint message */ }; /* Stuff to make stupid C compilers happy, and to fill in gaps */ #ifdef NOVOID #define void #endif #ifdef NOCONST #define const #endif #ifndef DEBUG #define DEBUG 0 #endif /* Function prototypes */ struct datatype *load_config(char *file, int *in_block_size); int getoffset(char *p, char **endpos); int getmagic(char *p, char **endpos, char *magic, char *mask); enum actions getaction(char *pos, char **cmd); /* Global variables */ extern int debug_flag; extern char NO_WILD[]; /* Used as senitel value by getmagic() */ magicfilter-1.2.orig/magicfilter.man.in100644 144 144 23511 6122767655 16716 0ustar davidusers.TH MAGICFILTER 8 "Version 1.2" "March 1996" \" -*- nroff -*- .SH NAME magicfilter \- automatic configurable printer filter .SH SYNOPSIS .B magicfilter config-file [\-c] [\-n user] [\-h host] [\-iindent] [\-\-debug] [other-options] .SH DESCRIPTION .B magicfilter is an extensible and customizable automatic printer filter. It selects an appropriate conversion technique for the input data by seeking for .IR "magic numbers" , and then utilizing the appropriate conversion utility. .PP .B magicfilter is primarily intended for use as the ``input filter'' by the .B lpd print spooler. The options accepted by .B magicfilter are exactly the ones passed to the input filter by .BR lpd . .SS OPTIONS Typically .B magicfilter will be invoked by .B lpd and hence provided the right options automatically. This list is included for reference only. .PP Note that only the .I \-n and .I \-h options may have spaces between the option letter and the option value. .TP .I \-c Copy the input to the output without any conversion whatsoever (used by .B lpd whenever the .I \-l option is passed to the .B lpr program). .TP .I "\-nuser, \-n user" The login name of the user who submitted the job. Available to subfilters as .BR $LPUSER . .TP .I "\-hhost, \-h host" The host on which the job was submitted. Available to subfilters as .BR $LPHOST . .TP .I "\-iindent" A numeric option passed by .BR lpd ; can be set by the user by the .I \-i option to .BR lpr. Although nominally used for the amount of indentation requested, .B magicfilter makes it available to subfilters for any useful purpose as .BR $LPINDENT . .TP .I "\-Cclassname" LPRng class (priority) name. Available to subfilters as .BR $LPCLASS . .TP .I "\-Fformat" Format letter (passed by LPRng only). When used as input filter (if) this will be .IR f , when used as other filter types it will be the option character corresponding to this filter. Available to subfilters as .BR $LPFORMAT . .TP .I "\-Jjobname" The name of the printer job (passed by LPRng only). Available to subfilters as .BR $LPJOB . .TP .I "\-Kcopies" Copy count (passed by LPRng only). Available to subfilters as .BR $LPCOPIES . .TP .I "\-Lbannername" User name from the banner page (passed by LPRng only). Available to subfilters as .BR $BANNERNAME . .TP .I "\-Pprinter" Printer name (passed by LPRng only). Available to subfilters as .BR $PRINTER . .TP .I "\-Qqueuename" Spool queue name (passed by LPRng only). Available to subfilters as .BR $LPQUEUE . .TP .I "\-Raccountinfo" Accounting information (passed by LPRng only). Available to subfilters as .BR $LPACCT . .TP .I "\-Zoptions" LPRng ``Z-options''. The LPRng .B lpr program supports a .I \-Z option, which can be used to pass arbitrary information to the printer filters. Available to subfilters as .BR $ZOPT . .TP .TP .I \-\-debug Write the name of each facility invoked (together with any options) to standard error. This can be useful for debugging complicated configuration files. .TP .I "other options" Any other options, such as the .IR \-w , .IR \-l , .IR \-x , and .I \-y options typically passed by .B lpd are ignored. .SS RUNNING MAGICFILTER FROM LPD To run .B magicfilter from .B lpd it should be entered as one of the filters in the .I /etc/printcap file. Typically, it will be the input filter (if). Since most version of .B lpd do not accept arguments entered as part of the filter name, typically the filter name entered into the .I /etc/printcap file will simply be the name of the configuration file, which is set executable and starts with the line: .PP .B #! XXX_BINDIR_XXX/magicfilter .PP Most UNIX kernels will then be able to treat the configuration file itself as if it was the actual program. .PP For systems which do not support the ``#!-hack'', the filter set in the if entry should point to .B magicfilter directly, and the accounting file (af) entry should point to the configuration file. This, however, is a less general, and hence less desirable solution. .PP This version of .B magicfilter supports the enhanced .B lpd included with the LPRng package from .IR dickory.sdsu.edu . .SS THE CONFIGURATION FILE The configuration file is used by .B magicfilter to redirect various types of data to the various conversion utilities. The configuration file is printer-specific, and often system-specific, depending on the available conversion programs. For example, a system which has GhostScript installed would be able to print PostScript to a non-PostScript printer, whereas other systems typically would not. The configuration file contains a sequence of lines of the form: .PP .I "offset magic facility" .PP where the .I offset represents the location of the indentification string in the data format, .I magic represents the identification string itself, .I facility represents the type of action to take. Blank lines and lines with a hash mark (#) as the first nonblank character are ignored. A line may be continued onto the next line by ending the line in a backslash (\e). The .I offset is a nonnegative integer, which can be represented either in decimal form (default), octal form (preceded by .IR 0 ), or hexadecimal form (preceded by .IR 0x ). The .I magic is a string of characters, which may include C-style \e-escape sequences. In addition, the sequence \e? can be used to represent a ``wildcard'' byte. If the string includes spaces, the spaces have to be preceded by a backslash, or the entire string must be enclosed in double quotation marks. For ambiguous matches, the first match is used. Hence, the most specific match should always be placed first in the file. In addition, the last line may be of the form: .PP \fBdefault\fR \fIfacility\fR .PP which designates a default action to be used in case no other action matches. This will typically be the action for plain text. .SS FACILITIES .B magicfilter provides the following options for the .I facility field in the configuration file: .TP \fBcat\fR [\fIprefix\fR [\fIsuffix\fR]] Copy the input to the output without any conversion, like the .B cat command. If the optional .I prefix and .I suffix strings are specified, they are transmitted to the printer immediately before and after the data itself. The .I prefix and .I suffix strings are specified in the same way as the .I magic string (except that the wildcard sequence \e? is not permitted), and like the .I magic sequence can contain any control character, including nulls (\e0). To specify a .I suffix without a .IR prefix , specify an empty .I prefix string enclosed in double quotes (i.e. ""). .TP \fBtext\fR [\fIprefix\fR [\fIsuffix\fR]] Copy the input to the output, but add carriage return characters before every line feed and form feed character in the file, and a line feed-form feed sequence at end of file. The .I prefix and .I suffix arguments are treated the same way as for the .B cat facility; the .IR suffix , if present, is added after the final line feed-form feed sequence. .TP \fBpostscript\fR Same as the .B text facility, except add an ASCII EOT (Ctrl-D) character to the end of the data. This lets a PostScript printer know that the end of the job has been reached. This is functionally equivalent to the command .TP .I " " \fBtext\fR "" \e004 .TP \fBignore\fR Ignore the job; do not provide any output whatsoever. .TP \fBreject\fR \fImessage\fR Same as the .B ignore facility, but attempt to send an email message to the user who submitted the job to inform that a job has been rejected and why. .TP \fBfilter\fR \fIcommand\fR Run the given .IR command , feeding it the input data, and sending the output data to the printer. The environment variables .BR LPUSER , .BR LPHOST , and .B LPINDENT is set to the values of the user, host and indent options passed to .BR magicfilter . Since the .I command is fed to .I /bin/sh it may contain shell special characters, and the sequences .BR $LPUSER , .BR $LPHOST , and .B $LPINDENT can be used to access the values of the passed environment variables. If the .B lpd daemon on the system is LPRng, the following environment variables are also available, see the .B OPTIONS section for details: .BR LPCLASS , .BR LPFORMAT , .BR LPJOB , .BR LPCOPIES , .BR BANNERNAME , .BR PRINTER , .BR LPQUEUE , .BR LPACCT , and .BR ZOPT . .TP \fBpipe\fR \fIcommand\fR Same as the .B filter facility, except that the output data is fed back into .B magicfilter for reprocessing. This is used for external filter programs which themselves do not produce a format that the printer can accept, but which can be futher processed to obtain such a format. .TP \fBffilter\fR \fIcommand\fR .sp -0.5 .TP \fBfpipe\fR \fIcommand\fR Same as the .B filter and .B pipe facilities, respectively, except that the input is written to a temporary file before being fed to the filter program given by .IR command . This is useful for programs which require seekable input, such as .BR dvips , or which need to do multiple passes over an input file, such as .BR grog . The environment variable .B FILE is set to the name of the temporary file (and, like the other ones, it can be accessed on the command line as .BR $FILE ). .SH HINTS Using the .B pipe facility together with .B zcat or .B gunzip lets you transparently print compressed files. .PP The .B pbmplus or .B netpbm collections of image conversion utilities contain a large number of very useful external filter programs. .PP You will probably want to examine the sample configuration files included with the .B magicfilter distribution before creating your own. .SH BUGS Some data formats cannot be easily identified by a simple fixed-offset magic number check. .PP Providing large offsets can cause .B magicfilter to take up lots of memory. Fortunately, large offsets for magic numbers are pretty much unheard of. .PP Currently, there is no protection against the .B pipe or .B fpipe facilities going into an infinite loop. .PP .SH AUTHOR H. Peter Anvin .SH SEE ALSO .BR printcap (5), .BR lpr (8), .BR dvips (1), .BR grog (1), .BR gs (1), .BR gzip (1), .BR troff (1). magicfilter-1.2.orig/Makefile.in100644 144 144 4003 5735716057 15345 0ustar davidusers# # Makefile for the lpr/lpd magic filter # # Copyright © 1995 Yggdrasil Computing, Inc # # # Define the following to suit your taste # srcdir = @srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = ${exec_prefix}/bin mansec=8 mandir = ${prefix}/man/man${mansec} CC = @CC@ CFLAGS = @CFLAGS@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ RM = rm -f SED = sed INSTALL = @INSTALL@ INSTALL_EXEC = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ # # These defines control the sending of mail notices to people who submit # bad jobs (PostScript to non-PS printers, or trying to print binaries.) # # This may not work if the hostname lpd knows about is not necessary a # valid mail address (for example, if you can submit print jobs from # non-mailer machines without MX records). If so, define -DNOMAIL. # # -DNOMAIL Disable sending of rejection mail notices # -DSENDMAIL="path" Where is your mail transport agent? # -DBANG_ADDRESS To send to "host!user" instead of "user@host" # # If exist and contains _PATH_SENDMAIL, it will be used unless # overridden here # SYSOPT= .c.o: ${CC} ${CFLAGS} ${SYSOPT} -c $< .PHONY: all filters clean distclean install install_filters OBJS = magicfilter.o parseconfig.o loadconfig.o all: magicfilter magicfilter.man filters filters: cd filters; make install: magicfilter magicfilter.man ${INSTALL_EXEC} magicfilter ${bindir}/magicfilter ${INSTALL_DATA} magicfilter.man ${mandir}/magicfilter.${mansec} install_filters: cd filters; make install clean: -cd filters; make clean -${RM} magicfilter magicfilter.man *.o distclean: clean -cd filters; make distclean -${RM} *~ Makefile config.cache config.log config.status config.h magicfilter: ${OBJS} ${CC} ${LDFLAGS} -o magicfilter ${OBJS} ${LIBS} magicfilter.o: magicfilter.c magicfilter.h parseconfig.o: parseconfig.c magicfilter.h loadconfig.o: loadconfig.c magicfilter.h magicfilter.man: magicfilter.man.in ${SED} -e "s:XXX_BINDIR_XXX:${bindir}:g" < magicfilter.man.in | \ ${SED} -e "s:///*:/:g" > magicfilter.man magicfilter-1.2.orig/parseconfig.c100644 144 144 21006 5744013530 15750 0ustar davidusers/* * parseconfig.c * * Routine library for parsing the configuration file * * Copyright © 1995 H. Peter Anvin */ #include "magicfilter.h" /* * int getoffset(char *startpos, char **endpos) * * Returns the parsing offset (a decimal, octal or hex number, or "default"). * Returns the number, or one of the negative numbers * MAG_DEFAULT ... is default * MAG_COMMENT ... comment line * MAG_ERR ... invalid offset * * *endpos is set to the first character after the offset, unless NULL */ int getoffset(char *p, char **endpos) { int offset = 0; /* So far */ enum { st_start, st_zero, st_oct, st_dec, st_hex, st_done } state = st_start; #if DEBUG > 3 fprintf(stderr,"getoffset %s\n", p); #endif while ( isspace(*p) ) p++; /* Skip leading whitespace */ while ( state != st_done ) { switch( state ) { case st_start: switch ( *p ) { case '\b': /* Whitespace */ case '\t': case '\n': case '\v': case '\f': case '\r': case ' ': p++; break; case '#': case '\0': /* Blank line counts as comment */ offset = MAG_COMMENT; state = st_done; break; case '0': state = st_zero; p++; break; case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': offset = *p - '0'; state = st_dec; p++; break; case 'd': if ( strncmp(p, "default", 7) ) { offset = MAG_ERR; } else { p += 7; offset = MAG_DEFAULT; } state = st_done; break; default: offset = MAG_ERR; state = st_done; break; } break; case st_zero: if ( *p == 'x' || *p == 'X' ) { state = st_hex; p++; break; } /* else fall through */ case st_oct: if ( *p < '0' || *p > '7' ) { state = st_done; } else { offset <<= 3; offset += *(p++) - '0'; } break; case st_dec: if ( *p < '0' || *p > '9' ) { state = st_done; } else { offset *= 10; offset += *(p++) - '0'; } break; case st_hex: if ( *p >= '0' && *p <= '9' ) { offset <<= 4; offset += *(p++) - '0'; } else if ( *p >= 'A' && *p <= 'F' ) { offset <<= 4; offset += *(p++) - 'A' + 10; } else if ( *p >= 'a' && *p <= 'f' ) { offset <<= 4; offset += *(p++) - 'a' + 10; } else { state = st_done; } } } if ( endpos ) *endpos = p; /* Where did we end? */ return offset; } /* * int getmagic(char *startpos, char **endpos, char *magic, char *mask) * * Parse a magic string, returning the number of bytes in the magic string. * Stores the endpoint in *endpos if requested. If magic and/or mask * is NULL, do not store; used to count the number of characters in the * magic/mask string. * * Each character in mask is either 0 for \? (don't care) or (char)-1 for * any other (do care). * * If mask is set to the senitel value NO_WILD (a unique pointer value * pointing to a bogus static string) the \? will not be interpreted * as don't care; just as a regular escaped questionmark. * */ char NO_WILD[1] = ""; /* Used as senitel value */ int getmagic(char *p, char **endpos, char *magic, char *mask) { int count = 0; /* Count of bytes */ int quote = 0; /* Quoted? */ int ch; int wildcards = 1; /* Wildcards allowed by default */ enum { st_def, st_backsl, st_oct, st_hex, st_done } state = st_def; #if DEBUG > 3 fprintf(stderr,"getmagic %s\n", p); #endif if ( mask == NO_WILD ) /* If wildcards forbidden */ { mask = NULL; /* Don't store a mask */ wildcards = 0; /* Don't accept wildcards */ } while ( isspace(*p) ) p++; /* Skip leading whitespace */ while ( state != st_done ) { switch ( state ) { case st_def: switch ( *p ) { case '\n': /* Unconditional whitespace */ case '\r': case '\f': case '\0': if ( quote ) count = MAG_ERR; state = st_done; break; case '\\': /* Backslash */ p++; state = st_backsl; break; case '\"': /* Quote */ p++; quote = !quote; break; case '\b': /* Whitespace */ case '\t': case '\v': case ' ': if ( !quote ) { state = st_done; break; } /* else fall though */ default: if ( magic ) *(magic++) = *p; if ( mask ) *(mask++) = (char)(-1); p++; count++; break; } break; case st_backsl: /* After backslash */ ch = -1; switch ( *p ) { case 'a': ch = 7; /* Bell */ break; case 'b': ch = '\b'; /* Backspace */ break; case 'e': ch = 27; /* Escape */ break; case 'f': ch = '\f'; /* Form feed */ break; case 'n': ch = '\n'; /* Newline */ break; case 'r': ch = '\r'; /* Return */ break; case 't': ch = '\t'; /* Tab */ break; case 'v': ch = '\v'; /* Vtab */ break; case 'x': case 'X': state = st_hex; /* Hex prefix */ ch = 0; break; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': state = st_oct; /* Octal prefix */ ch = *p - '0'; break; case '?': if ( wildcards ) { if ( magic ) *(magic++) = (char)0; /* Ignore byte */ if ( mask ) *(mask++) = (char)0; count++; state = st_def; break; } /* else fall through */ default: ch = *p; /* Preserve character (e.g. " or \) */ break; } p++; if ( state == st_backsl ) { if ( magic ) *(magic++) = ch; if ( mask ) *(mask++) = (char)(-1); count++; state = st_def; } break; case st_oct: if ( *p >= '0' && *p <='7' ) { ch <<= 3; ch += *(p++) - '0'; } else { if ( magic ) *(magic++) = ch; if ( mask ) *(mask++) = (char)(-1); count++; state = st_def; /* Do not advance p */ } break; case st_hex: if ( *p >= '0' && *p <= '9' ) { ch <<= 4; ch += *(p++) - '0'; } else if ( *p >= 'A' && *p <= 'F' ) { ch <<= 4; ch += *(p++) - 'A' + 10; } else if ( *p >= 'a' && *p <= 'f' ) { ch <<= 4; ch += *(p++) - 'a' + 10; } else { if ( magic ) *(magic++) = ch; if ( mask ) *(mask++) = (char)(-1); count++; state = st_def; /* Do not advance p */ } break; } } if (endpos) *endpos = p; return count; } /* * enum actions getaction(char *pos, char **cmd) * * Reads the action proposed and returns: * * ACT_CAT ... output file raw * ACT_DROP ... silently ignore * ACT_REJECT ... mail user and complain * ACT_FILTER ... run through once, then done * ACT_PIPETHRU ... run through command, then feed back through filter * ACT_ADDCR ... \n -> \r\n, \f -> \r\f * ACT_PS ... same as ADDCR, but add Ctrl-D at end * ACT_FFILTER ... same as FILTER, but use a temp file * ACT_FPIPE ... same as PIPETHRU, but use a temp file * * If the command takes an argument, point cmd to it if non-NULL * * IMPORTANT: The matching algorithm is a bit simplistic. If any action * is a proper prefix of any other action, the longer action must be first * in the list. */ enum actions getaction(char *pos, char **cmd) { enum actions act; static char *act_strs[] = { "cat", "ignore", "reject", "filter", "pipe", "text", "postscript", "ffilter", "fpipe", NULL }; char **act_str; int i; #if DEBUG > 3 fprintf(stderr,"getaction %s\n", pos); #endif while ( isspace(*pos) ) pos++; /* Ignore leading whitespace */ if ( ! *pos ) return ACT_ERR; /* Syntax error */ for ( act = ACT_CAT, act_str = act_strs ; *act_str ; act++, act_str++ ) if ( strncmp(pos, *act_str, i = strlen(*act_str)) == 0 ) { pos += i; break; } if ( ! *act_str ) { #if DEBUG > 3 fprintf(stderr,"No match\n"); #endif return ACT_ERR; /* Unknown action */ } if ( *pos && !isspace(*pos) ) { #if DEBUG > 3 fprintf(stderr,"Garbage at end: %s\n", pos); #endif return ACT_ERR; /* Garbage after action name */ } if ( cmd ) { while ( isspace(*pos) ) pos++; /* Skip leading whitespace again */ *cmd = pos; } return act; }