*** empty log message ***
This commit is contained in:
parent
da77cde2e9
commit
dbc4896166
6
parser.y
6
parser.y
@ -1,7 +1,7 @@
|
||||
%{
|
||||
#include <stdio.h>
|
||||
#include "type.h"
|
||||
#include "tiff2pdf.h"
|
||||
#include "semantics.h"
|
||||
%}
|
||||
|
||||
%union {
|
||||
@ -74,7 +74,7 @@ image_ranges:
|
||||
|
||||
|
||||
input_file_clause:
|
||||
FILE_KEYWORD STRING ';' { open_tiff_input_file ($2) } ;
|
||||
FILE_KEYWORD STRING ';' { input_set_file ($2) } ;
|
||||
|
||||
image_clause:
|
||||
IMAGE INTEGER ';' { input_images ($2, $2); }
|
||||
@ -152,7 +152,7 @@ input_statement:
|
||||
INPUT input_clauses ;
|
||||
|
||||
output_file_clause:
|
||||
FILE_KEYWORD STRING ';' { open_pdf_output_file ($2) } ;
|
||||
FILE_KEYWORD STRING ';' { output_set_file ($2) } ;
|
||||
|
||||
page_ranges:
|
||||
range { output_pages ($1.first, $1.last); }
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
$Id: scanner.l,v 1.8 2001/12/29 20:16:46 eric Exp $
|
||||
$Id: scanner.l,v 1.9 2001/12/30 08:29:50 eric Exp $
|
||||
*/
|
||||
|
||||
%option case-insensitive
|
||||
@ -10,7 +10,7 @@ $Id: scanner.l,v 1.8 2001/12/29 20:16:46 eric Exp $
|
||||
#include <string.h>
|
||||
#include "parser.tab.h"
|
||||
#include "type.h"
|
||||
#include "tiff2pdf.h"
|
||||
#include "semantics.h"
|
||||
|
||||
#ifdef SCANNER_DEBUG
|
||||
#define LDBG(x) printf x
|
||||
|
||||
46
t2p.c
46
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.3 2001/12/29 20:16:46 eric Exp $
|
||||
* $Id: t2p.c,v 1.4 2001/12/30 08:29:50 eric Exp $
|
||||
* Copyright 2001 Eric Smith <eric@brouhaha.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -29,12 +29,10 @@
|
||||
#include "type.h"
|
||||
#include "bitblt.h"
|
||||
#include "parser.tab.h"
|
||||
#include "semantics.h"
|
||||
#include "tiff2pdf.h"
|
||||
|
||||
|
||||
int line;
|
||||
|
||||
FILE *yyin;
|
||||
TIFF *in;
|
||||
panda_pdf *out;
|
||||
|
||||
@ -209,29 +207,6 @@ 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, "%d: %s\n", line, s);
|
||||
}
|
||||
|
||||
|
||||
int main (int argc, char *argv[])
|
||||
{
|
||||
int result = 0;
|
||||
@ -245,21 +220,10 @@ int main (int argc, char *argv[])
|
||||
goto fail;
|
||||
}
|
||||
|
||||
yyin = fopen (argv [1], "r");
|
||||
if (! yyin)
|
||||
{
|
||||
fprintf (stderr, "can't open spec file '%s'\n", argv [1]);
|
||||
result = 3;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
line = 1;
|
||||
|
||||
yyparse ();
|
||||
|
||||
if (! parse_spec_file (argv [1]))
|
||||
goto fail;
|
||||
|
||||
fail:
|
||||
if (yyin)
|
||||
fclose (yyin);
|
||||
close_tiff_input_file ();
|
||||
close_pdf_output_file ();
|
||||
return (result);
|
||||
|
||||
5
t2p.h
5
t2p.h
@ -1,5 +1,3 @@
|
||||
extern int line;
|
||||
|
||||
boolean open_tiff_input_file (char *name);
|
||||
boolean close_tiff_input_file (void);
|
||||
|
||||
@ -8,9 +6,6 @@ boolean close_pdf_output_file (void);
|
||||
|
||||
boolean process_page (int image); /* range 1 .. n */
|
||||
|
||||
void input_images (int first, int last);
|
||||
void output_pages (int first, int last);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
46
tumble.c
46
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.3 2001/12/29 20:16:46 eric Exp $
|
||||
* $Id: tumble.c,v 1.4 2001/12/30 08:29:50 eric Exp $
|
||||
* Copyright 2001 Eric Smith <eric@brouhaha.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -29,12 +29,10 @@
|
||||
#include "type.h"
|
||||
#include "bitblt.h"
|
||||
#include "parser.tab.h"
|
||||
#include "semantics.h"
|
||||
#include "tiff2pdf.h"
|
||||
|
||||
|
||||
int line;
|
||||
|
||||
FILE *yyin;
|
||||
TIFF *in;
|
||||
panda_pdf *out;
|
||||
|
||||
@ -209,29 +207,6 @@ 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, "%d: %s\n", line, s);
|
||||
}
|
||||
|
||||
|
||||
int main (int argc, char *argv[])
|
||||
{
|
||||
int result = 0;
|
||||
@ -245,21 +220,10 @@ int main (int argc, char *argv[])
|
||||
goto fail;
|
||||
}
|
||||
|
||||
yyin = fopen (argv [1], "r");
|
||||
if (! yyin)
|
||||
{
|
||||
fprintf (stderr, "can't open spec file '%s'\n", argv [1]);
|
||||
result = 3;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
line = 1;
|
||||
|
||||
yyparse ();
|
||||
|
||||
if (! parse_spec_file (argv [1]))
|
||||
goto fail;
|
||||
|
||||
fail:
|
||||
if (yyin)
|
||||
fclose (yyin);
|
||||
close_tiff_input_file ();
|
||||
close_pdf_output_file ();
|
||||
return (result);
|
||||
|
||||
5
tumble.h
5
tumble.h
@ -1,5 +1,3 @@
|
||||
extern int line;
|
||||
|
||||
boolean open_tiff_input_file (char *name);
|
||||
boolean close_tiff_input_file (void);
|
||||
|
||||
@ -8,9 +6,6 @@ boolean close_pdf_output_file (void);
|
||||
|
||||
boolean process_page (int image); /* range 1 .. n */
|
||||
|
||||
void input_images (int first, int last);
|
||||
void output_pages (int first, int last);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user