Sun, 30 Dec 2001 04:16:46 +0000
..
t2p.c | file | annotate | diff | revisions | |
tumble.c | file | annotate | diff | revisions |
1.1 --- a/t2p.c Sun Dec 30 01:54:43 2001 +0000 1.2 +++ b/t2p.c Sun Dec 30 04:16:46 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.2 2001/12/29 10:59:47 eric Exp $ 1.8 + * $Id: t2p.c,v 1.3 2001/12/29 20:16:46 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,8 @@ 1.13 #include "tiff2pdf.h" 1.14 1.15 1.16 +int line; 1.17 + 1.18 FILE *yyin; 1.19 TIFF *in; 1.20 panda_pdf *out; 1.21 @@ -207,9 +209,26 @@ 1.22 } 1.23 1.24 1.25 +void input_images (int first, int last) 1.26 +{ 1.27 + if (first == last) 1.28 + printf ("image %d\n", first); 1.29 + else 1.30 + printf ("iamges %d..%d\n", first, last); 1.31 +} 1.32 + 1.33 +void output_pages (int first, int last) 1.34 +{ 1.35 + if (first == last) 1.36 + printf ("page %d\n", first); 1.37 + else 1.38 + printf ("pages %d..%d\n", first, last); 1.39 +} 1.40 + 1.41 + 1.42 void yyerror (char *s) 1.43 { 1.44 - fprintf (stderr, "%s\n", s); 1.45 + fprintf (stderr, "%d: %s\n", line, s); 1.46 } 1.47 1.48 1.49 @@ -226,18 +245,21 @@ 1.50 goto fail; 1.51 } 1.52 1.53 - yyin = fopen (argv [2], "r"); 1.54 + yyin = fopen (argv [1], "r"); 1.55 if (! yyin) 1.56 { 1.57 - fprintf (stderr, "can't open spec file '%s'\n", argv [2]); 1.58 + fprintf (stderr, "can't open spec file '%s'\n", argv [1]); 1.59 result = 3; 1.60 goto fail; 1.61 } 1.62 1.63 + line = 1; 1.64 + 1.65 yyparse (); 1.66 1.67 fail: 1.68 - fclose (yyin); 1.69 + if (yyin) 1.70 + fclose (yyin); 1.71 close_tiff_input_file (); 1.72 close_pdf_output_file (); 1.73 return (result);
2.1 --- a/tumble.c Sun Dec 30 01:54:43 2001 +0000 2.2 +++ b/tumble.c Sun Dec 30 04:16:46 2001 +0000 2.3 @@ -1,7 +1,7 @@ 2.4 /* 2.5 * tiffg4: reencode a bilevel TIFF file as a single-strip TIFF Class F Group 4 2.6 * Main program 2.7 - * $Id: tumble.c,v 1.2 2001/12/29 10:59:47 eric Exp $ 2.8 + * $Id: tumble.c,v 1.3 2001/12/29 20:16:46 eric Exp $ 2.9 * Copyright 2001 Eric Smith <eric@brouhaha.com> 2.10 * 2.11 * This program is free software; you can redistribute it and/or modify 2.12 @@ -32,6 +32,8 @@ 2.13 #include "tiff2pdf.h" 2.14 2.15 2.16 +int line; 2.17 + 2.18 FILE *yyin; 2.19 TIFF *in; 2.20 panda_pdf *out; 2.21 @@ -207,9 +209,26 @@ 2.22 } 2.23 2.24 2.25 +void input_images (int first, int last) 2.26 +{ 2.27 + if (first == last) 2.28 + printf ("image %d\n", first); 2.29 + else 2.30 + printf ("iamges %d..%d\n", first, last); 2.31 +} 2.32 + 2.33 +void output_pages (int first, int last) 2.34 +{ 2.35 + if (first == last) 2.36 + printf ("page %d\n", first); 2.37 + else 2.38 + printf ("pages %d..%d\n", first, last); 2.39 +} 2.40 + 2.41 + 2.42 void yyerror (char *s) 2.43 { 2.44 - fprintf (stderr, "%s\n", s); 2.45 + fprintf (stderr, "%d: %s\n", line, s); 2.46 } 2.47 2.48 2.49 @@ -226,18 +245,21 @@ 2.50 goto fail; 2.51 } 2.52 2.53 - yyin = fopen (argv [2], "r"); 2.54 + yyin = fopen (argv [1], "r"); 2.55 if (! yyin) 2.56 { 2.57 - fprintf (stderr, "can't open spec file '%s'\n", argv [2]); 2.58 + fprintf (stderr, "can't open spec file '%s'\n", argv [1]); 2.59 result = 3; 2.60 goto fail; 2.61 } 2.62 2.63 + line = 1; 2.64 + 2.65 yyparse (); 2.66 2.67 fail: 2.68 - fclose (yyin); 2.69 + if (yyin) 2.70 + fclose (yyin); 2.71 close_tiff_input_file (); 2.72 close_pdf_output_file (); 2.73 return (result);