t2p.c

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