t2p.c

changeset 17
d4699dfddcc0
parent 14
4c261fbf8c77
child 18
3de372e4b230
     1.1 diff -r dbf5e39b1658 -r d4699dfddcc0 t2p.c
     1.2 --- a/t2p.c	Sun Dec 30 16:29:50 2001 +0000
     1.3 +++ b/t2p.c	Sun Dec 30 16:29:50 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.3 2001/12/29 20:16:46 eric Exp $
     1.9 + * $Id: t2p.c,v 1.4 2001/12/30 08:29:50 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 @@ -29,12 +29,10 @@
    1.14  #include "type.h"
    1.15  #include "bitblt.h"
    1.16  #include "parser.tab.h"
    1.17 +#include "semantics.h"
    1.18  #include "tiff2pdf.h"
    1.19  
    1.20  
    1.21 -int line;
    1.22 -
    1.23 -FILE *yyin;
    1.24  TIFF *in;
    1.25  panda_pdf *out;
    1.26  
    1.27 @@ -209,29 +207,6 @@
    1.28  }
    1.29  
    1.30  
    1.31 -void input_images (int first, int last)
    1.32 -{
    1.33 -  if (first == last)
    1.34 -    printf ("image %d\n", first);
    1.35 -  else
    1.36 -    printf ("iamges %d..%d\n", first, last);
    1.37 -}
    1.38 -
    1.39 -void output_pages (int first, int last)
    1.40 -{
    1.41 -  if (first == last)
    1.42 -    printf ("page %d\n", first);
    1.43 -  else
    1.44 -    printf ("pages %d..%d\n", first, last);
    1.45 -}
    1.46 -
    1.47 -
    1.48 -void yyerror (char *s)
    1.49 -{
    1.50 -  fprintf (stderr, "%d: %s\n", line, s);
    1.51 -}
    1.52 -
    1.53 -
    1.54  int main (int argc, char *argv[])
    1.55  {
    1.56    int result = 0;
    1.57 @@ -245,21 +220,10 @@
    1.58        goto fail;
    1.59      }
    1.60  
    1.61 -  yyin = fopen (argv [1], "r");
    1.62 -  if (! yyin)
    1.63 -    {
    1.64 -      fprintf (stderr, "can't open spec file '%s'\n", argv [1]);
    1.65 -      result = 3;
    1.66 -      goto fail;
    1.67 -    }
    1.68 -
    1.69 -  line = 1;
    1.70 -
    1.71 -  yyparse ();
    1.72 -
    1.73 +  if (! parse_spec_file (argv [1]))
    1.74 +    goto fail;
    1.75 +  
    1.76   fail:
    1.77 -  if (yyin)
    1.78 -    fclose (yyin);
    1.79    close_tiff_input_file ();
    1.80    close_pdf_output_file ();
    1.81    return (result);