..
This commit is contained in:
32
t2p.c
32
t2p.c
@@ -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);
|
||||
|
||||
32
tumble.c
32
tumble.c
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user