tumble.c

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