home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / unix / macps_21.shr < prev    next >
Text File  |  1989-04-04  |  38KB  |  1,341 lines

  1. 29-Mar-89 23:07:47-GMT,37871;000000000001
  2. Return-Path: <edmoy@violet.berkeley.edu>
  3. Received: from violet.berkeley.edu by sumex-aim.stanford.edu (4.0/inc-1.0)
  4.     id AA12117; Wed, 29 Mar 89 15:07:47 PST
  5. Received: by violet.berkeley.edu (5.61/1.30)
  6.     id AA11046; Wed, 29 Mar 89 15:05:45 PST
  7. Date: Wed, 29 Mar 89 15:05:45 PST
  8. From: edmoy@violet.berkeley.edu
  9. Message-Id: <8903292305.AA11046@violet.berkeley.edu>
  10. To: info-mac@sumex-aim.stanford.edu
  11. Subject: New version of macps & prepfix
  12.  
  13. Here is version 2.1 of macps & prepfix, to replace the current version.
  14.  
  15. Macps is a Unix program that takes an uploaded PostScript file created
  16. on a Macintosh (by typing Command-F at the LaserWriter dialog box) and
  17. includes an appropriately modified LaserPrep file so that the result
  18. can be sent to a PostScript printer from Unix.  Since the Apple
  19. LaserPrep files are copyrighted, I've included a program, prepfix, that
  20. reads version 4.0 and up LaserPrep files, and edits them so that they
  21. are compatible with Unix, and are even electronically mailable.
  22.  
  23. CHANGES IN VERSION 2.1
  24.  
  25. Version 2.1 of prepfix uses a safer method for turning on bit-smoothing
  26. for non-Apple printers.  This should get around some of the problems
  27. people have been having with specialized macros in the LaserPreps that
  28. are Apple printer specific.  The -l and -p options in version 1.1 have
  29. been replaced with the single -l option, and the limit on the number
  30. of printers you can specify has been removed.
  31.  
  32. Also, prepfix removes some other various macros that cause
  33. unpredictable problems, and a problem with Apple LaserWriter II/NTs
  34. (but not other Apple printers).
  35.  
  36. Version 2.1 macps has several new options.  The -c option allow you to
  37. specify the number of copies to generate (overriding any multiple copy
  38. option that was specified on the Macintosh).  The -d option allows an
  39. alternate directory to look for the macps.config file.  Finally, the -r
  40. (raw) option suppresses the conversion of 8-bit binary into ASCII, and
  41. is useful for some graphics programs that manipulate gray-scale images,
  42. and produce 8-bit binary PostScript output.
  43.  
  44. Macps will even work with a NeXT laser printer, but (at least the 0.8
  45. version of the operating system) will not do bit smoothing.  Beware,
  46. though, that if you print Macintosh patterns at 400 dpi, they will
  47. look funny.
  48.  
  49. Edward Moy                Principal Programmer - Macintosh & Unix
  50. Workstation Support Services        Workstation Software Support Group
  51. University of California
  52. Berkeley, CA  94720
  53.  
  54. edmoy@violet.Berkeley.EDU
  55. ucbvax!violet!edmoy
  56. -------- cut ---------------------- cut -------------------- cut ------------
  57. #! /bin/sh
  58. # This is a shell archive, meaning:
  59. # 1. Remove everything above the #! /bin/sh line.
  60. # 2. Save the resulting text in a file.
  61. # 3. Execute the file with /bin/sh (not csh) to create the files:
  62. #    ReadMe
  63. #    Installation
  64. #    Makefile
  65. #    macaux.c
  66. #    macps.c
  67. #    prepfix.c
  68. #    str.h
  69. #    ucbwhich.c
  70. #    ucbwhich.h
  71. #    macps.config
  72. #    macps.1
  73. #    prepfix.1
  74. # macps.shar - archive created: Wed Mar 29 13:54:22 PST 1989
  75. if test -f ReadMe
  76. then
  77.     echo shar: will not overwrite existing file "'ReadMe'"
  78. else
  79. echo 'x - ReadMe'
  80. cat << \RAZZLE!DAZZLE > ReadMe
  81. COPYRIGHT NOTICE (SCCSid = "@(#)ReadMe    2.1 3/29/89")
  82.  
  83. Copyright (c) 1988, The Regents of the University of California.
  84. Edward Moy, Workstation Software Support Group, Workstation Support
  85. Serices, Information Systems and Technology.
  86.  
  87. Permission is granted to any individual or institution to use, copy, or
  88. redistribute this software so long as it is not sold for profit,
  89. provided that this notice and the original copyright notices are
  90. retained.  The University of California makes no representations about
  91. the suitability of this software for any purpose.  It is provided "as
  92. is" without express or implied warranty.
  93.  
  94. WHAT IS MACPS?
  95.  
  96. Macps is a Unix program that takes an uploaded PostScript file created
  97. on a Macintosh (by typing Command-F at the LaserWriter dialog box; see
  98. macps.1 for more details) and includes an appropriately modified
  99. LaserPrep file so that the result can be sent to a PostScript printer
  100. >From Unix.  The LaserPrep file contains macros used by the PostScript
  101. generator on the Macintosh.
  102.  
  103. WHY IS MACPS NEEDED?
  104.  
  105. This is how Mac printing works.  When a Mac talks to a LaserWriter, it
  106. asks if the LaserWriter has had a LaserPrep file downloaded to it.  A
  107. LaserWriter that is first powered up, has no such LaserPrep file, and
  108. so the Mac downloads it and makes the LaserPrep file resident in
  109. memory.  Then the actual print file is sent to the LaserWriter.
  110. Subsequent print requests need not download the LaserPrep file, unless
  111. it is a different version.
  112.  
  113. Since a LaserWriter connected to a Unix system usually does things
  114. other than Mac printing, it is unwise to make LaserPrep files resident
  115. in memory so that other PostScript jobs have less memory to work with.
  116. What prepfix does is to modify a LaserPrep file so that, among other
  117. things, it does not make itself resident in memory.  Thus, the
  118. LaserPrep file must be downloaded for each Mac print job.  This is the
  119. function of macps, to automatically append the appropriate LaserPrep
  120. file.
  121.  
  122. WHICH VERSION OF THE LASERPREP WILL BE USED?
  123.  
  124. Macps interprets the %%IncludeProcSet directive found in the PostScript
  125. generated by LaserWriter driver 4.0 and greater.  It takes the ProcSet
  126. id and looks it up in a file "macps.config", to get the pathname of the
  127. prep file, and thus macps can convert PostScript generated by different
  128. versions of the LaserWriter driver.
  129.  
  130. HOW ARE THE LASERPREP FILES GENERATED?
  131.  
  132. Since the Apple LaserPrep files are copyrighted, I've included a
  133. program, prepfix, that reads version 4.0 and up LaserPrep files, and
  134. edits them so that they are compatible with Unix, and are even
  135. electronically mailable (See prepfix.1 for more details).
  136.  
  137. WHERE IS THE MACPS.CONFIG FILE LOCATED?
  138.  
  139. Macps has some special code that is able to figure out from which
  140. directory it was called from.  It will then look in a "lib" subdiretory
  141. for the macps.config file.
  142.  
  143. WHAT ABOUT BIT-SMOOTHING ON NON-LASERWRITER PRINTERS?
  144.  
  145. For PostScript printers using Motorola 680x0 processors and Adobe
  146. PostScript firmware other than LaserWriters, there is an option that
  147. will allow these printers to do bit-smoothing, just like LaserWriters.
  148.  
  149. CHANGES IN VERSION 2.1
  150.  
  151. Version 2.1 of prepfix uses a safer method for turning on bit-smoothing
  152. for non-Apple printers.  This should get around some of the problems
  153. people have been having with specialized macros in the LaserPreps that
  154. are Apple printer specific.  The -l and -p options in version 1.1 have
  155. been replaced with the single -l option, and the limit on the number
  156. of printers you can specify has been removed.
  157.  
  158. Also, prepfix removes some other various macros that cause
  159. unpredictable problems, and a problem with Apple LaserWriter II/NTs
  160. (but not other Apple printers).
  161.  
  162. Version 2.1 macps has several new options.  The -c option allow you to
  163. specify the number of copies to generate (overriding any multiple copy
  164. option that was specified on the Macintosh).  The -d option allows an
  165. alternate directory to look for the macps.config file.  Finally, the -r
  166. (raw) option suppresses the conversion of 8-bit binary into ASCII, and
  167. is useful for some graphics programs that manipulate gray-scale images,
  168. and produce 8-bit binary PostScript output.
  169.  
  170. Macps will even work with a NeXT laser printer, but (at least the 0.8
  171. version of the operating system) will not do bit smoothing.  Beware,
  172. though, that if you print Macintosh patterns at 400 dpi, they will
  173. look funny.
  174. RAZZLE!DAZZLE
  175. fi    # End ReadMe
  176. if test -f Installation
  177. then
  178.     echo shar: will not overwrite existing file "'Installation'"
  179. else
  180. echo 'x - Installation'
  181. cat << \RAZZLE!DAZZLE > Installation
  182. Installation Instructions (SCCSid = "@(#)Installation    2.1 3/29/89")
  183.  
  184. 1) Look at the Makefile.  There are two CFLAGS options that you can
  185. use.  Setting SYSV should allow macps and prepfix to compile on System
  186. V machines (I've only tried it under A/UX).  Setting CONFIGDIR will
  187. cause macps to look for macps.config in that directory.  The options
  188. will look something like:
  189.  
  190. CFLAGS = -O -DSYSV -DCONFIGDIR=\"/usr/new/lib\"
  191.  
  192. 2) Type "make".  If all goes well, macps and prepfix will be created.
  193.  
  194. 3) To create the unprocessed LaserPrep file on the Mac, as well as
  195. creating the raw PostScript files that you want to print, make sure
  196. that either you're not running MultiFinder, or if you are, go to the
  197. Chooser under the Apple menu, click on the LaserWriter icon and then
  198. turn off Background Printing.
  199.  
  200. 4) For each version of LaserPrep on the Mac that you want to include,
  201. install that version in the System Folder.  Then, open an empty
  202. document in some simple application (one that doesn't have its
  203. own ProcSet to download).  Choose Print from the File menu and the
  204. LaserWriter print dialog will appear.  Click on the OK button and
  205. IMMEDIATELY press and hold Command-K.  When a dialog box appears
  206. telling you that it is creating a PostScript file, you can release
  207. Command-K.  The unprocessed LaserPrep file will usually be found in one
  208. of three places, in the System Folder, in the same folder as the
  209. application or at the top level of the disk.
  210.  
  211. 5) Upload the PostScript file(s) to Unix, using some file transfer
  212. program like MacTerminal, Versaterm, Red Ryder, MacKermit or NCSA
  213. Telnet (if your file transfer program feels left out, feel free to add
  214. it to your list).
  215.  
  216. 6) Run prepfix on each unprocessed file, diverting the standard output
  217. to an appropriataly named file (like LaserPrep5.2).  If you want to
  218. allow bit smoothing on a non-Apple PostScript printer, specify the -l
  219. option to prepfix (you can specify as many printer names as you want,
  220. each with a separate -l flag).  If you aren't sure the your printer can
  221. do smoothing, you can try it and see if it works (if it doesn't, you
  222. can always re-run prepfix on the unprocessed file(s), leaving off the
  223. printer that doesn't work).  If you don't know the product name for you
  224. printer, you can use the following PostScript code to print it:
  225.  
  226. %!
  227. /in {72 mul} def
  228. /Courier findfont 18 scalefont setfont
  229. 1 in 8 in moveto
  230. statusdict /product get show
  231. showpage
  232.  
  233. 7) Put the modified LaserPrep file(s) in some directory and modify the
  234. macps.config file to point to these LaserPrep files.  Then put the
  235. macps.config file in a "lib" subdirectory to where you install macps
  236. (or in the directory CONFIGDIR if you used that option).
  237.  
  238. 8) Now when you want to print something, do the same thing as in step 4
  239. above with the LaserWriter print dialog, except press and hold
  240. Command-F (this cause LaserPrep not to be included in the PostScript
  241. file).
  242.  
  243. 9) Upload the PostScript file and run macps on it, sending the output
  244. to your printer, as in:
  245.  
  246.     % macps psfile | lpr
  247. RAZZLE!DAZZLE
  248. fi    # End Installation
  249. if test -f Makefile
  250. then
  251.     echo shar: will not overwrite existing file "'Makefile'"
  252. else
  253. echo 'x - Makefile'
  254. cat << \RAZZLE!DAZZLE > Makefile
  255. # Copyright (c) 1988, The Regents of the University of California.
  256. # Edward Moy, Workstation Software Support Group, Workstation Support Serices,
  257. # Information Systems and Technology.
  258. #
  259. # Permission is granted to any individual or institution to use, copy,
  260. # or redistribute this software so long as it is not sold for profit,
  261. # provided that this notice and the original copyright notices are
  262. # retained.  The University of California makes no representations about the
  263. # suitability of this software for any purpose.  It is provided "as is"
  264. # without express or implied warranty.
  265. #
  266. # SCCSid = "@(#)Makefile    2.1 3/29/89"
  267. #
  268. # For System V, include -DSYSV in CFLAGS below.
  269. # To specify a fixed path for macps.config, include -DCONFIGDIR=\"path\"
  270. # in CFLAGS below (path is the full pathname of the directory).
  271. #
  272. CFLAGS = -O
  273. MACPS = macps.o macaux.o ucbwhich.o
  274. PREPFIX = prepfix.o macaux.o
  275.  
  276. all : macps prepfix
  277.  
  278. macps : $(MACPS)
  279.     cc -o macps $(CFLAGS) $(MACPS)
  280.  
  281. prepfix : $(PREPFIX)
  282.     cc -o prepfix $(CFLAGS) $(PREPFIX)
  283.  
  284. clean :
  285.     /bin/rm -f *.o macps prepfix
  286. RAZZLE!DAZZLE
  287. fi    # End Makefile
  288. if test -f macaux.c
  289. then
  290.     echo shar: will not overwrite existing file "'macaux.c'"
  291. else
  292. echo 'x - macaux.c'
  293. cat << \RAZZLE!DAZZLE > macaux.c
  294. /*
  295.  * Copyright (c) 1988, The Regents of the University of California.
  296.  * Edward Moy, Workstation Software Support Group, Workstation Support Serices,
  297.  * Information Systems and Technology.
  298.  *
  299.  * Permission is granted to any individual or institution to use, copy,
  300.  * or redistribute this software so long as it is not sold for profit,
  301.  * provided that this notice and the original copyright notices are
  302.  * retained.  The University of California makes no representations about the
  303.  * suitability of this software for any purpose.  It is provided "as is"
  304.  * without express or implied warranty.
  305.  */
  306.  
  307. #ifndef lint
  308. static char *SCCSid = "@(#)macaux.c    2.1 3/29/89";
  309. #endif lint
  310.  
  311. #include <ctype.h>
  312. #include <stdio.h>
  313. #include "str.h"
  314.  
  315. #define    FALSE        0
  316. #define    TRUE        1
  317.  
  318. extern char *myname;
  319. int rawmode = FALSE;
  320.  
  321. STR *
  322. STRalloc()
  323. {
  324.     register STR *str;
  325.     char *malloc();
  326.  
  327.     if((str = (STR *)malloc(sizeof(STR))) == NULL ||
  328.      (str->bufptr = (unsigned char *)malloc(STRSIZE)) == NULL) {
  329.         fprintf(stderr, "%s: STRalloc: Out of memory\n", myname);
  330.         exit(1);
  331.     }
  332.     str->curendptr = str->bufptr;
  333.     str->realendptr = str->bufptr + STRSIZE;
  334.     return(str);
  335. }
  336.  
  337. STRfree(str)
  338. STR *str;
  339. {
  340.     free((char *)str->bufptr);
  341.     free((char *)str);
  342. }
  343.  
  344. STRexpand(str)
  345. register STR *str;
  346. {
  347.     register int curend, realend;
  348.     char *realloc();
  349.  
  350.     curend = str->curendptr - str->bufptr;
  351.     realend = (str->realendptr - str->bufptr) + STRSIZEDELTA;
  352.     if((str->bufptr = (unsigned char *)realloc((char *)str->bufptr,
  353.      realend)) == NULL) {
  354.         fprintf(stderr, "%s: STRexpand: Out of memory\n", myname);
  355.         exit(1);
  356.     }
  357.     str->curendptr = str->bufptr + curend;
  358.     str->realendptr = str->bufptr + realend;
  359. }
  360.  
  361. STRgets(str, fp)
  362. register STR *str;
  363. register FILE *fp;
  364. {
  365.     register int c;
  366.  
  367.     str->curendptr = str->bufptr;
  368.     for( ; ; ) {
  369.         if((c = getc(fp)) == EOF)
  370.             return(str->curendptr > str->bufptr);
  371.         if(str->curendptr >= str->realendptr)
  372.             STRexpand(str);
  373.         *str->curendptr++ = c;
  374.         if(c == '\n' || c == '\r')
  375.             return(TRUE);
  376.     }
  377. }
  378.  
  379. STRputsptr(str, cp, fp)
  380. register STR *str;
  381. register unsigned char *cp;
  382. register FILE *fp;
  383. {
  384.     if(rawmode) {
  385.         for( ; cp < str->curendptr ; cp++)
  386.             putc(*cp, fp);
  387.         return;
  388.     }
  389.     for( ; cp < str->curendptr ; cp++) {
  390.         if(!isascii(*cp))
  391.             fprintf(fp, "\\%03o", *cp);
  392.         else if(isprint(*cp))
  393.             putc(*cp, fp);
  394.         else {
  395.             switch(*cp) {
  396.              case '\n':
  397.              case '\r':
  398.                 putc('\n', fp);
  399.                 continue;
  400.              case '\t':
  401.                 putc('\t', fp);
  402.                 continue;
  403.              default:
  404.                 fprintf(fp, "\\%03o", *str);
  405.                 continue;
  406.             }
  407.         }
  408.     }
  409. }
  410.  
  411. STRcompareptr(str, cp, sp)
  412. register STR *str;
  413. register unsigned char *cp, *sp;
  414. {
  415.     register int comp;
  416.  
  417.     for( ; ; ) {
  418.         if(*sp == 0)
  419.             return(cp >= str->curendptr ? 0 : 1);
  420.         if(cp >= str->curendptr)
  421.             return(-1);
  422.         if(*sp == '\n') {
  423.             if(*cp != '\n' && *cp != '\r')
  424.                 return((int)*cp - (int)*sp);
  425.         } else if((comp = (int)*cp - (int)*sp) != 0)
  426.             return(comp);
  427.         cp++;
  428.         sp++;
  429.     }
  430. }
  431.  
  432. STRheadcmpptr(str, cp, sp)
  433. register STR *str;
  434. register unsigned char *cp, *sp;
  435. {
  436.     register int comp;
  437.  
  438.     for( ; ; ) {
  439.         if(*sp == 0)
  440.             return(0);
  441.         if(cp >= str->curendptr)
  442.             return(-1);
  443.         if(*sp == '\n') {
  444.             if(*cp != '\n' && *cp != '\r')
  445.                 return((int)*cp - (int)*sp);
  446.         } else if((comp = (int)*cp - (int)*sp) != 0)
  447.             return(comp);
  448.         cp++;
  449.         sp++;
  450.     }
  451. }
  452.  
  453. unsigned char *
  454. STRmatch(str, sp)
  455. register STR *str;
  456. register unsigned char *sp;
  457. {
  458.     register unsigned char *mp, *last;
  459.     register int firstchar;
  460.  
  461.     firstchar = *sp;
  462.     last = str->curendptr - strlen(sp);
  463.     mp = str->bufptr;
  464.     while(mp <= last) {
  465.         if(*mp == firstchar && STRheadcmpptr(str, mp, sp) == 0)
  466.             return(mp);
  467.         mp++;
  468.     }
  469.     return(NULL);
  470. }
  471. RAZZLE!DAZZLE
  472. fi    # End macaux.c
  473. if test -f macps.c
  474. then
  475.     echo shar: will not overwrite existing file "'macps.c'"
  476. else
  477. echo 'x - macps.c'
  478. cat << \RAZZLE!DAZZLE > macps.c
  479. /*
  480.  * Copyright (c) 1988, The Regents of the University of California.
  481.  * Edward Moy, Workstation Software Support Group, Workstation Support Serices,
  482.  * Information Systems and Technology.
  483.  *
  484.  * Permission is granted to any individual or institution to use, copy,
  485.  * or redistribute this software so long as it is not sold for profit,
  486.  * provided that this notice and the original copyright notices are
  487.  * retained.  The University of California makes no representations about the
  488.  * suitability of this software for any purpose.  It is provided "as is"
  489.  * without express or implied warranty.
  490.  */
  491.  
  492. #ifndef lint
  493. static char *SCCSid = "@(#)macps.c    2.1 3/29/89";
  494. #endif lint
  495.  
  496. #include <ctype.h>
  497. #include <stdio.h>
  498. #ifdef SYSV
  499. #include <string.h>
  500. #else SYSV
  501. #include <strings.h>
  502. #endif SYSV
  503. #include <sys/types.h>
  504. #include <sys/file.h>
  505. #include "str.h"
  506. #include "ucbwhich.h"
  507.  
  508. #define    CONFIG        "macps.config"
  509. #ifdef SYSV
  510. #define    index        strchr
  511. #define    rindex        strrchr
  512. #endif SYSV
  513.  
  514. char *finale = "macps restore\n";
  515. char intro[] = "\
  516. %%! *** Created by macps: %s\
  517. /macps save def\n\
  518. ";
  519. char *myname;
  520. int ncopies = 0;
  521. #ifdef CONFIGDIR
  522. char ucblib[UCBMAXPATHLEN] = CONFIGDIR;
  523. #else CONFIGDIR
  524. int ucbalternate;
  525. char ucbpath[UCBMAXPATHLEN];
  526. char ucblib[UCBMAXPATHLEN];
  527. #endif CONFIGDIR
  528.  
  529. main(argc, argv)
  530. int argc;
  531. char **argv;
  532. {
  533.     register STR* str;
  534.     register char *cp, *pp;
  535.     register FILE *fp;
  536.     register int i, fd;
  537.     char line[BUFSIZ];
  538.     char path[UCBMAXPATHLEN];
  539.     long ltime;
  540.     char *ctime();
  541.  
  542. #ifndef CONFIGDIR
  543.     ucbwhich(*argv);
  544. #endif CONFIGDIR
  545.     if(myname = rindex(*argv, '/'))
  546.         myname++;
  547.     else
  548.         myname = *argv;
  549.     cp = NULL;
  550.     for(argc--, argv++ ; argc > 0 && **argv == '-' ; argc--, argv++) {
  551.         switch((*argv)[1]) {
  552.          case 'c':    /* multiple copies */
  553.             if((*argv)[2])
  554.                 ncopies = atoi(&(*argv[2]));
  555.             else {
  556.                 if(argc < 2)
  557.                     Usage();    /* never returns */
  558.                 argc--;
  559.                 ncopies = atoi(*++argv);
  560.             }
  561.             if(ncopies <= 0)
  562.                 Usage();    /* never returns */
  563.             break;
  564.          case 'd':    /* alternate directory for config file */
  565.             if((*argv)[2])
  566.                 cp = &(*argv[2]);
  567.             else {
  568.                 if(argc < 2)
  569.                     Usage();    /* never returns */
  570.                 argc--;
  571.                 cp = *++argv;
  572.             }
  573.             strcpy(ucblib, cp);
  574.             break;
  575.          case 'r':    /* raw mode */
  576.             rawmode++;
  577.             break;
  578.          default:
  579.             Usage();    /* never returns */
  580.         }
  581.     }
  582.     if(argc > 1)
  583.         Usage();    /* never returns */
  584.     if(argc == 1 && freopen(*argv, "r", stdin) == NULL) {
  585.         fprintf(stderr, "%s: can't open %s\n", myname, *argv);
  586.         exit(1);
  587.     }
  588.     str = STRalloc();
  589.     if(!STRgets(str, stdin)) {
  590.         fprintf(stderr, "%s: Null input\n", myname);
  591.         exit(1);
  592.     }
  593.     strcat(ucblib, "/");
  594.     strcpy(path, ucblib);
  595.     strcat(path, CONFIG);
  596.     if((fp = fopen(path, "r")) == NULL) {
  597.         fprintf(stderr, "%s: Can't open %s\n", myname, path);
  598.         exit(1);
  599.     }
  600.     time(<ime);
  601.     printf(intro, ctime(<ime));
  602.     do {
  603.         if(ncopies != 0 && STRheadcompare(str, "userdict /#copies ")
  604.          == 0)
  605.             continue;
  606.         if(STRcompare(str, "%%EOF\n") == 0) {
  607.             if(finale) {
  608.                 fputs(finale, stdout);
  609.                 finale = NULL;
  610.             }
  611.             STRputs(str, stdout);
  612.             continue;
  613.         }
  614.         if(STRheadcompare(str, "%%IncludeProcSet:") == 0) {
  615.             for(cp = (char *)&str->bufptr[17] ; ; cp++) {
  616.                 if(!*cp) {
  617.                     fprintf(stderr,
  618.                  "%s: Syntax error on IncludeProcSet line\n",
  619.                      myname);
  620.                     exit(1);
  621.                 }
  622.                 if(!isascii(*cp) || !isspace(*cp))
  623.                     break;
  624.             }
  625.             pp = (char *)str->curendptr;
  626.             while(--pp >= cp) {
  627.                 if(!isascii(*pp) || !isspace(*pp))
  628.                     break;
  629.                 *pp = 0;
  630.             }
  631.             str->curendptr = (unsigned char *)(pp + 1);
  632.             fseek(fp, 0L, 0);
  633.             for( ; ; ) {
  634.                 if(!fgets(line, BUFSIZ, fp)) {
  635.                     fprintf(stderr,
  636.                      "%s: Unknown IncludeProcSet %s\n",
  637.                      myname, cp);
  638.                     exit(1);
  639.                 }
  640.                 if(*line == '#')
  641.                     continue;
  642.                 if(pp = index(line, '\n')) {
  643.                     if(pp == line)
  644.                         continue;
  645.                     *pp = 0;
  646.                 }
  647.                 if(!(pp = index(line, '\t'))) {
  648.                     fprintf(stderr,
  649.                      "%s: Syntax error in macps.config\n",
  650.                      myname);
  651.                     exit(1);
  652.                 }
  653.                 *pp++ = 0;
  654.                 if(STRcompareptr(str, cp, line) == 0)
  655.                     break;
  656.             }
  657.             if(*pp == '/')
  658.                 strcpy(path, pp);
  659.             else {
  660.                 strcpy(path, ucblib);
  661.                 strcat(path, pp);
  662.             }
  663.             fflush(stdout);
  664.             if((fd = open(path, O_RDONLY, 0)) < 0) {
  665.                 fprintf(stderr, "%s: Can't open %s\n", myname,
  666.                  path);
  667.                 exit(1);
  668.             }
  669.             while((i = read(fd, line, BUFSIZ)) > 0)
  670.                 write(1, line, i);
  671.             close(fd);
  672.             continue;
  673.         }
  674.         STRputs(str, stdout);
  675.         if(ncopies > 1 && isascii(*str->bufptr) &&
  676.          isdigit(*str->bufptr)) {
  677.             cp = (char *)str->bufptr;
  678.             while(cp < (char *)str->curendptr && isascii(*cp)
  679.              && isdigit(*cp))
  680.                 cp++;
  681.             if((char *)str->curendptr - cp == 4 &&
  682.              STRcompareptr(str, cp, " mf\n") == 0) {
  683.                 printf("userdict /#copies %d put\n", ncopies);
  684.                 ncopies = -1;
  685.             }
  686.         }
  687.     } while(STRgets(str, stdin));
  688.     if(finale)
  689.         fputs(finale, stdout);
  690.     exit(0);
  691. }
  692.  
  693. Usage()
  694. {
  695.     fputs("Usage: macps [-c #] [-d directory] [-r] [file]\n", stderr);
  696.     exit(1);
  697. }
  698. RAZZLE!DAZZLE
  699. fi    # End macps.c
  700. if test -f prepfix.c
  701. then
  702.     echo shar: will not overwrite existing file "'prepfix.c'"
  703. else
  704. echo 'x - prepfix.c'
  705. cat << \RAZZLE!DAZZLE > prepfix.c
  706. /*
  707.  * Copyright (c) 1988, The Regents of the University of California.
  708.  * Edward Moy, Workstation Software Support Group, Workstation Support Serices,
  709.  * Information Systems and Technology.
  710.  *
  711.  * Permission is granted to any individual or institution to use, copy,
  712.  * or redistribute this software so long as it is not sold for profit,
  713.  * provided that this notice and the original copyright notices are
  714.  * retained.  The University of California makes no representations about the
  715.  * suitability of this software for any purpose.  It is provided "as is"
  716.  * without express or implied warranty.
  717.  */
  718.  
  719. #ifndef lint
  720. static char *SCCSid = "@(#)prepfix.c    2.1 3/29/89";
  721. #endif lint
  722.  
  723. #include <ctype.h>
  724. #include <stdio.h>
  725. #ifdef SYSV
  726. #include <string.h>
  727. #else SYSV
  728. #include <strings.h>
  729. #endif SYSV
  730. #include "str.h"
  731.  
  732. #define    CLEARTOMARK    12
  733. #define EEXECLEN    80
  734. #define EXTRA        (NZEROLINE * ZEROLINE + CLEARTOMARK)
  735. #define LINELEN        256
  736. #define    NPRODUCTS    32
  737. #define NZEROLINE    7
  738. #define ZEROLINE    65
  739. #ifdef SYSV
  740. #define    index        strchr
  741. #define    rindex        strrchr
  742. #endif SYSV
  743.  
  744. char exstr[] = "\
  745. %ck userdict/%s known not and{currentfile eexec}{%d{currentfile read\n\
  746. pop pop}repeat}ifelse\n\
  747. ";
  748. char *match();
  749. char *myname;
  750. int maxproducts = NPRODUCTS;
  751. int nproducts = 0;
  752. char Ok[] = "\
  753. /Ok{ok dup not{save /Pd statusdict /product get def false 0 1 ProdArr length\n\
  754. 1 sub{Pd exch ProdArr exch get anchorsearch exch pop{pop pop true exit}if}for\n\
  755. exch restore}if}bind def\n\
  756. ";
  757. char ProdArr0[] = "/ProdArr [\n";
  758. char ProdArr1[] = "] def\n";
  759. char **products;
  760. char tempname[] = "/tmp/prepfixXXXXXX";
  761.  
  762. main(argc, argv)
  763. int argc;
  764. char **argv;
  765. {
  766.     register STR *str;
  767.     register FILE *tp;
  768.     register int i;
  769.     register unsigned char *lp;
  770.     char buf[BUFSIZ];
  771.     char *malloc(), *realloc();
  772.  
  773.     if(myname = rindex(*argv, '/'))
  774.         myname++;
  775.     else
  776.         myname = *argv;
  777.     for(argc--, argv++ ; argc > 0 && **argv == '-' ; argc--, argv++) {
  778.         switch((*argv)[1]) {
  779.          case 'h':
  780.             usage();
  781.          case 'l':
  782.             if(nproducts <= 0 && (products =
  783.              (char **)malloc(maxproducts*sizeof(char *))) == NULL) {
  784.                 fprintf(stderr,
  785.                  "%s: Out of memory creating products array\n",
  786.                  myname);
  787.                 exit(1);
  788.             } else if(nproducts >= maxproducts - 1 && (products =
  789.              (char **)realloc(products, (maxproducts += NPRODUCTS)
  790.              * sizeof(char *))) == NULL) {
  791.                 fprintf(stderr,
  792.                  "%s: Out of memory expanding products array\n",
  793.                  myname);
  794.                 exit(1);
  795.             }
  796.             if((*argv)[2])
  797.                 products[nproducts++] = &(*argv)[2];
  798.             else {
  799.                 if(argc < 2) {
  800.                     fprintf(stderr,
  801.                      "%s: No argument for -l\n", myname);
  802.                     exit(1);
  803.                 }
  804.                 argc--;
  805.                 argv++;
  806.                 products[nproducts++] = *argv;
  807.             }
  808.             break;
  809.         }
  810.     }
  811.     if(argc > 1)
  812.         usage();
  813.     if(argc > 0 && freopen(*argv, "r", stdin) == NULL) {
  814.         fprintf(stderr, "%s: Can't open %s\n", myname, *argv);
  815.         exit(1);
  816.     }
  817.     mktemp(tempname);
  818.     if((tp = fopen(tempname, "w+")) == NULL) {
  819.         fprintf(stderr, "%s: Can't create temp file %s\n",
  820.          myname, tempname);
  821.         exit(1);
  822.     }
  823.     unlink(tempname);
  824.     str = STRalloc();
  825.     if(!STRgets(str, stdin)) {
  826.         fprintf(stderr, "%s: Null input\n", myname);
  827.         exit(1);
  828.     }
  829.     for( ; ; ) {
  830.         if(STRheadcompare(str, "% \251") == 0) {
  831.             fputs("% ", tp);
  832.             str->bufptr[0] = '(';
  833.             str->bufptr[1] = 'C';
  834.             str->bufptr[2] = ')';
  835.         } else if(STRheadcompare(str, "%%BeginProcSet:") == 0) {
  836.             STRputs(str, stdout);
  837.             fseek(tp, 0L, 0);
  838.             while((i = fread(buf, 1, BUFSIZ, tp)) > 0)
  839.                 fwrite(buf, 1, i, stdout);
  840.             fclose(tp);
  841.             break;
  842.         }
  843.         STRputs(str, tp);
  844.         if(!STRgets(str, stdin)) {
  845.             fprintf(stderr, "%s: No BeginProcSet\n", myname);
  846.             exit(1);
  847.         }
  848.     }
  849.     while(STRgets(str, stdin)) {
  850.         if(nproducts > 0 && STRheadcompare(str, "/ok{") == 0) {
  851.             STRputs(str, stdout);
  852.             fputs(ProdArr0, stdout);
  853.             for(i = 0 ; i < nproducts ; i++)
  854.                 printf("(%s)\n", products[i]);
  855.             fputs(ProdArr1, stdout);
  856.             fputs(Ok, stdout);
  857.             continue;
  858.         } else if(STRmatch(str, "setdefaulttimeouts")
  859.          || STRmatch(str, "setsccinteractive"))
  860.             continue;
  861.         else if(STRmatch(str, "eexec")) {
  862.             if(STRmatch(str, "/stretch")) {
  863.                 eexec("stretch", str);
  864.                 continue;
  865.             } else if(STRmatch(str, "/smooth4")) {
  866.                 eexec("smooth4", str);
  867.                 continue;
  868.             }
  869.         } else if(STRmatch(str, "(LaserWriter II NT)")) {
  870.             STRgets(str, stdin);    /* skip next line */
  871.             while(STRgets(str, stdin) && isxdigit(*str->bufptr))
  872.                 {}
  873.         } else if(lp = STRmatch(str, "scaleby96{ppr")) {
  874.             STRputsptr(str, lp, stdout);
  875.             continue;
  876.         } else if(STRheadcompare(str, "%%EndProcSet") == 0) {
  877.             STRputs(str, stdout);
  878.             break;
  879.         }
  880.         STRputs(str, stdout);
  881.     }
  882.     exit(0);
  883. }
  884.  
  885. eexec(name, str)
  886. char *name;
  887. register STR *str;
  888. {
  889.     register int len;
  890.     register unsigned char *bp;
  891.  
  892.     if(!STRgets(str, stdin)) {
  893.         fprintf(stderr, "%s: EOF during reading eexec\n", myname);
  894.         exit(1);
  895.     }
  896.     bp = str->bufptr;
  897.     len = (str->curendptr - bp) - 1;
  898.     printf(exstr, nproducts > 0 ? 'O' : 'o', name, len + (len / EEXECLEN)
  899.      + (len % EEXECLEN ? 1 : 0) + EXTRA);
  900.     while(len >= 80) {
  901.         fwrite(bp, 80, 1, stdout);
  902.         putchar('\n');
  903.         bp += 80;
  904.         len -= 80;
  905.     }
  906.     if(len > 0) {
  907.         fwrite(bp, len, 1, stdout);
  908.         putchar('\n');
  909.     }
  910.     for( ; ; ) {
  911.         if(!STRgets(str, stdin)) {
  912.             fprintf(stderr, "%s: EOF reached before cleartomark\n",
  913.              myname);
  914.             exit(1);
  915.         }
  916.         if(STRheadcompare(str, "cleartomark") == 0) {
  917.             STRputs(str, stdout);
  918.             return;
  919.         }
  920.         STRputs(str, stdout);
  921.     }
  922. }
  923.  
  924. usage()
  925. {
  926.     fprintf(stderr,
  927.      "Usage: %s [-l product_name1 [-l product_name2]...] [file]\n",
  928.      myname);
  929.     fprintf(stderr, "       %s -help\n", myname);
  930.     exit(1);
  931. }
  932. RAZZLE!DAZZLE
  933. fi    # End prepfix.c
  934. if test -f str.h
  935. then
  936.     echo shar: will not overwrite existing file "'str.h'"
  937. else
  938. echo 'x - str.h'
  939. cat << \RAZZLE!DAZZLE > str.h
  940. /*
  941.  * Copyright (c) 1988, The Regents of the University of California.
  942.  * Edward Moy, Workstation Software Support Group, Workstation Support Serices,
  943.  * Information Systems and Technology.
  944.  *
  945.  * Permission is granted to any individual or institution to use, copy,
  946.  * or redistribute this software so long as it is not sold for profit,
  947.  * provided that this notice and the original copyright notices are
  948.  * retained.  The University of California makes no representations about the
  949.  * suitability of this software for any purpose.  It is provided "as is"
  950.  * without express or implied warranty.
  951.  */
  952.  
  953. /*
  954.  * SCCSid = "@(#)str.h    2.1 3/29/89"
  955.  */
  956.  
  957. #define    STRSIZEDELTA    1024
  958. #define    STRSIZE        1024
  959.  
  960. #define    STRcompare(str,fp)    STRcompareptr((str), (str)->bufptr, (fp))
  961. #define    STRheadcompare(str,fp)    STRheadcmpptr((str), (str)->bufptr, (fp))
  962. #define    STRputs(str,fp)        STRputsptr((str), (str)->bufptr, (fp))
  963.  
  964. typedef struct {
  965.     unsigned char *bufptr;
  966.     unsigned char *curendptr;
  967.     unsigned char *realendptr;
  968. } STR;
  969.  
  970. extern int rawmode;
  971.  
  972. STR *STRalloc();
  973. int STRcompareptr();
  974. int STRfree();
  975. int STRgets();
  976. int STRheadcmpptr();
  977. unsigned char *STRmatch();
  978. int STRputsptr();
  979. RAZZLE!DAZZLE
  980. fi    # End str.h
  981. if test -f ucbwhich.c
  982. then
  983.     echo shar: will not overwrite existing file "'ucbwhich.c'"
  984. else
  985. echo 'x - ucbwhich.c'
  986. cat << \RAZZLE!DAZZLE > ucbwhich.c
  987. /*
  988.  * Copyright (c) 1988, The Regents of the University of California.
  989.  * Edward Moy, Workstation Software Support Group, Workstation Support Serices,
  990.  * Information Systems and Technology.
  991.  *
  992.  * Permission is granted to any individual or institution to use, copy,
  993.  * or redistribute this software so long as it is not sold for profit,
  994.  * provided that this notice and the original copyright notices are
  995.  * retained.  The University of California makes no representations about the
  996.  * suitability of this software for any purpose.  It is provided "as is"
  997.  * without express or implied warranty.
  998.  */
  999.  
  1000. #ifndef CONFIGDIR
  1001. #ifndef lint
  1002. static char *SCCSid = "@(#)ucbwhich.c    2.1 3/29/89";
  1003. #endif lint
  1004.  
  1005. #include <stdio.h>
  1006. #include <sys/types.h>
  1007. #include <sys/stat.h>
  1008. #include "ucbwhich.h"
  1009.  
  1010. #define    F_OK        0    /* does file exist */
  1011. #define    X_OK        1    /* is it executable by caller */
  1012. #define    W_OK        2    /* writable by caller */
  1013. #define    R_OK        4    /* readable by caller */
  1014.  
  1015. #define    LIBLEN        4
  1016. #ifdef SYSV
  1017. #define    index        strchr
  1018. #define    rindex        strrchr
  1019. #endif SYSV
  1020.  
  1021. static char lib[] = "/lib";
  1022.  
  1023. char ucblib[UCBMAXPATHLEN];
  1024. int ucbalternate = 0;
  1025. char ucbpath[UCBMAXPATHLEN];
  1026.  
  1027. ucbwhich(str)
  1028. char *str;
  1029. {
  1030.     register char *dir, *name, *cp, *tp;
  1031.     register int len;
  1032.     char dirbuf[UCBMAXPATHLEN], namebuf[UCBMAXPATHLEN];
  1033.     struct stat sbuf;
  1034.     char *index(), *rindex(), *getwd(), *getenv();
  1035.  
  1036.     strcpy(name = namebuf, str);
  1037.     if(*name == '/')    /* absolute pathname */
  1038.         *(rindex(dir = name, '/')) = 0 ; /* remove tail */
  1039.     else {
  1040.         if(cp = index(name, '/')) { /* relative pathname */
  1041.             if((dir = getwd(dirbuf)) == NULL)
  1042.                 return(0);
  1043.              /* if any errors occurs assume standard version */
  1044.             *cp++ = 0;
  1045.             for( ; ; ) {
  1046.                 if(*name != 0) { /* multiple slashes */
  1047.                     if(strcmp(name, "..") == 0) {
  1048.                         /* parent directory */
  1049.                         if((tp = rindex(dir, '/')) ==
  1050.                          NULL)
  1051.                              return(0);
  1052.                         if(tp == dir)
  1053.                             tp++;
  1054.                          /* root directory */
  1055.                         *tp = 0;
  1056.                          /* remove last component */
  1057.                     } else if(strcmp(name, ".") != 0) {
  1058.                         /* subdirectory */
  1059.                         strcat(dir, "/");
  1060.                         strcat(dir, name);
  1061.                     }
  1062.                 }
  1063.                 name = cp;
  1064.                 if((cp = index(name, '/')) == NULL) break;
  1065.                 /* ignore last component */
  1066.                 *cp++ = 0;
  1067.             }
  1068.         } else { /* look through $PATH variable */
  1069.             if((tp = getenv("PATH")) == NULL)
  1070.                 return(0);
  1071.             for(name = namebuf ; ; ) {
  1072.                 if(*tp == 0)
  1073.                     return(0);
  1074.                 else if(*tp == ':')
  1075.                     tp++;
  1076.                 if((cp = index(tp, ':')) == NULL)
  1077.                     cp = tp + strlen(tp);
  1078.                  /* positioned on null */
  1079.                 for(dir = dirbuf ; tp < cp ; )
  1080.                     *dir++ = *tp++;
  1081.                 *dir = 0;
  1082.                 strcpy(name, dir = dirbuf);
  1083.                 strcat(name, "/");
  1084.                 strcat(name, str);
  1085.                 if(stat(name, &sbuf) < 0 || (sbuf.st_mode &
  1086.                  S_IFMT) != S_IFREG)
  1087.                     continue;
  1088.                 if(access(name, X_OK) == 0) {
  1089.                     if(strcmp(dir, ".") == 0 &&
  1090.                      (dir = getwd(dirbuf)) == NULL)
  1091.                         return(0);
  1092.                     break;
  1093.                 }
  1094.             }
  1095.         }
  1096.     }
  1097.     strcpy(ucbpath, dir);
  1098.     strcpy(ucblib, dir);
  1099.     if((len = strlen(dir)) < LIBLEN || strcmp(&dir[len - LIBLEN], lib)
  1100.      != 0)
  1101.         strcat(ucblib, lib);
  1102.     else
  1103.         ucbpath[len - LIBLEN] = 0;
  1104.     ucbalternate = (strcmp(ucbpath, UCBSTANDARD) != 0);
  1105. #ifdef EBUG
  1106.     fprintf(stderr, "ucbwhich: alt=%d path=%s lib=%s\n", ucbalternate,
  1107.      ucbpath, ucblib);
  1108. #endif EBUG
  1109.     return(ucbalternate);
  1110. }
  1111. #endif CONFIGDIR
  1112. RAZZLE!DAZZLE
  1113. fi    # End ucbwhich.c
  1114. if test -f ucbwhich.h
  1115. then
  1116.     echo shar: will not overwrite existing file "'ucbwhich.h'"
  1117. else
  1118. echo 'x - ucbwhich.h'
  1119. cat << \RAZZLE!DAZZLE > ucbwhich.h
  1120. /*
  1121.  * Copyright (c) 1988, The Regents of the University of California.
  1122.  * Edward Moy, Workstation Software Support Group, Workstation Support Serices,
  1123.  * Information Systems and Technology.
  1124.  *
  1125.  * Permission is granted to any individual or institution to use, copy,
  1126.  * or redistribute this software so long as it is not sold for profit,
  1127.  * provided that this notice and the original copyright notices are
  1128.  * retained.  The University of California makes no representations about the
  1129.  * suitability of this software for any purpose.  It is provided "as is"
  1130.  * without express or implied warranty.
  1131.  */
  1132.  
  1133. /*
  1134.  * SCCSid = "@(#)ucbwhich.h    2.1 3/29/89"
  1135.  */
  1136.  
  1137. #define    UCBMAXPATHLEN    128
  1138. #define    UCBSTANDARD    "/usr/ucb"
  1139.  
  1140. extern char ucblib[];
  1141. extern int ucbalternate;
  1142. extern char ucbpath[];
  1143. RAZZLE!DAZZLE
  1144. fi    # End ucbwhich.h
  1145. if test -f macps.config
  1146. then
  1147.     echo shar: will not overwrite existing file "'macps.config'"
  1148. else
  1149. echo 'x - macps.config'
  1150. cat << \RAZZLE!DAZZLE > macps.config
  1151. # This is the config file read by macps.
  1152. # SCCSid = "@(#)macps.config    2.1 3/29/89"
  1153. #
  1154. # Each line is composed of the %%IncludeProcSet id, a tab and the file
  1155. # containing the ProcSet.  If the file doesn't begin with a slash, the
  1156. # the name is taken to be relative to the directory in which this config file
  1157. # resides.
  1158.  
  1159. "(AppleDict md)" 65 0    ProcSets/LaserPrep4.0
  1160. "(AppleDict md)" 66    ProcSets/LaserPrep5.0
  1161. "(AppleDict md)" 67 0    ProcSets/LaserPrep5.1
  1162. "(AppleDict md)" 68 0    ProcSets/LaserPrep5.2
  1163. RAZZLE!DAZZLE
  1164. fi    # End macps.config
  1165. if test -f macps.1
  1166. then
  1167.     echo shar: will not overwrite existing file "'macps.1'"
  1168. else
  1169. echo 'x - macps.1'
  1170. cat << \RAZZLE!DAZZLE > macps.1
  1171. .\" SCCSid = "@(#)macps.1    2.1 3/29/89"
  1172. .TH MACPS 1 "29 March 1989"
  1173. .UC 4
  1174. .SH NAME
  1175. macps \- print Macintosh-created PostScript file on Unix
  1176. .SH SYNOPSIS
  1177. .B macps
  1178. [
  1179. \-c copies
  1180. ]
  1181. [
  1182. \-d directory
  1183. ]
  1184. [
  1185. \-r
  1186. ]
  1187. [
  1188. file
  1189. ]
  1190. .SH DESCRIPTION
  1191. .I Macps
  1192. takes the command-line file (or the standard input if no filename is given),
  1193. and prepends the appropriate Macintosh LaserPrep file (e.g., those generated
  1194. by
  1195. .IR prepfix (1)).
  1196. The standard output can then be directed to a PostScript printer, via
  1197. .IR lpr (1),
  1198. for example.
  1199. .PP
  1200. The input PostScript file is generated on a Macintosh by typing (and holding)
  1201. Command-F immediately after clicking the OK button of the LaserWriter printer
  1202. dialog box.
  1203. Another dialog will appear, confirming that a file named ``PostScript'' is
  1204. being created (the Command-F keys can be released now).
  1205. .PP
  1206. Depending on the application, the created PostScript file can be found in the
  1207. System Folder, the application folder or the top level of the disk.
  1208. This file can then be uploaded via some file transfer program, such as
  1209. MacTerminal/VersaTerm and
  1210. .IR macget (1)
  1211. or MacKermit/Red Ryder and
  1212. .IR kermit (1).
  1213. .PP
  1214. Normally, you would specify the number of copies in the LaserWriter
  1215. print dialog box on the Macintosh.
  1216. However, you can override that after uploading the PostScript file by
  1217. specifying the
  1218. .B \-c
  1219. option, followed by the number of copies.
  1220. .PP
  1221. The file
  1222. .B macps.config
  1223. specifies the mapping between the internal LaserPrep name and the actual
  1224. file it resides in.
  1225. This file is normally located in the lib subdirectory from which
  1226. .I macps
  1227. was called from.
  1228. The
  1229. .B \-d
  1230. option allow you to specify an alternate directory in which the
  1231. .B macps.config
  1232. file can be found.
  1233. .PP
  1234. Most Macintosh applications produce normal ASCII PostScript files.
  1235. However, some graphics programs that manipulate gray-scale images will
  1236. produce PostScript files that contain 8-bit binary data.
  1237. Since
  1238. .I macps
  1239. normally converts this binary data, these PostScript file will not work
  1240. properly.
  1241. The
  1242. .B \-r
  1243. (raw) option suppresses this binary conversion.
  1244. (Note: Depending on how the printer is physically connected, it may not be
  1245. able to handle 8-bit binary data properly, and results may be disappointing.)
  1246. .SH FILES
  1247. .TP "\w'lib/macps.config   'u"
  1248. lib/macps.config
  1249. maps ProcSet ids to LaserPrep filenames
  1250. .SH "SEE ALSO"
  1251. lpr(1), macget(1), kermit(1), prepfix(1)
  1252. .SH BUGS
  1253. .I Macps
  1254. only works with version 4.0 and up of the Macintosh LaserPrep files.
  1255. Because of the way bit smoothing is implimented by the LaserWriter driver,
  1256. some PostScript printers other than the Apple LaserWriters may not be able to
  1257. bit smooth.
  1258. RAZZLE!DAZZLE
  1259. fi    # End macps.1
  1260. if test -f prepfix.1
  1261. then
  1262.     echo shar: will not overwrite existing file "'prepfix.1'"
  1263. else
  1264. echo 'x - prepfix.1'
  1265. cat << \RAZZLE!DAZZLE > prepfix.1
  1266. .\" SCCSid = "@(#)prepfix.1    2.1 3/29/89"
  1267. .TH PREPFIX 1 "29 March 1989"
  1268. .UC 4
  1269. .SH NAME
  1270. prepfix \- converts Apple LaserPrep files to form useable on Unix
  1271. .SH SYNOPSIS
  1272. .B prepfix
  1273. [
  1274. \-l
  1275. printer_name1
  1276. [
  1277. \-l
  1278. printer_name2
  1279. ]...
  1280. ]
  1281. [
  1282. file
  1283. ]
  1284. .SH DESCRIPTION
  1285. .I Prepfix
  1286. takes the command-line LaserPrep file (or the standard input if no filename is
  1287. given), and converts it into a form that is useable on Unix with the
  1288. .IR macps (1),
  1289. and is even electronically mailable.
  1290. .PP
  1291. To use
  1292. .IR prepfix ,
  1293. create the input LaserPrep file on a Macintosh by opening an empty
  1294. document in some application, selecting
  1295. .B Print
  1296. >From the
  1297. .B File
  1298. menu and then typing (and holding) Command-K immediately after clicking the
  1299. .B OK
  1300. button in the LaserWriter print dialog box.
  1301. Another dialog will appear, confirming that a file named ``PostScript'' is
  1302. being created (the Command-K keys can be released now).
  1303. .PP
  1304. Depending on the application, the created PostScript file can be found in the
  1305. System Folder, the application folder or the top level of the disk.
  1306. This file can then be uploaded via some file transfer program, such as
  1307. MacTerminal/VersaTerm and
  1308. .IR macget (1)
  1309. or MacKermit/Red Ryder and
  1310. .IR kermit (1).
  1311. .PP
  1312. Normally, only Apple LaserWriters can take advantage of the bit smoothing
  1313. feature of the LaserPrep file.
  1314. However, other PostScript laser printer using the Motorola 680x0 processor
  1315. and the Adobe PostScript firmware can be made to do bit smoothing by
  1316. specifying for each printer the
  1317. .B \-l
  1318. option and the printer's name, as returned by the PostScript
  1319. .B product
  1320. command in
  1321. .B statusdict
  1322. (remember to quote the printer name if it contains blanks).
  1323. The resulting LaserPrep file will be modified so that for LaserWriters and for
  1324. printers specified in the
  1325. .B \-l
  1326. option, bit smoothing will be allowed (smoothing must still be selected in the
  1327. Print Dialog box when saving the PostScript to disk).
  1328. More than one printer name can be specified using additional
  1329. .B \-l
  1330. and printer name pairs.
  1331. .SH "SEE ALSO"
  1332. macps(1), macget(1), kermit(1)
  1333. .SH BUGS
  1334. .I Prepfix
  1335. only works with version 4.0 and up of the Macintosh LaserPrep files.
  1336. RAZZLE!DAZZLE
  1337. fi    # End prepfix.1
  1338. echo '***** End of' macps.shar '*****'
  1339. exit
  1340.  
  1341.