*** empty log message ***

Sat, 29 Dec 2001 18:59:47 +0000

author
eric
date
Sat, 29 Dec 2001 18:59:47 +0000
changeset 12
c3e2c2344560
parent 11
30d18cf8bb67
child 13
3ab5717225d3

*** empty log message ***

Makefile file | annotate | diff | revisions
parser.y file | annotate | diff | revisions
scanner.l file | annotate | diff | revisions
t2p.c file | annotate | diff | revisions
tumble.c file | annotate | diff | revisions
     1.1 diff -r 30d18cf8bb67 -r c3e2c2344560 Makefile
     1.2 --- a/Makefile	Sat Dec 29 17:45:43 2001 +0000
     1.3 +++ b/Makefile	Sat Dec 29 18:59:47 2001 +0000
     1.4 @@ -1,6 +1,6 @@
     1.5  # tiff2pdf: build a PDF file out of one or more TIFF Class F Group 4 files
     1.6  # Makefile
     1.7 -# $Id: Makefile,v 1.4 2001/12/29 09:44:27 eric Exp $
     1.8 +# $Id: Makefile,v 1.5 2001/12/29 10:59:17 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 @@ -24,12 +24,14 @@
    1.13  YACC = bison
    1.14  YFLAGS = -d -v
    1.15  
    1.16 +SRCS = bitblt.c bitblt_test.c tiff2pdf.c
    1.17 +HDRS = type.h bitblt.h tiff2pdf.h
    1.18 +MISC = Makefile scanner.l parser.y
    1.19 +
    1.20  tiff2pdf: tiff2pdf.o scanner.o parser.tab.o
    1.21  
    1.22  bitblt_test: bitblt_test.o bitblt.o
    1.23  
    1.24 -pandamain: pandamain.o
    1.25 -
    1.26  
    1.27  %.tab.c %.tab.h: %.y
    1.28  	$(YACC) $(YFLAGS) $<
     2.1 diff -r 30d18cf8bb67 -r c3e2c2344560 parser.y
     2.2 --- a/parser.y	Sat Dec 29 17:45:43 2001 +0000
     2.3 +++ b/parser.y	Sat Dec 29 18:59:47 2001 +0000
     2.4 @@ -73,8 +73,8 @@
     2.5  	| image_ranges ',' range ;
     2.6  
     2.7  
     2.8 -file_clause:
     2.9 -	FILE_KEYWORD STRING  ';' ;
    2.10 +input_file_clause:
    2.11 +	FILE_KEYWORD STRING  ';'  { open_tiff_input_file ($2) } ;
    2.12  
    2.13  image_clause:
    2.14  	IMAGE INTEGER ';'
    2.15 @@ -135,7 +135,7 @@
    2.16  	| part_clauses part_clause;
    2.17  
    2.18  input_clause:
    2.19 -	file_clause
    2.20 +	input_file_clause
    2.21  	| image_clause
    2.22  	| images_clause
    2.23  	| modifier_clause
    2.24 @@ -151,6 +151,9 @@
    2.25  input_statement:
    2.26  	INPUT input_clauses ;
    2.27  
    2.28 +output_file_clause:
    2.29 +	FILE_KEYWORD STRING  ';' { open_pdf_output_file ($2) } ;
    2.30 +
    2.31  page_ranges:
    2.32  	range
    2.33  	| page_ranges ',' range ;
    2.34 @@ -168,7 +171,9 @@
    2.35  	| BOOKMARK STRING ';' ;
    2.36  
    2.37  output_clause:
    2.38 -	page_clause | pages_clause | bookmark_clause
    2.39 +	output_file_clause
    2.40 +	| page_clause | pages_clause
    2.41 +	| bookmark_clause
    2.42  	| output_clause_list ;
    2.43  
    2.44  output_clauses:
     3.1 diff -r 30d18cf8bb67 -r c3e2c2344560 scanner.l
     3.2 --- a/scanner.l	Sat Dec 29 17:45:43 2001 +0000
     3.3 +++ b/scanner.l	Sat Dec 29 18:59:47 2001 +0000
     3.4 @@ -1,8 +1,13 @@
     3.5 +/*
     3.6 +$Id: scanner.l,v 1.6 2001/12/29 10:59:33 eric Exp $
     3.7 +*/
     3.8 +
     3.9  %option case-insensitive
    3.10  
    3.11  %{
    3.12  #include "parser.tab.h"
    3.13 -}%
    3.14 +%}
    3.15 +
    3.16  
    3.17  digit [0-9]
    3.18  alpha [a-zA-Z]
    3.19 @@ -12,7 +17,7 @@
    3.20  \.\.		{ return (ELIPSIS); }
    3.21  
    3.22  {digit}+	{ yylval.integer = atoi (yytext); return (INTEGER); }
    3.23 -{digit}+.{digit}* { yylval.float = atof (yytext); return (FLOAT); }
    3.24 +{digit}+.{digit}* { yylval.fp = atof (yytext); return (FLOAT); }
    3.25  
    3.26  a		{ yylval.size.width = 8.5 * 25.4;
    3.27  		  yylval.size.height = 11.0 * 25.4;
    3.28 @@ -50,7 +55,7 @@
    3.29  rotate		{ return (ROTATE); }
    3.30  size		{ return (SIZE); }
    3.31  
    3.32 -\".*\"		{ yylval.string = newstr (yytext); return (STRING); }
    3.33 +\".*\"		{ yylval.string = strdup (yytext); return (STRING); }
    3.34  
    3.35  [ \t\n]+	/* whitespace */
    3.36  
    3.37 @@ -58,3 +63,4 @@
    3.38  
    3.39  .		{ printf( "Unrecognized character: %s\n", yytext ); }
    3.40  
    3.41 +%%
     4.1 diff -r 30d18cf8bb67 -r c3e2c2344560 t2p.c
     4.2 --- a/t2p.c	Sat Dec 29 17:45:43 2001 +0000
     4.3 +++ b/t2p.c	Sat Dec 29 18:59:47 2001 +0000
     4.4 @@ -1,7 +1,7 @@
     4.5  /*
     4.6   * tiffg4: reencode a bilevel TIFF file as a single-strip TIFF Class F Group 4
     4.7   * Main program
     4.8 - * $Id: t2p.c,v 1.1 2001/12/29 09:44:24 eric Exp $
     4.9 + * $Id: t2p.c,v 1.2 2001/12/29 10:59:47 eric Exp $
    4.10   * Copyright 2001 Eric Smith <eric@brouhaha.com>
    4.11   *
    4.12   * This program is free software; you can redistribute it and/or modify
    4.13 @@ -32,6 +32,7 @@
    4.14  #include "tiff2pdf.h"
    4.15  
    4.16  
    4.17 +FILE *yyin;
    4.18  TIFF *in;
    4.19  panda_pdf *out;
    4.20  
    4.21 @@ -206,10 +207,14 @@
    4.22  }
    4.23  
    4.24  
    4.25 +void yyerror (char *s)
    4.26 +{
    4.27 +  fprintf (stderr, "%s\n", s);
    4.28 +}
    4.29 +
    4.30  
    4.31  int main (int argc, char *argv[])
    4.32  {
    4.33 -  FILE *spec;
    4.34    int result = 0;
    4.35  
    4.36    panda_init ();
    4.37 @@ -221,8 +226,8 @@
    4.38        goto fail;
    4.39      }
    4.40  
    4.41 -  spec = fopen (argv [2], "r");
    4.42 -  if (! spec)
    4.43 +  yyin = fopen (argv [2], "r");
    4.44 +  if (! yyin)
    4.45      {
    4.46        fprintf (stderr, "can't open spec file '%s'\n", argv [2]);
    4.47        result = 3;
    4.48 @@ -232,6 +237,7 @@
    4.49    yyparse ();
    4.50  
    4.51   fail:
    4.52 +  fclose (yyin);
    4.53    close_tiff_input_file ();
    4.54    close_pdf_output_file ();
    4.55    return (result);
     5.1 diff -r 30d18cf8bb67 -r c3e2c2344560 tumble.c
     5.2 --- a/tumble.c	Sat Dec 29 17:45:43 2001 +0000
     5.3 +++ b/tumble.c	Sat Dec 29 18:59:47 2001 +0000
     5.4 @@ -1,7 +1,7 @@
     5.5  /*
     5.6   * tiffg4: reencode a bilevel TIFF file as a single-strip TIFF Class F Group 4
     5.7   * Main program
     5.8 - * $Id: tumble.c,v 1.1 2001/12/29 09:44:24 eric Exp $
     5.9 + * $Id: tumble.c,v 1.2 2001/12/29 10:59:47 eric Exp $
    5.10   * Copyright 2001 Eric Smith <eric@brouhaha.com>
    5.11   *
    5.12   * This program is free software; you can redistribute it and/or modify
    5.13 @@ -32,6 +32,7 @@
    5.14  #include "tiff2pdf.h"
    5.15  
    5.16  
    5.17 +FILE *yyin;
    5.18  TIFF *in;
    5.19  panda_pdf *out;
    5.20  
    5.21 @@ -206,10 +207,14 @@
    5.22  }
    5.23  
    5.24  
    5.25 +void yyerror (char *s)
    5.26 +{
    5.27 +  fprintf (stderr, "%s\n", s);
    5.28 +}
    5.29 +
    5.30  
    5.31  int main (int argc, char *argv[])
    5.32  {
    5.33 -  FILE *spec;
    5.34    int result = 0;
    5.35  
    5.36    panda_init ();
    5.37 @@ -221,8 +226,8 @@
    5.38        goto fail;
    5.39      }
    5.40  
    5.41 -  spec = fopen (argv [2], "r");
    5.42 -  if (! spec)
    5.43 +  yyin = fopen (argv [2], "r");
    5.44 +  if (! yyin)
    5.45      {
    5.46        fprintf (stderr, "can't open spec file '%s'\n", argv [2]);
    5.47        result = 3;
    5.48 @@ -232,6 +237,7 @@
    5.49    yyparse ();
    5.50  
    5.51   fail:
    5.52 +  fclose (yyin);
    5.53    close_tiff_input_file ();
    5.54    close_pdf_output_file ();
    5.55    return (result);