t2p.c

changeset 12
c3e2c2344560
parent 10
3184d26a9596
child 14
4c261fbf8c77
     1.1 diff -r 30d18cf8bb67 -r c3e2c2344560 t2p.c
     1.2 --- a/t2p.c	Sat Dec 29 17:45:43 2001 +0000
     1.3 +++ b/t2p.c	Sat Dec 29 18:59:47 2001 +0000
     1.4 @@ -1,7 +1,7 @@
     1.5  /*
     1.6   * tiffg4: reencode a bilevel TIFF file as a single-strip TIFF Class F Group 4
     1.7   * Main program
     1.8 - * $Id: t2p.c,v 1.1 2001/12/29 09:44:24 eric Exp $
     1.9 + * $Id: t2p.c,v 1.2 2001/12/29 10:59:47 eric Exp $
    1.10   * Copyright 2001 Eric Smith <eric@brouhaha.com>
    1.11   *
    1.12   * This program is free software; you can redistribute it and/or modify
    1.13 @@ -32,6 +32,7 @@
    1.14  #include "tiff2pdf.h"
    1.15  
    1.16  
    1.17 +FILE *yyin;
    1.18  TIFF *in;
    1.19  panda_pdf *out;
    1.20  
    1.21 @@ -206,10 +207,14 @@
    1.22  }
    1.23  
    1.24  
    1.25 +void yyerror (char *s)
    1.26 +{
    1.27 +  fprintf (stderr, "%s\n", s);
    1.28 +}
    1.29 +
    1.30  
    1.31  int main (int argc, char *argv[])
    1.32  {
    1.33 -  FILE *spec;
    1.34    int result = 0;
    1.35  
    1.36    panda_init ();
    1.37 @@ -221,8 +226,8 @@
    1.38        goto fail;
    1.39      }
    1.40  
    1.41 -  spec = fopen (argv [2], "r");
    1.42 -  if (! spec)
    1.43 +  yyin = fopen (argv [2], "r");
    1.44 +  if (! yyin)
    1.45      {
    1.46        fprintf (stderr, "can't open spec file '%s'\n", argv [2]);
    1.47        result = 3;
    1.48 @@ -232,6 +237,7 @@
    1.49    yyparse ();
    1.50  
    1.51   fail:
    1.52 +  fclose (yyin);
    1.53    close_tiff_input_file ();
    1.54    close_pdf_output_file ();
    1.55    return (result);