1
0
mirror of synced 2026-04-15 16:20:04 +00:00
This commit is contained in:
Eric Smith
2001-12-30 04:16:46 +00:00
parent c10f72f2f9
commit a73c7f0eae
2 changed files with 54 additions and 10 deletions

32
t2p.c
View File

@@ -1,7 +1,7 @@
/*
* tiffg4: reencode a bilevel TIFF file as a single-strip TIFF Class F Group 4
* Main program
* $Id: t2p.c,v 1.2 2001/12/29 10:59:47 eric Exp $
* $Id: t2p.c,v 1.3 2001/12/29 20:16:46 eric Exp $
* Copyright 2001 Eric Smith <eric@brouhaha.com>
*
* This program is free software; you can redistribute it and/or modify
@@ -32,6 +32,8 @@
#include "tiff2pdf.h"
int line;
FILE *yyin;
TIFF *in;
panda_pdf *out;
@@ -207,9 +209,26 @@ boolean process_page (int image) /* range 1 .. n */
}
void input_images (int first, int last)
{
if (first == last)
printf ("image %d\n", first);
else
printf ("iamges %d..%d\n", first, last);
}
void output_pages (int first, int last)
{
if (first == last)
printf ("page %d\n", first);
else
printf ("pages %d..%d\n", first, last);
}
void yyerror (char *s)
{
fprintf (stderr, "%s\n", s);
fprintf (stderr, "%d: %s\n", line, s);
}
@@ -226,18 +245,21 @@ int main (int argc, char *argv[])
goto fail;
}
yyin = fopen (argv [2], "r");
yyin = fopen (argv [1], "r");
if (! yyin)
{
fprintf (stderr, "can't open spec file '%s'\n", argv [2]);
fprintf (stderr, "can't open spec file '%s'\n", argv [1]);
result = 3;
goto fail;
}
line = 1;
yyparse ();
fail:
fclose (yyin);
if (yyin)
fclose (yyin);
close_tiff_input_file ();
close_pdf_output_file ();
return (result);

View File

@@ -1,7 +1,7 @@
/*
* tiffg4: reencode a bilevel TIFF file as a single-strip TIFF Class F Group 4
* Main program
* $Id: tumble.c,v 1.2 2001/12/29 10:59:47 eric Exp $
* $Id: tumble.c,v 1.3 2001/12/29 20:16:46 eric Exp $
* Copyright 2001 Eric Smith <eric@brouhaha.com>
*
* This program is free software; you can redistribute it and/or modify
@@ -32,6 +32,8 @@
#include "tiff2pdf.h"
int line;
FILE *yyin;
TIFF *in;
panda_pdf *out;
@@ -207,9 +209,26 @@ boolean process_page (int image) /* range 1 .. n */
}
void input_images (int first, int last)
{
if (first == last)
printf ("image %d\n", first);
else
printf ("iamges %d..%d\n", first, last);
}
void output_pages (int first, int last)
{
if (first == last)
printf ("page %d\n", first);
else
printf ("pages %d..%d\n", first, last);
}
void yyerror (char *s)
{
fprintf (stderr, "%s\n", s);
fprintf (stderr, "%d: %s\n", line, s);
}
@@ -226,18 +245,21 @@ int main (int argc, char *argv[])
goto fail;
}
yyin = fopen (argv [2], "r");
yyin = fopen (argv [1], "r");
if (! yyin)
{
fprintf (stderr, "can't open spec file '%s'\n", argv [2]);
fprintf (stderr, "can't open spec file '%s'\n", argv [1]);
result = 3;
goto fail;
}
line = 1;
yyparse ();
fail:
fclose (yyin);
if (yyin)
fclose (yyin);
close_tiff_input_file ();
close_pdf_output_file ();
return (result);