home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.3.4.17 [SPARC, PA-RISC] / nextstep33_risc.iso / NextLibrary / TeX / tex / src / dvips / dospecial.c < prev    next >
C/C++ Source or Header  |  1993-01-18  |  18KB  |  649 lines

  1. /*
  2.  *   This routine handles special commands;
  3.  *   predospecial() is for the prescan, dospecial() for the real thing.
  4.  */
  5. #include "dvips.h" /* The copyright notice in that file is included too! */
  6.  
  7. #include <ctype.h>
  8. extern int atoi();
  9. extern void fil2ps();
  10. extern FILE *search();
  11. extern int system();
  12. /*
  13.  *   These are the external routines called:
  14.  */
  15. /**/
  16. #ifdef TPIC
  17. /*
  18.  * Fri Mar  9 1990  jourdan@minos.inria.fr (MJ)
  19.  * Upgraded to accommodate tpic release 2.0 extended output language.
  20.  * Should prove upward compatible!
  21.  */
  22. extern void setPenSize();
  23. extern void flushPath();
  24. extern void flushDashed();
  25. extern void flushDashed();
  26. extern void addPath();
  27. extern void arc();
  28. extern void flushSpline();
  29. extern void shadeLast();
  30. extern void whitenLast();
  31. extern void blackenLast();
  32. extern void SetShade() ;
  33. #endif
  34. extern shalfword dvibyte() ;
  35. extern int add_header() ;
  36. extern void hvpos() ;
  37. extern void figcopyfile() ;
  38. extern void nlcmdout() ;
  39. extern void cmdout() ;
  40. extern void numout() ;
  41. extern void scout() ;
  42. extern void stringend() ;
  43. extern void error() ;
  44. extern void psflush() ;
  45. extern void emspecial() ;
  46. /* IBM: color - begin */
  47. extern void pushcolor() ;
  48. extern void popcolor() ;
  49. extern void resetcolorstack() ;
  50. extern void background() ;
  51. /* IBM: color - end */
  52. extern char errbuf[] ;
  53. extern shalfword linepos;
  54. extern Boolean usesspecial ;
  55. extern Boolean usescolor ;   /* IBM: color */
  56. extern int landscape ;
  57. extern char *paperfmt ;
  58. extern char *nextstring;
  59. extern char *maxstring;
  60. extern char *oname;
  61. extern FILE *bitfile;
  62. extern int quiet;
  63. extern fontdesctype *curfnt ;
  64. extern int actualdpi ;
  65. extern int vactualdpi ;
  66. extern integer hh, vv;
  67. extern int lastfont ;
  68. extern real conv ;
  69. extern real vconv ;
  70. extern integer hpapersize, vpapersize ;
  71. extern Boolean pprescan ;
  72. extern char *figpath ;
  73. extern int prettycolumn ;
  74. extern Boolean disablecomments ;
  75.  
  76. #ifdef DEBUG
  77. extern integer debug_flag;
  78. #endif
  79. extern void scanfontcomments() ;
  80. extern void handlepapersize() ;
  81.  
  82. static int specialerrors = 20 ;
  83.  
  84. struct bangspecial {
  85.    struct bangspecial *next ;
  86.    char actualstuff[1] ; /* more space will actually be allocated */
  87. } *bangspecials = NULL ;
  88.  
  89. void specerror(s)
  90. char *s ;
  91. {
  92.    if (specialerrors > 0) {
  93.       error(s) ;
  94.       specialerrors-- ;
  95.    } else if (specialerrors == 0) {
  96.       error("more errors in special, being ignored . . .") ;
  97.       specialerrors-- ;
  98.    }
  99. }
  100.  
  101. static void trytobreakout(p)
  102. register char *p ;
  103. {
  104.    register int i ;
  105.    register int instring = 0 ;
  106.    int lastc = 0 ;
  107.  
  108.    i = 0 ;
  109.    (void)putc('\n', bitfile) ;
  110.    while (*p) {
  111.       if (i > 65 && *p == ' ' && instring == 0) {
  112.          (void)putc('\n', bitfile) ;
  113.          i = 0 ;
  114.       } else {
  115.          (void)putc(*p, bitfile) ;
  116.          i++ ;
  117.       }
  118.       if (*p == '(' && lastc != '\\')
  119.          instring = 1 ;
  120.       else if (*p == ')' && lastc != '\\')
  121.          instring = 0 ;
  122.       lastc = *p ;
  123.       p++ ;
  124.    }
  125.    (void)putc('\n', bitfile) ;
  126. }
  127.  
  128. static void dobs(q)
  129. register struct bangspecial *q ;
  130. {
  131.    if (q) {
  132.       dobs(q->next) ;
  133.       trytobreakout(q->actualstuff) ;
  134.    }
  135. }
  136.  
  137. void
  138. outbangspecials() {
  139.    if (bangspecials) {
  140.       cmdout("TeXDict") ;
  141.       cmdout("begin") ;
  142.       cmdout("@defspecial\n") ;
  143.       dobs(bangspecials) ;
  144.       cmdout("\n@fedspecial") ;
  145.       cmdout("end") ;
  146.    }
  147. }
  148.  
  149. /* We recommend that new specials be handled by the following general
  150.  * (and extensible) scheme, in which the user specifies one or more
  151.  * `key=value' pairs separated by spaces.
  152.  * The known keys are given in KeyTab; they take values
  153.  * of one of the following types:
  154.  *
  155.  * None: no value, just a keyword (in which case the = sign is omitted)
  156.  * String: the value should be "<string without double-quotes"
  157.  *                          or '<string without single-quotes'
  158.  * Integer: the value should be a decimal integer (%d format)
  159.  * Number: the value should be a decimal integer or real (%f format)
  160.  * Dimension: like Number, but will be multiplied by the scaledsize
  161.  *       of the current font and converted to default PostScript units
  162.  * (Actually, strings are allowed in all cases; the delimiting quotes
  163.  *  are simply stripped off if present.)
  164.  *
  165.  */
  166.  
  167. typedef enum {None, String, Integer, Number, Dimension} ValTyp;
  168. typedef struct {
  169.    char    *Entry;
  170.    ValTyp  Type;
  171. } KeyDesc;
  172.  
  173. #define NKEYS    (sizeof(KeyTab)/sizeof(KeyTab[0]))
  174.  
  175. KeyDesc KeyTab[] = {{"psfile",  String}, /* j==0 in the routine below */
  176.                     {"ifffile", String}, /* j==1 */
  177.                     {"tekfile", String}, /* j==2 */
  178.                     {"hsize",   Number},
  179.                     {"vsize",   Number},
  180.                     {"hoffset", Number},
  181.                     {"voffset", Number},
  182.                     {"hscale",  Number},
  183.                     {"vscale",  Number},
  184.                     {"angle",   Number},
  185.                     {"llx", Number},
  186.                     {"lly", Number},
  187.                     {"urx", Number},
  188.                     {"ury", Number},
  189.                     {"rwi", Number},
  190.                     {"rhi", Number},
  191.                     {"clip", None}};
  192.  
  193. #ifdef VMS
  194. #define Tolower tolower
  195. #else
  196. #ifdef VMCMS    /* IBM: VM/CMS */
  197. #define Tolower __tolower
  198. #else
  199. #ifdef MVSXA    /* IBM: MVS/XA */
  200. #define Tolower __tolower
  201. #else
  202. /*
  203.  * compare strings, ignore case
  204.  */
  205. char Tolower(c)
  206. register char c ;
  207. {
  208.    if ('A' <= c && c <= 'Z')
  209.       return(c+32) ;
  210.    else
  211.       return(c) ;
  212. }
  213. #endif
  214. #endif  /* IBM: VM/CMS */
  215. #endif
  216. int IsSame(a, b)
  217. char *a, *b;
  218. {
  219.    for( ; *a != '\0'; ) {
  220.       if( Tolower(*a) != Tolower(*b) ) 
  221.          return( 0 );
  222.       a++ ;
  223.       b++ ;
  224.    }
  225.    return( *b == '\0' );
  226. }
  227.  
  228. char *KeyStr, *ValStr ; /* Key and String values found */
  229. long ValInt ; /* Integer value found */
  230. float ValNum ; /* Number or Dimension value found */
  231.  
  232. char  *GetKeyVal(str,tno) /* returns NULL if none found, else next scan point */
  233.    char *str ; /* starting point for scan */
  234.    int  *tno ; /* table entry number of keyword, or -1 if keyword not found */
  235. {
  236.    register char *s ;
  237.    register int i ;
  238.    register char t ;
  239.  
  240.    for (s=str; *s <= ' ' && *s; s++) ; /* skip over blanks */
  241.    if (*s == '\0')
  242.       return (NULL) ;
  243.    KeyStr = s ;
  244.    while (*s>' ' && *s!='=') s++ ;
  245.    if (t = *s)
  246.       *s++ = 0 ;
  247.  
  248.    for(i=0; i<NKEYS; i++)
  249.       if( IsSame(KeyStr, KeyTab[i].Entry) )
  250.          goto found ;
  251.    *tno = -1;
  252.    return (s) ;
  253.  
  254. found: *tno = i ;
  255.    if (KeyTab[i].Type == None)
  256.       return (s) ;
  257.  
  258.    if (t && t <= ' ') {
  259.       for (; *s <= ' ' && *s; s++) ; /* now look for the value part */
  260.       if ((t = *s)=='=')
  261.          s++ ;
  262.    }
  263.    ValStr = "" ;
  264.    if ( t == '=' ) {
  265.       while (*s <= ' ' && *s)
  266.          s++ ;
  267.       if (*s=='\'' || *s=='\"')
  268.          t = *s++ ;               /* get string delimiter */
  269.       else t = ' ' ;
  270.       ValStr = s ;
  271.       while (*s!=t && *s)
  272.          s++ ;
  273.       if (*s)
  274.          *s++ = 0 ;
  275.    }
  276.    switch (KeyTab[i].Type) {
  277.  case Integer:
  278.       if(sscanf(ValStr,"%ld",&ValInt)!=1) {
  279.           sprintf(errbuf,"Non-integer value (%s) given for keyword %s",
  280.               ValStr, KeyStr) ;
  281.           specerror(errbuf) ;
  282.           ValInt = 0 ;
  283.       }
  284.       break ;
  285.  case Number:
  286.  case Dimension:
  287.       if(sscanf(ValStr,"%f",&ValNum)!=1) {  
  288.           sprintf(errbuf,"Non-numeric value (%s) given for keyword %s",
  289.               ValStr, KeyStr) ;
  290.           specerror(errbuf) ;
  291.           ValNum = 0.0 ;
  292.       }
  293.       if (KeyTab[i].Type==Dimension) {
  294.          if (curfnt==NULL)
  295.             error("! No font selected") ;
  296.          ValNum = ValNum * ((double)curfnt->scaledsize) * conv * 72 / DPI ;
  297.       }
  298.       break ;
  299.  default: break ;
  300.    }
  301.    return (s) ;
  302. }
  303.  
  304. /*
  305.  *   Now our routines.  We get the number of bytes specified and place them
  306.  *   into the string buffer, and then parse it. Numerous conventions are
  307.  *   supported here for historical reasons.
  308.  */
  309.  
  310. void predospecial(numbytes, scanning)
  311. integer numbytes ;
  312. Boolean scanning ;
  313. {
  314.    register char *p = nextstring ;
  315.    register int i = 0 ;
  316.    int j ;
  317.  
  318.    if (nextstring + numbytes > maxstring)
  319.       error("! out of string space in predospecial") ;
  320.    for (i=numbytes; i>0; i--)
  321. #ifdef VMCMS /* IBM: VM/CMS */
  322.       *p++ = ascii2ebcdic[(char)dvibyte()] ;
  323. #else
  324. #ifdef MVSXA /* IBM: MVS/XA */
  325.       *p++ = ascii2ebcdic[(char)dvibyte()] ;
  326. #else
  327.       *p++ = (char)dvibyte() ;
  328. #endif /* IBM: VM/CMS */
  329. #endif
  330.    if (pprescan)
  331.       return ;
  332.    while (p[-1] <= ' ' && p > nextstring)
  333.       p-- ; /* trim trailing blanks */
  334.    if (p==nextstring) return ; /* all blank is no-op */
  335.    *p = 0 ;
  336.    p = nextstring ;
  337.    while (*p <= ' ')
  338.       p++ ;
  339. #ifdef DEBUG
  340.    if (dd(D_SPECIAL))
  341.       (void)fprintf(stderr, "Preprocessing special: %s\n", p) ;
  342. #endif
  343.  
  344. /*
  345.  *   We use strncmp() here to also pass things like landscape()
  346.  *   or landscape: or such.
  347.  */
  348.  
  349.    if (strncmp(p, "landscape", 9)==0) {
  350.       if (hpapersize || vpapersize)
  351.          error(
  352.              "both landscape and papersize specified:  ignoring landscape") ;
  353.       else
  354.          landscape = 1 ;
  355.       return ;
  356.    } else if (strncmp(p, "papersize", 9)==0) {
  357.       p += 9 ;
  358.       while (*p == '=' || *p == ' ')
  359.          p++ ;
  360.       if (hpapersize == 0 || vpapersize == 0) {
  361.          if (landscape) {
  362.             error(
  363.              "both landscape and papersize specified:  ignoring landscape") ;
  364.             landscape = 0 ;
  365.          }
  366.          handlepapersize(p, &hpapersize, &vpapersize) ;
  367.       }
  368.       return ;
  369.    }
  370.    if (strncmp(p, "xtex:", 5)==0) return ;
  371.    usesspecial = 1 ;  /* now the special prolog will be sent */
  372.    if (strncmp(p, "header", 6)==0) {
  373.       char *q ;
  374.       p += 6 ;
  375.       while ((*p <= ' ' || *p == '=' || *p == '(') && *p != 0)
  376.          p++ ;
  377.       q = p ;  /* we will remove enclosing parentheses */
  378.       p = p + strlen(p) - 1 ;
  379.       while ((*p <= ' ' || *p == ')') && p >= q)
  380.          p-- ;
  381.       p[1] = 0 ;
  382.       if (p >= q)
  383.          (void)add_header(q) ;
  384.    }
  385. /* IBM: color - added section here for color header and color history */
  386.    if (strncmp(p, "background", 10) == 0) {
  387.       usescolor = 1 ;
  388.       p +=11 ;
  389.       while ( *p <= ' ' ) p++ ;
  390.       background(p) ;
  391.    }
  392.    if (strncmp(p, "color", 5) == 0) {
  393.       usescolor = 1 ;
  394.       p += 6 ;
  395.       while ( *p <= ' ' ) p++ ;
  396.       if (strncmp(p, "push", 4) == 0 ) {
  397.          p += 5 ;
  398.          while ( *p <= ' ' ) p++ ;
  399.          pushcolor(p, 0) ;
  400.       } else if (strncmp(p, "pop", 3) == 0 ) {
  401.          popcolor(0) ;
  402.       } else {
  403.          resetcolorstack(p,0) ;
  404.       }
  405.    }   /* IBM: color - end changes */
  406.    else if (*p == '!') {
  407.       register struct bangspecial *q ;
  408.       p++ ;
  409.       q = (struct bangspecial *)mymalloc((integer)
  410.                          (sizeof(struct bangspecial) + strlen(p))) ;
  411.       (void)strcpy(q->actualstuff, p) ;
  412.       q->next = bangspecials ;
  413.       bangspecials = q ;
  414.    } else if (scanning && *p != '"' &&
  415.           (p=GetKeyVal(p, &j)) != NULL && j==0)
  416.       scanfontcomments(ValStr) ;
  417. }
  418.  
  419. int maccess(s)
  420. char *s ;
  421. {
  422.    FILE *f = search(figpath, s, "r") ;
  423.    if (f)
  424.       fclose(f) ;
  425.    return (f != 0) ;
  426. }
  427.  
  428. char *tasks[] = { 0, "iff2ps", "tek2ps" } ;
  429.  
  430. void dospecial(numbytes)
  431. integer numbytes ;
  432. {
  433.    register char *p = nextstring ;
  434.    register int i = 0 ;
  435.    int j, systemtype = 0 ;
  436.    char psfile[100] ; 
  437.    char cmdbuf[100] ; 
  438.    register char *q ;
  439.    Boolean psfilewanted = 1 ;
  440.    char *task = 0 ;
  441.  
  442.    if (nextstring + i > maxstring)
  443.       error("! out of string space in dospecial") ;
  444.    for (i=numbytes; i>0; i--)
  445. #ifdef VMCMS /* IBM: VM/CMS */
  446.       *p++ = ascii2ebcdic[(char)dvibyte()] ;
  447. #else
  448. #ifdef MVSXA /* IBM: MVS/XA */
  449.       *p++ = ascii2ebcdic[(char)dvibyte()] ;
  450. #else
  451.       *p++ = (char)dvibyte() ;
  452. #endif  /* IBM: VM/CMS */
  453. #endif
  454.    while (p[-1] <= ' ' && p > nextstring)
  455.       p-- ; /* trim trailing blanks */
  456.    if (p==nextstring) return ; /* all blank is no-op */
  457.    *p = 0 ;
  458.    p = nextstring ;
  459.    while (*p <= ' ')
  460.       p++ ;
  461. #ifdef DEBUG
  462.    if (dd(D_SPECIAL))
  463.       (void)fprintf(stderr, "Processing special: %s\n", p) ;
  464. #endif
  465.  
  466.    if (strncmp(p, "em:", 3)==0) {    /* emTeX specials in emspecial.c */
  467.     emspecial(p);
  468.     return;
  469.    }
  470.  
  471.    if (strncmp(p, "ps:", 3)==0) {
  472.         psflush() ; /* now anything can happen. */
  473.         if (p[3]==':') {
  474.            if (strncmp(p+4, "[begin]", 7) == 0) {
  475.               hvpos() ;
  476.               trytobreakout(&p[11]);
  477.            } else if (strncmp(p+4, "[end]", 5) == 0)
  478.               trytobreakout(&p[9]);
  479.            else trytobreakout(&p[4]);
  480.         } else if (strncmp(p+3, " plotfile ", 10) == 0) {
  481.              char *sfp ;
  482.              hvpos() ;
  483.              p += 13;
  484.            /*
  485.             *  Fixed to allow popen input for plotfile
  486.             *  TJD 10/20/91
  487.             */
  488.            while (*p == ' ') p++;
  489.            if (*p == '"') {
  490.              p++;
  491.              for (sfp = p; *sfp && *sfp != '"'; sfp++) ;
  492.            } else {
  493.              for (sfp = p; *sfp && *sfp != ' '; sfp++) ;
  494.            }
  495.            *sfp = '\0';
  496.            if (*p == '`') 
  497.              figcopyfile(p+1, 1);
  498.            else
  499.              figcopyfile (p, 0);
  500.            /* End TJD changes */
  501.         } else {
  502.            hvpos() ;
  503.            trytobreakout(&p[3]);
  504.         }
  505.         return;
  506.    }
  507.    if (strncmp(p, "landscape", 9)==0 || strncmp(p, "header", 6)==0 ||
  508.        strncmp(p, "papersize", 9)==0 || *p=='!')
  509.       return ; /* already handled in prescan */
  510. /* IBM: color - begin changes */
  511.    if ( strncmp(p, "background", 10) == 0 )
  512.       return ; /* already handled in prescan */
  513.    if (strncmp(p, "color", 5) == 0) {
  514.       p += 6 ;
  515.       while ( *p <= ' ' ) p++ ;
  516.       if (strncmp(p, "push", 4) == 0 ) {
  517.          p += 4 ;
  518.          while ( *p <= ' ' ) p++ ;
  519.          pushcolor(p,1);
  520.       } else if (strncmp(p, "pop", 3) == 0 ) {
  521.          popcolor(1) ;
  522.       } else {
  523.          resetcolorstack(p,1) ;
  524.       }
  525.       return ;
  526.    } /* IBM: color - end changes*/
  527. #ifdef TPIC
  528. /* ordered as in tpic 2.0 documentation for ease of cross-referencing */
  529.    if (strncmp(p, "pn ", 3) == 0) {setPenSize(p+2); return;}
  530.    if (strncmp(p, "pa ", 3) == 0) {addPath(p+2); return;}
  531.    if (strcmp(p, "fp") == 0) {flushPath(0); return;}
  532.    if (strcmp(p, "ip") == 0) {flushPath(1); return;} /* tpic 2.0 */
  533.    if (strncmp(p, "da ", 3) == 0) {flushDashed(p+2, 0); return;}
  534.    if (strncmp(p, "dt ", 3) == 0) {flushDashed(p+2, 1); return;}
  535.    if (strcmp(p, "sp") == 0) {flushSpline(p+2); return;} /* tpic 2.0 */
  536.    if (strncmp(p, "sp ", 3) == 0) {flushSpline(p+3); return;} /* tpic 2.0 */
  537.    if (strncmp(p, "ar ", 3) == 0) {arc(p+2, 0); return;} /* tpic 2.0 */
  538.    if (strncmp(p, "ia ", 3) == 0) {arc(p+2, 1); return;} /* tpic 2.0 */
  539.    if (strcmp(p, "sh") == 0) {shadeLast(p+2); return;} /* tpic 2.0 */
  540.    if (strncmp(p, "sh ", 3) == 0) {shadeLast(p+3); return;} /* tpic 2.0 */
  541.    if (strcmp(p, "wh") == 0) {whitenLast(); return;}
  542.    if (strcmp(p, "bk") == 0) {blackenLast(); return;}
  543.    if (strncmp(p, "tx ", 3) == 0) {SetShade(p+3); return;}
  544. #endif
  545.    if (*p == '"') {
  546.       hvpos();
  547.       cmdout("@beginspecial") ;
  548.       cmdout("@setspecial") ;
  549.       trytobreakout(p+1) ;
  550.       cmdout("\n@endspecial") ;
  551.       return ;
  552.    }
  553.  
  554. /* At last we get to the key/value conventions */
  555.    psfile[0] = '\0';
  556.    hvpos();
  557.    cmdout("@beginspecial");
  558.  
  559.    while( (p=GetKeyVal(p,&j)) != NULL )
  560.       switch (j) {
  561.  case -1: /* for compatability with old conventions, we allow a file name
  562.            * to be given without the 'psfile=' keyword */
  563.          if (!psfile[0] && maccess(KeyStr)==0) /* yes we can read it */
  564.              (void)strcpy(psfile,KeyStr) ;
  565.          else {
  566.            sprintf(errbuf, "Unknown keyword (%s) in \\special will be ignored",
  567.                               KeyStr) ;
  568.            specerror(errbuf) ;
  569.          }
  570.          break ;
  571.  case 0: case 1: case 2: /* psfile */
  572.          if (psfile[0]) {
  573.            sprintf(errbuf, "More than one \\special %s given; %s ignored", 
  574.                     "psfile",  ValStr) ;
  575.            specerror(errbuf) ;
  576.          }
  577.          else (void)strcpy(psfile,ValStr) ;
  578.          task = tasks[j] ;
  579.          break ;
  580.  default: /* most keywords are output as PostScript procedure calls */
  581.          if (KeyTab[j].Type == Integer)
  582.             numout((integer)ValInt);
  583.          else if (KeyTab[j].Type == String)
  584.             for (q=ValStr; *q; q++)
  585.                scout(*q) ;
  586.          else if (KeyTab[j].Type == None) ;
  587.          else { /* Number or Dimension */
  588.             ValInt = (integer)(ValNum<0? ValNum-0.5 : ValNum+0.5) ;
  589.             if (ValInt-ValNum < 0.001 && ValInt-ValNum > -0.001)
  590.                 numout((integer)ValInt) ;
  591.             else {
  592.                (void)sprintf(cmdbuf, "%f", ValNum) ;
  593.                cmdout(cmdbuf) ;
  594.             }
  595.          }
  596.       (void)sprintf(cmdbuf, "@%s", KeyStr);
  597.       cmdout(cmdbuf) ;
  598.       }
  599.  
  600.    cmdout("@setspecial");
  601.  
  602.    if(psfile[0]) {
  603.       if (task == 0) {
  604.          systemtype = (psfile[0]=='`') ;
  605.          figcopyfile(psfile+systemtype, systemtype);
  606.       } else {
  607.          fil2ps(task, psfile) ;
  608.       }
  609.    } else if (psfilewanted)
  610.       specerror("No \\special psfile was given; figure will be blank") ;
  611.  
  612.    cmdout("@endspecial");
  613. }
  614.  
  615. extern char realnameoffile[] ;
  616. extern char *pictpath ;
  617.  
  618. void fil2ps(task, iname)
  619. char *task, *iname ;
  620. {
  621.    char cmd[400] ;
  622.    FILE *f ;
  623.    if (f=search(pictpath, iname, "r")) {
  624.       fclose(f) ;
  625.    } else {
  626.       fprintf(stderr, " couldn't open %s\n", iname) ;
  627.       return ;
  628.    }
  629.    if (!quiet) {
  630.       fprintf(stderr, " [%s", realnameoffile) ;
  631.       fflush(stderr) ;
  632.    }
  633.    if (oname && oname[0] && oname[0] != '-') {
  634.       putc(10, bitfile) ;
  635.       fclose(bitfile) ;
  636.       sprintf(cmd, "%s -f %s %s", task, realnameoffile, oname) ;
  637.       system(cmd) ;
  638.       if ((bitfile=fopen(oname, "a"))==NULL)
  639.          error("! couldn't reopen PostScript file") ;
  640.       linepos = 0 ;
  641.    } else {
  642.       sprintf(cmd, "%s -f %s", task, realnameoffile) ;
  643.       system(cmd) ;
  644.    }
  645.    if (!quiet)
  646.       fprintf(stderr, "]") ;
  647. }
  648.  
  649.