added missing member initialization.
[swftools.git] / pdf2swf / ttf2pt1 / runt1asm.c
blob58c4cad8c03fe0bb16cfbb39412c8e2751361902
1 /*
2 * Wrap-around code to either compile in t1asm or call it externally
4 * Copyright (C) 2000 by Sergey Babkin
5 * Copyright (C) 2000 by The TTF2PT1 Project
7 * See COPYRIGHT for full license
8 */
10 #ifdef EXTERNAL_T1ASM
12 #include <stdio.h>
13 #include <errno.h>
15 FILE *ifp;
16 FILE *ofp;
18 int
19 runt1asm(
20 int pfbflag
23 char *cmd;
24 int id, od;
25 int error;
27 /* first make a copy in case some of then is already stdin/stdout */
28 if(( id = dup(fileno(ifp)) )<0) {
29 perror("** Re-opening input file for t1asm");
30 exit(1);
32 if(( od = dup(fileno(ofp)) )<0) {
33 perror("** Re-opening output file for t1asm");
34 exit(1);
36 fclose(ifp); fclose(ofp);
37 close(0);
38 if(( dup(id) )!=0) {
39 perror("** Re-directing input file for t1asm");
40 exit(1);
42 close(1);
43 if(( dup(od) )!=1) {
44 perror("** Re-directing output file for t1asm");
45 exit(1);
47 close(id); close(od);
49 if(pfbflag)
50 error = execlp("t1asm", "t1asm", "-b", NULL);
51 else
52 error = execlp("t1asm", "t1asm", NULL);
54 perror("** Calling t1asm");
56 exit(1);
59 #else
60 # include "t1asm.c"
61 #endif