Sat, 29 Dec 2001 17:45:43 +0000
*** empty log message ***
Makefile | file | annotate | diff | revisions | |
bitblt.c | file | annotate | diff | revisions | |
bitblt.h | file | annotate | diff | revisions | |
bitblt_test.c | file | annotate | diff | revisions | |
parser.y | file | annotate | diff | revisions | |
scanner.l | file | annotate | diff | revisions |
1.1 --- a/Makefile Sat Dec 29 17:44:57 2001 +0000 1.2 +++ b/Makefile Sat Dec 29 17:45:43 2001 +0000 1.3 @@ -1,6 +1,6 @@ 1.4 -# tiffg4: reencode a bilevel TIFF file as a single-strip TIFF Class F Group 4 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.3 2001/12/27 20:44:15 eric Exp $ 1.8 +# $Id: Makefile,v 1.4 2001/12/29 09:44:27 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 @@ -19,16 +19,14 @@ 1.13 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA 1.14 1.15 1.16 -CFLAGS = -g -I/usr/local/include/panda 1.17 +CFLAGS = -Wall -g -I/usr/local/include/panda 1.18 LDLIBS = -g -ltiff -lm -L/usr/local/lib/panda -lpanda -lpng 1.19 YACC = bison 1.20 YFLAGS = -d -v 1.21 1.22 -bitblt_test: bitblt_test.o bitblt.o 1.23 +tiff2pdf: tiff2pdf.o scanner.o parser.tab.o 1.24 1.25 -bitblt.o: bitblt.c 1.26 - 1.27 -tiff2pdf: tiff2pdf.o scanner.o parser.tab.o 1.28 +bitblt_test: bitblt_test.o bitblt.o 1.29 1.30 pandamain: pandamain.o 1.31 1.32 @@ -37,4 +35,5 @@ 1.33 $(YACC) $(YFLAGS) $< 1.34 1.35 # %.c: %.l 1.36 -# $(LEX) $(LFLAGS) $< 1.37 \ No newline at end of file 1.38 +# $(LEX) $(LFLAGS) $< 1.39 +
2.1 --- a/bitblt.c Sat Dec 29 17:44:57 2001 +0000 2.2 +++ b/bitblt.c Sat Dec 29 17:45:43 2001 +0000 2.3 @@ -1,5 +1,6 @@ 2.4 #include <stdlib.h> 2.5 2.6 +#include "type.h" 2.7 #include "bitblt.h" 2.8 2.9 static inline u8 pixel_mask (x)
3.1 --- a/bitblt.h Sat Dec 29 17:44:57 2001 +0000 3.2 +++ b/bitblt.h Sat Dec 29 17:45:43 2001 +0000 3.3 @@ -1,7 +1,3 @@ 3.4 -typedef unsigned char u8; 3.5 -typedef unsigned int u32; 3.6 -typedef int boolean; 3.7 - 3.8 typedef struct Point 3.9 { 3.10 u32 x;
4.1 --- a/bitblt_test.c Sat Dec 29 17:44:57 2001 +0000 4.2 +++ b/bitblt_test.c Sat Dec 29 17:45:43 2001 +0000 4.3 @@ -1,5 +1,6 @@ 4.4 #include <stdio.h> 4.5 4.6 +#include "type.h" 4.7 #include "bitblt.h" 4.8 4.9
5.1 --- a/parser.y Sat Dec 29 17:44:57 2001 +0000 5.2 +++ b/parser.y Sat Dec 29 17:45:43 2001 +0000 5.3 @@ -1,12 +1,15 @@ 5.4 %{ 5.5 -#include <stdio.h> 5.6 + #include <stdio.h> 5.7 + #include "type.h" 5.8 + #include "tiff2pdf.h" 5.9 %} 5.10 5.11 %union { 5.12 int integer; 5.13 double fp; 5.14 char *string; 5.15 - struct { double width, double height } size; 5.16 + struct { double width; double height; } size; 5.17 + struct { int first; int last; } range; 5.18 } 5.19 5.20 %token <integer> INTEGER 5.21 @@ -26,12 +29,13 @@ 5.22 %token PORTRAIT 5.23 %token LANDSCAPE 5.24 5.25 -%token FILE 5.26 +%token FILE_KEYWORD 5.27 %token IMAGE 5.28 %token IMAGES 5.29 %token ROTATE 5.30 %token CROP 5.31 %token SIZE 5.32 +%token RESOLUTION 5.33 %token INPUT 5.34 5.35 %token PAGE 5.36 @@ -39,10 +43,13 @@ 5.37 %token BOOKMARK 5.38 %token OUTPUT 5.39 5.40 -%type <integer> image_range 5.41 -%type <integer> image_ranges 5.42 -%type <integer> page_range 5.43 -%type <integer> page_ranges 5.44 +%type <range> range 5.45 +%type <range> image_ranges 5.46 +%type <range> page_ranges 5.47 + 5.48 +%type <fp> unit 5.49 + 5.50 + 5.51 5.52 %type <fp> length 5.53 5.54 @@ -57,17 +64,17 @@ 5.55 | output_statement ; 5.56 5.57 5.58 -image_range: 5.59 - INTEGER ELIPSIS INTEGER 5.60 - | INTEGER ; 5.61 +range: 5.62 + INTEGER ELIPSIS INTEGER { $$.first = $1; $$.last = $3; } 5.63 + | INTEGER { $$.first = $1; $$.last = $1; } ; 5.64 5.65 image_ranges: 5.66 - image_range 5.67 - | image_ranges ',' image_range ; 5.68 + range 5.69 + | image_ranges ',' range ; 5.70 5.71 5.72 file_clause: 5.73 - FILE STRING ';' ; 5.74 + FILE_KEYWORD STRING ';' ; 5.75 5.76 image_clause: 5.77 IMAGE INTEGER ';' 5.78 @@ -82,12 +89,12 @@ 5.79 ROTATE INTEGER ';' ; 5.80 5.81 unit: 5.82 - CM 5.83 - | INCH ; 5.84 + /* empty */ /* default to INCH */ { $$ = 25.4; } 5.85 + | CM { $$ = 1.0; } 5.86 + | INCH { $$ = 25.4; } ; 5.87 5.88 length: 5.89 - FLOAT 5.90 - | FLOAT unit ; 5.91 + FLOAT unit { $$ = $1 * $2; } ; 5.92 5.93 crop_clause: 5.94 CROP PAGE_SIZE ';' 5.95 @@ -104,8 +111,11 @@ 5.96 | SIZE PAGE_SIZE orientation ';' 5.97 | SIZE length ',' length ';' ; 5.98 5.99 +resolution_clause: 5.100 + RESOLUTION FLOAT unit ; 5.101 + 5.102 modifier_clause: 5.103 - rotate_clause | crop_clause | size_clause; 5.104 + rotate_clause | crop_clause | size_clause | resolution_clause; 5.105 5.106 modifier_clauses: 5.107 modifier_clause 5.108 @@ -141,13 +151,9 @@ 5.109 input_statement: 5.110 INPUT input_clauses ; 5.111 5.112 -page_range: 5.113 - INTEGER ELIPSIS INTEGER 5.114 - | INTEGER ; 5.115 - 5.116 page_ranges: 5.117 - page_range 5.118 - | page_ranges ',' page_range ; 5.119 + range 5.120 + | page_ranges ',' range ; 5.121 5.122 page_clause: 5.123 PAGE INTEGER ';'
6.1 --- a/scanner.l Sat Dec 29 17:44:57 2001 +0000 6.2 +++ b/scanner.l Sat Dec 29 17:45:43 2001 +0000 6.3 @@ -1,10 +1,8 @@ 6.4 %option case-insensitive 6.5 6.6 -/* 6.7 %{ 6.8 #include "parser.tab.h" 6.9 }% 6.10 -*/ 6.11 6.12 digit [0-9] 6.13 alpha [a-zA-Z] 6.14 @@ -37,7 +35,7 @@ 6.15 cm { return (CM); } 6.16 crop { return (CROP); } 6.17 even { return (EVEN); } 6.18 -file { return (FILE); } 6.19 +file { return (FILE_KEYWORD); } 6.20 image { return (IMAGE); } 6.21 images { return (IMAGES); } 6.22 inch { return (INCH); } 6.23 @@ -48,6 +46,7 @@ 6.24 page { return (PAGE); } 6.25 pages { return (PAGES); } 6.26 portrait { return (PORTRAIT) ; } 6.27 +resolution { return (RESOLUTION) ; } 6.28 rotate { return (ROTATE); } 6.29 size { return (SIZE); } 6.30