*** empty log message ***

Sun, 30 Dec 2001 16:29:50 +0000

author
eric
date
Sun, 30 Dec 2001 16:29:50 +0000
changeset 17
d4699dfddcc0
parent 16
dbf5e39b1658
child 18
3de372e4b230

*** empty log message ***

parser.y file | annotate | diff | revisions
scanner.l file | annotate | diff | revisions
t2p.c file | annotate | diff | revisions
t2p.h file | annotate | diff | revisions
tumble.c file | annotate | diff | revisions
tumble.h file | annotate | diff | revisions
     1.1 diff -r dbf5e39b1658 -r d4699dfddcc0 parser.y
     1.2 --- a/parser.y	Sun Dec 30 16:29:50 2001 +0000
     1.3 +++ b/parser.y	Sun Dec 30 16:29:50 2001 +0000
     1.4 @@ -1,7 +1,7 @@
     1.5  %{
     1.6    #include <stdio.h>
     1.7    #include "type.h"
     1.8 -  #include "tiff2pdf.h"
     1.9 +  #include "semantics.h"
    1.10  %}
    1.11  
    1.12  %union {
    1.13 @@ -74,7 +74,7 @@
    1.14  
    1.15  
    1.16  input_file_clause:
    1.17 -	FILE_KEYWORD STRING  ';'  { open_tiff_input_file ($2) } ;
    1.18 +	FILE_KEYWORD STRING  ';'  { input_set_file ($2) } ;
    1.19  
    1.20  image_clause:
    1.21  	IMAGE INTEGER ';' { input_images ($2, $2); }
    1.22 @@ -152,7 +152,7 @@
    1.23  	INPUT input_clauses ;
    1.24  
    1.25  output_file_clause:
    1.26 -	FILE_KEYWORD STRING  ';' { open_pdf_output_file ($2) } ;
    1.27 +	FILE_KEYWORD STRING  ';' { output_set_file ($2) } ;
    1.28  
    1.29  page_ranges:
    1.30  	range { output_pages ($1.first, $1.last); }
     2.1 diff -r dbf5e39b1658 -r d4699dfddcc0 scanner.l
     2.2 --- a/scanner.l	Sun Dec 30 16:29:50 2001 +0000
     2.3 +++ b/scanner.l	Sun Dec 30 16:29:50 2001 +0000
     2.4 @@ -1,5 +1,5 @@
     2.5  /*
     2.6 -$Id: scanner.l,v 1.8 2001/12/29 20:16:46 eric Exp $
     2.7 +$Id: scanner.l,v 1.9 2001/12/30 08:29:50 eric Exp $
     2.8  */
     2.9  
    2.10  %option case-insensitive
    2.11 @@ -10,7 +10,7 @@
    2.12  #include <string.h>
    2.13  #include "parser.tab.h"
    2.14  #include "type.h"
    2.15 -#include "tiff2pdf.h"
    2.16 +#include "semantics.h"
    2.17  
    2.18  #ifdef SCANNER_DEBUG
    2.19  #define LDBG(x) printf x
     3.1 diff -r dbf5e39b1658 -r d4699dfddcc0 t2p.c
     3.2 --- a/t2p.c	Sun Dec 30 16:29:50 2001 +0000
     3.3 +++ b/t2p.c	Sun Dec 30 16:29:50 2001 +0000
     3.4 @@ -1,7 +1,7 @@
     3.5  /*
     3.6   * tiffg4: reencode a bilevel TIFF file as a single-strip TIFF Class F Group 4
     3.7   * Main program
     3.8 - * $Id: t2p.c,v 1.3 2001/12/29 20:16:46 eric Exp $
     3.9 + * $Id: t2p.c,v 1.4 2001/12/30 08:29:50 eric Exp $
    3.10   * Copyright 2001 Eric Smith <eric@brouhaha.com>
    3.11   *
    3.12   * This program is free software; you can redistribute it and/or modify
    3.13 @@ -29,12 +29,10 @@
    3.14  #include "type.h"
    3.15  #include "bitblt.h"
    3.16  #include "parser.tab.h"
    3.17 +#include "semantics.h"
    3.18  #include "tiff2pdf.h"
    3.19  
    3.20  
    3.21 -int line;
    3.22 -
    3.23 -FILE *yyin;
    3.24  TIFF *in;
    3.25  panda_pdf *out;
    3.26  
    3.27 @@ -209,29 +207,6 @@
    3.28  }
    3.29  
    3.30  
    3.31 -void input_images (int first, int last)
    3.32 -{
    3.33 -  if (first == last)
    3.34 -    printf ("image %d\n", first);
    3.35 -  else
    3.36 -    printf ("iamges %d..%d\n", first, last);
    3.37 -}
    3.38 -
    3.39 -void output_pages (int first, int last)
    3.40 -{
    3.41 -  if (first == last)
    3.42 -    printf ("page %d\n", first);
    3.43 -  else
    3.44 -    printf ("pages %d..%d\n", first, last);
    3.45 -}
    3.46 -
    3.47 -
    3.48 -void yyerror (char *s)
    3.49 -{
    3.50 -  fprintf (stderr, "%d: %s\n", line, s);
    3.51 -}
    3.52 -
    3.53 -
    3.54  int main (int argc, char *argv[])
    3.55  {
    3.56    int result = 0;
    3.57 @@ -245,21 +220,10 @@
    3.58        goto fail;
    3.59      }
    3.60  
    3.61 -  yyin = fopen (argv [1], "r");
    3.62 -  if (! yyin)
    3.63 -    {
    3.64 -      fprintf (stderr, "can't open spec file '%s'\n", argv [1]);
    3.65 -      result = 3;
    3.66 -      goto fail;
    3.67 -    }
    3.68 -
    3.69 -  line = 1;
    3.70 -
    3.71 -  yyparse ();
    3.72 -
    3.73 +  if (! parse_spec_file (argv [1]))
    3.74 +    goto fail;
    3.75 +  
    3.76   fail:
    3.77 -  if (yyin)
    3.78 -    fclose (yyin);
    3.79    close_tiff_input_file ();
    3.80    close_pdf_output_file ();
    3.81    return (result);
     4.1 diff -r dbf5e39b1658 -r d4699dfddcc0 t2p.h
     4.2 --- a/t2p.h	Sun Dec 30 16:29:50 2001 +0000
     4.3 +++ b/t2p.h	Sun Dec 30 16:29:50 2001 +0000
     4.4 @@ -1,5 +1,3 @@
     4.5 -extern int line;
     4.6 -
     4.7  boolean open_tiff_input_file (char *name);
     4.8  boolean close_tiff_input_file (void);
     4.9  
    4.10 @@ -8,12 +6,9 @@
    4.11  
    4.12  boolean process_page (int image);  /* range 1 .. n */
    4.13  
    4.14 -void input_images (int first, int last);
    4.15 -void output_pages (int first, int last);
    4.16  
    4.17  
    4.18  
    4.19  
    4.20  
    4.21  
    4.22 -
     5.1 diff -r dbf5e39b1658 -r d4699dfddcc0 tumble.c
     5.2 --- a/tumble.c	Sun Dec 30 16:29:50 2001 +0000
     5.3 +++ b/tumble.c	Sun Dec 30 16:29:50 2001 +0000
     5.4 @@ -1,7 +1,7 @@
     5.5  /*
     5.6   * tiffg4: reencode a bilevel TIFF file as a single-strip TIFF Class F Group 4
     5.7   * Main program
     5.8 - * $Id: tumble.c,v 1.3 2001/12/29 20:16:46 eric Exp $
     5.9 + * $Id: tumble.c,v 1.4 2001/12/30 08:29:50 eric Exp $
    5.10   * Copyright 2001 Eric Smith <eric@brouhaha.com>
    5.11   *
    5.12   * This program is free software; you can redistribute it and/or modify
    5.13 @@ -29,12 +29,10 @@
    5.14  #include "type.h"
    5.15  #include "bitblt.h"
    5.16  #include "parser.tab.h"
    5.17 +#include "semantics.h"
    5.18  #include "tiff2pdf.h"
    5.19  
    5.20  
    5.21 -int line;
    5.22 -
    5.23 -FILE *yyin;
    5.24  TIFF *in;
    5.25  panda_pdf *out;
    5.26  
    5.27 @@ -209,29 +207,6 @@
    5.28  }
    5.29  
    5.30  
    5.31 -void input_images (int first, int last)
    5.32 -{
    5.33 -  if (first == last)
    5.34 -    printf ("image %d\n", first);
    5.35 -  else
    5.36 -    printf ("iamges %d..%d\n", first, last);
    5.37 -}
    5.38 -
    5.39 -void output_pages (int first, int last)
    5.40 -{
    5.41 -  if (first == last)
    5.42 -    printf ("page %d\n", first);
    5.43 -  else
    5.44 -    printf ("pages %d..%d\n", first, last);
    5.45 -}
    5.46 -
    5.47 -
    5.48 -void yyerror (char *s)
    5.49 -{
    5.50 -  fprintf (stderr, "%d: %s\n", line, s);
    5.51 -}
    5.52 -
    5.53 -
    5.54  int main (int argc, char *argv[])
    5.55  {
    5.56    int result = 0;
    5.57 @@ -245,21 +220,10 @@
    5.58        goto fail;
    5.59      }
    5.60  
    5.61 -  yyin = fopen (argv [1], "r");
    5.62 -  if (! yyin)
    5.63 -    {
    5.64 -      fprintf (stderr, "can't open spec file '%s'\n", argv [1]);
    5.65 -      result = 3;
    5.66 -      goto fail;
    5.67 -    }
    5.68 -
    5.69 -  line = 1;
    5.70 -
    5.71 -  yyparse ();
    5.72 -
    5.73 +  if (! parse_spec_file (argv [1]))
    5.74 +    goto fail;
    5.75 +  
    5.76   fail:
    5.77 -  if (yyin)
    5.78 -    fclose (yyin);
    5.79    close_tiff_input_file ();
    5.80    close_pdf_output_file ();
    5.81    return (result);
     6.1 diff -r dbf5e39b1658 -r d4699dfddcc0 tumble.h
     6.2 --- a/tumble.h	Sun Dec 30 16:29:50 2001 +0000
     6.3 +++ b/tumble.h	Sun Dec 30 16:29:50 2001 +0000
     6.4 @@ -1,5 +1,3 @@
     6.5 -extern int line;
     6.6 -
     6.7  boolean open_tiff_input_file (char *name);
     6.8  boolean close_tiff_input_file (void);
     6.9  
    6.10 @@ -8,12 +6,9 @@
    6.11  
    6.12  boolean process_page (int image);  /* range 1 .. n */
    6.13  
    6.14 -void input_images (int first, int last);
    6.15 -void output_pages (int first, int last);
    6.16  
    6.17  
    6.18  
    6.19  
    6.20  
    6.21  
    6.22 -