1*33668Sjaap891a
2*33668Sjaap#ifdef XMOD
3*33668Sjaap	fontheight = n;
4*33668Sjaap#endif
5*33668Sjaap.
6*33668Sjaap592a
7*33668Sjaap#ifdef XMOD
8*33668Sjaapincludefile(filenm)
9*33668Sjaapchar *filenm; {
10*33668Sjaap
11*33668Sjaap	FILE *inf;
12*33668Sjaap	int ch, c1, c2, firstch = 0;
13*33668Sjaap
14*33668Sjaap	if (!(inf = fopen(filenm, "r"))) {
15*33668Sjaap		fprintf(stderr, "psdit: fopen(%s): ", filenm);
16*33668Sjaap		perror();
17*33668Sjaap		exit(1);
18*33668Sjaap	}
19*33668Sjaap	c1 = fgetc(inf); c2 = fgetc(inf);
20*33668Sjaap	if (c1 != '%' || c2 != '!')
21*33668Sjaap		fprintf(stderr, "psdit: %s not a postscript file.\n", filenm),
22*33668Sjaap		exit(1);
23*33668Sjaap
24*33668Sjaap	fputs("%!", tf);
25*33668Sjaap	while ((ch = fgetc(inf)) != EOF) {
26*33668Sjaap		fputc(ch, tf);
27*33668Sjaap		if (firstch && ch == '%') {
28*33668Sjaap			/* we have to double leading '%'s */
29*33668Sjaap			fputc('%', tf);
30*33668Sjaap		}
31*33668Sjaap		firstch = (ch == '\n');
32*33668Sjaap	}
33*33668Sjaap	fclose(inf);
34*33668Sjaap}
35*33668Sjaap#endif
36*33668Sjaap.
37*33668Sjaap587a
38*33668Sjaap#ifdef XMOD
39*33668Sjaap	case 'X': {		/* \X command from ditroff */
40*33668Sjaap            int last;
41*33668Sjaap	    char largebuf[128];
42*33668Sjaap	    fscanf (fp, "%1s", str);
43*33668Sjaap	    switch (str[0]) {
44*33668Sjaap		case 'p' :
45*33668Sjaap		    FlushShow(0);MoveTo();DoMove();
46*33668Sjaap		    fgets(largebuf, sizeof(largebuf), fp);
47*33668Sjaap		    last = strlen(largebuf) - 1;
48*33668Sjaap		    if (last >= 0 && largebuf[last] == '\n') {
49*33668Sjaap			ungetc('\n', fp);
50*33668Sjaap			largebuf[last] = ' ';
51*33668Sjaap		    }
52*33668Sjaap		    fputs(largebuf, tf);
53*33668Sjaap		    putc('\n', tf);
54*33668Sjaap		    break;
55*33668Sjaap		case 'f' :
56*33668Sjaap		    FlushShow(0);MoveTo();DoMove();
57*33668Sjaap		    if (fscanf(fp, "%s", largebuf) == 1) {
58*33668Sjaap			char *nl = (char *) index(largebuf, '\n');
59*33668Sjaap			if (nl) *nl = '\0';
60*33668Sjaap			includefile(largebuf);
61*33668Sjaap		    } else
62*33668Sjaap			fprintf(stderr, "warning - include cmd w/o path.\n");
63*33668Sjaap		    break;
64*33668Sjaap	    }
65*33668Sjaap	}
66*33668Sjaap	break;
67*33668Sjaap#endif
68*33668Sjaap.
69*33668Sjaap4a
70*33668Sjaap# define XMOD
71*33668Sjaap.
72*33668Sjaapw psdit.c.new
73*33668Sjaapq
74