home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume28 / psf3 / patch01a next >
Encoding:
Text File  |  1992-02-09  |  51.8 KB  |  1,862 lines

  1. Newsgroups: comp.sources.misc
  2. From: tony@ajfcal.cuc.ab.ca (Tony Field)
  3. Subject:  v28i014:  psf3 - Postscript print filter system, Patch01a/2
  4. Message-ID: <csm-v28i014=psf3.162118@sparky.IMD.Sterling.COM>
  5. X-Md4-Signature: d1e88dd47bc7ff17e9db90a6cb70776c
  6. Date: Thu, 6 Feb 1992 22:23:01 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: tony@ajfcal.cuc.ab.ca (Tony Field)
  10. Posting-number: Volume 28, Issue 14
  11. Archive-name: psf3/patch01a
  12. Environment: ISC, SUNOS, SYSVR3, DOS
  13. Patch-To: psf3: Volume 27, Issue 91-100
  14.  
  15.         The following is part 1 of a two part patch to psf3 corrects a 
  16.         few problems and adds new options.  The Makefile is modified
  17.         by this patch:  Please save your "working" Makefile.
  18.         
  19.         After the patches have been applied, re-edit the Makefile
  20.         to ensure your configuration parameters are valid.  Recompile
  21.         the system and install the update (using the NEW Makefile):
  22.         
  23.         Rebuild system and reinstall binaries:
  24.  
  25.                 make all                (compile sources)
  26.                 make update             (install spooler+user binaries)
  27.         or:
  28.                 make updateuser         (install only user binaries)
  29.                 
  30.         If desired, a complete reinstallation could be performed instead.
  31.         
  32.         Various shell scripts do not need to be updated, although minor
  33.         cosmetic changes have been made in the various .SH files.
  34.  
  35.         The man pages have been modified to reflect new features:
  36.         
  37.                 make installman         (or installcat, installdoc)
  38.         
  39.         If psf is part of your lpr/lpd spooler system, you may be inclined
  40.         to add the -E or -e (enable line wrap) options to some
  41.         of your print options in psfprint.def.
  42.  
  43. CORRECTIONS
  44.     1. column count (-c) now works for 2-up, portraint layout.
  45.     2. scaling when point size (-p) specified corrected
  46.        for 2/4up and other transformations.
  47.     3. a couple of "why didn't my compiler detect" errors are fixed.
  48.        (i.e. sloppy programming was fixed up...)
  49.     4. the -i and -m options correctly offsets the physical page
  50.        The units of indentation may be points/inches/centimeters
  51.     5. use of the "language" feature resulted in the loss of the
  52.        first print line.  (fixed by fer@gorbie.n.tv.se)
  53.     6. The "-u file.def" option now can search the directory
  54.        contain the defaut "psfprint.def" file.  This allows
  55.        multiple printers (or language translations) to easily
  56.        selected with "-u apple", "-u iso8", etc...
  57.       
  58. ADDITIONS
  59.     1. psf did not allow line wrap.  The following options now do:
  60.         -e = enable line wrap.  The last wrapped portion of
  61.              a line is LEFT justified on the page.
  62.         -E = enable line wrap.  The last wrapped portion of
  63.              a line is RIGHT justified on the page.
  64.  
  65.     2. margins man now be set around each logical plage.
  66.         -M lm,rm,tm,bm[,pic]  sets margins around for the
  67.            top (tm), bottom (bm), left (lm) and right (rm)
  68.            side of the page.  The amount of indentation
  69.            is in points (p), inches (i) or centimenters (c).
  70.     
  71.     3. Harv Dayhoff (dayhoff@amac.plk.af.mil) contributed a
  72.        printer definition file for a DEC LN03 printer.
  73.     
  74.     4. Jan Fernquist (fer@gorbie.n.tv.se) added some helpful
  75.        instructions for the "language.PSF" feature.
  76.  
  77. APPLY THIS PATCH WITH:
  78.  
  79.     patch -p -n <this.note.
  80.  
  81. tony     (tony@ajfcal.cuc.ab.ca)
  82.          (*********************)    
  83. -------------------        
  84. *** /dev/null    Fri Jan 31 15:12:24 1992
  85. --- defs/decln03.def    Thu Jan 30 11:16:43 1992
  86. ***************
  87. *** 0 ****
  88. --- 1,25 ----
  89. + *printer
  90. + DEC ScriptPrinter LN03R v47.2 (manually constructed)
  91. + *paper 2
  92. + Letter
  93. +   612   792    18     8   593   775
  94. + A4
  95. +   595   842    18    10   577   825
  96. + *order 1
  97. + Normal
  98. + *fonts 11
  99. + AvantGarde-Book
  100. + AvantGarde-Demi
  101. + LubalinGraph-Book
  102. + LubalinGraph-Demi
  103. + Courier
  104. + Helvetica
  105. + NewCenturySchlbk-Roman
  106. + Souvenir-Light
  107. + Souvenir-Demi
  108. + Symbol
  109. + Times-Roman
  110. + *slots 0
  111. + *eof
  112. *** ../psf3.net/psf.c    Fri Jan 31 19:19:45 1992
  113. --- psf.c    Thu Jan 30 11:22:50 1992
  114. ***************
  115. *** 19,29 ****
  116.           psflpd:        used with lpr/lpd.  does not accept command line
  117.                       arguments.  compile with -DPSFFILTER -DFORLPD
  118.    */
  119.   
  120.   #include <stdio.h>
  121. - #include <malloc.h>
  122.   #include <string.h>
  123.   #include <setjmp.h>
  124.   #include <math.h>
  125.   #include <time.h>
  126.   #include <signal.h>
  127. --- 19,28 ----
  128. ***************
  129. *** 50,60 ****
  130.   
  131.   /*    set up the mechanism for underline display */
  132.   
  133.   #define SHOWU(fp,ps)    fprintf (fp, ") %d showuline\n", ps)
  134.   
  135. ! #define NOMINAL_CWIDE    7.2001    /* point width for Courier 12-point            */
  136.   #define NOMINAL_POINTS    12        /* standard 12-point for printing            */
  137.   
  138.   #define NORMAL        0x00        /* bitset for  print_attributes                */
  139.   #define ITALICS        0x01
  140.   #define BOLD        0x02
  141. --- 49,59 ----
  142.   
  143.   /*    set up the mechanism for underline display */
  144.   
  145.   #define SHOWU(fp,ps)    fprintf (fp, ") %d showuline\n", ps)
  146.   
  147. ! #define NOMINAL_CWIDE    7.2        /* point width for Courier 12-point            */
  148.   #define NOMINAL_POINTS    12        /* standard 12-point for printing            */
  149.   
  150.   #define NORMAL        0x00        /* bitset for  print_attributes                */
  151.   #define ITALICS        0x01
  152.   #define BOLD        0x02
  153. ***************
  154. *** 115,124 ****
  155. --- 114,126 ----
  156.               "statusdict begin 2 setpapertray end",
  157.               "", "", "", ""
  158.   } ;
  159.   int        nslots = 2;
  160.   
  161. + int        nominal_high;            /*    save original width and height for        */
  162. + int        nominal_wide;            /*        defaults when -M is used.            */
  163.   int        y_top_offset;            /*    offsets for each frame                    */
  164.   int        x_left_offset;
  165.   int        dx_home[4];                /*    page frame home (0,0) translations        */
  166.   int        dy_home[4];
  167.   
  168. ***************
  169. *** 136,154 ****
  170. --- 138,164 ----
  171.   int        chars_on_line     = 80;    /* default number of chars on line            */
  172.   int        landscape         = 0;    /* 1 = landscape, 0 = portrait layout        */
  173.   int        header            = 0;    /* 1 = print header at top of each page        */
  174.   int        cross              = 0;    /* 1 = print cross on 4-up pages            */
  175.   int        line_number        = 0;    /* current logical line number on page        */
  176. + int        enable_wrap        = 0;    /* enable line wrap if 1.                    */
  177. + int        rational_wrap    = 0;    /* wrap lines to right if 1                    */
  178.   int        tab_size           = 8;    /* space translation for tabs.                */
  179.   int        font_number     = 0;    /* one of the valid fonts in the printer    */
  180.   int        point_size        = 12;    /* can be changed with the -p option        */
  181. + int        extra_space        = 0;    /* if point size and line count specified    */
  182.   int        x_user_offset     = 0;    /* offsets specified buy user                */
  183.   int        y_user_offset     = 0;    /* points from physical page edge.            */
  184. + #ifdef FORCETYPE
  185. + int        set_paper_tray     = 1;    /* user has set paper tray selection        */
  186. + #else
  187.   int        set_paper_tray     = 0;    /* user has set paper tray selection        */
  188. + #endif
  189.   int        set_line_count     = 0;    /*                print line count on page    */
  190.   int        set_total_count    = 0;    /*                total line count on page    */
  191.   int        set_point_size     = 0;    /*                point size                    */
  192. + int        preserve_point    = 0;    /*                preserve point size with -M    */
  193.   int        set_char_count     = 0;    /*                characters on a line        */
  194.   int        set_paper_bin    = 0;    /*                paper bin (not page size)    */
  195.   char    header_text[100];        /*                header line text            */
  196.   
  197.   int        print_attribute = 0;    /* such as BOLD, UNDERLINE, ITALICS            */
  198. ***************
  199. *** 219,228 ****
  200. --- 229,239 ----
  201.   FILE    *input_fp, *output_fp;
  202.   
  203.   /*    input line and input line pointer */
  204.   char    *c;
  205.   char    line[LONG_STR + 1];
  206. + char    shortline[150];
  207.   
  208.   char    *pgmname;
  209.   
  210.   void catch();
  211.   jmp_buf eof_env;
  212. ***************
  213. *** 231,240 ****
  214. --- 242,253 ----
  215.   FILE    *pdef = NULL;        /*    psfprint.def file    */
  216.   
  217.   char *ascii_hex = "0123456789abcdefghijklmnopqrstuvwxyz";
  218.   extern int atoi(), getpid();
  219.   
  220. + char *malloc();
  221.   /****************************************************************************
  222.   *    main ()                                                                    *
  223.   ****************************************************************************/
  224.   
  225.   main (argc, argv)
  226. ***************
  227. *** 246,255 ****
  228. --- 259,270 ----
  229.       char    bookfile[100];
  230.       char    *env_fname;            /*    environment specified output file */
  231.       char    *getenv();
  232.       int        narrow2x;
  233.       char    alt_cmd[200];
  234. +     char    *new_marg;
  235. +     int        want_stats = 0;
  236.   
  237.       if ((pgmname = strrchr (argv[0], '/'))
  238.               || (pgmname = strrchr (argv[0], '\\'))
  239.               || (pgmname = strrchr (argv[0], ':')))
  240.           pgmname++;
  241. ***************
  242. *** 260,269 ****
  243. --- 275,285 ----
  244.       for (i = 0; i < 256;  i++)            /*    initial xlate = no translation */
  245.           xlate[i] = i;
  246.       for (i = font_count;  i < NFONTS;  i++)
  247.           fonts[i] = "N/A";
  248.   
  249. +     defref = NULL;
  250.       for (i = 0;  i < argc;  i++)        /*    if user sets -u alt.def */
  251.       {    if (strncmp (argv[i], "-u", 2) == 0)
  252.           {    if (strlen (argv[i]) > 2)
  253.                   defref = argv[i] + 2;
  254.            else
  255. ***************
  256. *** 277,286 ****
  257. --- 293,321 ----
  258.       }
  259.   
  260.       /*    Read the .def file if it exists    */
  261.   
  262.       alt_cmd[0] = '\0';
  263. +     if (access (defref, 0)  &&  defref != PDEF
  264. +                             &&  strchr (defref, '/') == NULL  
  265. +                             &&  strchr (defref, '\\') == NULL)
  266. +     {    /* see if file is in same directory as PDEF */
  267. +         char *c, *strrchr();
  268. +         strcpy (shortline, PDEF);
  269. +         if ((c = strrchr (shortline, '/')) == NULL)
  270. +         {    if ((c = strrchr (shortline, '\\')) == NULL)
  271. +                 c = shortline;
  272. +             else
  273. +                 c++;
  274. +         }
  275. +         else
  276. +             c++;
  277. +         *c = 0;
  278. +         strcat (c, defref);
  279. +         defref = shortline;
  280. +     }
  281. +         
  282.       if ((pdef = fopen (defref, "r")) != NULL)
  283.       {    char    line_type[50];
  284.   #if defined(FORLPD)
  285.           char    *quote, *word;
  286.           int        modified_argv = 0;
  287. ***************
  288. *** 423,442 ****
  289.       else /* if no .def, assume all fonts exist */
  290.       {    for (i = 0;  i < font_count;  i++)
  291.               fonts_have[i] = 1;
  292.       }
  293.   
  294. -     for (i = 0;  page_types[i].paper_name[0];  i++)
  295. -     {    page_types[i].left_marg  = page_types[i].lx;
  296. -         page_types[i].bot_marg   = page_types[i].ly;
  297. -         page_types[i].top_marg   = (page_types[i].height - 1) - page_types[i].uy;
  298. -         page_types[i].right_marg = (page_types[i].width  - 1) - page_types[i].ux;
  299. -         page_types[i].x_size = page_types[i].ux - page_types[i].lx + 1;
  300. -         page_types[i].y_size = page_types[i].uy - page_types[i].ly + 1;
  301. -     }
  302. -         
  303.   #ifdef PAPERTYPE
  304.       for (i = 0;  page_types[i].paper_name[0];  i++)
  305.       {    if (strcmp (page_types[i].paper_name, PAPERTYPE) == 0)
  306.           {    p = &page_types[i];
  307.               break;
  308. --- 458,467 ----
  309. ***************
  310. *** 451,461 ****
  311.       *header_text = '\0';
  312.       if (argc > 1  &&  (strcmp (argv[1], "-") == 0  || strcmp (argv[1], "--") == 0))
  313.           usage();
  314.   
  315.       narrow2x = 0;
  316. !     while ((c = getopt(argc, argv, "124xhnwdvzsi:m:b:c:g:H:l:L:f:t:p:r:R:u:-?")) != -1)
  317.       {    switch (c)
  318.           {
  319.           case '1':
  320.               max_frame = 1;
  321.               break;
  322. --- 476,487 ----
  323.       *header_text = '\0';
  324.       if (argc > 1  &&  (strcmp (argv[1], "-") == 0  || strcmp (argv[1], "--") == 0))
  325.           usage();
  326.   
  327.       narrow2x = 0;
  328. !     new_marg = NULL;
  329. !     while ((c = getopt(argc, argv, "124Eexhnwdvzsi:m:b:c:g:H:l:L:M:f:t:P:p:r:R:u:-?")) != -1)
  330.       {    switch (c)
  331.           {
  332.           case '1':
  333.               max_frame = 1;
  334.               break;
  335. ***************
  336. *** 470,480 ****
  337.               max_frame = 4;
  338.               break;
  339.               
  340.           case 'b':
  341.               if ((set_paper_bin = atoi (optarg)) > nslots)
  342. !             {    if (nslots = 0)
  343.                       fprintf (stderr, "%s: no alternate bins permitted\n", nslots);
  344.                   else
  345.                       fprintf (stderr, "%s: paper bin greater than %d\n", pgmname, nslots);
  346.                   exit (1);
  347.               }
  348. --- 496,506 ----
  349.               max_frame = 4;
  350.               break;
  351.               
  352.           case 'b':
  353.               if ((set_paper_bin = atoi (optarg)) > nslots)
  354. !             {    if (nslots == 0)
  355.                       fprintf (stderr, "%s: no alternate bins permitted\n", nslots);
  356.                   else
  357.                       fprintf (stderr, "%s: paper bin greater than %d\n", pgmname, nslots);
  358.                   exit (1);
  359.               }
  360. ***************
  361. *** 487,496 ****
  362. --- 513,531 ----
  363.   
  364.           case 'd':
  365.               book = 1;
  366.               break;
  367.                       
  368. +         case 'e':
  369. +             enable_wrap = 1;
  370. +             break;
  371. +     
  372. +         case 'E':
  373. +             enable_wrap = 1;
  374. +             rational_wrap = 1;
  375. +             break;
  376. +     
  377.           case 'f':
  378.               if (*optarg > '9'  &&  optarg[1])        /*    at least 2 chars */
  379.               {    /*    character string name of font */
  380.                   for (i = 0;  i < font_count;  i += 4)
  381.                   {    if (partial_compare (optarg, fonts[i]) == 0)
  382. ***************
  383. *** 530,540 ****
  384.               header = 2;
  385.               strcpy (header_text, optarg);
  386.               break;
  387.   
  388.           case 'i':
  389. !             x_user_offset = atoi (optarg);
  390.               break;
  391.   
  392.           case 'l':
  393.               lines_on_page = atoi (optarg);
  394.               set_line_count = 1;
  395. --- 565,575 ----
  396.               header = 2;
  397.               strcpy (header_text, optarg);
  398.               break;
  399.   
  400.           case 'i':
  401. !             x_user_offset = atoi (optarg) * cvt_unit (optarg) + 0.01;
  402.               break;
  403.   
  404.           case 'l':
  405.               lines_on_page = atoi (optarg);
  406.               set_line_count = 1;
  407. ***************
  408. *** 544,555 ****
  409.               lines_total = atoi (optarg);
  410.               set_total_count = 1;
  411.               break;
  412.   
  413.           case 'm':
  414. !             y_user_offset = atoi (optarg);
  415.               break;
  416.   
  417.           case 'n':
  418.               landscape = 0;
  419.               narrow2x = 1;
  420.               break;
  421. --- 579,594 ----
  422.               lines_total = atoi (optarg);
  423.               set_total_count = 1;
  424.               break;
  425.   
  426.           case 'm':
  427. !             y_user_offset = atoi (optarg) * cvt_unit(optarg) + 0.01;
  428.               break;
  429. +         
  430. +         case 'M':
  431. +             new_marg = optarg;
  432. +             break;
  433.   
  434.           case 'n':
  435.               landscape = 0;
  436.               narrow2x = 1;
  437.               break;
  438. ***************
  439. *** 557,578 ****
  440.           case 'p':
  441.               point_size = atoi (optarg);
  442.               set_point_size = 1;
  443.               break;
  444.   
  445.           case 'r':
  446.               remove_between = atoi (optarg);
  447.               break;
  448.           
  449.           case 'R':
  450.               remove_beginning = atoi (optarg);
  451.               break;
  452.               
  453.           case 's':
  454. !             size_display();
  455. !             exit (1);
  456. !     
  457.           case 't':
  458.               tab_size = atoi (optarg);
  459.               break;
  460.               
  461.           case 'u':        /* already processed */
  462. --- 596,623 ----
  463.           case 'p':
  464.               point_size = atoi (optarg);
  465.               set_point_size = 1;
  466.               break;
  467.   
  468. +         case 'P':
  469. +             point_size = atoi (optarg);
  470. +             set_point_size = 1;
  471. +             preserve_point = 1;
  472. +             break;
  473.           case 'r':
  474.               remove_between = atoi (optarg);
  475.               break;
  476.           
  477.           case 'R':
  478.               remove_beginning = atoi (optarg);
  479.               break;
  480.               
  481.           case 's':
  482. !             want_stats = 1;
  483. !             break;
  484.           case 't':
  485.               tab_size = atoi (optarg);
  486.               break;
  487.               
  488.           case 'u':        /* already processed */
  489. ***************
  490. *** 612,643 ****
  491.       else if (reverse_order == 0  &&  order_normal[0])    /*    Force normal order tray?*/
  492.           order_command = order_normal;                    /*        yes                    */
  493.       else
  494.           order_command = NULL;                            /*    use default action         */
  495.   
  496.       if (reverse_requested && book)
  497.       {    fprintf (stderr, "Double sided or book in reverse ordered not supported\n");
  498.           exit (1);
  499.       }
  500.   
  501.   
  502.       if (nslots <= 1)
  503.           hopper_available = 0;
  504.       if (reverse_order  ||  (book  &&  hopper_available))
  505.           sprintf (bookfile, "%s%d.bok", TEMPFILE, getpid());
  506.       else
  507.           strcpy (bookfile, BOOKFILE);
  508.   
  509. -     if (max_frame == 2  &&  landscape == 0)
  510. -         set_point_size = 1;
  511.       if (optind >=  argc  &&  header == 1)    /* no file name header on stdin */
  512.           header = 0;
  513.       save_point_size = point_size;
  514.       
  515.       (void)    signal (SIGINT, catch);        /*    for lpd quit */
  516.   
  517.   #ifdef PSFFILTER
  518.   
  519.       output_fp = stdout;
  520.       input_fp  = stdin;
  521.       if (header == 1)
  522. --- 657,751 ----
  523.       else if (reverse_order == 0  &&  order_normal[0])    /*    Force normal order tray?*/
  524.           order_command = order_normal;                    /*        yes                    */
  525.       else
  526.           order_command = NULL;                            /*    use default action         */
  527.   
  528. +     nominal_high = p->uy - p->ly + 1;                    /* for default row/col scaling */
  529. +     nominal_wide = p->ux - p->lx + 1;        
  530.       if (reverse_requested && book)
  531.       {    fprintf (stderr, "Double sided or book in reverse ordered not supported\n");
  532.           exit (1);
  533.       }
  534. +     /*    if -M specified, set the imageable area coordinates to reflect
  535. +         the deisred margin size.
  536. +     */
  537. +     if (new_marg)
  538. +     {    char *mc, *v[6];
  539. +         int    iv;
  540. +         double    fact, atof();
  541. +         mc = new_marg;
  542. +         iv = 1;
  543. +         v[0] = mc;
  544. +         while (*mc  &&  iv < 6)
  545. +         {    if (*mc == ',')
  546. +             {    v[iv++] = mc + 1;
  547. +                 *mc = 0;
  548. +             }
  549. +             mc++;
  550. +         }
  551. +         if (iv < 4)
  552. +         {    fprintf (stderr, "Must have 4 margin sizes specified\n");
  553. +             exit (1);
  554. +         }
  555. +         if (iv > 4)
  556. +             fact = cvt_unit (v[4]);
  557. +         else
  558. +             fact = cvt_unit (v[3]);
  559.   
  560. +         if (landscape)
  561. +         {    if ((iv = atof (v[3]) * fact) > 0)
  562. +                 p->lx = max (p->lx, (iv + 1));
  563. +             if ((iv = atof (v[2]) * fact) > 0)
  564. +                 p->ux = min (p->ux, p->width  - (iv + 1));
  565. +             if ((iv = atof (v[1]) * fact) > 0)
  566. +                 p->uy = min (p->uy, p->height - (iv + 1));
  567. +             if ((iv = atof (v[0]) * fact) > 0)
  568. +                 p->ly = max (p->ly, (iv + 1));
  569. +         }
  570. +         else
  571. +         {    if ((iv = atof (v[0]) * fact) > 0)
  572. +                 p->lx = max (p->lx, (iv + 1));
  573. +             if ((iv = atof (v[1]) * fact) > 0)
  574. +                 p->ux = min (p->ux, p->width  - (iv + 1));
  575. +             if ((iv = atof (v[2]) * fact) > 0)
  576. +                 p->uy = min (p->uy, p->height - (iv + 1));
  577. +             if ((iv = atof (v[3]) * fact) > 0)
  578. +                 p->ly = max (p->ly, (iv + 1));
  579. +         }
  580. +         if (p->ux - p->lx < 200  ||  p->uy - p->ly < 200)
  581. +         {    fprintf (stderr, "Margin size is inappropriate\n");
  582. +                 exit (1);
  583. +         }
  584. +     }
  585. +     for (i = 0;  page_types[i].paper_name[0];  i++)
  586. +     {    page_types[i].left_marg  = page_types[i].lx;
  587. +         page_types[i].bot_marg   = page_types[i].ly;
  588. +         page_types[i].top_marg   = (page_types[i].height - 1) - page_types[i].uy;
  589. +         page_types[i].right_marg = (page_types[i].width  - 1) - page_types[i].ux;
  590.   
  591. +         page_types[i].x_size = page_types[i].ux - page_types[i].lx + 1;
  592. +         page_types[i].y_size = page_types[i].uy - page_types[i].ly + 1;
  593. +     }
  594. +     if (want_stats)
  595. +     {    size_display();
  596. +         exit (1);
  597. +     }
  598.       if (nslots <= 1)
  599.           hopper_available = 0;
  600.       if (reverse_order  ||  (book  &&  hopper_available))
  601.           sprintf (bookfile, "%s%d.bok", TEMPFILE, getpid());
  602.       else
  603.           strcpy (bookfile, BOOKFILE);
  604.   
  605.       if (optind >=  argc  &&  header == 1)    /* no file name header on stdin */
  606.           header = 0;
  607.       save_point_size = point_size;
  608.       
  609.       (void)    signal (SIGINT, catch);        /*    for lpd quit */
  610.   
  611.   #ifdef PSFFILTER
  612.   
  613.       output_fp = stdout;
  614.       input_fp  = stdin;
  615.       if (header == 1)
  616. ***************
  617. *** 683,693 ****
  618.           line_number = 32000;
  619.           default_point_size = point_size;
  620.           default_font_number = font_number;
  621.           bookwork = book  &&  landscape  &&  (max_frame == 2);
  622.   
  623. -         input_fp = stdin;
  624.           get_time (now);        
  625.           scale_factors ();
  626.           prologue ();
  627.           start_file ();
  628.           process_file ();
  629. --- 791,800 ----
  630. ***************
  631. *** 772,781 ****
  632. --- 879,919 ----
  633.       exit (0);
  634.   }
  635.   
  636.   
  637.   /****************************************************************************
  638. + *    cvt_unit ()                                                                *
  639. + *    Determine the margin offset conversion factor to points.                *
  640. + ****************************************************************************/
  641. + double cvt_unit (which)
  642. + char *which;
  643. + {    double    fact;
  644. +     fact = 1.0;
  645. +     while (*which)
  646. +     {
  647. +         if (isdigit (*which))
  648. +         {    which++;
  649. +             continue;
  650. +         }
  651. +         switch (toupper (*which))
  652. +         {
  653. +         case 'I':    fact = 72.0;        break;        /* inches     */
  654. +         case 'C':    fact = 72.0 / 2.54;    break;        /* cm          */
  655. +         case 'P':    fact = 1.0;            break;        /* points    */
  656. +         case ',':    break;
  657. +         default :    fprintf (stderr, "invalid margin unit '%c'\n", *which);
  658. +                     exit (1);
  659. +         }
  660. +         if (*which++ != ',')
  661. +             break;
  662. +     }
  663. +     return (fact);
  664. + }
  665. + /****************************************************************************
  666.   *    scale_factors ()                                                        *
  667.   *    Compute the x and y scale factors.                                        *
  668.   ****************************************************************************/
  669.   
  670.   /*                    total paper size - unprintable size
  671. ***************
  672. *** 788,861 ****
  673.       int    high;                /*    points needed for line count        */
  674.       int    n_lines;            /*    number of lines on a page            */
  675.       int    i;
  676.       double    char_width, scale;
  677.       double    char_sf, line_sf;
  678. !     int        nominal_high, nominal_wide;
  679. !     int        on_portrait;
  680. !     /*    use either the "portrait" or landscape width/height for basic scaling
  681. !     */
  682. !     switch (max_frame)
  683. !     {
  684. !     case 1:    on_portrait = 0;
  685. !             break;
  686. !     case 2: if (landscape)
  687. !                 on_portrait = 1;
  688. !             else
  689. !                 on_portrait = 0;
  690. !             break;
  691. !     case 4: if (landscape)
  692. !                 on_portrait = 0;
  693. !             else
  694. !                 on_portrait = 1;
  695. !     }
  696.       real_width = p->width;        /* for initial axis translate only    */
  697.   
  698. -     /*    if 4up in portrait or 2up, we want to shrink the image as
  699. -         though it were a proper 8.5x11 page.  thus do all calculations
  700. -         of line and column count as though it were a normal portrait page.
  701. -     */
  702. -     if (on_portrait)
  703. -     {    nominal_high = p->y_size;
  704. -         nominal_wide = p->x_size;
  705. -     }
  706.       if (landscape)
  707. !     {
  708.           i = p->height;      p->height    = p->width;        p->width      = i;
  709.           i = p->left_marg;   p->left_marg = p->bot_marg;     p->bot_marg   = i;
  710.           i = p->top_marg;    p->top_marg  = p->right_marg;   p->right_marg = i;
  711.           i = p->lx;            p->lx        = p->ly;            p->ly          = i;
  712.           i = p->ux;            p->ux        = p->uy;            p->uy          = i;
  713.           i = p->x_size;        p->x_size    = p->y_size;        p->y_size      = i;
  714.       }
  715. !     if (on_portrait == 0)
  716. !     {    nominal_high = p->y_size;
  717. !         nominal_wide = p->x_size;
  718. !     }
  719. !     if (set_point_size)
  720. !     {    /*    if point size specified, ignore changes to rows and columns
  721. !             with -L, -l & -c.  They destroy character shape.
  722. !         */
  723. !         char_width = point_size / 12.0 * NOMINAL_CWIDE;
  724. !         n_chars = ceil ((double) nominal_wide / (double) char_width);
  725.           n_lines = (double) nominal_high / (double) point_size;
  726. !         char_sf = 1.0;
  727.           line_sf = 1.0;
  728.   
  729. !         if (set_total_count == 0  ||  lines_total > n_lines)
  730.               lines_total = n_lines;
  731. !         if (set_line_count == 0  ||  lines_on_page > n_lines)
  732.               lines_on_page = n_lines;
  733.           if (lines_total < lines_on_page)
  734. !             lines_on_page = lines_total;
  735.           if (header)                /* compress scale to allow headers */
  736.           {    lines_on_page += 2;
  737.               lines_total += 2;
  738. !             line_sf = (double) n_lines / (double) lines_total;
  739.           }
  740.       }
  741.       else
  742.       {    /*    determine independent scale factors to lines and columns
  743.               based on user line and column count. This changes
  744. --- 926,992 ----
  745.       int    high;                /*    points needed for line count        */
  746.       int    n_lines;            /*    number of lines on a page            */
  747.       int    i;
  748.       double    char_width, scale;
  749.       double    char_sf, line_sf;
  750. !     
  751.       real_width = p->width;        /* for initial axis translate only    */
  752.   
  753.       if (landscape)
  754. !     {    if ((max_frame == 1) || ( max_frame == 4)  ||  set_point_size)
  755. !         {    /* use landscape as basis for line/col counts */
  756. !             i = nominal_high;
  757. !             nominal_high = nominal_wide;
  758. !             nominal_wide = i;
  759. !         }
  760.           i = p->height;      p->height    = p->width;        p->width      = i;
  761.           i = p->left_marg;   p->left_marg = p->bot_marg;     p->bot_marg   = i;
  762.           i = p->top_marg;    p->top_marg  = p->right_marg;   p->right_marg = i;
  763.           i = p->lx;            p->lx        = p->ly;            p->ly          = i;
  764.           i = p->ux;            p->ux        = p->uy;            p->uy          = i;
  765.           i = p->x_size;        p->x_size    = p->y_size;        p->y_size      = i;
  766.       }
  767. !     x_user_offset = max (0, x_user_offset - p->left_marg);
  768. !     y_user_offset = max (0, y_user_offset - p->top_marg);
  769. !     p->width -= x_user_offset;        /* reduce effective page size */
  770. !     p->height -= y_user_offset;
  771. !     p->x_size -= x_user_offset;
  772. !     p->y_size -= y_user_offset;
  773. !     if (set_point_size)        /*    Attempt to honour point size */
  774. !     {    if (preserve_point)
  775. !         {    nominal_high = p->y_size;
  776. !             nominal_wide = p->x_size;
  777. !         }
  778. !         char_width = (double) point_size / 12.0 * (double) NOMINAL_CWIDE;
  779. !         n_chars = ceil ((double) nominal_wide / char_width);
  780. !         char_sf = (double) (nominal_wide) / (double) (char_width * n_chars);
  781.           n_lines = (double) nominal_high / (double) point_size;
  782. !         if (set_char_count)
  783. !             char_sf *= (double) n_chars / (double) chars_on_line;
  784. !         else
  785. !             chars_on_line = n_chars;
  786.           line_sf = 1.0;
  787.   
  788. !         if (set_total_count == 0)
  789.               lines_total = n_lines;
  790. !         if (set_line_count == 0)
  791.               lines_on_page = n_lines;
  792.           if (lines_total < lines_on_page)
  793. !         {    if (set_total_count)
  794. !                 lines_on_page = lines_total;
  795. !             else
  796. !                 lines_total = lines_on_page;
  797. !         }
  798. !         if (n_lines != lines_total)
  799. !             extra_space = (double) (nominal_high - (lines_total * point_size)) 
  800. !                             / (double) (lines_total);
  801.           if (header)                /* compress scale to allow headers */
  802.           {    lines_on_page += 2;
  803.               lines_total += 2;
  804. !             line_sf = (double) (lines_total - 2) / (double) (lines_total);
  805.           }
  806.       }
  807.       else
  808.       {    /*    determine independent scale factors to lines and columns
  809.               based on user line and column count. This changes
  810. ***************
  811. *** 896,944 ****
  812.           for descenders for the last line.
  813.       */
  814.       high = ceil ((double) point_size * ((double) n_lines + 0.51));
  815.       wide = ceil (n_chars * char_width);
  816.   
  817. -     x_user_offset = max (0, x_user_offset - p->left_marg);
  818. -     y_user_offset = max (0, y_user_offset - p->top_marg );
  819.       switch (max_frame)
  820.       {
  821.       case 1:
  822.           scale_x = (double) (p->x_size) / (double) wide * char_sf;
  823.           scale_y = (double) (p->y_size) / (double) high * line_sf;
  824. !         x_left_offset  = (int) ceil ((double) (p->left_marg + x_user_offset) / scale_x);
  825. !         y_top_offset   = (int) ceil ((double) (p->top_marg  + y_user_offset) / scale_y);
  826. !         dx_home[0] = 0;
  827. !         dy_home[0] = 0;
  828. !         p->height = ceil ((double) p->height / scale_y);
  829. !         p->width  = ceil ((double) p->width / scale_x);
  830.           p->bot_marg = ceil ((double) p->bot_marg / scale_y);
  831.           break;
  832.   
  833.       case 2:
  834.           scale_x = (double) (p->width - 2 * p->left_marg - 2 * p->right_marg)
  835.                   / (double) (2 * wide) * char_sf;
  836.           scale_y = (double) (p->y_size) / (double) high * line_sf;
  837.   
  838. !         if (landscape == 0)
  839.           {    scale_y /= 2.0;
  840.               lines_total *= 2.0;
  841.               lines_on_page *= 2.0;
  842.           }
  843.           /*    point offsets for margins account for physical "forbidden" area */
  844.   
  845.           x_left_offset  = (int) ceil ((double) p->left_marg / scale_x);
  846.           y_top_offset   = (int) ceil ((double) p->top_marg / scale_y);
  847.   
  848.           /*    page origin translation vectors    */
  849.   
  850. !         p->height = ceil ((double) p->height / scale_y);
  851. !         p->width  = ceil ((double) p->width  / (scale_x * 2.0));
  852. !         p->bot_marg = ceil ((double) p->bot_marg / scale_y);
  853. !         dx_home[0] = 0;
  854.           dy_home[0] = 0;
  855.           dx_home[1] = p->width;
  856.           dy_home[1] = 0;
  857.           break;
  858.       
  859. --- 1027,1080 ----
  860.           for descenders for the last line.
  861.       */
  862.       high = ceil ((double) point_size * ((double) n_lines + 0.51));
  863.       wide = ceil (n_chars * char_width);
  864.   
  865.       switch (max_frame)
  866.       {
  867.       case 1:
  868.           scale_x = (double) (p->x_size) / (double) wide * char_sf;
  869.           scale_y = (double) (p->y_size) / (double) high * line_sf;
  870. !         x_left_offset  = (int) ceil ((double) (p->left_marg) / scale_x);
  871. !         y_top_offset   = (int) ceil ((double) (p->top_marg) / scale_y);
  872. !         x_user_offset = (double) x_user_offset / scale_x;
  873. !         y_user_offset = (double) y_user_offset / scale_y;
  874. !         p->height = (int)((double) p->height / scale_y);
  875. !         p->width  = (int)((double) p->width / scale_x);
  876.           p->bot_marg = ceil ((double) p->bot_marg / scale_y);
  877. +         /*    page origin translation vectors    */
  878. +         dx_home[0] = x_user_offset;
  879. +         dy_home[0] = 0;
  880.           break;
  881.   
  882.       case 2:
  883.           scale_x = (double) (p->width - 2 * p->left_marg - 2 * p->right_marg)
  884.                   / (double) (2 * wide) * char_sf;
  885.           scale_y = (double) (p->y_size) / (double) high * line_sf;
  886.   
  887. !         if (landscape == 0  &&  set_line_count == 0)
  888.           {    scale_y /= 2.0;
  889.               lines_total *= 2.0;
  890.               lines_on_page *= 2.0;
  891.           }
  892.           /*    point offsets for margins account for physical "forbidden" area */
  893.   
  894.           x_left_offset  = (int) ceil ((double) p->left_marg / scale_x);
  895.           y_top_offset   = (int) ceil ((double) p->top_marg / scale_y);
  896.   
  897. +         p->height = (int)((double) p->height / scale_y);
  898. +         p->width  = (int)((double) (p->width)  / (scale_x * 2.0));
  899. +         p->bot_marg = ceil ((double) p->bot_marg / scale_y);
  900. +         x_user_offset = (double) x_user_offset / scale_x;
  901. +         y_user_offset = (double) y_user_offset / scale_y;
  902.           /*    page origin translation vectors    */
  903.   
  904. !         dx_home[0] = x_user_offset;
  905.           dy_home[0] = 0;
  906.           dx_home[1] = p->width;
  907.           dy_home[1] = 0;
  908.           break;
  909.       
  910. ***************
  911. *** 951,966 ****
  912.           /*    point offsets for margins account for physical "forbidden" area */
  913.   
  914.           x_left_offset = (int) ceil ((double) p->left_marg / scale_x);
  915.           y_top_offset  = (int) ceil ((double) p->top_marg / scale_y);
  916.   
  917.           /*    page origin tranlsation vectors    */
  918.   
  919. !         p->height = ceil ((double) p->height / (scale_y * 2.0));
  920. !         p->width  = ceil ((double) p->width  / (scale_x * 2.0));
  921. !         p->bot_marg = ceil ((double) p->bot_marg / scale_y);
  922. !         dx_home[0] = 0;
  923.           dy_home[0] = p->height;
  924.           dx_home[1] = p->width;
  925.           dy_home[1] = 0;
  926.           dx_home[2] = -p->width;
  927.           dy_home[2] = -p->height;
  928. --- 1087,1106 ----
  929.           /*    point offsets for margins account for physical "forbidden" area */
  930.   
  931.           x_left_offset = (int) ceil ((double) p->left_marg / scale_x);
  932.           y_top_offset  = (int) ceil ((double) p->top_marg / scale_y);
  933.   
  934. +         p->height = (int)((double) (p->height)  / (scale_y * 2.0));
  935. +         p->width  = (int)((double) (p->width)  / (scale_x * 2.0));
  936. +         p->bot_marg = ceil ((double) p->bot_marg / scale_y);
  937. +         x_user_offset = (double) x_user_offset / scale_x;
  938. +         y_user_offset = (double) y_user_offset / scale_y;
  939.           /*    page origin tranlsation vectors    */
  940.   
  941. !         dx_home[0] = x_user_offset;
  942.           dy_home[0] = p->height;
  943.           dx_home[1] = p->width;
  944.           dy_home[1] = 0;
  945.           dx_home[2] = -p->width;
  946.           dy_home[2] = -p->height;
  947. ***************
  948. *** 968,982 ****
  949.           dy_home[3] = 0;
  950.           break;
  951.   
  952.       default: ;
  953.       }
  954. -     if (max_frame > 1)
  955. -     {    x_left_offset += x_user_offset;
  956. -         y_top_offset  += y_user_offset;
  957. -     }
  958.   }
  959.   
  960.   
  961.   /****************************************************************************
  962.   *    prologue ()                                                                *
  963. --- 1108,1117 ----
  964. ***************
  965. *** 1023,1033 ****
  966.   
  967.       /*    add additional startup prologue code from psfprint.def
  968.           probably for non-English language support.
  969.       */
  970.       if (pdef)
  971. !     {    while (fgets (line, LONG_STR, pdef))
  972.           {    if (fputs (line, output_fp) == EOF)
  973.                   output_trouble (2);
  974.           }
  975.           fclose (pdef);
  976.           pdef = NULL;
  977. --- 1158,1173 ----
  978.   
  979.       /*    add additional startup prologue code from psfprint.def
  980.           probably for non-English language support.
  981.       */
  982.       if (pdef)
  983. !     {
  984. ! #ifdef PSFILTER
  985. !          char    line[LONG_STR + 1];        /* line already has text stream           */
  986. !                                         /* Jan Fernquist (fer@gorbie.n.tvt.se) */
  987. ! #endif
  988. !         while (fgets (line, LONG_STR, pdef))
  989.           {    if (fputs (line, output_fp) == EOF)
  990.                   output_trouble (2);
  991.           }
  992.           fclose (pdef);
  993.           pdef = NULL;
  994. ***************
  995. *** 1123,1140 ****
  996.           findfont();
  997.       }
  998.   
  999.       set_y_coord ();
  1000.   
  1001. !     if (max_frame > 1  &&  bookwork == 0)
  1002.           fprintf (output_fp, "%d %d translate\n", dx_home[frame], dy_home[frame]);
  1003. -     if (frame == 0  &&  cross)
  1004. -         draw_cross();
  1005.       if (max_frame > 1)
  1006. !     {    fprintf (output_fp, "gsave\n");
  1007.           set_clip_path (0, 0, p->width, p->height);
  1008.       }
  1009.   }
  1010.   
  1011.   
  1012. --- 1263,1279 ----
  1013.           findfont();
  1014.       }
  1015.   
  1016.       set_y_coord ();
  1017.   
  1018. !     if (bookwork == 0)
  1019.           fprintf (output_fp, "%d %d translate\n", dx_home[frame], dy_home[frame]);
  1020.       if (max_frame > 1)
  1021. !     {
  1022. !         if (frame == 0  &&  cross)
  1023. !             draw_cross();
  1024. !         fprintf (output_fp, "gsave\n");
  1025.           set_clip_path (0, 0, p->width, p->height);
  1026.       }
  1027.   }
  1028.   
  1029.   
  1030. ***************
  1031. *** 1143,1153 ****
  1032.   *    position next line to the top of a logical page.                        *
  1033.   *****************************************************************************/
  1034.   
  1035.   void set_y_coord ()
  1036.   {
  1037. !     y_coord = p->height - y_top_offset - point_size;
  1038.   }
  1039.   
  1040.   /****************************************************************************
  1041.   *    put_top                                                                    *
  1042.   *    put a header line at the top of the page                                *
  1043. --- 1282,1295 ----
  1044.   *    position next line to the top of a logical page.                        *
  1045.   *****************************************************************************/
  1046.   
  1047.   void set_y_coord ()
  1048.   {
  1049. !     if (extra_space > 0)
  1050. !         y_coord = p->height - y_top_offset - (point_size + extra_space / 2);
  1051. !     else
  1052. !         y_coord = p->height - y_top_offset - point_size;
  1053.   }
  1054.   
  1055.   /****************************************************************************
  1056.   *    put_top                                                                    *
  1057.   *    put a header line at the top of the page                                *
  1058. ***************
  1059. *** 1169,1179 ****
  1060.       sprintf (fmt, "(%%-%ds%%3d     %%s)show\n", nc);
  1061.   
  1062.       findfont();
  1063.       moveto (0, y_coord, 1);
  1064.       fprintf (output_fp, fmt, hd, page_number + 1, now);
  1065. !     y_coord -= point_size * 2;
  1066.       x_coord = 0;
  1067.       print_attribute = save_attr;
  1068.       point_size = save_point;
  1069.       findfont();
  1070.   }
  1071. --- 1311,1322 ----
  1072.       sprintf (fmt, "(%%-%ds%%3d     %%s)show\n", nc);
  1073.   
  1074.       findfont();
  1075.       moveto (0, y_coord, 1);
  1076.       fprintf (output_fp, fmt, hd, page_number + 1, now);
  1077. !     y_coord -= ((point_size + extra_space)  * 2);
  1078.       x_coord = 0;
  1079.       print_attribute = save_attr;
  1080.       point_size = save_point;
  1081.       findfont();
  1082.   }
  1083. ***************
  1084. *** 1183,1195 ****
  1085.   *    Read the file, look for escape sequences, put text in postscript form    *
  1086.   ****************************************************************************/
  1087.   
  1088.   void process_file ()
  1089.   {    int        char_type, char_count, i, set_page, esc_type;
  1090. !     char    *strchr ();
  1091.       int        previous_attribute;
  1092.       int        lcount = 0;
  1093.       unsigned char    *xln;
  1094.   
  1095.       set_page = 0;
  1096.       i = remove_beginning;
  1097.       while (i--  &&  fgets (line, LONG_STR, input_fp))
  1098. --- 1326,1340 ----
  1099.   *    Read the file, look for escape sequences, put text in postscript form    *
  1100.   ****************************************************************************/
  1101.   
  1102.   void process_file ()
  1103.   {    int        char_type, char_count, i, set_page, esc_type;
  1104. !     char    *strchr (), *lc;
  1105.       int        previous_attribute;
  1106.       int        lcount = 0;
  1107. +     int        line_is_wrapped;
  1108. +     char    line_tab[LONG_STR + 1];
  1109.       unsigned char    *xln;
  1110.   
  1111.       set_page = 0;
  1112.       i = remove_beginning;
  1113.       while (i--  &&  fgets (line, LONG_STR, input_fp))
  1114. ***************
  1115. *** 1200,1215 ****
  1116.       }
  1117.   
  1118.       if (setjmp (eof_env))
  1119.       {    return;
  1120.       }
  1121.   
  1122.   #ifdef PSFFILTER
  1123.       /*    psffilter already has a first line,  psf does not */
  1124.       do
  1125.   #else
  1126. !     while (fgets (line, LONG_STR, input_fp) != NULL)
  1127.   #endif
  1128.       {
  1129.           if (*line == CTLD_EOJ)        /* printing postscript code: ^D at end    */
  1130.               break;                    /* assume it is end of file also        */
  1131.   
  1132. --- 1345,1361 ----
  1133.       }
  1134.   
  1135.       if (setjmp (eof_env))
  1136.       {    return;
  1137.       }
  1138. +     line_is_wrapped = 0;
  1139.   
  1140.   #ifdef PSFFILTER
  1141.       /*    psffilter already has a first line,  psf does not */
  1142.       do
  1143.   #else
  1144. !     while (line_is_wrapped  ||  fgets (line, LONG_STR, input_fp) != NULL)
  1145.   #endif
  1146.       {
  1147.           if (*line == CTLD_EOJ)        /* printing postscript code: ^D at end    */
  1148.               break;                    /* assume it is end of file also        */
  1149.   
  1150. ***************
  1151. *** 1240,1249 ****
  1152. --- 1386,1424 ----
  1153.               is_a_formfeed = 1;
  1154.           }
  1155.           else
  1156.               c = line;
  1157.   
  1158. +         if (enable_wrap  &&  line_is_wrapped == 0)
  1159. +         {    /* for wrapped line, do tab analysis now */
  1160. +             char_count = 0;
  1161. +             lc = line_tab;
  1162. +             c = line;
  1163. +             while (*c)
  1164. +             {
  1165. +                 if (*c == ESCAPE)
  1166. +                 {    *lc++ = *c++;
  1167. +                     if (*c == 'P')
  1168. +                         *lc++ = *c++;        /* point size = 2 chars */
  1169. +                     if (*c)
  1170. +                         *lc++ = *c++;
  1171. +                 }
  1172. +                 else if (*c == '\t')
  1173. +                 {    *lc++ = ' ';
  1174. +                     while (++char_count % tab_size)
  1175. +                         *lc++ = ' ';
  1176. +                     c++;
  1177. +                 }
  1178. +                 else
  1179. +                 {    *lc++ = *c++;
  1180. +                     char_count++;
  1181. +                 }
  1182. +             }
  1183. +             *lc = '\0';
  1184. +             c = line_tab;
  1185. +         }
  1186.           if (line_number >= lines_on_page * 10)
  1187.           {    page_number++;
  1188.               showpage (0);
  1189.               line_number = 10;
  1190.               if (header)
  1191. ***************
  1192. *** 1289,1301 ****
  1193.                                   output_trouble (2);
  1194.                           }
  1195.                           if (esc_type == '+'  ||  esc_type == '-')
  1196.                           {    /*    check for +/- 1/2 line feed        */
  1197.                               if (esc_type == '+')
  1198. !                                 y_coord -= point_size / 2;
  1199.                               else
  1200. !                                 y_coord += point_size / 2;
  1201.                               moveto (x_coord, y_coord, 1);
  1202.                               char_type = -1;
  1203.                               c++;
  1204.                               if (*c != '\n')
  1205.                               {    if (fputc ('(', output_fp) == EOF)
  1206. --- 1464,1476 ----
  1207.                                   output_trouble (2);
  1208.                           }
  1209.                           if (esc_type == '+'  ||  esc_type == '-')
  1210.                           {    /*    check for +/- 1/2 line feed        */
  1211.                               if (esc_type == '+')
  1212. !                                 y_coord -= ((point_size + extra_space) / 2);
  1213.                               else
  1214. !                                 y_coord += ((point_size + extra_space)  / 2);
  1215.                               moveto (x_coord, y_coord, 1);
  1216.                               char_type = -1;
  1217.                               c++;
  1218.                               if (*c != '\n')
  1219.                               {    if (fputc ('(', output_fp) == EOF)
  1220. ***************
  1221. *** 1309,1355 ****
  1222.                       char_type = 0;
  1223.                   }
  1224.                   break;
  1225.   
  1226.               default:
  1227.                   if (*c == '\t')
  1228.                   {    fputc (' ', output_fp);
  1229.                       while (++char_count % tab_size)
  1230.                       {    if (fputc (' ', output_fp) == EOF)
  1231.                               output_trouble (2);
  1232.                       }
  1233.                   }
  1234.                   else
  1235.                   {    if (strchr ("\r\b\\()", *c) != NULL)
  1236. !                     if (fputc ('\\', output_fp) == EOF)
  1237. !                         output_trouble (2);
  1238.                       if (fputc (*c, output_fp) == EOF)
  1239.                           output_trouble (2);
  1240.                       char_count++;
  1241.                   }
  1242. -                 char_type = 1;
  1243.                   break;
  1244.               }
  1245.               c++;
  1246.           }
  1247.           if (char_type == 1)
  1248.           {    if (print_attribute & UNDERLINE)
  1249.                   SHOWU (output_fp, point_size);
  1250.               else
  1251.               {    if (fputs (")show\n", output_fp) == EOF)
  1252.                       output_trouble (2);
  1253.               }
  1254.           }
  1255.   
  1256. !         y_coord -= point_size;
  1257.           x_coord = 0;
  1258.           if (set_page)
  1259.           {    line_number = 32000;
  1260.               set_page = 0;
  1261.           }
  1262.   #ifdef PSFFILTER
  1263. !     } while (fgets (line, LONG_STR, input_fp) != NULL);
  1264.   #else
  1265.       }
  1266.   #endif
  1267.       if (end_of_file == 0)
  1268.           showpage (1);
  1269. --- 1484,1548 ----
  1270.                       char_type = 0;
  1271.                   }
  1272.                   break;
  1273.   
  1274.               default:
  1275. +                 char_type = 1;
  1276. +                 if (enable_wrap  &&  char_count >= chars_on_line)
  1277. +                 {    int      nb;
  1278. +                     lc = line;
  1279. +                     if (rational_wrap)    /* right-justify */
  1280. +                     {    nb = chars_on_line - strlen (c) + 1;
  1281. +                         if (nb > 0)
  1282. +                         {    while (nb--)
  1283. +                                 *lc++ = ' ';
  1284. +                         }
  1285. +                     }
  1286. +                     while (*c)
  1287. +                         *lc++ = *c++;
  1288. +                     *lc = 0;
  1289. +                     line_is_wrapped = 1;
  1290. +                     goto wrapit;
  1291. +                 }
  1292.                   if (*c == '\t')
  1293.                   {    fputc (' ', output_fp);
  1294.                       while (++char_count % tab_size)
  1295.                       {    if (fputc (' ', output_fp) == EOF)
  1296.                               output_trouble (2);
  1297.                       }
  1298.                   }
  1299.                   else
  1300.                   {    if (strchr ("\r\b\\()", *c) != NULL)
  1301. !                         if (fputc ('\\', output_fp) == EOF)
  1302. !                             output_trouble (2);
  1303.                       if (fputc (*c, output_fp) == EOF)
  1304.                           output_trouble (2);
  1305.                       char_count++;
  1306.                   }
  1307.                   break;
  1308.               }
  1309.               c++;
  1310.           }
  1311. +         line_is_wrapped = 0;
  1312. + wrapit:
  1313.           if (char_type == 1)
  1314.           {    if (print_attribute & UNDERLINE)
  1315.                   SHOWU (output_fp, point_size);
  1316.               else
  1317.               {    if (fputs (")show\n", output_fp) == EOF)
  1318.                       output_trouble (2);
  1319.               }
  1320.           }
  1321.   
  1322. !         y_coord -= (point_size + extra_space);
  1323.           x_coord = 0;
  1324.           if (set_page)
  1325.           {    line_number = 32000;
  1326.               set_page = 0;
  1327.           }
  1328.   #ifdef PSFFILTER
  1329. !     } while (line_is_wrapped  ||  fgets (line, LONG_STR, input_fp) != NULL);
  1330.   #else
  1331.       }
  1332.   #endif
  1333.       if (end_of_file == 0)
  1334.           showpage (1);
  1335. ***************
  1336. *** 1545,1564 ****
  1337.   
  1338.       if (max_frame > 1)
  1339.       {    p_w = p->width;
  1340.           p_h = p->height;
  1341.           if (max_frame == 4)
  1342. !         {    set_clip_path (0, -p_h, p_w * 2, p_h);
  1343. !             fprintf (output_fp,"gsave %d %d moveto\n", p_w, p_h);
  1344.               fprintf (output_fp,"%d %d lineto\n", p_w, -p_h);
  1345.               fprintf (output_fp,"%d %d moveto\n", 0, 0);
  1346.               fprintf (output_fp,"%d %d lineto\n", p_w * 2, 0);
  1347.               fprintf (output_fp,"%s\n", "stroke grestore");
  1348.           }
  1349.           else
  1350. !         {    set_clip_path (0, 0, p_w * 2+ 1, p_h + 1);
  1351. !             fprintf (output_fp,"gsave %d %d moveto\n", p_w, p_h);
  1352.               fprintf (output_fp,"%d %d lineto\n", p_w, 0);
  1353.               fprintf (output_fp,"%s\n", "stroke grestore");
  1354.           }
  1355.       }
  1356.   }
  1357. --- 1738,1755 ----
  1358.   
  1359.       if (max_frame > 1)
  1360.       {    p_w = p->width;
  1361.           p_h = p->height;
  1362.           if (max_frame == 4)
  1363. !         {    fprintf (output_fp,"gsave %d %d moveto\n", p_w, p_h);
  1364.               fprintf (output_fp,"%d %d lineto\n", p_w, -p_h);
  1365.               fprintf (output_fp,"%d %d moveto\n", 0, 0);
  1366.               fprintf (output_fp,"%d %d lineto\n", p_w * 2, 0);
  1367.               fprintf (output_fp,"%s\n", "stroke grestore");
  1368.           }
  1369.           else
  1370. !         {    fprintf (output_fp,"gsave %d %d moveto\n", p_w, p_h);
  1371.               fprintf (output_fp,"%d %d lineto\n", p_w, 0);
  1372.               fprintf (output_fp,"%s\n", "stroke grestore");
  1373.           }
  1374.       }
  1375.   }
  1376. ***************
  1377. *** 1891,1918 ****
  1378.   
  1379.   #else    /* not PSFFILTER */
  1380.   
  1381.   static char *usage_text[] =
  1382.   {
  1383. !     "Usage: %s [-1|2|4] [-b n] [-c n] [-d] [-f n] [-g type ] [-h]\n",
  1384. !     "           [-H text] [-i n] [-l n] [-m n] [-n] [-p n] [-R n]",
  1385. !     "           [-r n] [-s] [-t n] [-u fil] [-w] [-x] file ...",
  1386.       "where:",
  1387.       "   -1|2|4  print 1,2,4 up (default=1)",
  1388.       "   -b n    paper bin n",
  1389.       "   -c n    print columns",
  1390.       "   -d      double sided",
  1391.       "   -f n    font number (def=0:Courier)",
  1392.       "   -g type letter legal a4 b5",
  1393.       "   -h      file name header",
  1394.       "   -H text text header",
  1395. !     "   -i n    indent left margin points",
  1396.       "   -l n    print lines per page",
  1397.       "   -L n    lines per page",
  1398. !     "   -m n    top margin points",
  1399.       "   -n      portrait (narrow) format",
  1400.       "   -p n    point size n",
  1401.       "   -R n    remove lines from beginning",
  1402.       "   -r n    remove lines between pages",
  1403.       "   -s      show page stats",
  1404.       "   -t n    tabs to n (default=8)",
  1405.       "   -u fil  use this file as psfprint.def",
  1406. --- 2082,2112 ----
  1407.   
  1408.   #else    /* not PSFFILTER */
  1409.   
  1410.   static char *usage_text[] =
  1411.   {
  1412. !     "Usage: %s [-124dEehnswx] [-b n] [-c n] [-f n] [-g type] [-H txt] [-i n] [-l n]\n",
  1413. !     "     [-m n] [-M l,r,t,b[,pic]] [-p n] [-P n] [-R n] [-r n] [-t n] [-u f] file..",
  1414.       "where:",
  1415.       "   -1|2|4  print 1,2,4 up (default=1)",
  1416.       "   -b n    paper bin n",
  1417.       "   -c n    print columns",
  1418.       "   -d      double sided",
  1419. +     "   -e      left-justified line wrap",
  1420. +     "   -E      right-justified line wrap",
  1421.       "   -f n    font number (def=0:Courier)",
  1422.       "   -g type letter legal a4 b5",
  1423.       "   -h      file name header",
  1424.       "   -H text text header",
  1425. !     "   -i n[pic] indent left margin points",
  1426.       "   -l n    print lines per page",
  1427.       "   -L n    lines per page",
  1428. !     "   -m n[pic] top margin points",
  1429. !     "   -M xxx  set all margins",
  1430.       "   -n      portrait (narrow) format",
  1431.       "   -p n    point size n",
  1432. +     "   -P n    preserve point size n",
  1433.       "   -R n    remove lines from beginning",
  1434.       "   -r n    remove lines between pages",
  1435.       "   -s      show page stats",
  1436.       "   -t n    tabs to n (default=8)",
  1437.       "   -u fil  use this file as psfprint.def",
  1438. ***************
  1439. *** 1922,1932 ****
  1440.       "   file..  name of files (or stdin)",
  1441.       "   output: stdout",
  1442.       ""
  1443.   } ;
  1444.   
  1445. ! #define TOPCOUNT 4
  1446.   
  1447.   void usage ()
  1448.   {    int        i, many, n, ff;
  1449.   
  1450.       fprintf (stderr, usage_text[0], pgmname);
  1451. --- 2116,2126 ----
  1452.       "   file..  name of files (or stdin)",
  1453.       "   output: stdout",
  1454.       ""
  1455.   } ;
  1456.   
  1457. ! #define TOPCOUNT 3
  1458.   
  1459.   void usage ()
  1460.   {    int        i, many, n, ff;
  1461.   
  1462.       fprintf (stderr, usage_text[0], pgmname);
  1463. ***************
  1464. *** 2005,2015 ****
  1465.               }
  1466.               fprintf (stderr, "%10.10s %9s: ", page_types[ps].paper_name, which);
  1467.               for (point_size = 6;  point_size < 17;  point_size += 2)
  1468.               {    char_width = point_size / 12.0 * NOMINAL_CWIDE;
  1469.                   n_chars = ceil ((double) nominal_wide / (double) char_width);
  1470. !                 n_lines = (double) nominal_high / (double) point_size;
  1471.                   fprintf (stderr, " %4d%4d", n_lines, n_chars);
  1472.               }
  1473.               fprintf (stderr, "\n");
  1474.           }
  1475.       }
  1476. --- 2199,2209 ----
  1477.               }
  1478.               fprintf (stderr, "%10.10s %9s: ", page_types[ps].paper_name, which);
  1479.               for (point_size = 6;  point_size < 17;  point_size += 2)
  1480.               {    char_width = point_size / 12.0 * NOMINAL_CWIDE;
  1481.                   n_chars = ceil ((double) nominal_wide / (double) char_width);
  1482. !                 n_lines = (double) nominal_high / (double) point_size + 0.0001;
  1483.                   fprintf (stderr, " %4d%4d", n_lines, n_chars);
  1484.               }
  1485.               fprintf (stderr, "\n");
  1486.           }
  1487.       }
  1488. *** ../psf3.net/Install.unix    Fri Jan 31 19:19:36 1992
  1489. --- Install.unix    Thu Jan 30 00:09:50 1992
  1490. ***************
  1491. *** 53,65 ****
  1492.        4.    Make shell scripts:
  1493.        
  1494.       Some man systems may require additional options before the shell
  1495.       script "psfman" can successfully process man pages through the
  1496.       psf filters system. Examine and modify the file "psfman.SH" for
  1497. !     additional man options needed.  On some systems, you man
  1498.       need to specify the full path to the "man" programme and/or
  1499.       force the option "-Tlp".
  1500.       
  1501.       Now build the shell scripts.
  1502.   
  1503.           make scripts
  1504.   
  1505. --- 53,70 ----
  1506.        4.    Make shell scripts:
  1507.        
  1508.       Some man systems may require additional options before the shell
  1509.       script "psfman" can successfully process man pages through the
  1510.       psf filters system. Examine and modify the file "psfman.SH" for
  1511. !     additional man options needed.  On some systems, you may
  1512.       need to specify the full path to the "man" programme and/or
  1513.       force the option "-Tlp".
  1514. +     
  1515. +     Each of the prototype scripts assumes that /bin/sh is the
  1516. +     desired shell for execution.  If /bin/ksh is desired
  1517. +     (as in the case of most Aplllo versions of unix), then
  1518. +     edit each *.SH file to reflect the desired shell.
  1519.       
  1520.       Now build the shell scripts.
  1521.   
  1522.           make scripts
  1523.   
  1524. *** ../psf3.net/Makefile    Fri Jan 31 19:19:37 1992
  1525. --- Makefile    Fri Jan 31 15:22:19 1992
  1526. ***************
  1527. *** 13,28 ****
  1528.   
  1529.   # - - - - Begin configuration - - - - -
  1530.   #
  1531.   # set compiler, tar and nroff names
  1532.   
  1533. ! # CC=cc
  1534. ! CC = gcc
  1535.   # CC=lpicc -sys -xid
  1536.   
  1537. ! # TAR = tar
  1538. ! TAR = gtar
  1539.   
  1540.   NROFF = nroff
  1541.   # NROFF = cawf
  1542.   
  1543.   # man directory  (if you have man or catman directories)
  1544. --- 13,28 ----
  1545.   
  1546.   # - - - - Begin configuration - - - - -
  1547.   #
  1548.   # set compiler, tar and nroff names
  1549.   
  1550. ! CC=cc
  1551. ! # CC = gcc
  1552.   # CC=lpicc -sys -xid
  1553.   
  1554. ! TAR = tar
  1555. ! # TAR = gtar
  1556.   
  1557.   NROFF = nroff
  1558.   # NROFF = cawf
  1559.   
  1560.   # man directory  (if you have man or catman directories)
  1561. ***************
  1562. *** 30,39 ****
  1563. --- 30,43 ----
  1564.   # MANDIR=/usr/man/man1
  1565.   # MANDIR=/usr/catman/u_man/manl
  1566.   # MANDIR=/usr/catman/u_man/man1
  1567.   # MANDIR=/usr/man/man.1
  1568.   
  1569. + # suffix for man pages
  1570. + MANSUF=l
  1571. + # MANSUF=1
  1572.   # If catman/formatted pages should be filtered with col
  1573.   # COL=
  1574.   COL=| col -b 
  1575.   
  1576.   # user print interface
  1577. ***************
  1578. *** 54,71 ****
  1579.   # DEFFILE=/usr/spool/lp/model/psfprint.def
  1580.   
  1581.   # Set the default paper type  (letter, legal, a4, b5, etc.)
  1582.   PSPTYPE = letter
  1583.   
  1584.   # if 2 paper trays, specifiy -DHOPPER  for double sided printing.
  1585.   #        Second tray should be reserved for double sided printing only!
  1586. ! # TRAYS=
  1587. ! TRAYS=-DHOPPER
  1588.   
  1589.   # compile and library options
  1590.   LDFLAGS = -lm
  1591. ! CFLAGS = -O $(NAMES) $(PAPTYPE) $(TRAYS) -DBINDIR=\"$(BINDIR)\" -DPDEF=\"$(DEFFILE)\" 
  1592.   
  1593.   # extra things for SysV or Xenix with lp/lpsched
  1594.   MODEL=/usr/spool/lp/model
  1595.   
  1596.   # if getopt isn't a standard part of your system
  1597. --- 58,80 ----
  1598.   # DEFFILE=/usr/spool/lp/model/psfprint.def
  1599.   
  1600.   # Set the default paper type  (letter, legal, a4, b5, etc.)
  1601.   PSPTYPE = letter
  1602.   
  1603. + # Psf assumes that the default paper tray is enabled by default
  1604. + # in the printer.  If the default paper tray cannot be set as defined
  1605. + # in PSTYPE above, or to always force tray selection, activate the following:
  1606. + # FORCETYPE=-DFORCETYPE
  1607.   # if 2 paper trays, specifiy -DHOPPER  for double sided printing.
  1608.   #        Second tray should be reserved for double sided printing only!
  1609. ! TRAYS=
  1610. ! # TRAYS=-DHOPPER
  1611.   
  1612.   # compile and library options
  1613.   LDFLAGS = -lm
  1614. ! CFLAGS = -O $(NAMES) $(PAPTYPE) $(TRAYS) $(FORCETYPE) -DBINDIR=\"$(BINDIR)\" -DPDEF=\"$(DEFFILE)\" 
  1615.   
  1616.   # extra things for SysV or Xenix with lp/lpsched
  1617.   MODEL=/usr/spool/lp/model
  1618.   
  1619.   # if getopt isn't a standard part of your system
  1620. ***************
  1621. *** 78,89 ****
  1622.   PSFDOUB = psfdoub
  1623.   PSFBANNER = psfbanner
  1624.   PSFFILTER = psffilter
  1625.   PSFLPD = psflpd
  1626.   
  1627. ! RCSVER = 3.2
  1628. ! RCSCOM="psf3, patch 2"
  1629.   
  1630.   # - - - - - end configuration - - - - - - - -
  1631.   #           ^^^^^^^^^^^^^^^^^
  1632.   
  1633.   # psf uses NAMES to find the current name of psfdoub
  1634. --- 87,98 ----
  1635.   PSFDOUB = psfdoub
  1636.   PSFBANNER = psfbanner
  1637.   PSFFILTER = psffilter
  1638.   PSFLPD = psflpd
  1639.   
  1640. ! RCSVER = 3.3
  1641. ! RCSCOM="psf3, patch 3"
  1642.   
  1643.   # - - - - - end configuration - - - - - - - -
  1644.   #           ^^^^^^^^^^^^^^^^^
  1645.   
  1646.   # psf uses NAMES to find the current name of psfdoub
  1647. ***************
  1648. *** 128,138 ****
  1649.       @echo "  'make scripts'      tailor scripts"
  1650.       @echo " "
  1651.       @echo "Then:  select one of the following installations"
  1652.       @echo "  'make install'      install all user and spooler files"
  1653.       @echo "  'make installuser'  install only user binaries and scripts"
  1654. !     @echo "  'make installbin'   re-install binaries only after a source patch"
  1655.       @echo "  'make installxenix' may work - no longer spported"
  1656.       @echo " "
  1657.       @echo "Others:"
  1658.       @echo "  'make installman'   install unformatted $(MANDIR) pages"
  1659.       @echo "  'make installcat'   format/install $(MANDIR) pages (needs nroff)"
  1660. --- 137,148 ----
  1661.       @echo "  'make scripts'      tailor scripts"
  1662.       @echo " "
  1663.       @echo "Then:  select one of the following installations"
  1664.       @echo "  'make install'      install all user and spooler files"
  1665.       @echo "  'make installuser'  install only user binaries and scripts"
  1666. !     @echo "  'make update'       re-install all binaries after a source patch"
  1667. !     @echo "  'make updateuser'   re-install only user binaries after a source patch"
  1668.       @echo "  'make installxenix' may work - no longer spported"
  1669.       @echo " "
  1670.       @echo "Others:"
  1671.       @echo "  'make installman'   install unformatted $(MANDIR) pages"
  1672.       @echo "  'make installcat'   format/install $(MANDIR) pages (needs nroff)"
  1673. ***************
  1674. *** 194,204 ****
  1675.   
  1676.   
  1677.   # Create a printer selection
  1678.   # ^^^^^^^^^^^^^^^^^^^^^^^^^^
  1679.   printer:
  1680. !     selectdef defs/*.def
  1681.       @test -r psfprint.def || ( echo "Error: cannot find psfprint.def" ;  exit 1)
  1682.       @chmod 644 psfprint.def
  1683.       @if ( test  $(UPRINT) = lpr )  then rm -f zz91 ; \
  1684.            mv psfprint.def zz91 ; \
  1685.            cat psflpd.DEF zz91 > psfprint.def ; \
  1686. --- 204,214 ----
  1687.   
  1688.   
  1689.   # Create a printer selection
  1690.   # ^^^^^^^^^^^^^^^^^^^^^^^^^^
  1691.   printer:
  1692. !     ./selectdef defs/*.def
  1693.       @test -r psfprint.def || ( echo "Error: cannot find psfprint.def" ;  exit 1)
  1694.       @chmod 644 psfprint.def
  1695.       @if ( test  $(UPRINT) = lpr )  then rm -f zz91 ; \
  1696.            mv psfprint.def zz91 ; \
  1697.            cat psflpd.DEF zz91 > psfprint.def ; \
  1698. ***************
  1699. *** 264,302 ****
  1700.       chown lp $(MODEL)/psf $(DEFFILE)
  1701.       chgrp bin $(MODEL)/psf $(DEFFILE)
  1702.       strip $(BINARIES) $(SUPPORT)
  1703.       cp $(BINARIES) $(SCRIPTS) $(BINDIR)
  1704.   
  1705. ! installbin:
  1706. !     @echo "Binary re-install."
  1707.       @test -w $(BINDIR) || ( echo Directory $(BINDIR) not available ; exit 1)
  1708.       strip $(BINARIES)
  1709.       cp $(BINARIES) $(BINDIR)
  1710.   
  1711.   
  1712.   # Man page generation
  1713.   # ^^^^^^^^^^^^^^^^^^^
  1714.   
  1715.   installman:
  1716. !     cd man ; make installman MANDIR=$(MANDIR) NROFF=$(NROFF) COL="$(COL)"
  1717.   
  1718.   installcat:
  1719. !     cd man ; make installcat MANDIR=$(MANDIR) NROFF=$(NROFF) COL="$(COL)"
  1720.   
  1721.   installdoc:
  1722. !     cd man ; make installdoc MANDIR=$(MANDIR) NROFF=$(NROFF) COL="$(COL)"
  1723.   
  1724.   doc:
  1725. !     cd man ; make doc MANDIR=$(MANDIR) NROFF=$(NROFF) COL="$(COL)"
  1726.   
  1727.   # Copy distribution files
  1728.   # ^^^^^^^^^^^^^^^^^^^^^^^
  1729.   tar:
  1730.       $(TAR) cvf /tmp/psf.tar $(SOURCES) man $(OTHERS) defs Makefile.dis Makefile.ajf patchlevel.h
  1731.   
  1732.   shar:
  1733. !     makekit -m -s54k defs man man/*.1 man/*.doc man/Makefile defs/* $(SOURCES) $(OTHERS) patchlevel.h
  1734.   
  1735.   dostar:
  1736.       $(TAR) cvf /tmp/psfdos.tar $(DOSSRC) $(DOSMAN) $(DOSDOC) $(DOSOTHER) defs
  1737.   
  1738.   
  1739. --- 274,330 ----
  1740.       chown lp $(MODEL)/psf $(DEFFILE)
  1741.       chgrp bin $(MODEL)/psf $(DEFFILE)
  1742.       strip $(BINARIES) $(SUPPORT)
  1743.       cp $(BINARIES) $(SCRIPTS) $(BINDIR)
  1744.   
  1745. ! update:
  1746. !     @if ( test $(UPRINT) = lpr ) then make updatebsd ; \
  1747. !         else make updatesysv ; fi
  1748. ! updatebsd:
  1749. !     @echo "Binary only update for lpr/lpd spooler systems."
  1750. !     @test -w $(LPDDIR) || ( echo Directory $(LPDDIR) not available ; exit 1)
  1751. !     @test -w $(BINDIR) || ( echo Directory $(BINDIR) not available ; exit 1)
  1752. !     strip $(LPDBIN) $(LPBIN) $(BINARIES) $(SUPPORT)
  1753. !     cp $(LPDBIN) $(LPDDIR)
  1754. !     cp $(BINARIES) $(BINDIR)
  1755. ! updatesysv:
  1756. !     @echo "Binary only update for lp/lpsched spooler systems."
  1757. !     @test -w $(BINDIR) || ( echo Directory $(BINDIR) not available ; exit 1)
  1758. !     strip $(BINARIES) $(LPBIN) $(SUPPORT)
  1759. !     cp $(BINARIES) $(LPBIN) $(BINDIR)
  1760. ! updateuser:
  1761. !     @echo "User binary re-install"
  1762.       @test -w $(BINDIR) || ( echo Directory $(BINDIR) not available ; exit 1)
  1763.       strip $(BINARIES)
  1764.       cp $(BINARIES) $(BINDIR)
  1765.   
  1766.   
  1767.   # Man page generation
  1768.   # ^^^^^^^^^^^^^^^^^^^
  1769.   
  1770.   installman:
  1771. !     cd man ; make installman MANSUF=$(MANSUF) MANDIR=$(MANDIR) NROFF=$(NROFF) COL="$(COL)"
  1772.   
  1773.   installcat:
  1774. !     cd man ; make installcat MANSUF=$(MANSUF) MANDIR=$(MANDIR) NROFF=$(NROFF) COL="$(COL)"
  1775.   
  1776.   installdoc:
  1777. !     cd man ; make installdoc MANSUF=$(MANSUF) MANDIR=$(MANDIR) NROFF=$(NROFF) COL="$(COL)"
  1778.   
  1779.   doc:
  1780. !     cd man ; make doc MANSUF=$(MANSUF) MANDIR=$(MANDIR) NROFF=$(NROFF) COL="$(COL)"
  1781.   
  1782.   # Copy distribution files
  1783.   # ^^^^^^^^^^^^^^^^^^^^^^^
  1784.   tar:
  1785.       $(TAR) cvf /tmp/psf.tar $(SOURCES) man $(OTHERS) defs Makefile.dis Makefile.ajf patchlevel.h
  1786.   
  1787.   shar:
  1788. !     makekit -m -s59k defs man man/*.1 man/*.doc man/Makefile defs/* $(SOURCES) $(OTHERS) patchlevel.h
  1789.   
  1790.   dostar:
  1791.       $(TAR) cvf /tmp/psfdos.tar $(DOSSRC) $(DOSMAN) $(DOSDOC) $(DOSOTHER) defs
  1792.   
  1793.   
  1794. ***************
  1795. *** 321,332 ****
  1796.       co -l $(SOURCES) $(OTHERS) Makefile.dis Makefile.ajf Makefile patchlevel.h lines.c
  1797.   
  1798.   coman:
  1799.       cd man ; make co RCSVER=$(RCSVER)
  1800.   
  1801. ! # Remove anything that cannot be rebuilt
  1802. ! # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1803.   clean:
  1804.       rm -f $(BINARIES) $(SCRIPTS) $(SUPPORT) $(LPBIN) $(LPDBIN) psfdouble
  1805.       rm -f *.o 
  1806.       rm -f *.B
  1807.       rm -f *.doc
  1808. --- 349,360 ----
  1809.       co -l $(SOURCES) $(OTHERS) Makefile.dis Makefile.ajf Makefile patchlevel.h lines.c
  1810.   
  1811.   coman:
  1812.       cd man ; make co RCSVER=$(RCSVER)
  1813.   
  1814. ! # Remove anything that can be rebuilt
  1815. ! # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1816.   clean:
  1817.       rm -f $(BINARIES) $(SCRIPTS) $(SUPPORT) $(LPBIN) $(LPDBIN) psfdouble
  1818.       rm -f *.o 
  1819.       rm -f *.B
  1820.       rm -f *.doc
  1821.   
  1822.  
  1823.  $ $ $ end of patch 1/2 $ $ $
  1824.  
  1825. exit 0 # Just in case...
  1826.