(DEFINE-FILE-INFO READTABLE "XCL" PACKAGE "INTERLISP")
(FILECREATED "20-May-92 15:34:18" |{DSK}<users>nilsson>UNIXPRINTCOMMAND.;1| 3317   

      |changes| |to:|  (VARS UNIXPRINTCOMMANDCOMS)
                       (FUNCTIONS FOOT)
                       (FNS |UnixPrintCommandForHP|))


; Copyright (c) 1992 by Venue.  All rights reserved.

(PRETTYCOMPRINT UNIXPRINTCOMMANDCOMS)

(RPAQQ UNIXPRINTCOMMANDCOMS ((FNS |UnixPrintCommand| |UnixPrintCommandForHP|)))
(DEFINEQ

(|UnixPrintCommand|
  (LAMBDA (PRINTER COPIES NAME TMPNAME)               (* \; "Edited 20-May-92 14:26 by nilsson")

    (* |;;| "This function is called when the user wants to UNIXPRINT a file. It has to return a string that when sent to a shell prints the file tmpname. In the cub version this should look something like \"/usr/ucb/lpr  tmpname\". The arguments to this function are:")

    (* |;;| " PRINTER - the name of the printer. Usually something like lw or  plw.")

    (* |;;| "COPIES - how many copies of this job to be printed.")

    (* |;;| "NAME - the name of this job. This gets printed on the banner of your job.")

    (* |;;| 
  "TMPNAME - The name of the temporary file that contains the postscript code for this job. ")

    (* |;;| "Note the clever function UnixShellQuote. It converts any lisp name to a string that is quoted according to /bin/sh syntax")

    (CONCAT "/usr/ucb/lpr " (COND
                               (PRINTER (CONCAT "-P" (|UnixShellQuote| PRINTER)
                                               " "))
                               (T ""))
           (COND
              ((AND (FIXP COPIES)
                    (NEQ COPIES 1))
               (CONCAT "-#" COPIES " "))
              (T ""))
           " -J"
           (|UnixShellQuote| NAME)
           " -r -s " TMPNAME)))

(|UnixPrintCommandForHP|
  (LAMBDA (PRINTER COPIES NAME TMPNAME)               (* \; "Edited 20-May-92 15:33 by nilsson")

    (* |;;| "This function is called when the user wants to UNIXPRINT a file. It has to return a string that when sent to a shell prints the file tmpname. In the cub version this should look something like \"/usr/ucb/lpr  tmpname\". The arguments to this function are:")

    (* |;;| " PRINTER - the name of the printer. Usually something like lw or  plw.")

    (* |;;| "COPIES - how many copies of this job to be printed.")

    (* |;;| "NAME - the name of this job. This gets printed on the banner of your job.")

    (* |;;| 
  "TMPNAME - The name of the temporary file that contains the postscript code for this job. ")

    (* |;;| "Note the clever function UnixShellQuote. It converts any lisp name to a string that is quoted according to /bin/sh syntax")

    (CONCAT "/usr/ucb/lp "                                   (* \; "HPUX uses lp instead.")
           (COND
              (PRINTER (CONCAT "-P" (|UnixShellQuote| PRINTER)
                              " "))
              (T ""))
           (COND
              ((AND (FIXP COPIES)
                    (NEQ COPIES 1))
               (CONCAT "-#" COPIES " "))
              (T ""))
           " -J"
           (|UnixShellQuote| NAME)
           " -r -s " TMPNAME)))
)
(PUTPROPS UNIXPRINTCOMMAND COPYRIGHT ("Venue" 1992))
(DECLARE\: DONTCOPY
  (FILEMAP (NIL (472 3241 (|UnixPrintCommand| 482 . 1843) (|UnixPrintCommandForHP| 1845 . 3239)))))
STOP
