summaryrefslogtreecommitdiff
path: root/graphics/psfig/unsupported/dospecial.frag
blob: 90aa1cd5cbcf2cd6341918a509bd3e2a59cdd290 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*
 * This is a code fragment from a patched version of dospecial.c
 * dvips version 5.47
 *
 * The changed lines are between the TJD comments.
 * The patch allows for zcat input to plotfile commands.
 *
 */


   if (strncmp(p, "ps:", 3)==0) {
        hvpos() ;
        psflush() ; /* now anything can happen. */
        if (p[3]==':') {
           if (strncmp(p+4, "[begin]", 7) == 0)
              nlcmdout(&p[11]);
           else if (strncmp(p+4, "[end]", 5) == 0)
              nlcmdout(&p[9]);
           else nlcmdout(&p[4]);
        } else if (strncmp(p+3, " plotfile ", 10) == 0) {
           char *sfp ;
           p += 13;
	   /*
	    *  Fixed to allow popen input for plotfile
	    *  TJD 10/20/91
	    */
	   while (*p == ' ') p++;
	   if (*p == '"') {
	     p++;
	     for (sfp = p; *sfp && *sfp != '"'; sfp++) ;
           } else {
	     for (sfp = p; *sfp && *sfp != ' '; sfp++) ;
           }
           *sfp = '\0';
	   if (*p == '`') 
	     figcopyfile(p+1, 1);
	   else
	     figcopyfile (p, 0);
	   /* End TJD changes */
        } else
           nlcmdout(&p[3]);
        return;
   }