~ubuntu-branches/ubuntu/raring/xfig/raring

« back to all changes in this revision

Viewing changes to f_readeps.c

  • Committer: Bazaar Package Importer
  • Author(s): Daniel T Chen
  • Date: 2007-05-20 23:33:59 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20070520233359-4ejk0ave70m2ihlz
Tags: 1:3.2.5-rel-1ubuntu1
* Merge from Debian unstable. Remaining Ubuntu change:
  - .desktop added.
* Modify Maintainer value to match Debian-Maintainer-Field Spec

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
#include "w_msgpanel.h"
23
23
#include "w_setup.h"
24
24
 
25
 
int         _read_pcx();
 
25
#include "w_util.h"
 
26
 
 
27
int         _read_pcx(FILE *pcxfile, F_pic *pic);
26
28
Boolean     bitmap_from_gs();
27
29
 
28
30
/* read a PDF file */
29
31
 
 
32
 
 
33
int read_epsf_pdf (FILE *file, int filetype, F_pic *pic, Boolean pdf_flag);
 
34
void lower (char *buf);
 
35
int hex (char c);
 
36
 
30
37
int
31
 
read_pdf(file, filetype, pic)
32
 
    FILE       *file;
33
 
    int         filetype;
34
 
    F_pic      *pic;
 
38
read_pdf(FILE *file, int filetype, F_pic *pic)
35
39
{
36
40
    return read_epsf_pdf(file, filetype, pic, True);
37
41
}
43
47
*/
44
48
 
45
49
int
46
 
read_epsf(file, filetype, pic)
47
 
    FILE       *file;
48
 
    int         filetype;
49
 
    F_pic      *pic;
 
50
read_epsf(FILE *file, int filetype, F_pic *pic)
50
51
{
51
52
    return read_epsf_pdf(file, filetype, pic, False);
52
53
}
53
54
 
54
55
int
55
 
read_epsf_pdf(file, filetype, pic, pdf_flag)
56
 
    FILE       *file;
57
 
    int         filetype;
58
 
    F_pic      *pic;
59
 
    Boolean     pdf_flag;
 
56
read_epsf_pdf(FILE *file, int filetype, F_pic *pic, Boolean pdf_flag)
60
57
{
61
58
    int         nbitmap;
62
59
    Boolean     bitmapz;
224
221
}
225
222
 
226
223
int
227
 
hex(c)
228
 
    char        c;
 
224
hex(char c)
229
225
{
230
226
    if (isdigit(c))
231
227
        return (c - 48);
233
229
        return (c - 87);
234
230
}
235
231
 
236
 
lower(buf)
237
 
    char       *buf;
 
232
void lower(char *buf)
238
233
{
239
234
    while (*buf) {
240
235
        if (isupper(*buf))
255
250
    int         urx, llx, ury, lly;
256
251
    int         pdf_flag;
257
252
{
 
253
    static      tempseq = 0;
258
254
    char        buf[300];
259
255
    FILE       *tmpfp, *pixfile, *gsfile;
260
256
    char       *psnam, *driver;
283
279
            fputs(buf, tmpfp);
284
280
        fclose(tmpfp);
285
281
    }
286
 
    /* make name /TMPDIR/xfig-pic.pix */
287
 
    sprintf(pixnam, "%s/%s%06d.pix", TMPDIR, "xfig-pic", getpid());
 
282
    /* make name /TMPDIR/xfig-pic######.pix */
 
283
    sprintf(pixnam, "%s/%s%06d.pix", TMPDIR, "xfig-pic", tempseq);
288
284
    /* and file name for any error messages from gs */
289
 
    sprintf(errnam, "%s/%s%06d.err", TMPDIR, "xfig-pic", getpid());
 
285
    sprintf(errnam, "%s/%s%06d.err", TMPDIR, "xfig-pic", tempseq);
 
286
    tempseq++;
 
287
 
290
288
    /* generate gs command line */
291
289
    /* for monochrome, use pbm */
292
290
    if (tool_cells <= 2 || appres.monochrome) {
352
350
    fprintf(gsfile, "quit\n");
353
351
 
354
352
    status = pclose(gsfile);
 
353
 
355
354
    if (filetype == 1)
356
355
        unlink(tmpfile);
357
356
    /* error return from ghostscript, look in error file */