Thu, 13 Mar 2003 08:57:05 +0000
changed program name from t2p to tumble.
1.1 diff -r ba64dfca82e9 -r e2ef1c2f9eca Makefile 1.2 --- a/Makefile Thu Mar 13 08:03:11 2003 +0000 1.3 +++ b/Makefile Thu Mar 13 08:57:05 2003 +0000 1.4 @@ -1,6 +1,6 @@ 1.5 -# t2p: build a PDF file out of one or more TIFF Class F Group 4 files 1.6 +# tumble: build a PDF file from image files 1.7 # Makefile 1.8 -# $Id: Makefile,v 1.28 2003/03/12 23:57:21 eric Exp $ 1.9 +# $Id: Makefile,v 1.29 2003/03/13 00:57:05 eric Exp $ 1.10 # Copyright 2001, 2002, 2003 Eric Smith <eric@brouhaha.com> 1.11 # 1.12 # This program is free software; you can redistribute it and/or modify 1.13 @@ -55,18 +55,18 @@ 1.14 # let me know why so I can improve this Makefile. 1.15 # ----------------------------------------------------------------------------- 1.16 1.17 -VERSION = 0.23 1.18 +VERSION = 0.24 1.19 1.20 -PACKAGE = t2p 1.21 +PACKAGE = tumble 1.22 1.23 -TARGETS = t2p 1.24 +TARGETS = tumble 1.25 1.26 -CSRCS = t2p.c semantics.c \ 1.27 +CSRCS = tumble.c semantics.c \ 1.28 bitblt.c bitblt_table_gen.c bitblt_g4.c g4_table_gen.c \ 1.29 pdf.c pdf_util.c pdf_prim.c pdf_bookmark.c pdf_name_tree.c \ 1.30 pdf_text.c pdf_g4.c pdf_jpeg.c 1.31 OSRCS = scanner.l parser.y 1.32 -HDRS = t2p.h semantics.h bitblt.h bitblt_tables.h \ 1.33 +HDRS = tumble.h semantics.h bitblt.h bitblt_tables.h \ 1.34 pdf.h pdf_private.h pdf_util.h pdf_prim.h pdf_name_tree.h 1.35 MISC = COPYING Makefile 1.36 1.37 @@ -85,7 +85,7 @@ 1.38 all: $(TARGETS) $(TEST_TARGETS) 1.39 1.40 1.41 -t2p: t2p.o scanner.o semantics.o parser.tab.o \ 1.42 +tumble: tumble.o scanner.o semantics.o parser.tab.o \ 1.43 bitblt.o bitblt_g4.o bitblt_tables.o g4_tables.o \ 1.44 pdf.o pdf_util.o pdf_prim.o pdf_bookmark.o pdf_name_tree.o \ 1.45 pdf_text.o pdf_g4.o pdf_jpeg.o
2.1 diff -r ba64dfca82e9 -r e2ef1c2f9eca bitblt.c 2.2 --- a/bitblt.c Thu Mar 13 08:03:11 2003 +0000 2.3 +++ b/bitblt.c Thu Mar 13 08:57:05 2003 +0000 2.4 @@ -1,10 +1,8 @@ 2.5 /* 2.6 - * t2p: Create a PDF file from the contents of one or more TIFF 2.7 - * bilevel image files. The images in the resulting PDF file 2.8 - * will be compressed using ITU-T T.6 (G4) fax encoding. 2.9 + * tumble: build a PDF file from image files 2.10 * 2.11 * bitblt routines 2.12 - * $Id: bitblt.c,v 1.15 2003/03/12 02:59:09 eric Exp $ 2.13 + * $Id: bitblt.c,v 1.16 2003/03/13 00:57:05 eric Exp $ 2.14 * Copyright 2001, 2002, 2003 Eric Smith <eric@brouhaha.com> 2.15 * 2.16 * This program is free software; you can redistribute it and/or modify
3.1 diff -r ba64dfca82e9 -r e2ef1c2f9eca bitblt.h 3.2 --- a/bitblt.h Thu Mar 13 08:03:11 2003 +0000 3.3 +++ b/bitblt.h Thu Mar 13 08:57:05 2003 +0000 3.4 @@ -1,10 +1,8 @@ 3.5 /* 3.6 - * t2p: Create a PDF file from the contents of one or more TIFF 3.7 - * bilevel image files. The images in the resulting PDF file 3.8 - * will be compressed using ITU-T T.6 (G4) fax encoding. 3.9 + * tumble: build a PDF file from image files 3.10 * 3.11 * bitblt routines 3.12 - * $Id: bitblt.h,v 1.16 2003/03/12 02:59:09 eric Exp $ 3.13 + * $Id: bitblt.h,v 1.17 2003/03/13 00:57:05 eric Exp $ 3.14 * Copyright 2001, 2002, 2003 Eric Smith <eric@brouhaha.com> 3.15 * 3.16 * This program is free software; you can redistribute it and/or modify
4.1 diff -r ba64dfca82e9 -r e2ef1c2f9eca bitblt_g4.c 4.2 --- a/bitblt_g4.c Thu Mar 13 08:03:11 2003 +0000 4.3 +++ b/bitblt_g4.c Thu Mar 13 08:57:05 2003 +0000 4.4 @@ -1,10 +1,8 @@ 4.5 /* 4.6 - * t2p: Create a PDF file from the contents of one or more TIFF 4.7 - * bilevel image files. The images in the resulting PDF file 4.8 - * will be compressed using ITU-T T.6 (G4) fax encoding. 4.9 + * tumble: build a PDF file from image files 4.10 * 4.11 * G4 compression 4.12 - * $Id: bitblt_g4.c,v 1.13 2003/03/12 19:30:44 eric Exp $ 4.13 + * $Id: bitblt_g4.c,v 1.14 2003/03/13 00:57:05 eric Exp $ 4.14 * Copyright 2003 Eric Smith <eric@brouhaha.com> 4.15 * 4.16 * This program is free software; you can redistribute it and/or modify
5.1 diff -r ba64dfca82e9 -r e2ef1c2f9eca bitblt_table_gen.c 5.2 --- a/bitblt_table_gen.c Thu Mar 13 08:03:11 2003 +0000 5.3 +++ b/bitblt_table_gen.c Thu Mar 13 08:57:05 2003 +0000 5.4 @@ -1,10 +1,8 @@ 5.5 /* 5.6 - * t2p: Create a PDF file from the contents of one or more TIFF 5.7 - * bilevel image files. The images in the resulting PDF file 5.8 - * will be compressed using ITU-T T.6 (G4) fax encoding. 5.9 + * tumble: build a PDF file from image files 5.10 * 5.11 * bitblt table generator 5.12 - * $Id: bitblt_table_gen.c,v 1.6 2003/03/11 22:40:34 eric Exp $ 5.13 + * $Id: bitblt_table_gen.c,v 1.7 2003/03/13 00:57:05 eric Exp $ 5.14 * Copyright 2003 Eric Smith <eric@brouhaha.com> 5.15 * 5.16 * This program is free software; you can redistribute it and/or modify
6.1 diff -r ba64dfca82e9 -r e2ef1c2f9eca g4_table_gen.c 6.2 --- a/g4_table_gen.c Thu Mar 13 08:03:11 2003 +0000 6.3 +++ b/g4_table_gen.c Thu Mar 13 08:57:05 2003 +0000 6.4 @@ -1,10 +1,8 @@ 6.5 /* 6.6 - * t2p: Create a PDF file from the contents of one or more TIFF 6.7 - * bilevel image files. The images in the resulting PDF file 6.8 - * will be compressed using ITU-T T.6 (G4) fax encoding. 6.9 + * tumble: build a PDF file from image files 6.10 * 6.11 * G4 table generator 6.12 - * $Id: g4_table_gen.c,v 1.3 2003/03/11 22:57:46 eric Exp $ 6.13 + * $Id: g4_table_gen.c,v 1.4 2003/03/13 00:57:05 eric Exp $ 6.14 * Copyright 2003 Eric Smith <eric@brouhaha.com> 6.15 * 6.16 * This program is free software; you can redistribute it and/or modify
7.1 diff -r ba64dfca82e9 -r e2ef1c2f9eca parser.y 7.2 --- a/parser.y Thu Mar 13 08:03:11 2003 +0000 7.3 +++ b/parser.y Thu Mar 13 08:57:05 2003 +0000 7.4 @@ -1,10 +1,8 @@ 7.5 /* 7.6 - * t2p: Create a PDF file from the contents of one or more TIFF 7.7 - * bilevel image files. The images in the resulting PDF file 7.8 - * will be compressed using ITU-T T.6 (G4) fax encoding. 7.9 + * tumble: build a PDF file from image files 7.10 * 7.11 * Parser 7.12 - * $Id: parser.y,v 1.17 2003/02/21 00:49:11 eric Exp $ 7.13 + * $Id: parser.y,v 1.18 2003/03/13 00:57:05 eric Exp $ 7.14 * Copyright 2001, 2002, 2003 Eric Smith <eric@brouhaha.com> 7.15 * 7.16 * This program is free software; you can redistribute it and/or modify
8.1 diff -r ba64dfca82e9 -r e2ef1c2f9eca pdf.c 8.2 --- a/pdf.c Thu Mar 13 08:03:11 2003 +0000 8.3 +++ b/pdf.c Thu Mar 13 08:57:05 2003 +0000 8.4 @@ -1,10 +1,8 @@ 8.5 /* 8.6 - * t2p: Create a PDF file from the contents of one or more TIFF 8.7 - * bilevel image files. The images in the resulting PDF file 8.8 - * will be compressed using ITU-T T.6 (G4) fax encoding. 8.9 + * tumble: build a PDF file from image files 8.10 * 8.11 * PDF routines 8.12 - * $Id: pdf.c,v 1.9 2003/03/13 00:03:11 eric Exp $ 8.13 + * $Id: pdf.c,v 1.10 2003/03/13 00:57:05 eric Exp $ 8.14 * Copyright 2001, 2002, 2003 Eric Smith <eric@brouhaha.com> 8.15 * 8.16 * This program is free software; you can redistribute it and/or modify
9.1 diff -r ba64dfca82e9 -r e2ef1c2f9eca pdf.h 9.2 --- a/pdf.h Thu Mar 13 08:03:11 2003 +0000 9.3 +++ b/pdf.h Thu Mar 13 08:57:05 2003 +0000 9.4 @@ -1,10 +1,8 @@ 9.5 /* 9.6 - * t2p: Create a PDF file from the contents of one or more TIFF 9.7 - * bilevel image files. The images in the resulting PDF file 9.8 - * will be compressed using ITU-T T.6 (G4) fax encoding. 9.9 + * tumble: build a PDF file from image files 9.10 * 9.11 * PDF routines 9.12 - * $Id: pdf.h,v 1.8 2003/03/12 23:57:21 eric Exp $ 9.13 + * $Id: pdf.h,v 1.9 2003/03/13 00:57:05 eric Exp $ 9.14 * Copyright 2001, 2002, 2003 Eric Smith <eric@brouhaha.com> 9.15 * 9.16 * This program is free software; you can redistribute it and/or modify
10.1 diff -r ba64dfca82e9 -r e2ef1c2f9eca pdf_bookmark.c 10.2 --- a/pdf_bookmark.c Thu Mar 13 08:03:11 2003 +0000 10.3 +++ b/pdf_bookmark.c Thu Mar 13 08:57:05 2003 +0000 10.4 @@ -1,10 +1,8 @@ 10.5 /* 10.6 - * t2p: Create a PDF file from the contents of one or more TIFF 10.7 - * bilevel image files. The images in the resulting PDF file 10.8 - * will be compressed using ITU-T T.6 (G4) fax encoding. 10.9 + * tumble: build a PDF file from image files 10.10 * 10.11 * PDF routines 10.12 - * $Id: pdf_bookmark.c,v 1.5 2003/03/05 12:56:25 eric Exp $ 10.13 + * $Id: pdf_bookmark.c,v 1.6 2003/03/13 00:57:05 eric Exp $ 10.14 * Copyright 2003 Eric Smith <eric@brouhaha.com> 10.15 * 10.16 * This program is free software; you can redistribute it and/or modify
11.1 diff -r ba64dfca82e9 -r e2ef1c2f9eca pdf_g4.c 11.2 --- a/pdf_g4.c Thu Mar 13 08:03:11 2003 +0000 11.3 +++ b/pdf_g4.c Thu Mar 13 08:57:05 2003 +0000 11.4 @@ -1,10 +1,8 @@ 11.5 /* 11.6 - * t2p: Create a PDF file from the contents of one or more TIFF 11.7 - * bilevel image files. The images in the resulting PDF file 11.8 - * will be compressed using ITU-T T.6 (G4) fax encoding. 11.9 + * tumble: build a PDF file from image files 11.10 * 11.11 * PDF routines 11.12 - * $Id: pdf_g4.c,v 1.14 2003/03/12 23:59:35 eric Exp $ 11.13 + * $Id: pdf_g4.c,v 1.15 2003/03/13 00:57:05 eric Exp $ 11.14 * Copyright 2003 Eric Smith <eric@brouhaha.com> 11.15 * 11.16 * This program is free software; you can redistribute it and/or modify
12.1 diff -r ba64dfca82e9 -r e2ef1c2f9eca pdf_jpeg.c 12.2 --- a/pdf_jpeg.c Thu Mar 13 08:03:11 2003 +0000 12.3 +++ b/pdf_jpeg.c Thu Mar 13 08:57:05 2003 +0000 12.4 @@ -1,10 +1,8 @@ 12.5 /* 12.6 - * t2p: Create a PDF file from the contents of one or more TIFF 12.7 - * bilevel image files. The images in the resulting PDF file 12.8 - * will be compressed using ITU-T T.6 (G4) fax encoding. 12.9 + * tumble: build a PDF file from image files 12.10 * 12.11 * PDF routines 12.12 - * $Id: pdf_jpeg.c,v 1.1 2003/03/12 02:57:06 eric Exp $ 12.13 + * $Id: pdf_jpeg.c,v 1.2 2003/03/13 00:57:05 eric Exp $ 12.14 * Copyright 2003 Eric Smith <eric@brouhaha.com> 12.15 * 12.16 * This program is free software; you can redistribute it and/or modify
13.1 diff -r ba64dfca82e9 -r e2ef1c2f9eca pdf_name_tree.c 13.2 --- a/pdf_name_tree.c Thu Mar 13 08:03:11 2003 +0000 13.3 +++ b/pdf_name_tree.c Thu Mar 13 08:57:05 2003 +0000 13.4 @@ -1,10 +1,8 @@ 13.5 /* 13.6 - * t2p: Create a PDF file from the contents of one or more TIFF 13.7 - * bilevel image files. The images in the resulting PDF file 13.8 - * will be compressed using ITU-T T.6 (G4) fax encoding. 13.9 + * tumble: build a PDF file from image files 13.10 * 13.11 * PDF routines 13.12 - * $Id: pdf_name_tree.c,v 1.8 2003/03/12 03:13:28 eric Exp $ 13.13 + * $Id: pdf_name_tree.c,v 1.9 2003/03/13 00:57:05 eric Exp $ 13.14 * Copyright 2003 Eric Smith <eric@brouhaha.com> 13.15 * 13.16 * This program is free software; you can redistribute it and/or modify
14.1 diff -r ba64dfca82e9 -r e2ef1c2f9eca pdf_name_tree.h 14.2 --- a/pdf_name_tree.h Thu Mar 13 08:03:11 2003 +0000 14.3 +++ b/pdf_name_tree.h Thu Mar 13 08:57:05 2003 +0000 14.4 @@ -1,10 +1,8 @@ 14.5 /* 14.6 - * t2p: Create a PDF file from the contents of one or more TIFF 14.7 - * bilevel image files. The images in the resulting PDF file 14.8 - * will be compressed using ITU-T T.6 (G4) fax encoding. 14.9 + * tumble: build a PDF file from image files 14.10 * 14.11 * PDF routines 14.12 - * $Id: pdf_name_tree.h,v 1.2 2003/03/07 22:52:09 eric Exp $ 14.13 + * $Id: pdf_name_tree.h,v 1.3 2003/03/13 00:57:05 eric Exp $ 14.14 * Copyright 2003 Eric Smith <eric@brouhaha.com> 14.15 * 14.16 * This program is free software; you can redistribute it and/or modify
15.1 diff -r ba64dfca82e9 -r e2ef1c2f9eca pdf_prim.c 15.2 --- a/pdf_prim.c Thu Mar 13 08:03:11 2003 +0000 15.3 +++ b/pdf_prim.c Thu Mar 13 08:57:05 2003 +0000 15.4 @@ -1,10 +1,8 @@ 15.5 /* 15.6 - * t2p: Create a PDF file from the contents of one or more TIFF 15.7 - * bilevel image files. The images in the resulting PDF file 15.8 - * will be compressed using ITU-T T.6 (G4) fax encoding. 15.9 + * tumble: build a PDF file from image files 15.10 * 15.11 * PDF routines 15.12 - * $Id: pdf_prim.c,v 1.11 2003/03/13 00:00:21 eric Exp $ 15.13 + * $Id: pdf_prim.c,v 1.12 2003/03/13 00:57:05 eric Exp $ 15.14 * Copyright 2001, 2002, 2003 Eric Smith <eric@brouhaha.com> 15.15 * 15.16 * This program is free software; you can redistribute it and/or modify
16.1 diff -r ba64dfca82e9 -r e2ef1c2f9eca pdf_prim.h 16.2 --- a/pdf_prim.h Thu Mar 13 08:03:11 2003 +0000 16.3 +++ b/pdf_prim.h Thu Mar 13 08:57:05 2003 +0000 16.4 @@ -1,10 +1,8 @@ 16.5 /* 16.6 - * t2p: Create a PDF file from the contents of one or more TIFF 16.7 - * bilevel image files. The images in the resulting PDF file 16.8 - * will be compressed using ITU-T T.6 (G4) fax encoding. 16.9 + * tumble: build a PDF file from image files 16.10 * 16.11 * PDF routines 16.12 - * $Id: pdf_prim.h,v 1.9 2003/03/12 22:56:57 eric Exp $ 16.13 + * $Id: pdf_prim.h,v 1.10 2003/03/13 00:57:05 eric Exp $ 16.14 * Copyright 2001, 2002, 2003 Eric Smith <eric@brouhaha.com> 16.15 * 16.16 * This program is free software; you can redistribute it and/or modify
17.1 diff -r ba64dfca82e9 -r e2ef1c2f9eca pdf_private.h 17.2 --- a/pdf_private.h Thu Mar 13 08:03:11 2003 +0000 17.3 +++ b/pdf_private.h Thu Mar 13 08:57:05 2003 +0000 17.4 @@ -1,10 +1,8 @@ 17.5 /* 17.6 - * t2p: Create a PDF file from the contents of one or more TIFF 17.7 - * bilevel image files. The images in the resulting PDF file 17.8 - * will be compressed using ITU-T T.6 (G4) fax encoding. 17.9 + * tumble: build a PDF file from image files 17.10 * 17.11 * PDF routines 17.12 - * $Id: pdf_private.h,v 1.6 2003/03/07 22:52:09 eric Exp $ 17.13 + * $Id: pdf_private.h,v 1.7 2003/03/13 00:57:05 eric Exp $ 17.14 * Copyright 2001, 2002, 2003 Eric Smith <eric@brouhaha.com> 17.15 * 17.16 * This program is free software; you can redistribute it and/or modify
18.1 diff -r ba64dfca82e9 -r e2ef1c2f9eca pdf_text.c 18.2 --- a/pdf_text.c Thu Mar 13 08:03:11 2003 +0000 18.3 +++ b/pdf_text.c Thu Mar 13 08:57:05 2003 +0000 18.4 @@ -1,10 +1,8 @@ 18.5 /* 18.6 - * t2p: Create a PDF file from the contents of one or more TIFF 18.7 - * bilevel image files. The images in the resulting PDF file 18.8 - * will be compressed using ITU-T T.6 (G4) fax encoding. 18.9 + * tumble: build a PDF file from image files 18.10 * 18.11 * PDF routines 18.12 - * $Id: pdf_text.c,v 1.1 2003/03/12 23:57:21 eric Exp $ 18.13 + * $Id: pdf_text.c,v 1.2 2003/03/13 00:57:05 eric Exp $ 18.14 * Copyright 2003 Eric Smith <eric@brouhaha.com> 18.15 * 18.16 * This program is free software; you can redistribute it and/or modify
19.1 diff -r ba64dfca82e9 -r e2ef1c2f9eca pdf_util.c 19.2 --- a/pdf_util.c Thu Mar 13 08:03:11 2003 +0000 19.3 +++ b/pdf_util.c Thu Mar 13 08:57:05 2003 +0000 19.4 @@ -1,10 +1,8 @@ 19.5 /* 19.6 - * t2p: Create a PDF file from the contents of one or more TIFF 19.7 - * bilevel image files. The images in the resulting PDF file 19.8 - * will be compressed using ITU-T T.6 (G4) fax encoding. 19.9 + * tumble: build a PDF file from image files 19.10 * 19.11 * PDF routines 19.12 - * $Id: pdf_util.c,v 1.5 2003/03/10 05:08:25 eric Exp $ 19.13 + * $Id: pdf_util.c,v 1.6 2003/03/13 00:57:05 eric Exp $ 19.14 * Copyright 2001, 2002, 2003 Eric Smith <eric@brouhaha.com> 19.15 * 19.16 * This program is free software; you can redistribute it and/or modify
20.1 diff -r ba64dfca82e9 -r e2ef1c2f9eca pdf_util.h 20.2 --- a/pdf_util.h Thu Mar 13 08:03:11 2003 +0000 20.3 +++ b/pdf_util.h Thu Mar 13 08:57:05 2003 +0000 20.4 @@ -1,10 +1,8 @@ 20.5 /* 20.6 - * t2p: Create a PDF file from the contents of one or more TIFF 20.7 - * bilevel image files. The images in the resulting PDF file 20.8 - * will be compressed using ITU-T T.6 (G4) fax encoding. 20.9 + * tumble: build a PDF file from image files 20.10 * 20.11 * PDF routines 20.12 - * $Id: pdf_util.h,v 1.5 2003/03/07 03:02:12 eric Exp $ 20.13 + * $Id: pdf_util.h,v 1.6 2003/03/13 00:57:05 eric Exp $ 20.14 * Copyright 2001, 2002, 2003 Eric Smith <eric@brouhaha.com> 20.15 * 20.16 * This program is free software; you can redistribute it and/or modify
21.1 diff -r ba64dfca82e9 -r e2ef1c2f9eca scanner.l 21.2 --- a/scanner.l Thu Mar 13 08:03:11 2003 +0000 21.3 +++ b/scanner.l Thu Mar 13 08:57:05 2003 +0000 21.4 @@ -1,10 +1,8 @@ 21.5 /* 21.6 - * t2p: Create a PDF file from the contents of one or more TIFF 21.7 - * bilevel image files. The images in the resulting PDF file 21.8 - * will be compressed using ITU-T T.6 (G4) fax encoding. 21.9 + * tumble: build a PDF file from image files 21.10 * 21.11 * Lexical analyzer 21.12 - * $Id: scanner.l,v 1.17 2003/02/21 00:49:11 eric Exp $ 21.13 + * $Id: scanner.l,v 1.18 2003/03/13 00:57:05 eric Exp $ 21.14 * Copyright 2001, 2002, 2003 Eric Smith <eric@brouhaha.com> 21.15 * 21.16 * This program is free software; you can redistribute it and/or modify
22.1 diff -r ba64dfca82e9 -r e2ef1c2f9eca semantics.c 22.2 --- a/semantics.c Thu Mar 13 08:03:11 2003 +0000 22.3 +++ b/semantics.c Thu Mar 13 08:57:05 2003 +0000 22.4 @@ -1,10 +1,8 @@ 22.5 /* 22.6 - * t2p: Create a PDF file from the contents of one or more TIFF 22.7 - * bilevel image files. The images in the resulting PDF file 22.8 - * will be compressed using ITU-T T.6 (G4) fax encoding. 22.9 + * tumble: build a PDF file from image files 22.10 * 22.11 * Semantic routines for spec file parser 22.12 - * $Id: semantics.c,v 1.18 2003/03/12 00:38:04 eric Exp $ 22.13 + * $Id: semantics.c,v 1.19 2003/03/13 00:57:05 eric Exp $ 22.14 * Copyright 2001, 2002, 2003 Eric Smith <eric@brouhaha.com> 22.15 * 22.16 * This program is free software; you can redistribute it and/or modify 22.17 @@ -32,7 +30,7 @@ 22.18 22.19 #include "semantics.h" 22.20 #include "parser.tab.h" 22.21 -#include "t2p.h" 22.22 +#include "tumble.h" 22.23 22.24 22.25 typedef struct
23.1 diff -r ba64dfca82e9 -r e2ef1c2f9eca semantics.h 23.2 --- a/semantics.h Thu Mar 13 08:03:11 2003 +0000 23.3 +++ b/semantics.h Thu Mar 13 08:57:05 2003 +0000 23.4 @@ -1,10 +1,8 @@ 23.5 /* 23.6 - * t2p: Create a PDF file from the contents of one or more TIFF 23.7 - * bilevel image files. The images in the resulting PDF file 23.8 - * will be compressed using ITU-T T.6 (G4) fax encoding. 23.9 + * tumble: build a PDF file from image files 23.10 * 23.11 * Semantic routines for spec file parser 23.12 - * $Id: semantics.h,v 1.12 2003/03/12 00:38:04 eric Exp $ 23.13 + * $Id: semantics.h,v 1.13 2003/03/13 00:57:05 eric Exp $ 23.14 * Copyright 2001, 2002, 2003 Eric Smith <eric@brouhaha.com> 23.15 * 23.16 * This program is free software; you can redistribute it and/or modify
24.1 diff -r ba64dfca82e9 -r e2ef1c2f9eca t2p.c 24.2 --- a/t2p.c Thu Mar 13 08:03:11 2003 +0000 24.3 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 24.4 @@ -1,732 +0,0 @@ 24.5 -/* 24.6 - * t2p: Create a PDF file from the contents of one or more TIFF 24.7 - * bilevel image files. The images in the resulting PDF file 24.8 - * will be compressed using ITU-T T.6 (G4) fax encoding. 24.9 - * 24.10 - * Main program 24.11 - * $Id: t2p.c,v 1.31 2003/03/12 23:59:10 eric Exp $ 24.12 - * Copyright 2001, 2002, 2003 Eric Smith <eric@brouhaha.com> 24.13 - * 24.14 - * This program is free software; you can redistribute it and/or modify 24.15 - * it under the terms of the GNU General Public License version 2 as 24.16 - * published by the Free Software Foundation. Note that permission is 24.17 - * not granted to redistribute this program under the terms of any 24.18 - * other version of the General Public License. 24.19 - * 24.20 - * This program is distributed in the hope that it will be useful, 24.21 - * but WITHOUT ANY WARRANTY; without even the implied warranty of 24.22 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 24.23 - * GNU General Public License for more details. 24.24 - * 24.25 - * You should have received a copy of the GNU General Public License 24.26 - * along with this program; if not, write to the Free Software 24.27 - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA 24.28 - */ 24.29 - 24.30 - 24.31 -#include <stdarg.h> 24.32 -#include <stdbool.h> 24.33 -#include <stdint.h> 24.34 -#include <stdio.h> 24.35 -#include <stdlib.h> 24.36 -#include <string.h> 24.37 -#include <unistd.h> 24.38 - 24.39 -#include <tiffio.h> 24.40 -#define TIFF_REVERSE_BITS 24.41 - 24.42 -#include "bitblt.h" 24.43 -#include "semantics.h" 24.44 -#include "parser.tab.h" 24.45 -#include "t2p.h" 24.46 -#include "pdf.h" 24.47 - 24.48 - 24.49 -#define MAX_INPUT_FILES 5000 24.50 - 24.51 -#define POINTS_PER_INCH 72 24.52 - 24.53 -/* page size limited by Acrobat Reader to 45 inches on a side */ 24.54 -#define PAGE_MAX_INCHES 45 24.55 -#define PAGE_MAX_POINTS (PAGE_MAX_INCHES * POINTS_PER_INCH) 24.56 - 24.57 - 24.58 -typedef struct output_file_t 24.59 -{ 24.60 - struct output_file_t *next; 24.61 - char *name; 24.62 - pdf_file_handle pdf; 24.63 -} output_file_t; 24.64 - 24.65 - 24.66 -int verbose; 24.67 - 24.68 - 24.69 -char *in_filename; 24.70 -TIFF *in; 24.71 -output_file_t *output_files; 24.72 -output_file_t *out; 24.73 - 24.74 - 24.75 -char *progname; 24.76 - 24.77 - 24.78 -bool close_tiff_input_file (void); 24.79 -bool close_pdf_output_files (void); 24.80 - 24.81 - 24.82 -void usage (void) 24.83 -{ 24.84 - fprintf (stderr, "\n"); 24.85 - fprintf (stderr, "t2p - Copyright 2001-2003 Eric Smith <eric@brouhaha.com>\n"); 24.86 - fprintf (stderr, "http://www.brouhaha.com/~eric/software/t2p/\n"); 24.87 - fprintf (stderr, "\n"); 24.88 - fprintf (stderr, "usage:\n"); 24.89 - fprintf (stderr, " %s [options] -s spec\n", progname); 24.90 - fprintf (stderr, " %s [options] <input.tif>... -o <output.pdf>\n", progname); 24.91 - fprintf (stderr, "options:\n"); 24.92 - fprintf (stderr, " -v verbose\n"); 24.93 - fprintf (stderr, " -b fmt create bookmarks\n"); 24.94 - fprintf (stderr, "bookmark format:\n"); 24.95 - fprintf (stderr, " %%F file name (sans suffix)\n"); 24.96 - fprintf (stderr, " %%p page number\n"); 24.97 -} 24.98 - 24.99 - 24.100 -/* generate fatal error message to stderr, doesn't return */ 24.101 -void fatal (int ret, char *format, ...) 24.102 -{ 24.103 - va_list ap; 24.104 - 24.105 - fprintf (stderr, "fatal error"); 24.106 - if (format) 24.107 - { 24.108 - fprintf (stderr, ": "); 24.109 - va_start (ap, format); 24.110 - vfprintf (stderr, format, ap); 24.111 - va_end (ap); 24.112 - } 24.113 - else 24.114 - fprintf (stderr, "\n"); 24.115 - if (ret == 1) 24.116 - usage (); 24.117 - close_tiff_input_file (); 24.118 - close_pdf_output_files (); 24.119 - exit (ret); 24.120 -} 24.121 - 24.122 - 24.123 -bool close_tiff_input_file (void) 24.124 -{ 24.125 - if (in) 24.126 - { 24.127 - free (in_filename); 24.128 - TIFFClose (in); 24.129 - } 24.130 - in = NULL; 24.131 - in_filename = NULL; 24.132 - return (1); 24.133 -} 24.134 - 24.135 - 24.136 -bool open_tiff_input_file (char *name) 24.137 -{ 24.138 - if (in) 24.139 - { 24.140 - if (strcmp (name, in_filename) == 0) 24.141 - return (1); 24.142 - close_tiff_input_file (); 24.143 - } 24.144 - in_filename = strdup (name); 24.145 - if (! in_filename) 24.146 - { 24.147 - fprintf (stderr, "can't strdup input filename '%s'\n", name); 24.148 - return (0); 24.149 - } 24.150 - in = TIFFOpen (name, "r"); 24.151 - if (! in) 24.152 - { 24.153 - fprintf (stderr, "can't open input file '%s'\n", name); 24.154 - free (in_filename); 24.155 - return (0); 24.156 - } 24.157 - return (1); 24.158 -} 24.159 - 24.160 - 24.161 -bool close_pdf_output_files (void) 24.162 -{ 24.163 - output_file_t *o, *n; 24.164 - 24.165 - for (o = output_files; o; o = n) 24.166 - { 24.167 - n = o->next; 24.168 - pdf_close (o->pdf); 24.169 - free (o->name); 24.170 - free (o); 24.171 - } 24.172 - out = NULL; 24.173 - output_files = NULL; 24.174 - return (1); 24.175 -} 24.176 - 24.177 -bool open_pdf_output_file (char *name, 24.178 - pdf_file_attributes_t *attributes) 24.179 -{ 24.180 - output_file_t *o; 24.181 - 24.182 - if (out && (strcmp (name, out->name) == 0)) 24.183 - return (1); 24.184 - for (o = output_files; o; o = o->next) 24.185 - if (strcmp (name, o->name) == 0) 24.186 - { 24.187 - out = o; 24.188 - return (1); 24.189 - } 24.190 - o = calloc (1, sizeof (output_file_t)); 24.191 - if (! o) 24.192 - { 24.193 - fprintf (stderr, "can't calloc output file struct for '%s'\n", name); 24.194 - return (0); 24.195 - } 24.196 - 24.197 - o->name = strdup (name); 24.198 - if (! o->name) 24.199 - { 24.200 - fprintf (stderr, "can't strdup output filename '%s'\n", name); 24.201 - free (o); 24.202 - return (0); 24.203 - } 24.204 - 24.205 - o->pdf = pdf_create (name, (attributes->has_bookmarks ? 24.206 - PDF_PAGE_MODE_USE_OUTLINES : 24.207 - PDF_PAGE_MODE_USE_NONE)); 24.208 - if (! o->pdf) 24.209 - { 24.210 - fprintf (stderr, "can't open output file '%s'\n", name); 24.211 - free (o->name); 24.212 - free (o); 24.213 - return (0); 24.214 - } 24.215 - 24.216 - if (attributes->author) 24.217 - pdf_set_author (o->pdf, attributes->author); 24.218 - if (attributes->creator) 24.219 - pdf_set_creator (o->pdf, attributes->creator); 24.220 - if (attributes->title) 24.221 - pdf_set_title (o->pdf, attributes->title); 24.222 - if (attributes->subject) 24.223 - pdf_set_subject (o->pdf, attributes->subject); 24.224 - if (attributes->keywords) 24.225 - pdf_set_keywords (o->pdf, attributes->keywords); 24.226 - 24.227 - /* prepend new output file onto list */ 24.228 - o->next = output_files; 24.229 - output_files = o; 24.230 - 24.231 - out = o; 24.232 - return (1); 24.233 -} 24.234 - 24.235 - 24.236 -void process_page_numbers (int page_index, 24.237 - int count, 24.238 - int base, 24.239 - page_label_t *page_label) 24.240 -{ 24.241 -} 24.242 - 24.243 - 24.244 -/* frees original! */ 24.245 -static Bitmap *resize_bitmap (Bitmap *src, 24.246 - double x_resolution, 24.247 - double y_resolution, 24.248 - input_attributes_t input_attributes) 24.249 -{ 24.250 - Rect src_rect; 24.251 - Point dest_min; 24.252 - Bitmap *dest; 24.253 - 24.254 - int width_pixels = input_attributes.page_size.width * x_resolution; 24.255 - int height_pixels = input_attributes.page_size.height * y_resolution; 24.256 - 24.257 - src_rect.min.x = (rect_width (& src->rect) - width_pixels) / 2; 24.258 - src_rect.min.y = (rect_height (& src->rect) - height_pixels) / 2; 24.259 - src_rect.max.x = src_rect.min.x + width_pixels; 24.260 - src_rect.max.y = src_rect.min.y + height_pixels; 24.261 - 24.262 - dest_min.x = 0; 24.263 - dest_min.y = 0; 24.264 - 24.265 - dest = bitblt (src, & src_rect, NULL, & dest_min, TF_SRC, 0); 24.266 - free_bitmap (src); 24.267 - return (dest); 24.268 -} 24.269 - 24.270 - 24.271 -/* "in place" rotation */ 24.272 -static void rotate_bitmap (Bitmap *src, 24.273 - input_attributes_t input_attributes) 24.274 -{ 24.275 - switch (input_attributes.rotation) 24.276 - { 24.277 - case 0: break; 24.278 - case 90: rot_90 (src); break; 24.279 - case 180: rot_180 (src); break; 24.280 - case 270: rot_270 (src); break; 24.281 - default: 24.282 - fprintf (stderr, "rotation must be 0, 90, 180, or 270\n"); 24.283 - } 24.284 -} 24.285 - 24.286 - 24.287 -#define SWAP(type,a,b) do { type temp; temp = a; a = b; b = temp; } while (0) 24.288 - 24.289 - 24.290 -bool last_tiff_page (void) 24.291 -{ 24.292 - return (TIFFLastDirectory (in)); 24.293 -} 24.294 - 24.295 - 24.296 -bool process_tiff_page (int image, /* range 1 .. n */ 24.297 - input_attributes_t input_attributes, 24.298 - bookmark_t *bookmarks) 24.299 -{ 24.300 - int result = 0; 24.301 - 24.302 - uint32_t image_length, image_width; 24.303 - uint32_t dest_image_length, dest_image_width; 24.304 -#ifdef CHECK_DEPTH 24.305 - uint32_t image_depth; 24.306 -#endif 24.307 - 24.308 - uint16_t samples_per_pixel; 24.309 - uint16_t bits_per_sample; 24.310 - uint16_t planar_config; 24.311 - 24.312 - uint16_t resolution_unit; 24.313 - float x_resolution, y_resolution; 24.314 - double dest_x_resolution, dest_y_resolution; 24.315 - 24.316 - double width_points, height_points; /* really 1/72 inch units rather than 24.317 - points */ 24.318 - 24.319 - Rect rect; 24.320 - Bitmap *bitmap = NULL; 24.321 - 24.322 - int row; 24.323 - 24.324 - pdf_page_handle page; 24.325 - 24.326 - if (! TIFFSetDirectory (in, image - 1)) 24.327 - { 24.328 - fprintf (stderr, "can't find page %d of input file\n", image); 24.329 - goto fail; 24.330 - } 24.331 - if (1 != TIFFGetField (in, TIFFTAG_IMAGELENGTH, & image_length)) 24.332 - { 24.333 - fprintf (stderr, "can't get image length\n"); 24.334 - goto fail; 24.335 - } 24.336 - if (1 != TIFFGetField (in, TIFFTAG_IMAGEWIDTH, & image_width)) 24.337 - { 24.338 - fprintf (stderr, "can't get image width\n"); 24.339 - goto fail; 24.340 - } 24.341 - 24.342 - if (1 != TIFFGetField (in, TIFFTAG_SAMPLESPERPIXEL, & samples_per_pixel)) 24.343 - { 24.344 - fprintf (stderr, "can't get samples per pixel\n"); 24.345 - goto fail; 24.346 - } 24.347 - 24.348 -#ifdef CHECK_DEPTH 24.349 - if (1 != TIFFGetField (in, TIFFTAG_IMAGEDEPTH, & image_depth)) 24.350 - { 24.351 - fprintf (stderr, "can't get image depth\n"); 24.352 - goto fail; 24.353 - } 24.354 -#endif 24.355 - 24.356 - if (1 != TIFFGetField (in, TIFFTAG_BITSPERSAMPLE, & bits_per_sample)) 24.357 - { 24.358 - fprintf (stderr, "can't get bits per sample\n"); 24.359 - goto fail; 24.360 - } 24.361 - 24.362 - if (1 != TIFFGetField (in, TIFFTAG_PLANARCONFIG, & planar_config)) 24.363 - planar_config = 1; 24.364 - 24.365 - if (1 != TIFFGetField (in, TIFFTAG_RESOLUTIONUNIT, & resolution_unit)) 24.366 - resolution_unit = 2; 24.367 - if (1 != TIFFGetField (in, TIFFTAG_XRESOLUTION, & x_resolution)) 24.368 - x_resolution = 300; 24.369 - if (1 != TIFFGetField (in, TIFFTAG_YRESOLUTION, & y_resolution)) 24.370 - y_resolution = 300; 24.371 - 24.372 - if (samples_per_pixel != 1) 24.373 - { 24.374 - fprintf (stderr, "samples per pixel %u, must be 1\n", samples_per_pixel); 24.375 - goto fail; 24.376 - } 24.377 - 24.378 -#ifdef CHECK_DEPTH 24.379 - if (image_depth != 1) 24.380 - { 24.381 - fprintf (stderr, "image depth %u, must be 1\n", image_depth); 24.382 - goto fail; 24.383 - } 24.384 -#endif 24.385 - 24.386 - if (bits_per_sample != 1) 24.387 - { 24.388 - fprintf (stderr, "bits per sample %u, must be 1\n", bits_per_sample); 24.389 - goto fail; 24.390 - } 24.391 - 24.392 - if (planar_config != 1) 24.393 - { 24.394 - fprintf (stderr, "planar config %u, must be 1\n", planar_config); 24.395 - goto fail; 24.396 - } 24.397 - 24.398 - if (input_attributes.has_resolution) 24.399 - { 24.400 - x_resolution = input_attributes.x_resolution; 24.401 - y_resolution = input_attributes.y_resolution; 24.402 - } 24.403 - 24.404 - if ((input_attributes.rotation == 90) || (input_attributes.rotation == 270)) 24.405 - { 24.406 - dest_image_width = image_length; 24.407 - dest_image_length = image_width; 24.408 - dest_x_resolution = y_resolution; 24.409 - dest_y_resolution = x_resolution; 24.410 - SWAP (double, width_points, height_points); /* $$$ not yet set!!! */ 24.411 - } 24.412 - else 24.413 - { 24.414 - dest_image_width = image_width; 24.415 - dest_image_length = image_length; 24.416 - dest_x_resolution = x_resolution; 24.417 - dest_y_resolution = y_resolution; 24.418 - } 24.419 - 24.420 - rect.min.x = 0; 24.421 - rect.min.y = 0; 24.422 - rect.max.x = image_width; 24.423 - rect.max.y = image_length; 24.424 - 24.425 - bitmap = create_bitmap (& rect); 24.426 - 24.427 - if (! bitmap) 24.428 - { 24.429 - fprintf (stderr, "can't allocate bitmap\n"); 24.430 - goto fail; 24.431 - } 24.432 - 24.433 - for (row = 0; row < image_length; row++) 24.434 - if (1 != TIFFReadScanline (in, 24.435 - bitmap->bits + row * bitmap->row_words, 24.436 - row, 24.437 - 0)) 24.438 - { 24.439 - fprintf (stderr, "can't read TIFF scanline\n"); 24.440 - goto fail; 24.441 - } 24.442 - 24.443 -#ifdef TIFF_REVERSE_BITS 24.444 - reverse_bits ((uint8_t *) bitmap->bits, 24.445 - image_length * bitmap->row_words * sizeof (word_t)); 24.446 -#endif /* TIFF_REVERSE_BITS */ 24.447 - 24.448 -#if 0 24.449 - if (input_attributes.has_page_size) 24.450 - bitmap = resize_bitmap (bitmap, 24.451 - x_resolution, 24.452 - y_resolution, 24.453 - input_attributes); 24.454 -#endif 24.455 - 24.456 - rotate_bitmap (bitmap, 24.457 - input_attributes); 24.458 - 24.459 - width_points = (rect_width (& bitmap->rect) / dest_x_resolution) * POINTS_PER_INCH; 24.460 - height_points = (rect_height (& bitmap->rect) / dest_y_resolution) * POINTS_PER_INCH; 24.461 - 24.462 - if ((height_points > PAGE_MAX_POINTS) || (width_points > PAGE_MAX_POINTS)) 24.463 - { 24.464 - fprintf (stdout, "image too large (max %d inches on a side\n", PAGE_MAX_INCHES); 24.465 - goto fail; 24.466 - } 24.467 - 24.468 - page = pdf_new_page (out->pdf, width_points, height_points); 24.469 - 24.470 -#if 0 24.471 - pdf_write_text (page); 24.472 -#else 24.473 - pdf_write_g4_fax_image (page, 24.474 - 0, 0, /* x, y */ 24.475 - width_points, height_points, 24.476 - bitmap, 24.477 - 0, /* ImageMask */ 24.478 - 0, 0, 0, /* r, g, b */ 24.479 - 0); /* BlackIs1 */ 24.480 -#endif 24.481 - 24.482 - while (bookmarks) 24.483 - { 24.484 - /* $$$ need to handle level here */ 24.485 - pdf_new_bookmark (NULL, bookmarks->name, 0, page); 24.486 - bookmarks = bookmarks->next; 24.487 - } 24.488 - 24.489 - result = 1; 24.490 - 24.491 - fail: 24.492 - if (bitmap) 24.493 - free_bitmap (bitmap); 24.494 - 24.495 - return (result); 24.496 -} 24.497 - 24.498 - 24.499 -#if 0 24.500 -bool process_jpeg_page (int image, /* range 1 .. n */ 24.501 - input_attributes_t input_attributes, 24.502 - bookmark_t *bookmarks) 24.503 -{ 24.504 - int result = 0; 24.505 - FILE *f; 24.506 - pdf_page_handle page; 24.507 - 24.508 - f = fopen (filename, "rb"); 24.509 - if (! f) 24.510 - fatal ("error opening input file '%s'\n", filename); 24.511 - 24.512 - page = pdf_new_page (out->pdf, width_points, height_points); 24.513 - 24.514 - pdf_write_jpeg_image (page, 24.515 - 0, 0, /* x, y */ 24.516 - width_points, height_points, 24.517 - f); 24.518 - 24.519 - return (result); 24.520 -} 24.521 -#endif 24.522 - 24.523 - 24.524 -bool process_page (int image, /* range 1 .. n */ 24.525 - input_attributes_t input_attributes, 24.526 - bookmark_t *bookmarks) 24.527 -{ 24.528 - int result = 0; 24.529 - 24.530 - result = process_tiff_page (image, input_attributes, bookmarks); 24.531 - 24.532 - return (result); 24.533 -} 24.534 - 24.535 - 24.536 -#define MAX_BOOKMARK_NAME_LEN 500 24.537 - 24.538 - 24.539 -static int filename_length_without_suffix (char *in_fn) 24.540 -{ 24.541 - char *p; 24.542 - int len = strlen (in_fn); 24.543 - 24.544 - p = strrchr (in_fn, '.'); 24.545 - if (p && ((strcasecmp (p, ".tif") == 0) || 24.546 - (strcasecmp (p, ".tiff") == 0))) 24.547 - return (p - in_fn); 24.548 - return (len); 24.549 -} 24.550 - 24.551 - 24.552 -/* $$$ this function should ensure that it doesn't overflow the name string! */ 24.553 -static void generate_bookmark_name (char *name, 24.554 - char *bookmark_fmt, 24.555 - char *in_fn, 24.556 - int page) 24.557 -{ 24.558 - bool meta = 0; 24.559 - int len; 24.560 - 24.561 - while (*bookmark_fmt) 24.562 - { 24.563 - if (meta) 24.564 - { 24.565 - meta = 0; 24.566 - switch (*bookmark_fmt) 24.567 - { 24.568 - case '%': 24.569 - *(name++) = '%'; 24.570 - break; 24.571 - case 'F': 24.572 - len = filename_length_without_suffix (in_fn); 24.573 - strncpy (name, in_fn, len); 24.574 - name += len; 24.575 - break; 24.576 - case 'p': 24.577 - sprintf (name, "%d", page); 24.578 - name += strlen (name); 24.579 - break; 24.580 - default: 24.581 - break; 24.582 - } 24.583 - } 24.584 - else 24.585 - switch (*bookmark_fmt) 24.586 - { 24.587 - case '%': 24.588 - meta = 1; 24.589 - break; 24.590 - default: 24.591 - *(name++) = *bookmark_fmt; 24.592 - } 24.593 - bookmark_fmt++; 24.594 - } 24.595 - *name = '\0'; 24.596 -} 24.597 - 24.598 - 24.599 -void main_args (char *out_fn, 24.600 - int inf_count, 24.601 - char **in_fn, 24.602 - char *bookmark_fmt) 24.603 -{ 24.604 - int i, ip; 24.605 - input_attributes_t input_attributes; 24.606 - pdf_file_attributes_t output_attributes; 24.607 - bookmark_t bookmark; 24.608 - char bookmark_name [MAX_BOOKMARK_NAME_LEN]; 24.609 - 24.610 - bookmark.next = NULL; 24.611 - bookmark.level = 1; 24.612 - bookmark.name = & bookmark_name [0]; 24.613 - 24.614 - memset (& input_attributes, 0, sizeof (input_attributes)); 24.615 - memset (& output_attributes, 0, sizeof (output_attributes)); 24.616 - 24.617 - output_attributes.has_bookmarks = (bookmark_fmt != NULL); 24.618 - 24.619 - if (! open_pdf_output_file (out_fn, & output_attributes)) 24.620 - fatal (3, "error opening output file \"%s\"\n", out_fn); 24.621 - for (i = 0; i < inf_count; i++) 24.622 - { 24.623 - if (! open_tiff_input_file (in_fn [i])) 24.624 - fatal (3, "error opening input file \"%s\"\n", in_fn [i]); 24.625 - for (ip = 1;; ip++) 24.626 - { 24.627 - fprintf (stderr, "processing page %d of file \"%s\"\r", ip, in_fn [i]); 24.628 - if (bookmark_fmt) 24.629 - generate_bookmark_name (& bookmark_name [0], 24.630 - bookmark_fmt, 24.631 - in_fn [i], 24.632 - ip); 24.633 - if (! process_page (ip, input_attributes, 24.634 - bookmark_fmt ? & bookmark : NULL)) 24.635 - fatal (3, "error processing page %d of input file \"%s\"\n", ip, in_fn [i]); 24.636 - if (last_tiff_page ()) 24.637 - break; 24.638 - } 24.639 - if (verbose) 24.640 - fprintf (stderr, "processed %d pages of input file \"%s\"\n", ip, in_fn [i]); 24.641 - if (! close_tiff_input_file ()) 24.642 - fatal (3, "error closing input file \"%s\"\n", in_fn [i]); 24.643 - } 24.644 - if (! close_pdf_output_files ()) 24.645 - fatal (3, "error closing output file \"%s\"\n", out_fn); 24.646 -} 24.647 - 24.648 - 24.649 -void main_spec (char *spec_fn) 24.650 -{ 24.651 - if (! parse_spec_file (spec_fn)) 24.652 - fatal (2, "error parsing spec file\n"); 24.653 - if (! process_specs ()) 24.654 - fatal (3, "error processing spec file\n"); 24.655 -} 24.656 - 24.657 - 24.658 -int main (int argc, char *argv[]) 24.659 -{ 24.660 - char *spec_fn = NULL; 24.661 - char *out_fn = NULL; 24.662 - char *bookmark_fmt = NULL; 24.663 - int inf_count = 0; 24.664 - char *in_fn [MAX_INPUT_FILES]; 24.665 - 24.666 - progname = argv [0]; 24.667 - 24.668 - pdf_init (); 24.669 - 24.670 - while (--argc) 24.671 - { 24.672 - if (argv [1][0] == '-') 24.673 - { 24.674 - if (strcmp (argv [1], "-v") == 0) 24.675 - verbose++; 24.676 - else if (strcmp (argv [1], "-o") == 0) 24.677 - { 24.678 - if (argc) 24.679 - { 24.680 - argc--; 24.681 - argv++; 24.682 - out_fn = argv [1]; 24.683 - } 24.684 - else 24.685 - fatal (1, "missing filename after \"-o\" option\n"); 24.686 - } 24.687 - else if (strcmp (argv [1], "-s") == 0) 24.688 - { 24.689 - if (argc) 24.690 - { 24.691 - argc--; 24.692 - argv++; 24.693 - spec_fn = argv [1]; 24.694 - } 24.695 - else 24.696 - fatal (1, "missing filename after \"-s\" option\n"); 24.697 - } 24.698 - else if (strcmp (argv [1], "-b") == 0) 24.699 - { 24.700 - if (argc) 24.701 - { 24.702 - argc--; 24.703 - argv++; 24.704 - bookmark_fmt = argv [1]; 24.705 - } 24.706 - else 24.707 - fatal (1, "missing format string after \"-b\" option\n"); 24.708 - } 24.709 - else 24.710 - fatal (1, "unrecognized option \"%s\"\n", argv [1]); 24.711 - } 24.712 - else if (inf_count < MAX_INPUT_FILES) 24.713 - in_fn [inf_count++] = argv [1]; 24.714 - else 24.715 - fatal (1, "exceeded maximum of %d input files\n", MAX_INPUT_FILES); 24.716 - argv++; 24.717 - } 24.718 - 24.719 - if (! ((! out_fn) ^ (! spec_fn))) 24.720 - fatal (1, "either a spec file or an output file (but not both) must be specified\n"); 24.721 - 24.722 - if (out_fn && ! inf_count) 24.723 - fatal (1, "no input files specified\n"); 24.724 - 24.725 - if (spec_fn && inf_count) 24.726 - fatal (1, "if spec file is provided, input files can't be specified as arguments\n"); 24.727 - 24.728 - if (spec_fn) 24.729 - main_spec (spec_fn); 24.730 - else 24.731 - main_args (out_fn, inf_count, in_fn, bookmark_fmt); 24.732 - 24.733 - close_tiff_input_file (); 24.734 - close_pdf_output_files (); 24.735 - exit (0); 24.736 -}
25.1 diff -r ba64dfca82e9 -r e2ef1c2f9eca t2p.h 25.2 --- a/t2p.h Thu Mar 13 08:03:11 2003 +0000 25.3 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 25.4 @@ -1,71 +0,0 @@ 25.5 -/* 25.6 - * t2p: Create a PDF file from the contents of one or more TIFF 25.7 - * bilevel image files. The images in the resulting PDF file 25.8 - * will be compressed using ITU-T T.6 (G4) fax encoding. 25.9 - * 25.10 - * $Id: t2p.h,v 1.12 2003/03/12 23:59:10 eric Exp $ 25.11 - * Copyright 2001, 2002, 2003 Eric Smith <eric@brouhaha.com> 25.12 - * 25.13 - * This program is free software; you can redistribute it and/or modify 25.14 - * it under the terms of the GNU General Public License version 2 as 25.15 - * published by the Free Software Foundation. Note that permission is 25.16 - * not granted to redistribute this program under the terms of any 25.17 - * other version of the General Public License. 25.18 - * 25.19 - * This program is distributed in the hope that it will be useful, 25.20 - * but WITHOUT ANY WARRANTY; without even the implied warranty of 25.21 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 25.22 - * GNU General Public License for more details. 25.23 - * 25.24 - * You should have received a copy of the GNU General Public License 25.25 - * along with this program; if not, write to the Free Software 25.26 - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA */ 25.27 - 25.28 - 25.29 -extern int verbose; 25.30 - 25.31 - 25.32 -typedef struct 25.33 -{ 25.34 - bool has_resolution; 25.35 - double x_resolution; 25.36 - double y_resolution; 25.37 - 25.38 - bool has_page_size; 25.39 - page_size_t page_size; 25.40 - 25.41 - bool has_rotation; 25.42 - int rotation; 25.43 - 25.44 - bool has_crop; 25.45 - crop_t crop; 25.46 -} input_attributes_t; 25.47 - 25.48 -bool open_tiff_input_file (char *name); 25.49 -bool close_tiff_input_file (void); 25.50 - 25.51 - 25.52 -typedef struct 25.53 -{ 25.54 - char *author; 25.55 - char *creator; 25.56 - char *title; 25.57 - char *subject; 25.58 - char *keywords; 25.59 - bool has_bookmarks; 25.60 -} pdf_file_attributes_t; 25.61 - 25.62 -bool open_pdf_output_file (char *name, 25.63 - pdf_file_attributes_t *attributes); 25.64 - 25.65 - 25.66 -void process_page_numbers (int page_index, 25.67 - int count, 25.68 - int base, 25.69 - page_label_t *page_label); 25.70 - 25.71 - 25.72 - 25.73 -bool process_page (int image, /* range 1 .. n */ 25.74 - input_attributes_t input_attributes, 25.75 - bookmark_t *bookmarks);
26.1 diff -r ba64dfca82e9 -r e2ef1c2f9eca tumble.c 26.2 --- a/tumble.c Thu Mar 13 08:03:11 2003 +0000 26.3 +++ b/tumble.c Thu Mar 13 08:57:05 2003 +0000 26.4 @@ -1,10 +1,8 @@ 26.5 /* 26.6 - * t2p: Create a PDF file from the contents of one or more TIFF 26.7 - * bilevel image files. The images in the resulting PDF file 26.8 - * will be compressed using ITU-T T.6 (G4) fax encoding. 26.9 + * tumble: build a PDF file from image files 26.10 * 26.11 * Main program 26.12 - * $Id: tumble.c,v 1.31 2003/03/12 23:59:10 eric Exp $ 26.13 + * $Id: tumble.c,v 1.32 2003/03/13 00:57:05 eric Exp $ 26.14 * Copyright 2001, 2002, 2003 Eric Smith <eric@brouhaha.com> 26.15 * 26.16 * This program is free software; you can redistribute it and/or modify 26.17 @@ -38,7 +36,7 @@ 26.18 #include "bitblt.h" 26.19 #include "semantics.h" 26.20 #include "parser.tab.h" 26.21 -#include "t2p.h" 26.22 +#include "tumble.h" 26.23 #include "pdf.h" 26.24 26.25 26.26 @@ -78,8 +76,8 @@ 26.27 void usage (void) 26.28 { 26.29 fprintf (stderr, "\n"); 26.30 - fprintf (stderr, "t2p - Copyright 2001-2003 Eric Smith <eric@brouhaha.com>\n"); 26.31 - fprintf (stderr, "http://www.brouhaha.com/~eric/software/t2p/\n"); 26.32 + fprintf (stderr, "tumble - Copyright 2001-2003 Eric Smith <eric@brouhaha.com>\n"); 26.33 + fprintf (stderr, "http://www.brouhaha.com/~eric/software/tumble/\n"); 26.34 fprintf (stderr, "\n"); 26.35 fprintf (stderr, "usage:\n"); 26.36 fprintf (stderr, " %s [options] -s spec\n", progname);
27.1 diff -r ba64dfca82e9 -r e2ef1c2f9eca tumble.h 27.2 --- a/tumble.h Thu Mar 13 08:03:11 2003 +0000 27.3 +++ b/tumble.h Thu Mar 13 08:57:05 2003 +0000 27.4 @@ -1,9 +1,7 @@ 27.5 /* 27.6 - * t2p: Create a PDF file from the contents of one or more TIFF 27.7 - * bilevel image files. The images in the resulting PDF file 27.8 - * will be compressed using ITU-T T.6 (G4) fax encoding. 27.9 + * tumble: build a PDF file from image files 27.10 * 27.11 - * $Id: tumble.h,v 1.12 2003/03/12 23:59:10 eric Exp $ 27.12 + * $Id: tumble.h,v 1.13 2003/03/13 00:57:05 eric Exp $ 27.13 * Copyright 2001, 2002, 2003 Eric Smith <eric@brouhaha.com> 27.14 * 27.15 * This program is free software; you can redistribute it and/or modify