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