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